Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) AND MIT) */
0002 /*
0003  *  compress_params.h - codec types and parameters for compressed data
0004  *  streaming interface
0005  *
0006  *  Copyright (C) 2011 Intel Corporation
0007  *  Authors:    Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
0008  *              Vinod Koul <vinod.koul@linux.intel.com>
0009  *
0010  *  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
0011  *
0012  *  This program is free software; you can redistribute it and/or modify
0013  *  it under the terms of the GNU General Public License as published by
0014  *  the Free Software Foundation; version 2 of the License.
0015  *
0016  *  This program is distributed in the hope that it will be useful, but
0017  *  WITHOUT ANY WARRANTY; without even the implied warranty of
0018  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0019  *  General Public License for more details.
0020  *
0021  *  You should have received a copy of the GNU General Public License along
0022  *  with this program; if not, write to the Free Software Foundation, Inc.,
0023  *  59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
0024  *
0025  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
0026  *
0027  * The definitions in this file are derived from the OpenMAX AL version 1.1
0028  * and OpenMAX IL v 1.1.2 header files which contain the copyright notice below.
0029  *
0030  * Copyright (c) 2007-2010 The Khronos Group Inc.
0031  *
0032  * Permission is hereby granted, free of charge, to any person obtaining
0033  * a copy of this software and/or associated documentation files (the
0034  * "Materials "), to deal in the Materials without restriction, including
0035  * without limitation the rights to use, copy, modify, merge, publish,
0036  * distribute, sublicense, and/or sell copies of the Materials, and to
0037  * permit persons to whom the Materials are furnished to do so, subject to
0038  * the following conditions:
0039  *
0040  * The above copyright notice and this permission notice shall be included
0041  * in all copies or substantial portions of the Materials.
0042  *
0043  * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
0044  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
0045  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
0046  * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
0047  * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
0048  * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
0049  * MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
0050  *
0051  */
0052 #ifndef __SND_COMPRESS_PARAMS_H
0053 #define __SND_COMPRESS_PARAMS_H
0054 
0055 #include <linux/types.h>
0056 
0057 /* AUDIO CODECS SUPPORTED */
0058 #define MAX_NUM_CODECS 32
0059 #define MAX_NUM_CODEC_DESCRIPTORS 32
0060 #define MAX_NUM_BITRATES 32
0061 #define MAX_NUM_SAMPLE_RATES 32
0062 
0063 /* Codecs are listed linearly to allow for extensibility */
0064 #define SND_AUDIOCODEC_PCM                   ((__u32) 0x00000001)
0065 #define SND_AUDIOCODEC_MP3                   ((__u32) 0x00000002)
0066 #define SND_AUDIOCODEC_AMR                   ((__u32) 0x00000003)
0067 #define SND_AUDIOCODEC_AMRWB                 ((__u32) 0x00000004)
0068 #define SND_AUDIOCODEC_AMRWBPLUS             ((__u32) 0x00000005)
0069 #define SND_AUDIOCODEC_AAC                   ((__u32) 0x00000006)
0070 #define SND_AUDIOCODEC_WMA                   ((__u32) 0x00000007)
0071 #define SND_AUDIOCODEC_REAL                  ((__u32) 0x00000008)
0072 #define SND_AUDIOCODEC_VORBIS                ((__u32) 0x00000009)
0073 #define SND_AUDIOCODEC_FLAC                  ((__u32) 0x0000000A)
0074 #define SND_AUDIOCODEC_IEC61937              ((__u32) 0x0000000B)
0075 #define SND_AUDIOCODEC_G723_1                ((__u32) 0x0000000C)
0076 #define SND_AUDIOCODEC_G729                  ((__u32) 0x0000000D)
0077 #define SND_AUDIOCODEC_BESPOKE               ((__u32) 0x0000000E)
0078 #define SND_AUDIOCODEC_ALAC                  ((__u32) 0x0000000F)
0079 #define SND_AUDIOCODEC_APE                   ((__u32) 0x00000010)
0080 #define SND_AUDIOCODEC_MAX                   SND_AUDIOCODEC_APE
0081 
0082 /*
0083  * Profile and modes are listed with bit masks. This allows for a
0084  * more compact representation of fields that will not evolve
0085  * (in contrast to the list of codecs)
0086  */
0087 
0088 #define SND_AUDIOPROFILE_PCM                 ((__u32) 0x00000001)
0089 
0090 /* MP3 modes are only useful for encoders */
0091 #define SND_AUDIOCHANMODE_MP3_MONO           ((__u32) 0x00000001)
0092 #define SND_AUDIOCHANMODE_MP3_STEREO         ((__u32) 0x00000002)
0093 #define SND_AUDIOCHANMODE_MP3_JOINTSTEREO    ((__u32) 0x00000004)
0094 #define SND_AUDIOCHANMODE_MP3_DUAL           ((__u32) 0x00000008)
0095 
0096 #define SND_AUDIOPROFILE_AMR                 ((__u32) 0x00000001)
0097 
0098 /* AMR modes are only useful for encoders */
0099 #define SND_AUDIOMODE_AMR_DTX_OFF            ((__u32) 0x00000001)
0100 #define SND_AUDIOMODE_AMR_VAD1               ((__u32) 0x00000002)
0101 #define SND_AUDIOMODE_AMR_VAD2               ((__u32) 0x00000004)
0102 
0103 #define SND_AUDIOSTREAMFORMAT_UNDEFINED      ((__u32) 0x00000000)
0104 #define SND_AUDIOSTREAMFORMAT_CONFORMANCE    ((__u32) 0x00000001)
0105 #define SND_AUDIOSTREAMFORMAT_IF1            ((__u32) 0x00000002)
0106 #define SND_AUDIOSTREAMFORMAT_IF2            ((__u32) 0x00000004)
0107 #define SND_AUDIOSTREAMFORMAT_FSF            ((__u32) 0x00000008)
0108 #define SND_AUDIOSTREAMFORMAT_RTPPAYLOAD     ((__u32) 0x00000010)
0109 #define SND_AUDIOSTREAMFORMAT_ITU            ((__u32) 0x00000020)
0110 
0111 #define SND_AUDIOPROFILE_AMRWB               ((__u32) 0x00000001)
0112 
0113 /* AMRWB modes are only useful for encoders */
0114 #define SND_AUDIOMODE_AMRWB_DTX_OFF          ((__u32) 0x00000001)
0115 #define SND_AUDIOMODE_AMRWB_VAD1             ((__u32) 0x00000002)
0116 #define SND_AUDIOMODE_AMRWB_VAD2             ((__u32) 0x00000004)
0117 
0118 #define SND_AUDIOPROFILE_AMRWBPLUS           ((__u32) 0x00000001)
0119 
0120 #define SND_AUDIOPROFILE_AAC                 ((__u32) 0x00000001)
0121 
0122 /* AAC modes are required for encoders and decoders */
0123 #define SND_AUDIOMODE_AAC_MAIN               ((__u32) 0x00000001)
0124 #define SND_AUDIOMODE_AAC_LC                 ((__u32) 0x00000002)
0125 #define SND_AUDIOMODE_AAC_SSR                ((__u32) 0x00000004)
0126 #define SND_AUDIOMODE_AAC_LTP                ((__u32) 0x00000008)
0127 #define SND_AUDIOMODE_AAC_HE                 ((__u32) 0x00000010)
0128 #define SND_AUDIOMODE_AAC_SCALABLE           ((__u32) 0x00000020)
0129 #define SND_AUDIOMODE_AAC_ERLC               ((__u32) 0x00000040)
0130 #define SND_AUDIOMODE_AAC_LD                 ((__u32) 0x00000080)
0131 #define SND_AUDIOMODE_AAC_HE_PS              ((__u32) 0x00000100)
0132 #define SND_AUDIOMODE_AAC_HE_MPS             ((__u32) 0x00000200)
0133 
0134 /* AAC formats are required for encoders and decoders */
0135 #define SND_AUDIOSTREAMFORMAT_MP2ADTS        ((__u32) 0x00000001)
0136 #define SND_AUDIOSTREAMFORMAT_MP4ADTS        ((__u32) 0x00000002)
0137 #define SND_AUDIOSTREAMFORMAT_MP4LOAS        ((__u32) 0x00000004)
0138 #define SND_AUDIOSTREAMFORMAT_MP4LATM        ((__u32) 0x00000008)
0139 #define SND_AUDIOSTREAMFORMAT_ADIF           ((__u32) 0x00000010)
0140 #define SND_AUDIOSTREAMFORMAT_MP4FF          ((__u32) 0x00000020)
0141 #define SND_AUDIOSTREAMFORMAT_RAW            ((__u32) 0x00000040)
0142 
0143 #define SND_AUDIOPROFILE_WMA7                ((__u32) 0x00000001)
0144 #define SND_AUDIOPROFILE_WMA8                ((__u32) 0x00000002)
0145 #define SND_AUDIOPROFILE_WMA9                ((__u32) 0x00000004)
0146 #define SND_AUDIOPROFILE_WMA10               ((__u32) 0x00000008)
0147 #define SND_AUDIOPROFILE_WMA9_PRO            ((__u32) 0x00000010)
0148 #define SND_AUDIOPROFILE_WMA9_LOSSLESS       ((__u32) 0x00000020)
0149 #define SND_AUDIOPROFILE_WMA10_LOSSLESS      ((__u32) 0x00000040)
0150 
0151 #define SND_AUDIOMODE_WMA_LEVEL1             ((__u32) 0x00000001)
0152 #define SND_AUDIOMODE_WMA_LEVEL2             ((__u32) 0x00000002)
0153 #define SND_AUDIOMODE_WMA_LEVEL3             ((__u32) 0x00000004)
0154 #define SND_AUDIOMODE_WMA_LEVEL4             ((__u32) 0x00000008)
0155 #define SND_AUDIOMODE_WMAPRO_LEVELM0         ((__u32) 0x00000010)
0156 #define SND_AUDIOMODE_WMAPRO_LEVELM1         ((__u32) 0x00000020)
0157 #define SND_AUDIOMODE_WMAPRO_LEVELM2         ((__u32) 0x00000040)
0158 #define SND_AUDIOMODE_WMAPRO_LEVELM3         ((__u32) 0x00000080)
0159 
0160 #define SND_AUDIOSTREAMFORMAT_WMA_ASF        ((__u32) 0x00000001)
0161 /*
0162  * Some implementations strip the ASF header and only send ASF packets
0163  * to the DSP
0164  */
0165 #define SND_AUDIOSTREAMFORMAT_WMA_NOASF_HDR  ((__u32) 0x00000002)
0166 
0167 #define SND_AUDIOPROFILE_REALAUDIO           ((__u32) 0x00000001)
0168 
0169 #define SND_AUDIOMODE_REALAUDIO_G2           ((__u32) 0x00000001)
0170 #define SND_AUDIOMODE_REALAUDIO_8            ((__u32) 0x00000002)
0171 #define SND_AUDIOMODE_REALAUDIO_10           ((__u32) 0x00000004)
0172 #define SND_AUDIOMODE_REALAUDIO_SURROUND     ((__u32) 0x00000008)
0173 
0174 #define SND_AUDIOPROFILE_VORBIS              ((__u32) 0x00000001)
0175 
0176 #define SND_AUDIOMODE_VORBIS                 ((__u32) 0x00000001)
0177 
0178 #define SND_AUDIOPROFILE_FLAC                ((__u32) 0x00000001)
0179 
0180 /*
0181  * Define quality levels for FLAC encoders, from LEVEL0 (fast)
0182  * to LEVEL8 (best)
0183  */
0184 #define SND_AUDIOMODE_FLAC_LEVEL0            ((__u32) 0x00000001)
0185 #define SND_AUDIOMODE_FLAC_LEVEL1            ((__u32) 0x00000002)
0186 #define SND_AUDIOMODE_FLAC_LEVEL2            ((__u32) 0x00000004)
0187 #define SND_AUDIOMODE_FLAC_LEVEL3            ((__u32) 0x00000008)
0188 #define SND_AUDIOMODE_FLAC_LEVEL4            ((__u32) 0x00000010)
0189 #define SND_AUDIOMODE_FLAC_LEVEL5            ((__u32) 0x00000020)
0190 #define SND_AUDIOMODE_FLAC_LEVEL6            ((__u32) 0x00000040)
0191 #define SND_AUDIOMODE_FLAC_LEVEL7            ((__u32) 0x00000080)
0192 #define SND_AUDIOMODE_FLAC_LEVEL8            ((__u32) 0x00000100)
0193 
0194 #define SND_AUDIOSTREAMFORMAT_FLAC           ((__u32) 0x00000001)
0195 #define SND_AUDIOSTREAMFORMAT_FLAC_OGG       ((__u32) 0x00000002)
0196 
0197 /* IEC61937 payloads without CUVP and preambles */
0198 #define SND_AUDIOPROFILE_IEC61937            ((__u32) 0x00000001)
0199 /* IEC61937 with S/PDIF preambles+CUVP bits in 32-bit containers */
0200 #define SND_AUDIOPROFILE_IEC61937_SPDIF      ((__u32) 0x00000002)
0201 
0202 /*
0203  * IEC modes are mandatory for decoders. Format autodetection
0204  * will only happen on the DSP side with mode 0. The PCM mode should
0205  * not be used, the PCM codec should be used instead.
0206  */
0207 #define SND_AUDIOMODE_IEC_REF_STREAM_HEADER  ((__u32) 0x00000000)
0208 #define SND_AUDIOMODE_IEC_LPCM           ((__u32) 0x00000001)
0209 #define SND_AUDIOMODE_IEC_AC3            ((__u32) 0x00000002)
0210 #define SND_AUDIOMODE_IEC_MPEG1          ((__u32) 0x00000004)
0211 #define SND_AUDIOMODE_IEC_MP3            ((__u32) 0x00000008)
0212 #define SND_AUDIOMODE_IEC_MPEG2          ((__u32) 0x00000010)
0213 #define SND_AUDIOMODE_IEC_AACLC          ((__u32) 0x00000020)
0214 #define SND_AUDIOMODE_IEC_DTS            ((__u32) 0x00000040)
0215 #define SND_AUDIOMODE_IEC_ATRAC          ((__u32) 0x00000080)
0216 #define SND_AUDIOMODE_IEC_SACD           ((__u32) 0x00000100)
0217 #define SND_AUDIOMODE_IEC_EAC3           ((__u32) 0x00000200)
0218 #define SND_AUDIOMODE_IEC_DTS_HD         ((__u32) 0x00000400)
0219 #define SND_AUDIOMODE_IEC_MLP            ((__u32) 0x00000800)
0220 #define SND_AUDIOMODE_IEC_DST            ((__u32) 0x00001000)
0221 #define SND_AUDIOMODE_IEC_WMAPRO         ((__u32) 0x00002000)
0222 #define SND_AUDIOMODE_IEC_REF_CXT            ((__u32) 0x00004000)
0223 #define SND_AUDIOMODE_IEC_HE_AAC         ((__u32) 0x00008000)
0224 #define SND_AUDIOMODE_IEC_HE_AAC2        ((__u32) 0x00010000)
0225 #define SND_AUDIOMODE_IEC_MPEG_SURROUND      ((__u32) 0x00020000)
0226 
0227 #define SND_AUDIOPROFILE_G723_1              ((__u32) 0x00000001)
0228 
0229 #define SND_AUDIOMODE_G723_1_ANNEX_A         ((__u32) 0x00000001)
0230 #define SND_AUDIOMODE_G723_1_ANNEX_B         ((__u32) 0x00000002)
0231 #define SND_AUDIOMODE_G723_1_ANNEX_C         ((__u32) 0x00000004)
0232 
0233 #define SND_AUDIOPROFILE_G729                ((__u32) 0x00000001)
0234 
0235 #define SND_AUDIOMODE_G729_ANNEX_A           ((__u32) 0x00000001)
0236 #define SND_AUDIOMODE_G729_ANNEX_B           ((__u32) 0x00000002)
0237 
0238 /* <FIXME: multichannel encoders aren't supported for now. Would need
0239    an additional definition of channel arrangement> */
0240 
0241 /* VBR/CBR definitions */
0242 #define SND_RATECONTROLMODE_CONSTANTBITRATE  ((__u32) 0x00000001)
0243 #define SND_RATECONTROLMODE_VARIABLEBITRATE  ((__u32) 0x00000002)
0244 
0245 /* Encoder options */
0246 
0247 struct snd_enc_wma {
0248     __u32 super_block_align; /* WMA Type-specific data */
0249 };
0250 
0251 
0252 /**
0253  * struct snd_enc_vorbis - Vorbis encoder parameters
0254  * @quality: Sets encoding quality to n, between -1 (low) and 10 (high).
0255  * In the default mode of operation, the quality level is 3.
0256  * Normal quality range is 0 - 10.
0257  * @managed: Boolean. Set  bitrate  management  mode. This turns off the
0258  * normal VBR encoding, but allows hard or soft bitrate constraints to be
0259  * enforced by the encoder. This mode can be slower, and may also be
0260  * lower quality. It is primarily useful for streaming.
0261  * @max_bit_rate: Enabled only if managed is TRUE
0262  * @min_bit_rate: Enabled only if managed is TRUE
0263  * @downmix: Boolean. Downmix input from stereo to mono (has no effect on
0264  * non-stereo streams). Useful for lower-bitrate encoding.
0265  *
0266  * These options were extracted from the OpenMAX IL spec and Gstreamer vorbisenc
0267  * properties
0268  *
0269  * For best quality users should specify VBR mode and set quality levels.
0270  */
0271 
0272 struct snd_enc_vorbis {
0273     __s32 quality;
0274     __u32 managed;
0275     __u32 max_bit_rate;
0276     __u32 min_bit_rate;
0277     __u32 downmix;
0278 } __attribute__((packed, aligned(4)));
0279 
0280 
0281 /**
0282  * struct snd_enc_real - RealAudio encoder parameters
0283  * @quant_bits: number of coupling quantization bits in the stream
0284  * @start_region: coupling start region in the stream
0285  * @num_regions: number of regions value
0286  *
0287  * These options were extracted from the OpenMAX IL spec
0288  */
0289 
0290 struct snd_enc_real {
0291     __u32 quant_bits;
0292     __u32 start_region;
0293     __u32 num_regions;
0294 } __attribute__((packed, aligned(4)));
0295 
0296 /**
0297  * struct snd_enc_flac - FLAC encoder parameters
0298  * @num: serial number, valid only for OGG formats
0299  *  needs to be set by application
0300  * @gain: Add replay gain tags
0301  *
0302  * These options were extracted from the FLAC online documentation
0303  * at http://flac.sourceforge.net/documentation_tools_flac.html
0304  *
0305  * To make the API simpler, it is assumed that the user will select quality
0306  * profiles. Additional options that affect encoding quality and speed can
0307  * be added at a later stage if needed.
0308  *
0309  * By default the Subset format is used by encoders.
0310  *
0311  * TAGS such as pictures, etc, cannot be handled by an offloaded encoder and are
0312  * not supported in this API.
0313  */
0314 
0315 struct snd_enc_flac {
0316     __u32 num;
0317     __u32 gain;
0318 } __attribute__((packed, aligned(4)));
0319 
0320 struct snd_enc_generic {
0321     __u32 bw;   /* encoder bandwidth */
0322     __s32 reserved[15]; /* Can be used for SND_AUDIOCODEC_BESPOKE */
0323 } __attribute__((packed, aligned(4)));
0324 
0325 struct snd_dec_flac {
0326     __u16 sample_size;
0327     __u16 min_blk_size;
0328     __u16 max_blk_size;
0329     __u16 min_frame_size;
0330     __u16 max_frame_size;
0331     __u16 reserved;
0332 } __attribute__((packed, aligned(4)));
0333 
0334 struct snd_dec_wma {
0335     __u32 encoder_option;
0336     __u32 adv_encoder_option;
0337     __u32 adv_encoder_option2;
0338     __u32 reserved;
0339 } __attribute__((packed, aligned(4)));
0340 
0341 struct snd_dec_alac {
0342     __u32 frame_length;
0343     __u8 compatible_version;
0344     __u8 pb;
0345     __u8 mb;
0346     __u8 kb;
0347     __u32 max_run;
0348     __u32 max_frame_bytes;
0349 } __attribute__((packed, aligned(4)));
0350 
0351 struct snd_dec_ape {
0352     __u16 compatible_version;
0353     __u16 compression_level;
0354     __u32 format_flags;
0355     __u32 blocks_per_frame;
0356     __u32 final_frame_blocks;
0357     __u32 total_frames;
0358     __u32 seek_table_present;
0359 } __attribute__((packed, aligned(4)));
0360 
0361 union snd_codec_options {
0362     struct snd_enc_wma wma;
0363     struct snd_enc_vorbis vorbis;
0364     struct snd_enc_real real;
0365     struct snd_enc_flac flac;
0366     struct snd_enc_generic generic;
0367     struct snd_dec_flac flac_d;
0368     struct snd_dec_wma wma_d;
0369     struct snd_dec_alac alac_d;
0370     struct snd_dec_ape ape_d;
0371 } __attribute__((packed, aligned(4)));
0372 
0373 /** struct snd_codec_desc - description of codec capabilities
0374  * @max_ch: Maximum number of audio channels
0375  * @sample_rates: Sampling rates in Hz, use values like 48000 for this
0376  * @num_sample_rates: Number of valid values in sample_rates array
0377  * @bit_rate: Indexed array containing supported bit rates
0378  * @num_bitrates: Number of valid values in bit_rate array
0379  * @rate_control: value is specified by SND_RATECONTROLMODE defines.
0380  * @profiles: Supported profiles. See SND_AUDIOPROFILE defines.
0381  * @modes: Supported modes. See SND_AUDIOMODE defines
0382  * @formats: Supported formats. See SND_AUDIOSTREAMFORMAT defines
0383  * @min_buffer: Minimum buffer size handled by codec implementation
0384  * @reserved: reserved for future use
0385  *
0386  * This structure provides a scalar value for profiles, modes and stream
0387  * format fields.
0388  * If an implementation supports multiple combinations, they will be listed as
0389  * codecs with different descriptors, for example there would be 2 descriptors
0390  * for AAC-RAW and AAC-ADTS.
0391  * This entails some redundancy but makes it easier to avoid invalid
0392  * configurations.
0393  *
0394  */
0395 
0396 struct snd_codec_desc {
0397     __u32 max_ch;
0398     __u32 sample_rates[MAX_NUM_SAMPLE_RATES];
0399     __u32 num_sample_rates;
0400     __u32 bit_rate[MAX_NUM_BITRATES];
0401     __u32 num_bitrates;
0402     __u32 rate_control;
0403     __u32 profiles;
0404     __u32 modes;
0405     __u32 formats;
0406     __u32 min_buffer;
0407     __u32 reserved[15];
0408 } __attribute__((packed, aligned(4)));
0409 
0410 /** struct snd_codec
0411  * @id: Identifies the supported audio encoder/decoder.
0412  *      See SND_AUDIOCODEC macros.
0413  * @ch_in: Number of input audio channels
0414  * @ch_out: Number of output channels. In case of contradiction between
0415  *      this field and the channelMode field, the channelMode field
0416  *      overrides.
0417  * @sample_rate: Audio sample rate of input data in Hz, use values like 48000
0418  *      for this.
0419  * @bit_rate: Bitrate of encoded data. May be ignored by decoders
0420  * @rate_control: Encoding rate control. See SND_RATECONTROLMODE defines.
0421  *               Encoders may rely on profiles for quality levels.
0422  *       May be ignored by decoders.
0423  * @profile: Mandatory for encoders, can be mandatory for specific
0424  *      decoders as well. See SND_AUDIOPROFILE defines.
0425  * @level: Supported level (Only used by WMA at the moment)
0426  * @ch_mode: Channel mode for encoder. See SND_AUDIOCHANMODE defines
0427  * @format: Format of encoded bistream. Mandatory when defined.
0428  *      See SND_AUDIOSTREAMFORMAT defines.
0429  * @align: Block alignment in bytes of an audio sample.
0430  *      Only required for PCM or IEC formats.
0431  * @options: encoder-specific settings
0432  * @reserved: reserved for future use
0433  */
0434 
0435 struct snd_codec {
0436     __u32 id;
0437     __u32 ch_in;
0438     __u32 ch_out;
0439     __u32 sample_rate;
0440     __u32 bit_rate;
0441     __u32 rate_control;
0442     __u32 profile;
0443     __u32 level;
0444     __u32 ch_mode;
0445     __u32 format;
0446     __u32 align;
0447     union snd_codec_options options;
0448     __u32 reserved[3];
0449 } __attribute__((packed, aligned(4)));
0450 
0451 #endif