1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52#ifndef __SND_COMPRESS_PARAMS_H
53#define __SND_COMPRESS_PARAMS_H
54
55#include <linux/types.h>
56
57
58#define MAX_NUM_CODECS 32
59#define MAX_NUM_CODEC_DESCRIPTORS 32
60#define MAX_NUM_BITRATES 32
61#define MAX_NUM_SAMPLE_RATES 32
62
63
64#define SND_AUDIOCODEC_PCM ((__u32) 0x00000001)
65#define SND_AUDIOCODEC_MP3 ((__u32) 0x00000002)
66#define SND_AUDIOCODEC_AMR ((__u32) 0x00000003)
67#define SND_AUDIOCODEC_AMRWB ((__u32) 0x00000004)
68#define SND_AUDIOCODEC_AMRWBPLUS ((__u32) 0x00000005)
69#define SND_AUDIOCODEC_AAC ((__u32) 0x00000006)
70#define SND_AUDIOCODEC_WMA ((__u32) 0x00000007)
71#define SND_AUDIOCODEC_REAL ((__u32) 0x00000008)
72#define SND_AUDIOCODEC_VORBIS ((__u32) 0x00000009)
73#define SND_AUDIOCODEC_FLAC ((__u32) 0x0000000A)
74#define SND_AUDIOCODEC_IEC61937 ((__u32) 0x0000000B)
75#define SND_AUDIOCODEC_G723_1 ((__u32) 0x0000000C)
76#define SND_AUDIOCODEC_G729 ((__u32) 0x0000000D)
77#define SND_AUDIOCODEC_BESPOKE ((__u32) 0x0000000E)
78#define SND_AUDIOCODEC_ALAC ((__u32) 0x0000000F)
79#define SND_AUDIOCODEC_APE ((__u32) 0x00000010)
80#define SND_AUDIOCODEC_MAX SND_AUDIOCODEC_APE
81
82
83
84
85
86
87
88#define SND_AUDIOPROFILE_PCM ((__u32) 0x00000001)
89
90
91#define SND_AUDIOCHANMODE_MP3_MONO ((__u32) 0x00000001)
92#define SND_AUDIOCHANMODE_MP3_STEREO ((__u32) 0x00000002)
93#define SND_AUDIOCHANMODE_MP3_JOINTSTEREO ((__u32) 0x00000004)
94#define SND_AUDIOCHANMODE_MP3_DUAL ((__u32) 0x00000008)
95
96#define SND_AUDIOPROFILE_AMR ((__u32) 0x00000001)
97
98
99#define SND_AUDIOMODE_AMR_DTX_OFF ((__u32) 0x00000001)
100#define SND_AUDIOMODE_AMR_VAD1 ((__u32) 0x00000002)
101#define SND_AUDIOMODE_AMR_VAD2 ((__u32) 0x00000004)
102
103#define SND_AUDIOSTREAMFORMAT_UNDEFINED ((__u32) 0x00000000)
104#define SND_AUDIOSTREAMFORMAT_CONFORMANCE ((__u32) 0x00000001)
105#define SND_AUDIOSTREAMFORMAT_IF1 ((__u32) 0x00000002)
106#define SND_AUDIOSTREAMFORMAT_IF2 ((__u32) 0x00000004)
107#define SND_AUDIOSTREAMFORMAT_FSF ((__u32) 0x00000008)
108#define SND_AUDIOSTREAMFORMAT_RTPPAYLOAD ((__u32) 0x00000010)
109#define SND_AUDIOSTREAMFORMAT_ITU ((__u32) 0x00000020)
110
111#define SND_AUDIOPROFILE_AMRWB ((__u32) 0x00000001)
112
113
114#define SND_AUDIOMODE_AMRWB_DTX_OFF ((__u32) 0x00000001)
115#define SND_AUDIOMODE_AMRWB_VAD1 ((__u32) 0x00000002)
116#define SND_AUDIOMODE_AMRWB_VAD2 ((__u32) 0x00000004)
117
118#define SND_AUDIOPROFILE_AMRWBPLUS ((__u32) 0x00000001)
119
120#define SND_AUDIOPROFILE_AAC ((__u32) 0x00000001)
121
122
123#define SND_AUDIOMODE_AAC_MAIN ((__u32) 0x00000001)
124#define SND_AUDIOMODE_AAC_LC ((__u32) 0x00000002)
125#define SND_AUDIOMODE_AAC_SSR ((__u32) 0x00000004)
126#define SND_AUDIOMODE_AAC_LTP ((__u32) 0x00000008)
127#define SND_AUDIOMODE_AAC_HE ((__u32) 0x00000010)
128#define SND_AUDIOMODE_AAC_SCALABLE ((__u32) 0x00000020)
129#define SND_AUDIOMODE_AAC_ERLC ((__u32) 0x00000040)
130#define SND_AUDIOMODE_AAC_LD ((__u32) 0x00000080)
131#define SND_AUDIOMODE_AAC_HE_PS ((__u32) 0x00000100)
132#define SND_AUDIOMODE_AAC_HE_MPS ((__u32) 0x00000200)
133
134
135#define SND_AUDIOSTREAMFORMAT_MP2ADTS ((__u32) 0x00000001)
136#define SND_AUDIOSTREAMFORMAT_MP4ADTS ((__u32) 0x00000002)
137#define SND_AUDIOSTREAMFORMAT_MP4LOAS ((__u32) 0x00000004)
138#define SND_AUDIOSTREAMFORMAT_MP4LATM ((__u32) 0x00000008)
139#define SND_AUDIOSTREAMFORMAT_ADIF ((__u32) 0x00000010)
140#define SND_AUDIOSTREAMFORMAT_MP4FF ((__u32) 0x00000020)
141#define SND_AUDIOSTREAMFORMAT_RAW ((__u32) 0x00000040)
142
143#define SND_AUDIOPROFILE_WMA7 ((__u32) 0x00000001)
144#define SND_AUDIOPROFILE_WMA8 ((__u32) 0x00000002)
145#define SND_AUDIOPROFILE_WMA9 ((__u32) 0x00000004)
146#define SND_AUDIOPROFILE_WMA10 ((__u32) 0x00000008)
147#define SND_AUDIOPROFILE_WMA9_PRO ((__u32) 0x00000010)
148#define SND_AUDIOPROFILE_WMA9_LOSSLESS ((__u32) 0x00000020)
149#define SND_AUDIOPROFILE_WMA10_LOSSLESS ((__u32) 0x00000040)
150
151#define SND_AUDIOMODE_WMA_LEVEL1 ((__u32) 0x00000001)
152#define SND_AUDIOMODE_WMA_LEVEL2 ((__u32) 0x00000002)
153#define SND_AUDIOMODE_WMA_LEVEL3 ((__u32) 0x00000004)
154#define SND_AUDIOMODE_WMA_LEVEL4 ((__u32) 0x00000008)
155#define SND_AUDIOMODE_WMAPRO_LEVELM0 ((__u32) 0x00000010)
156#define SND_AUDIOMODE_WMAPRO_LEVELM1 ((__u32) 0x00000020)
157#define SND_AUDIOMODE_WMAPRO_LEVELM2 ((__u32) 0x00000040)
158#define SND_AUDIOMODE_WMAPRO_LEVELM3 ((__u32) 0x00000080)
159
160#define SND_AUDIOSTREAMFORMAT_WMA_ASF ((__u32) 0x00000001)
161
162
163
164
165#define SND_AUDIOSTREAMFORMAT_WMA_NOASF_HDR ((__u32) 0x00000002)
166
167#define SND_AUDIOPROFILE_REALAUDIO ((__u32) 0x00000001)
168
169#define SND_AUDIOMODE_REALAUDIO_G2 ((__u32) 0x00000001)
170#define SND_AUDIOMODE_REALAUDIO_8 ((__u32) 0x00000002)
171#define SND_AUDIOMODE_REALAUDIO_10 ((__u32) 0x00000004)
172#define SND_AUDIOMODE_REALAUDIO_SURROUND ((__u32) 0x00000008)
173
174#define SND_AUDIOPROFILE_VORBIS ((__u32) 0x00000001)
175
176#define SND_AUDIOMODE_VORBIS ((__u32) 0x00000001)
177
178#define SND_AUDIOPROFILE_FLAC ((__u32) 0x00000001)
179
180
181
182
183
184#define SND_AUDIOMODE_FLAC_LEVEL0 ((__u32) 0x00000001)
185#define SND_AUDIOMODE_FLAC_LEVEL1 ((__u32) 0x00000002)
186#define SND_AUDIOMODE_FLAC_LEVEL2 ((__u32) 0x00000004)
187#define SND_AUDIOMODE_FLAC_LEVEL3 ((__u32) 0x00000008)
188#define SND_AUDIOMODE_FLAC_LEVEL4 ((__u32) 0x00000010)
189#define SND_AUDIOMODE_FLAC_LEVEL5 ((__u32) 0x00000020)
190#define SND_AUDIOMODE_FLAC_LEVEL6 ((__u32) 0x00000040)
191#define SND_AUDIOMODE_FLAC_LEVEL7 ((__u32) 0x00000080)
192#define SND_AUDIOMODE_FLAC_LEVEL8 ((__u32) 0x00000100)
193
194#define SND_AUDIOSTREAMFORMAT_FLAC ((__u32) 0x00000001)
195#define SND_AUDIOSTREAMFORMAT_FLAC_OGG ((__u32) 0x00000002)
196
197
198#define SND_AUDIOPROFILE_IEC61937 ((__u32) 0x00000001)
199
200#define SND_AUDIOPROFILE_IEC61937_SPDIF ((__u32) 0x00000002)
201
202
203
204
205
206
207#define SND_AUDIOMODE_IEC_REF_STREAM_HEADER ((__u32) 0x00000000)
208#define SND_AUDIOMODE_IEC_LPCM ((__u32) 0x00000001)
209#define SND_AUDIOMODE_IEC_AC3 ((__u32) 0x00000002)
210#define SND_AUDIOMODE_IEC_MPEG1 ((__u32) 0x00000004)
211#define SND_AUDIOMODE_IEC_MP3 ((__u32) 0x00000008)
212#define SND_AUDIOMODE_IEC_MPEG2 ((__u32) 0x00000010)
213#define SND_AUDIOMODE_IEC_AACLC ((__u32) 0x00000020)
214#define SND_AUDIOMODE_IEC_DTS ((__u32) 0x00000040)
215#define SND_AUDIOMODE_IEC_ATRAC ((__u32) 0x00000080)
216#define SND_AUDIOMODE_IEC_SACD ((__u32) 0x00000100)
217#define SND_AUDIOMODE_IEC_EAC3 ((__u32) 0x00000200)
218#define SND_AUDIOMODE_IEC_DTS_HD ((__u32) 0x00000400)
219#define SND_AUDIOMODE_IEC_MLP ((__u32) 0x00000800)
220#define SND_AUDIOMODE_IEC_DST ((__u32) 0x00001000)
221#define SND_AUDIOMODE_IEC_WMAPRO ((__u32) 0x00002000)
222#define SND_AUDIOMODE_IEC_REF_CXT ((__u32) 0x00004000)
223#define SND_AUDIOMODE_IEC_HE_AAC ((__u32) 0x00008000)
224#define SND_AUDIOMODE_IEC_HE_AAC2 ((__u32) 0x00010000)
225#define SND_AUDIOMODE_IEC_MPEG_SURROUND ((__u32) 0x00020000)
226
227#define SND_AUDIOPROFILE_G723_1 ((__u32) 0x00000001)
228
229#define SND_AUDIOMODE_G723_1_ANNEX_A ((__u32) 0x00000001)
230#define SND_AUDIOMODE_G723_1_ANNEX_B ((__u32) 0x00000002)
231#define SND_AUDIOMODE_G723_1_ANNEX_C ((__u32) 0x00000004)
232
233#define SND_AUDIOPROFILE_G729 ((__u32) 0x00000001)
234
235#define SND_AUDIOMODE_G729_ANNEX_A ((__u32) 0x00000001)
236#define SND_AUDIOMODE_G729_ANNEX_B ((__u32) 0x00000002)
237
238
239
240
241
242#define SND_RATECONTROLMODE_CONSTANTBITRATE ((__u32) 0x00000001)
243#define SND_RATECONTROLMODE_VARIABLEBITRATE ((__u32) 0x00000002)
244
245
246
247struct snd_enc_wma {
248 __u32 super_block_align;
249};
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272struct snd_enc_vorbis {
273 __s32 quality;
274 __u32 managed;
275 __u32 max_bit_rate;
276 __u32 min_bit_rate;
277 __u32 downmix;
278} __attribute__((packed, aligned(4)));
279
280
281
282
283
284
285
286
287
288
289
290struct snd_enc_real {
291 __u32 quant_bits;
292 __u32 start_region;
293 __u32 num_regions;
294} __attribute__((packed, aligned(4)));
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315struct snd_enc_flac {
316 __u32 num;
317 __u32 gain;
318} __attribute__((packed, aligned(4)));
319
320struct snd_enc_generic {
321 __u32 bw;
322 __s32 reserved[15];
323} __attribute__((packed, aligned(4)));
324
325struct snd_dec_flac {
326 __u16 sample_size;
327 __u16 min_blk_size;
328 __u16 max_blk_size;
329 __u16 min_frame_size;
330 __u16 max_frame_size;
331 __u16 reserved;
332} __attribute__((packed, aligned(4)));
333
334struct snd_dec_wma {
335 __u32 encoder_option;
336 __u32 adv_encoder_option;
337 __u32 adv_encoder_option2;
338 __u32 reserved;
339} __attribute__((packed, aligned(4)));
340
341struct snd_dec_alac {
342 __u32 frame_length;
343 __u8 compatible_version;
344 __u8 pb;
345 __u8 mb;
346 __u8 kb;
347 __u32 max_run;
348 __u32 max_frame_bytes;
349} __attribute__((packed, aligned(4)));
350
351struct snd_dec_ape {
352 __u16 compatible_version;
353 __u16 compression_level;
354 __u32 format_flags;
355 __u32 blocks_per_frame;
356 __u32 final_frame_blocks;
357 __u32 total_frames;
358 __u32 seek_table_present;
359} __attribute__((packed, aligned(4)));
360
361union snd_codec_options {
362 struct snd_enc_wma wma;
363 struct snd_enc_vorbis vorbis;
364 struct snd_enc_real real;
365 struct snd_enc_flac flac;
366 struct snd_enc_generic generic;
367 struct snd_dec_flac flac_d;
368 struct snd_dec_wma wma_d;
369 struct snd_dec_alac alac_d;
370 struct snd_dec_ape ape_d;
371} __attribute__((packed, aligned(4)));
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396struct snd_codec_desc {
397 __u32 max_ch;
398 __u32 sample_rates[MAX_NUM_SAMPLE_RATES];
399 __u32 num_sample_rates;
400 __u32 bit_rate[MAX_NUM_BITRATES];
401 __u32 num_bitrates;
402 __u32 rate_control;
403 __u32 profiles;
404 __u32 modes;
405 __u32 formats;
406 __u32 min_buffer;
407 __u32 reserved[15];
408} __attribute__((packed, aligned(4)));
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435struct snd_codec {
436 __u32 id;
437 __u32 ch_in;
438 __u32 ch_out;
439 __u32 sample_rate;
440 __u32 bit_rate;
441 __u32 rate_control;
442 __u32 profile;
443 __u32 level;
444 __u32 ch_mode;
445 __u32 format;
446 __u32 align;
447 union snd_codec_options options;
448 __u32 reserved[3];
449} __attribute__((packed, aligned(4)));
450
451#endif
452