| .. | .. |
|---|
| 54 | 54 | |
|---|
| 55 | 55 | #include <linux/types.h> |
|---|
| 56 | 56 | |
|---|
| 57 | | -/* Maximum PCM channels */ |
|---|
| 58 | | -#define MAX_PCM_DECODE_CHANNELS 32 |
|---|
| 59 | | - |
|---|
| 60 | 57 | /* AUDIO CODECS SUPPORTED */ |
|---|
| 61 | 58 | #define MAX_NUM_CODECS 32 |
|---|
| 62 | 59 | #define MAX_NUM_CODEC_DESCRIPTORS 32 |
|---|
| 63 | 60 | #define MAX_NUM_BITRATES 32 |
|---|
| 64 | 61 | #define MAX_NUM_SAMPLE_RATES 32 |
|---|
| 65 | | - |
|---|
| 66 | | -/* compressed TX */ |
|---|
| 67 | | -#define MAX_NUM_FRAMES_PER_BUFFER 1 |
|---|
| 68 | | -#define COMPRESSED_META_DATA_MODE 0x10 |
|---|
| 69 | | -#define META_DATA_LEN_BYTES 36 |
|---|
| 70 | | -#define Q6_AC3_DECODER 0x00010BF6 |
|---|
| 71 | | -#define Q6_EAC3_DECODER 0x00010C3C |
|---|
| 72 | | -#define Q6_DTS 0x00010D88 |
|---|
| 73 | | -#define Q6_DTS_LBR 0x00010DBB |
|---|
| 74 | | - |
|---|
| 75 | | -/* Timestamp flsg */ |
|---|
| 76 | | -/* Bit-0 - 1 : Enable Timestamp mode */ |
|---|
| 77 | | -/* Bit-0 - 0 : Disable Timestamp mode */ |
|---|
| 78 | | -#define COMPRESSED_TIMESTAMP_FLAG 0x0001 |
|---|
| 79 | | - |
|---|
| 80 | | -/* Perf mode flag */ |
|---|
| 81 | | -/* Bit-1 - 1 : Enable perf mode */ |
|---|
| 82 | | -/* Bit-1 - 0 : Disable perf mode */ |
|---|
| 83 | | -#define COMPRESSED_PERF_MODE_FLAG 0x0002 |
|---|
| 84 | 62 | |
|---|
| 85 | 63 | /* Codecs are listed linearly to allow for extensibility */ |
|---|
| 86 | 64 | #define SND_AUDIOCODEC_PCM ((__u32) 0x00000001) |
|---|
| .. | .. |
|---|
| 97 | 75 | #define SND_AUDIOCODEC_G723_1 ((__u32) 0x0000000C) |
|---|
| 98 | 76 | #define SND_AUDIOCODEC_G729 ((__u32) 0x0000000D) |
|---|
| 99 | 77 | #define SND_AUDIOCODEC_BESPOKE ((__u32) 0x0000000E) |
|---|
| 100 | | -#define SND_AUDIOCODEC_DTS_PASS_THROUGH ((__u32) 0x0000000F) |
|---|
| 101 | | -#define SND_AUDIOCODEC_DTS_LBR ((__u32) 0x00000010) |
|---|
| 102 | | -#define SND_AUDIOCODEC_DTS_TRANSCODE_LOOPBACK ((__u32) 0x00000011) |
|---|
| 103 | | -#define SND_AUDIOCODEC_PASS_THROUGH ((__u32) 0x00000012) |
|---|
| 104 | | -#define SND_AUDIOCODEC_MP2 ((__u32) 0x00000013) |
|---|
| 105 | | -#define SND_AUDIOCODEC_DTS_LBR_PASS_THROUGH ((__u32) 0x00000014) |
|---|
| 106 | | -#define SND_AUDIOCODEC_AC3 ((__u32) 0x00000015) |
|---|
| 107 | | -#define SND_AUDIOCODEC_AC3_PASS_THROUGH ((__u32) 0x00000016) |
|---|
| 108 | | -#define SND_AUDIOCODEC_WMA_PRO ((__u32) 0x00000017) |
|---|
| 109 | | -#define SND_AUDIOCODEC_DTS ((__u32) 0x00000018) |
|---|
| 110 | | -#define SND_AUDIOCODEC_EAC3 ((__u32) 0x00000019) |
|---|
| 111 | | -#define SND_AUDIOCODEC_ALAC ((__u32) 0x00000020) |
|---|
| 112 | | -#define SND_AUDIOCODEC_APE ((__u32) 0x00000021) |
|---|
| 113 | | -#define SND_AUDIOCODEC_DSD ((__u32) 0x00000022) |
|---|
| 114 | | -#define SND_AUDIOCODEC_APTX ((__u32) 0x00000023) |
|---|
| 115 | | -#define SND_AUDIOCODEC_TRUEHD ((__u32) 0x00000024) |
|---|
| 116 | | -#define SND_AUDIOCODEC_MAT ((__u32) 0x00000025) |
|---|
| 117 | | -#define SND_AUDIOCODEC_THD ((__u32) 0x00000026) |
|---|
| 118 | | -#define SND_AUDIOCODEC_MAX SND_AUDIOCODEC_THD |
|---|
| 78 | +#define SND_AUDIOCODEC_ALAC ((__u32) 0x0000000F) |
|---|
| 79 | +#define SND_AUDIOCODEC_APE ((__u32) 0x00000010) |
|---|
| 80 | +#define SND_AUDIOCODEC_MAX SND_AUDIOCODEC_APE |
|---|
| 119 | 81 | |
|---|
| 120 | 82 | /* |
|---|
| 121 | 83 | * Profile and modes are listed with bit masks. This allows for a |
|---|
| .. | .. |
|---|
| 182 | 144 | #define SND_AUDIOPROFILE_WMA8 ((__u32) 0x00000002) |
|---|
| 183 | 145 | #define SND_AUDIOPROFILE_WMA9 ((__u32) 0x00000004) |
|---|
| 184 | 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) |
|---|
| 185 | 150 | |
|---|
| 186 | 151 | #define SND_AUDIOMODE_WMA_LEVEL1 ((__u32) 0x00000001) |
|---|
| 187 | 152 | #define SND_AUDIOMODE_WMA_LEVEL2 ((__u32) 0x00000002) |
|---|
| .. | .. |
|---|
| 281 | 246 | |
|---|
| 282 | 247 | struct snd_enc_wma { |
|---|
| 283 | 248 | __u32 super_block_align; /* WMA Type-specific data */ |
|---|
| 284 | | - __u32 bits_per_sample; |
|---|
| 285 | | - __u32 channelmask; |
|---|
| 286 | | - __u32 encodeopt; |
|---|
| 287 | | - __u32 encodeopt1; |
|---|
| 288 | | - __u32 encodeopt2; |
|---|
| 289 | | - __u32 avg_bit_rate; |
|---|
| 290 | 249 | }; |
|---|
| 291 | 250 | |
|---|
| 292 | | -#define SND_ENC_WMA_EXTENTED_SUPPORT |
|---|
| 293 | 251 | |
|---|
| 294 | 252 | /** |
|---|
| 295 | 253 | * struct snd_enc_vorbis |
|---|
| .. | .. |
|---|
| 364 | 322 | __s32 reserved[15]; /* Can be used for SND_AUDIOCODEC_BESPOKE */ |
|---|
| 365 | 323 | } __attribute__((packed, aligned(4))); |
|---|
| 366 | 324 | |
|---|
| 367 | | -#define SND_DEC_THD_MAX_PARAMS 8 |
|---|
| 368 | | -struct snd_dec_thd { |
|---|
| 369 | | - __u32 params_length; |
|---|
| 370 | | - __u32 params_id[SND_DEC_THD_MAX_PARAMS]; |
|---|
| 371 | | - __u32 params_value[SND_DEC_THD_MAX_PARAMS]; |
|---|
| 372 | | -} __attribute__((packed, aligned(4))); |
|---|
| 373 | | - |
|---|
| 374 | 325 | struct snd_dec_flac { |
|---|
| 375 | 326 | __u16 sample_size; |
|---|
| 376 | 327 | __u16 min_blk_size; |
|---|
| 377 | 328 | __u16 max_blk_size; |
|---|
| 378 | 329 | __u16 min_frame_size; |
|---|
| 379 | 330 | __u16 max_frame_size; |
|---|
| 331 | + __u16 reserved; |
|---|
| 380 | 332 | } __attribute__((packed, aligned(4))); |
|---|
| 381 | 333 | |
|---|
| 382 | | -#define SND_DEC_FLAC_SUPPORTED |
|---|
| 383 | | - |
|---|
| 384 | | -struct snd_dec_vorbis { |
|---|
| 385 | | - __u32 bit_stream_fmt; |
|---|
| 386 | | -}; |
|---|
| 334 | +struct 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))); |
|---|
| 387 | 340 | |
|---|
| 388 | 341 | struct snd_dec_alac { |
|---|
| 389 | 342 | __u32 frame_length; |
|---|
| 390 | 343 | __u8 compatible_version; |
|---|
| 391 | | - __u8 bit_depth; |
|---|
| 392 | 344 | __u8 pb; |
|---|
| 393 | 345 | __u8 mb; |
|---|
| 394 | 346 | __u8 kb; |
|---|
| 395 | | - __u8 num_channels; |
|---|
| 396 | | - __u16 max_run; |
|---|
| 347 | + __u32 max_run; |
|---|
| 397 | 348 | __u32 max_frame_bytes; |
|---|
| 398 | | - __u32 avg_bit_rate; |
|---|
| 399 | | - __u32 sample_rate; |
|---|
| 400 | | - __u32 channel_layout_tag; |
|---|
| 401 | | -}; |
|---|
| 349 | +} __attribute__((packed, aligned(4))); |
|---|
| 402 | 350 | |
|---|
| 403 | 351 | struct snd_dec_ape { |
|---|
| 404 | 352 | __u16 compatible_version; |
|---|
| .. | .. |
|---|
| 407 | 355 | __u32 blocks_per_frame; |
|---|
| 408 | 356 | __u32 final_frame_blocks; |
|---|
| 409 | 357 | __u32 total_frames; |
|---|
| 410 | | - __u16 bits_per_sample; |
|---|
| 411 | | - __u16 num_channels; |
|---|
| 412 | | - __u32 sample_rate; |
|---|
| 413 | 358 | __u32 seek_table_present; |
|---|
| 414 | | -}; |
|---|
| 415 | | - |
|---|
| 416 | | -struct snd_dec_aptx { |
|---|
| 417 | | - __u32 lap; |
|---|
| 418 | | - __u32 uap; |
|---|
| 419 | | - __u32 nap; |
|---|
| 420 | | -}; |
|---|
| 421 | | - |
|---|
| 422 | | -/** struct snd_dec_dsd - codec for DSD format |
|---|
| 423 | | - * @blk_size - dsd channel block size |
|---|
| 424 | | - */ |
|---|
| 425 | | -struct snd_dec_dsd { |
|---|
| 426 | | - __u32 blk_size; |
|---|
| 427 | | -}; |
|---|
| 428 | | - |
|---|
| 429 | | -/** struct snd_dec_pcm - codec options for PCM format |
|---|
| 430 | | - * @num_channels: Number of channels |
|---|
| 431 | | - * @ch_map: Channel map for the above corresponding channels |
|---|
| 432 | | - */ |
|---|
| 433 | | -struct snd_dec_pcm { |
|---|
| 434 | | - __u32 num_channels; |
|---|
| 435 | | - __u8 ch_map[MAX_PCM_DECODE_CHANNELS]; |
|---|
| 436 | 359 | } __attribute__((packed, aligned(4))); |
|---|
| 437 | 360 | |
|---|
| 438 | | -struct snd_dec_amrwb_plus { |
|---|
| 439 | | - __u32 bit_stream_fmt; |
|---|
| 440 | | -}; |
|---|
| 441 | 361 | union snd_codec_options { |
|---|
| 442 | 362 | struct snd_enc_wma wma; |
|---|
| 443 | 363 | struct snd_enc_vorbis vorbis; |
|---|
| 444 | 364 | struct snd_enc_real real; |
|---|
| 445 | 365 | struct snd_enc_flac flac; |
|---|
| 446 | 366 | struct snd_enc_generic generic; |
|---|
| 447 | | - struct snd_dec_flac flac_dec; |
|---|
| 448 | | - struct snd_dec_vorbis vorbis_dec; |
|---|
| 449 | | - struct snd_dec_alac alac; |
|---|
| 450 | | - struct snd_dec_ape ape; |
|---|
| 451 | | - struct snd_dec_aptx aptx_dec; |
|---|
| 452 | | - struct snd_dec_thd truehd; |
|---|
| 453 | | - struct snd_dec_pcm pcm_dec; |
|---|
| 454 | | - struct snd_dec_amrwb_plus amrwbplus; |
|---|
| 455 | | - struct snd_dec_dsd dsd_dec; |
|---|
| 456 | | -}; |
|---|
| 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))); |
|---|
| 457 | 372 | |
|---|
| 458 | 373 | /** struct snd_codec_desc - description of codec capabilities |
|---|
| 459 | 374 | * @max_ch: Maximum number of audio channels |
|---|
| .. | .. |
|---|
| 514 | 429 | * @align: Block alignment in bytes of an audio sample. |
|---|
| 515 | 430 | * Only required for PCM or IEC formats. |
|---|
| 516 | 431 | * @options: encoder-specific settings |
|---|
| 517 | | - * @compr_passthr: compressed bitstream passthrough |
|---|
| 518 | 432 | * @reserved: reserved for future use |
|---|
| 519 | 433 | */ |
|---|
| 520 | 434 | |
|---|
| .. | .. |
|---|
| 531 | 445 | __u32 format; |
|---|
| 532 | 446 | __u32 align; |
|---|
| 533 | 447 | union snd_codec_options options; |
|---|
| 534 | | - __u32 compr_passthr; |
|---|
| 535 | | - __u32 flags; |
|---|
| 536 | | - __u32 reserved[1]; |
|---|
| 448 | + __u32 reserved[3]; |
|---|
| 537 | 449 | } __attribute__((packed, aligned(4))); |
|---|
| 538 | | - |
|---|
| 539 | | -#define SND_CODEC_COMPRESS_PASSTHROUGH |
|---|
| 540 | | - |
|---|
| 541 | | -/** struct snd_codec_metadata |
|---|
| 542 | | - * @length: Length of the encoded buffer. |
|---|
| 543 | | - * @offset: Offset from the buffer address to the first byte of the first |
|---|
| 544 | | - * encoded frame. All encoded frames are consecutive starting |
|---|
| 545 | | - * from this offset. |
|---|
| 546 | | - * @timestamp: Session time in microseconds of the first sample in the buffer. |
|---|
| 547 | | - * @reserved: Reserved for future use. |
|---|
| 548 | | - */ |
|---|
| 549 | | -struct snd_codec_metadata { |
|---|
| 550 | | - __u32 length; |
|---|
| 551 | | - __u32 offset; |
|---|
| 552 | | - __u64 timestamp; |
|---|
| 553 | | - __u32 reserved[4]; |
|---|
| 554 | | -}; |
|---|
| 555 | 450 | |
|---|
| 556 | 451 | #endif |
|---|