~diwic/ubuntu/lucid/pulseaudio/bugfixes

« back to all changes in this revision

Viewing changes to src/pulse/sample.h

  • Committer: Bazaar Package Importer
  • Author(s): Luke Yelavich
  • Date: 2009-05-05 14:18:20 UTC
  • mfrom: (1.2.4 upstream) (1.1.8 squeeze)
  • Revision ID: james.westby@ubuntu.com-20090505141820-rrr2mtdd1jkllvr8
Tags: 1:0.9.15-1ubuntu1
* Merge from unreleased Debian pulseaudio git, remaining changes:
  - epoch (my stupid fault :S)
  - Don't build against, and create jack package. Jack is not in main
  - use linear resampler to work better with lack of PREEMPT in jaunty's
    -generic kernel config, also change buffer size
  - Add alsa configuration files to route alsa applications via pulseaudio
  - Move libasound2-plugins from Recommends to Depends
  - Add pm-utils sleep hook to suspend (and resume) users' pulseaudio
    daemons
  - patch to fix source/sink and suspend-on-idle race
  - Make initscript more informative in the default case of per-user
    sessions
  - create /var/run/pulse, and make restart more robust
  - add status check for system wide pulseaudio instance
  - LSB {Required-*,Should-*} should specify hal instead of dbus,
    since hal is required (and already requires dbus)
  - indicate that the system pulseaudio instance is being started from the init
    script
  - Install more upstream man pages
  - Link to pacat for parec man page
  - check whether pulseaudio is running before preloading the padsp library
  - Add DEB_OPT_FLAG = -O3 as per recommendation from
    pulseaudio-discuss/2007-December/001017.html
  - cache /usr/share/sounds/ubuntu/stereo/ wav files on pulseaudio load
  - disable glitch free (use tsched=0)
  - Generate a PO template on build
  - add special case to disable pulseaudio loading if accessibility/speech
    is being used
  - the sd wrapper script should not load pulseaudio if pulseaudio is being
    used as a system service
  - add a pulseaudio apport hook
  - fix some typos in README.Debian
  - demote paprefs to suggests
  - drop padevchooser(Recommends) and pavucontrol (Suggests)
  - drop libasyncns-dev build dependency, its in universe
* add libudev-dev as a build-dependency

Show diffs side-by-side

added added

removed removed

Lines of Context:
9
9
 
10
10
  PulseAudio is free software; you can redistribute it and/or modify
11
11
  it under the terms of the GNU Lesser General Public License as published
12
 
  by the Free Software Foundation; either version 2 of the License,
 
12
  by the Free Software Foundation; either version 2.1 of the License,
13
13
  or (at your option) any later version.
14
14
 
15
15
  PulseAudio is distributed in the hope that it will be useful, but
30
30
 
31
31
#include <pulse/gccmacro.h>
32
32
#include <pulse/cdecl.h>
 
33
#include <pulse/version.h>
33
34
 
34
35
/** \page sample Sample Format Specifications
35
36
 *
51
52
 * \li PA_SAMPLE_ULAW - 8 bit mu-Law.
52
53
 * \li PA_SAMPLE_S32LE - Signed 32 bit integer PCM, little endian.
53
54
 * \li PA_SAMPLE_S32BE - Signed 32 bit integer PCM, big endian.
 
55
 * \li PA_SAMPLE_S24LE - Signed 24 bit integer PCM packed, little endian.
 
56
 * \li PA_SAMPLE_S24BE - Signed 24 bit integer PCM packed, big endian.
 
57
 * \li PA_SAMPLE_S24_32LE - Signed 24 bit integer PCM in LSB of 32 bit words, little endian.
 
58
 * \li PA_SAMPLE_S24_32BE - Signed 24 bit integer PCM in LSB of 32 bit words, big endian.
54
59
 *
55
60
 * The floating point sample formats have the range from -1.0 to 1.0.
56
61
 *
59
64
 *
60
65
 * \section rate_sec Sample Rates
61
66
 *
62
 
 * PulseAudio supports any sample rate between 1 Hz and 4 GHz. There is no
 
67
 * PulseAudio supports any sample rate between 1 Hz and 192000 Hz. There is no
63
68
 * point trying to exceed the sample rate of the output device though as the
64
69
 * signal will only get downsampled, consuming CPU on the machine running the
65
70
 * server.
66
71
 *
67
72
 * \section chan_sec Channels
68
73
 *
69
 
 * PulseAudio supports up to 16 individiual channels. The order of the
 
74
 * PulseAudio supports up to 32 individual channels. The order of the
70
75
 * channels is up to the application, but they must be continous. To map
71
76
 * channels to speakers, see \ref channelmap.
72
77
 *
136
141
    /**< Signed 16 Bit PCM, big endian */
137
142
 
138
143
    PA_SAMPLE_FLOAT32LE,
139
 
    /**< 32 Bit IEEE floating point, little endian, range -1 to 1 */
 
144
    /**< 32 Bit IEEE floating point, little endian (PC), range -1.0 to 1.0 */
140
145
 
141
146
    PA_SAMPLE_FLOAT32BE,
142
 
    /**< 32 Bit IEEE floating point, big endian, range -1 to 1 */
 
147
    /**< 32 Bit IEEE floating point, big endian, range -1.0 to 1.0 */
143
148
 
144
149
    PA_SAMPLE_S32LE,
145
150
    /**< Signed 32 Bit PCM, little endian (PC) */
146
151
 
147
152
    PA_SAMPLE_S32BE,
148
 
    /**< Signed 32 Bit PCM, big endian (PC) */
 
153
    /**< Signed 32 Bit PCM, big endian */
 
154
 
 
155
    PA_SAMPLE_S24LE,
 
156
    /**< Signed 24 Bit PCM packed, little endian (PC). \since 0.9.15 */
 
157
 
 
158
    PA_SAMPLE_S24BE,
 
159
    /**< Signed 24 Bit PCM packed, big endian. \since 0.9.15 */
 
160
 
 
161
    PA_SAMPLE_S24_32LE,
 
162
    /**< Signed 24 Bit PCM in LSB of 32 Bit words, little endian (PC). \since 0.9.15 */
 
163
 
 
164
    PA_SAMPLE_S24_32BE,
 
165
    /**< Signed 24 Bit PCM in LSB of 32 Bit words, big endian. \since 0.9.15 */
149
166
 
150
167
    PA_SAMPLE_MAX,
151
168
    /**< Upper limit of valid sample types */
161
178
#define PA_SAMPLE_FLOAT32NE PA_SAMPLE_FLOAT32BE
162
179
/** Signed 32 Bit PCM, native endian */
163
180
#define PA_SAMPLE_S32NE PA_SAMPLE_S32BE
 
181
/** Signed 24 Bit PCM packed, native endian. \since 0.9.15 */
 
182
#define PA_SAMPLE_S24NE PA_SAMPLE_S24BE
 
183
/** Signed 24 Bit PCM in LSB of 32 Bit words, native endian. \since 0.9.15 */
 
184
#define PA_SAMPLE_S24_32NE PA_SAMPLE_S24_32BE
 
185
 
164
186
/** Signed 16 Bit PCM reverse endian */
165
187
#define PA_SAMPLE_S16RE PA_SAMPLE_S16LE
166
188
/** 32 Bit IEEE floating point, reverse endian */
167
189
#define PA_SAMPLE_FLOAT32RE PA_SAMPLE_FLOAT32LE
168
 
/** Signed 32 Bit PCM reverse endian */
 
190
/** Signed 32 Bit PCM, reverse endian */
169
191
#define PA_SAMPLE_S32RE PA_SAMPLE_S32LE
 
192
/** Signed 24 Bit PCM, packed reverse endian. \since 0.9.15 */
 
193
#define PA_SAMPLE_S24RE PA_SAMPLE_S24LE
 
194
/** Signed 24 Bit PCM, in LSB of 32 Bit words, reverse endian. \since 0.9.15 */
 
195
#define PA_SAMPLE_S24_32RE PA_SAMPLE_S24_32LE
170
196
#else
171
197
/** Signed 16 Bit PCM, native endian */
172
198
#define PA_SAMPLE_S16NE PA_SAMPLE_S16LE
174
200
#define PA_SAMPLE_FLOAT32NE PA_SAMPLE_FLOAT32LE
175
201
/** Signed 32 Bit PCM, native endian */
176
202
#define PA_SAMPLE_S32NE PA_SAMPLE_S32LE
177
 
/** Signed 16 Bit PCM reverse endian */
 
203
/** Signed 24 Bit PCM packed, native endian. \since 0.9.15 */
 
204
#define PA_SAMPLE_S24NE PA_SAMPLE_S24LE
 
205
/** Signed 24 Bit PCM in LSB of 32 Bit words, native endian. \since 0.9.15 */
 
206
#define PA_SAMPLE_S24_32NE PA_SAMPLE_S24_32LE
 
207
 
 
208
/** Signed 16 Bit PCM, reverse endian */
178
209
#define PA_SAMPLE_S16RE PA_SAMPLE_S16BE
179
210
/** 32 Bit IEEE floating point, reverse endian */
180
211
#define PA_SAMPLE_FLOAT32RE PA_SAMPLE_FLOAT32BE
181
 
/** Signed 32 Bit PCM reverse endian */
 
212
/** Signed 32 Bit PCM, reverse endian */
182
213
#define PA_SAMPLE_S32RE PA_SAMPLE_S32BE
 
214
/** Signed 24 Bit PCM, packed reverse endian. \since 0.9.15 */
 
215
#define PA_SAMPLE_S24RE PA_SAMPLE_S24BE
 
216
/** Signed 24 Bit PCM, in LSB of 32 Bit words, reverse endian. \since 0.9.15 */
 
217
#define PA_SAMPLE_S24_32RE PA_SAMPLE_S24_32BE
183
218
#endif
184
219
 
185
220
/** A Shortcut for PA_SAMPLE_FLOAT32NE */
186
221
#define PA_SAMPLE_FLOAT32 PA_SAMPLE_FLOAT32NE
187
222
 
188
223
/** \cond fulldocs */
189
 
/* Allow clients to check with #ifdef for thse sample formats */
 
224
/* Allow clients to check with #ifdef for these sample formats */
190
225
#define PA_SAMPLE_U8 PA_SAMPLE_U8
191
226
#define PA_SAMPLE_ALAW PA_SAMPLE_ALAW
192
227
#define PA_SAMPLE_ULAW PA_SAMPLE_ULAW
196
231
#define PA_SAMPLE_FLOAT32BE PA_SAMPLE_FLOAT32BE
197
232
#define PA_SAMPLE_S32LE PA_SAMPLE_S32LE
198
233
#define PA_SAMPLE_S32BE PA_SAMPLE_S32BE
 
234
#define PA_SAMPLE_S24LE PA_SAMPLE_S24LE
 
235
#define PA_SAMPLE_S24BE PA_SAMPLE_S24BE
 
236
#define PA_SAMPLE_S24_32LE PA_SAMPLE_S24_32LE
 
237
#define PA_SAMPLE_S24_32BE PA_SAMPLE_S24_32BE
199
238
/** \endcond */
200
239
 
201
240
/** A sample format and attribute specification */
222
261
/** Return the size of a sample with the specific sample type */
223
262
size_t pa_sample_size(const pa_sample_spec *spec) PA_GCC_PURE;
224
263
 
 
264
/** Similar to pa_sample_size() but take a sample format instead of a
 
265
 * full sample spec. \since 0.9.15 */
 
266
size_t pa_sample_size_of_format(pa_sample_format_t f) PA_GCC_PURE;
 
267
 
225
268
/** Calculate the time the specified bytes take to play with the
226
269
 * specified sample type. The return value will always be rounded
227
270
 * down for non-integral return values. */