~ubuntu-branches/ubuntu/oneiric/oss4/oneiric-proposed

« back to all changes in this revision

Viewing changes to debian/include-alsa/alsa/pcm_ordinary.h

  • Committer: Bazaar Package Importer
  • Author(s): Stefano Rivera
  • Date: 2011-06-16 20:37:48 UTC
  • mfrom: (5.1.3 sid)
  • Revision ID: james.westby@ubuntu.com-20110616203748-jbrxik6ql33z54co
Tags: 4.2-build2004-1ubuntu1
* Merge from Debian unstable.
  - Supports our current kernel (LP: #746048)
  Remaining changes:
  - debian/oss4-dkms.dkms.in: s/source/build/ in Kernel headers paths.
* ld-as-needed.patch: Re-order CC arguments to enable building with ld
  --as-needed (LP: #770972)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/**
 
2
 * \file <alsa/pcm_ordinary.h>
 
3
 * \brief Application interface library for the ALSA driver
 
4
 * \author Jaroslav Kysela <perex@suse.cz>
 
5
 * \date 2003
 
6
 *
 
7
 * Application interface library for the ALSA driver.
 
8
 * See the \ref pcm_ordinary page for more details.
 
9
 *
 
10
 *
 
11
 *   This library is free software; you can redistribute it and/or modify
 
12
 *   it under the terms of the GNU Lesser General Public License as
 
13
 *   published by the Free Software Foundation; either version 2.1 of
 
14
 *   the License, or (at your option) any later version.
 
15
 *
 
16
 *   This program is distributed in the hope that it will be useful,
 
17
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
 
18
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
19
 *   GNU Lesser General Public License for more details.
 
20
 *
 
21
 *   You should have received a copy of the GNU Lesser General Public
 
22
 *   License along with this library; if not, write to the Free Software
 
23
 *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 
24
 *
 
25
 */
 
26
 
 
27
#ifndef __ALSA_PCM_ORDINARY_H
 
28
#define __ALSA_PCM_ORDINARY_H
 
29
 
 
30
#include <alsa/asoundlib.h>
 
31
 
 
32
/** Ordinary PCM latency type */
 
33
enum sndo_pcm_latency_type {
 
34
        /** normal latency - for standard playback or capture
 
35
            (estimated latency in one direction 350ms) (default) */
 
36
        SNDO_PCM_LATENCY_NORMAL = 0,
 
37
        /** medium latency - software phones etc.
 
38
            (estimated latency in one direction maximally 50ms) */
 
39
        SNDO_PCM_LATENCY_MEDIUM,
 
40
        /** realtime latency - realtime applications (effect processors etc.)
 
41
            (estimated latency in one direction 5ms) */
 
42
        SNDO_PCM_LATENCY_REALTIME
 
43
};
 
44
 
 
45
/** Ordinary PCM access type */
 
46
enum sndo_pcm_access_type {
 
47
        /** interleaved access - channels are interleaved without any gaps among samples (default) */
 
48
        SNDO_PCM_ACCESS_INTERLEAVED = 0,
 
49
        /** noninterleaved access - channels are separate without any gaps among samples */
 
50
        SNDO_PCM_ACCESS_NONINTERLEAVED
 
51
};
 
52
 
 
53
/** Ordinary PCM xrun type */
 
54
enum sndo_pcm_xrun_type {
 
55
        /** driver / library will ignore all xruns, the stream runs forever (default) */
 
56
        SNDO_PCM_XRUN_IGNORE = 0,
 
57
        /** driver / library stops the stream when an xrun occurs */
 
58
        SNDO_PCM_XRUN_STOP
 
59
};
 
60
 
 
61
typedef struct sndo_pcm sndo_pcm_t;
 
62
 
 
63
typedef int (sndo_pcm_engine_callback_t)(sndo_pcm_t *pcm);
 
64
 
 
65
#ifdef __cplusplus
 
66
extern "C" {
 
67
#endif
 
68
 
 
69
/**
 
70
 *  \defgroup PCM_ordinary PCM Ordinary Interface
 
71
 *  See the \ref pcm_ordinary page for more details.
 
72
 *  \{
 
73
 */
 
74
 
 
75
int sndo_pcm_open(sndo_pcm_t **pcm, const char *playback_name, const char *capture_name, struct alisp_cfg *lconf);
 
76
int sndo_pcm_close(sndo_pcm_t *pcm);
 
77
int sndo_pcm_poll_descriptors_count(sndo_pcm_t *pcm);
 
78
int sndo_pcm_poll_descriptors(sndo_pcm_t *pcm, struct pollfd *pfds, unsigned int space);
 
79
int sndo_pcm_start(sndo_pcm_t *pcm);
 
80
int sndo_pcm_drop(sndo_pcm_t *pcm);
 
81
int sndo_pcm_drain(sndo_pcm_t *pcm);
 
82
int sndo_pcm_delay(sndo_pcm_t *pcm, snd_pcm_sframes_t *delayp);
 
83
int sndo_pcm_transfer_block(sndo_pcm_t *pcm, snd_pcm_uframes_t *tblock);
 
84
int sndo_pcm_resume(sndo_pcm_t *pcm);
 
85
int sndo_pcm_wait(sndo_pcm_t *pcm, int timeout);
 
86
snd_pcm_t *sndo_pcm_raw_playback(sndo_pcm_t *pcm);
 
87
snd_pcm_t *sndo_pcm_raw_capture(sndo_pcm_t *pcm);
 
88
 
 
89
/**
 
90
 * \defgroup PCM_ordinary_params Parameters Functions
 
91
 * \ingroup PCM_ordinary
 
92
 * See the \ref pcm_ordinary page for more details.
 
93
 * \{
 
94
 */
 
95
 
 
96
int sndo_pcm_param_reset(sndo_pcm_t *pcm);
 
97
int sndo_pcm_param_access(sndo_pcm_t *pcm, enum sndo_pcm_access_type access);
 
98
int sndo_pcm_param_rate(sndo_pcm_t *pcm, unsigned int rate, unsigned int *used_rate);
 
99
int sndo_pcm_param_channels(sndo_pcm_t *pcm, unsigned int channels);
 
100
int sndo_pcm_param_format(sndo_pcm_t *pcm, snd_pcm_format_t format, snd_pcm_subformat_t subformat);
 
101
int sndo_pcm_param_latency(sndo_pcm_t *pcm, enum sndo_pcm_latency_type latency, snd_pcm_uframes_t *used_latency);
 
102
int sndo_pcm_param_xrun(sndo_pcm_t *pcm, enum sndo_pcm_xrun_type xrun);
 
103
 
 
104
/** \} */
 
105
 
 
106
/**
 
107
 * \defgroup PCM_ordinary_access Ring Buffer I/O Functions
 
108
 * \ingroup PCM_ordinary
 
109
 * See the \ref pcm_ordinary page for more details.
 
110
 * \{
 
111
 */
 
112
 
 
113
/* playback */
 
114
int sndo_pcm_pio_ibegin(sndo_pcm_t *pcm, void **ring_buffer, snd_pcm_uframes_t *frames);
 
115
snd_pcm_sframes_t sndo_pcm_pio_iend(sndo_pcm_t *pcm, snd_pcm_uframes_t frames);
 
116
int sndo_pcm_pio_nbegin(sndo_pcm_t *pcm, void ***ring_buffer, snd_pcm_uframes_t *frames);
 
117
snd_pcm_sframes_t sndo_pcm_pio_nend(sndo_pcm_t *pcm, snd_pcm_uframes_t frames);
 
118
/* capture */
 
119
int sndo_pcm_cio_ibegin(sndo_pcm_t *pcm, void **ring_buffer, snd_pcm_uframes_t *frames);
 
120
snd_pcm_sframes_t sndo_pcm_cio_iend(sndo_pcm_t *pcm, snd_pcm_uframes_t frames);
 
121
int sndo_pcm_cio_nbegin(sndo_pcm_t *pcm, void ***ring_buffer, snd_pcm_uframes_t *frames);
 
122
snd_pcm_sframes_t sndo_pcm_cio_nend(sndo_pcm_t *pcm, snd_pcm_uframes_t frames);
 
123
 
 
124
/** \} */
 
125
 
 
126
/**
 
127
 * \defgroup PCM_ordinary_engine Callback like engine
 
128
 * \ingroup PCM_ordinary
 
129
 * See the \ref pcm_ordinary page for more details.
 
130
 * \{
 
131
 */
 
132
 
 
133
int sndo_pcm_set_private_data(sndo_pcm_t *pcm, void *private_data);
 
134
int sndo_pcm_get_private_data(sndo_pcm_t *pcm, void **private_data);
 
135
int sndo_pcm_engine(sndo_pcm_t *pcm,
 
136
                    sndo_pcm_engine_callback_t *playback,
 
137
                    sndo_pcm_engine_callback_t *capture);
 
138
 
 
139
/** \} */
 
140
 
 
141
#ifdef __cplusplus
 
142
}
 
143
#endif
 
144
 
 
145
#endif /* __ALSA_PCM_ORDINARY_H */