1 /* ------------------------------------------------------------------
2  * Copyright (C) 1998-2009 PacketVideo
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
13  * express or implied.
14  * See the License for the specific language governing permissions
15  * and limitations under the License.
16  * -------------------------------------------------------------------
17  */
18 /*
19  * Copyright (c) 2008 The Khronos Group Inc.
20  *
21  * Permission is hereby granted, free of charge, to any person obtaining
22  * a copy of this software and associated documentation files (the
23  * "Software"), to deal in the Software without restriction, including
24  * without limitation the rights to use, copy, modify, merge, publish,
25  * distribute, sublicense, and/or sell copies of the Software, and to
26  * permit persons to whom the Software is furnished to do so, subject
27  * to the following conditions:
28  * The above copyright notice and this permission notice shall be included
29  * in all copies or substantial portions of the Software.
30  *
31  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
32  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
33  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
34  * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
35  * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
36  * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
37  * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
38  *
39  */
40 
41 /** @file OMX_Audio.h - OpenMax IL version 1.1.2
42  *  The structures needed by Audio components to exchange
43  *  parameters and configuration data with the componenmilts.
44  */
45 
46 #ifndef OMX_Audio_h
47 #define OMX_Audio_h
48 
49 #ifdef __cplusplus
50 extern "C" {
51 #endif /* __cplusplus */
52 
53 /* Each OMX header must include all required header files to allow the
54  *  header to compile without errors.  The includes below are required
55  *  for this header file to compile successfully
56  */
57 
58 #include <OMX_Core.h>
59 
60 /** @defgroup midi MIDI
61  * @ingroup audio
62  */
63 
64 /** @defgroup effects Audio effects
65  * @ingroup audio
66  */
67 
68 /** @defgroup audio OpenMAX IL Audio Domain
69  * Structures for OpenMAX IL Audio domain
70  * @{
71  */
72 
73 /** Enumeration used to define the possible audio codings.
74  *  If "OMX_AUDIO_CodingUnused" is selected, the coding selection must
75  *  be done in a vendor specific way.  Since this is for an audio
76  *  processing element this enum is relevant.  However, for another
77  *  type of component other enums would be in this area.
78  */
79 typedef enum OMX_AUDIO_CODINGTYPE {
80     OMX_AUDIO_CodingUnused = 0,  /**< Placeholder value when coding is N/A  */
81     OMX_AUDIO_CodingAutoDetect,  /**< auto detection of audio format */
82     OMX_AUDIO_CodingPCM,         /**< Any variant of PCM coding */
83     OMX_AUDIO_CodingADPCM,       /**< Any variant of ADPCM encoded data */
84     OMX_AUDIO_CodingAMR,         /**< Any variant of AMR encoded data */
85     OMX_AUDIO_CodingGSMFR,       /**< Any variant of GSM fullrate (i.e. GSM610) */
86     OMX_AUDIO_CodingGSMEFR,      /**< Any variant of GSM Enhanced Fullrate encoded data*/
87     OMX_AUDIO_CodingGSMHR,       /**< Any variant of GSM Halfrate encoded data */
88     OMX_AUDIO_CodingPDCFR,       /**< Any variant of PDC Fullrate encoded data */
89     OMX_AUDIO_CodingPDCEFR,      /**< Any variant of PDC Enhanced Fullrate encoded data */
90     OMX_AUDIO_CodingPDCHR,       /**< Any variant of PDC Halfrate encoded data */
91     OMX_AUDIO_CodingTDMAFR,      /**< Any variant of TDMA Fullrate encoded data (TIA/EIA-136-420) */
92     OMX_AUDIO_CodingTDMAEFR,     /**< Any variant of TDMA Enhanced Fullrate encoded data (TIA/EIA-136-410) */
93     OMX_AUDIO_CodingQCELP8,      /**< Any variant of QCELP 8kbps encoded data */
94     OMX_AUDIO_CodingQCELP13,     /**< Any variant of QCELP 13kbps encoded data */
95     OMX_AUDIO_CodingEVRC,        /**< Any variant of EVRC encoded data */
96     OMX_AUDIO_CodingSMV,         /**< Any variant of SMV encoded data */
97     OMX_AUDIO_CodingG711,        /**< Any variant of G.711 encoded data */
98     OMX_AUDIO_CodingG723,        /**< Any variant of G.723 dot 1 encoded data */
99     OMX_AUDIO_CodingG726,        /**< Any variant of G.726 encoded data */
100     OMX_AUDIO_CodingG729,        /**< Any variant of G.729 encoded data */
101     OMX_AUDIO_CodingAAC,         /**< Any variant of AAC encoded data */
102     OMX_AUDIO_CodingMP3,         /**< Any variant of MP3 encoded data */
103     OMX_AUDIO_CodingSBC,         /**< Any variant of SBC encoded data */
104     OMX_AUDIO_CodingVORBIS,      /**< Any variant of VORBIS encoded data */
105     OMX_AUDIO_CodingWMA,         /**< Any variant of WMA encoded data */
106     OMX_AUDIO_CodingRA,          /**< Any variant of RA encoded data */
107     OMX_AUDIO_CodingMIDI,        /**< Any variant of MIDI encoded data */
108     OMX_AUDIO_CodingFLAC,        /**< Any variant of FLAC encoded data */
109     OMX_AUDIO_CodingKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
110     OMX_AUDIO_CodingVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
111     OMX_AUDIO_CodingMax = 0x7FFFFFFF
112 } OMX_AUDIO_CODINGTYPE;
113 
114 
115 /** The PortDefinition structure is used to define all of the parameters
116  *  necessary for the compliant component to setup an input or an output audio
117  *  path.  If additional information is needed to define the parameters of the
118  *  port (such as frequency), additional structures must be sent such as the
119  *  OMX_AUDIO_PARAM_PCMMODETYPE structure to supply the extra parameters for the port.
120  */
121 typedef struct OMX_AUDIO_PORTDEFINITIONTYPE {
122     OMX_STRING cMIMEType;            /**< MIME type of data for the port */
123     OMX_NATIVE_DEVICETYPE pNativeRender; /** < platform specific reference
124                                                for an output device,
125                                                otherwise this field is 0 */
126     OMX_BOOL bFlagErrorConcealment;  /**< Turns on error concealment if it is
127                                           supported by the OMX component */
128     OMX_AUDIO_CODINGTYPE eEncoding;  /**< Type of data expected for this
129                                           port (e.g. PCM, AMR, MP3, etc) */
130 } OMX_AUDIO_PORTDEFINITIONTYPE;
131 
132 
133 /**  Port format parameter.  This structure is used to enumerate
134   *  the various data input/output format supported by the port.
135   */
136 typedef struct OMX_AUDIO_PARAM_PORTFORMATTYPE {
137     OMX_U32 nSize;                  /**< size of the structure in bytes */
138     OMX_VERSIONTYPE nVersion;       /**< OMX specification version information */
139     OMX_U32 nPortIndex;             /**< Indicates which port to set */
140     OMX_U32 nIndex;                 /**< Indicates the enumeration index for the format from 0x0 to N-1 */
141     OMX_AUDIO_CODINGTYPE eEncoding; /**< Type of data expected for this port (e.g. PCM, AMR, MP3, etc) */
142 } OMX_AUDIO_PARAM_PORTFORMATTYPE;
143 
144 
145 /** PCM mode type  */
146 typedef enum OMX_AUDIO_PCMMODETYPE {
147     OMX_AUDIO_PCMModeLinear = 0,  /**< Linear PCM encoded data */
148     OMX_AUDIO_PCMModeALaw,        /**< A law PCM encoded data (G.711) */
149     OMX_AUDIO_PCMModeMULaw,       /**< Mu law PCM encoded data (G.711)  */
150     OMX_AUDIO_PCMModeKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
151     OMX_AUDIO_PCMModeVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
152     OMX_AUDIO_PCMModeMax = 0x7FFFFFFF
153 } OMX_AUDIO_PCMMODETYPE;
154 
155 
156 typedef enum OMX_AUDIO_CHANNELTYPE {
157     OMX_AUDIO_ChannelNone = 0x0,    /**< Unused or empty */
158     OMX_AUDIO_ChannelLF   = 0x1,    /**< Left front */
159     OMX_AUDIO_ChannelRF   = 0x2,    /**< Right front */
160     OMX_AUDIO_ChannelCF   = 0x3,    /**< Center front */
161     OMX_AUDIO_ChannelLS   = 0x4,    /**< Left surround */
162     OMX_AUDIO_ChannelRS   = 0x5,    /**< Right surround */
163     OMX_AUDIO_ChannelLFE  = 0x6,    /**< Low frequency effects */
164     OMX_AUDIO_ChannelCS   = 0x7,    /**< Back surround */
165     OMX_AUDIO_ChannelLR   = 0x8,    /**< Left rear. */
166     OMX_AUDIO_ChannelRR   = 0x9,    /**< Right rear. */
167     OMX_AUDIO_ChannelKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
168     OMX_AUDIO_ChannelVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
169     OMX_AUDIO_ChannelMax  = 0x7FFFFFFF
170 } OMX_AUDIO_CHANNELTYPE;
171 
172 #define OMX_AUDIO_MAXCHANNELS 16  /**< maximum number distinct audio channels that a buffer may contain */
173 #define OMX_MIN_PCMPAYLOAD_MSEC 5 /**< Minimum audio buffer payload size for uncompressed (PCM) audio */
174 
175 /** PCM format description */
176 typedef struct OMX_AUDIO_PARAM_PCMMODETYPE {
177     OMX_U32 nSize;                    /**< Size of this structure, in Bytes */
178     OMX_VERSIONTYPE nVersion;         /**< OMX specification version information */
179     OMX_U32 nPortIndex;               /**< port that this structure applies to */
180     OMX_U32 nChannels;                /**< Number of channels (e.g. 2 for stereo) */
181     OMX_NUMERICALDATATYPE eNumData;   /**< indicates PCM data as signed, unsigned or floating pt. */
182     OMX_ENDIANTYPE eEndian;           /**< indicates PCM data as little or big endian */
183     OMX_BOOL bInterleaved;            /**< True for normal interleaved data; false for
184                                            non-interleaved data (e.g. block data) */
185     OMX_U32 nBitPerSample;            /**< Bit per sample */
186     OMX_U32 nSamplingRate;            /**< Sampling rate of the source data.  Use 0 for
187                                            variable or unknown sampling rate. */
188     OMX_AUDIO_PCMMODETYPE ePCMMode;   /**< PCM mode enumeration */
189     OMX_AUDIO_CHANNELTYPE eChannelMapping[OMX_AUDIO_MAXCHANNELS]; /**< Slot i contains channel defined by eChannelMap[i] */
190 
191 } OMX_AUDIO_PARAM_PCMMODETYPE;
192 
193 
194 /** Audio channel mode.  This is used by both AAC and MP3, although the names are more appropriate
195  * for the MP3.  For example, JointStereo for MP3 is CouplingChannels for AAC.
196  */
197 typedef enum OMX_AUDIO_CHANNELMODETYPE {
198     OMX_AUDIO_ChannelModeStereo = 0,  /**< 2 channels, the bitrate allocation between those
199                                           two channels changes accordingly to each channel information */
200     OMX_AUDIO_ChannelModeJointStereo, /**< mode that takes advantage of what is common between
201                                            2 channels for higher compression gain */
202     OMX_AUDIO_ChannelModeDual,        /**< 2 mono-channels, each channel is encoded with half
203                                            the bitrate of the overall bitrate */
204     OMX_AUDIO_ChannelModeMono,        /**< Mono channel mode */
205     OMX_AUDIO_ChannelModeKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
206     OMX_AUDIO_ChannelModeVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
207     OMX_AUDIO_ChannelModeMax = 0x7FFFFFFF
208 } OMX_AUDIO_CHANNELMODETYPE;
209 
210 
211 typedef enum OMX_AUDIO_MP3STREAMFORMATTYPE {
212     OMX_AUDIO_MP3StreamFormatMP1Layer3 = 0, /**< MP3 Audio MPEG 1 Layer 3 Stream format */
213     OMX_AUDIO_MP3StreamFormatMP2Layer3,     /**< MP3 Audio MPEG 2 Layer 3 Stream format */
214     OMX_AUDIO_MP3StreamFormatMP2_5Layer3,   /**< MP3 Audio MPEG2.5 Layer 3 Stream format */
215     OMX_AUDIO_MP3StreamFormatKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
216     OMX_AUDIO_MP3StreamFormatVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
217     OMX_AUDIO_MP3StreamFormatMax = 0x7FFFFFFF
218 } OMX_AUDIO_MP3STREAMFORMATTYPE;
219 
220 /** MP3 params */
221 typedef struct OMX_AUDIO_PARAM_MP3TYPE {
222     OMX_U32 nSize;                 /**< size of the structure in bytes */
223     OMX_VERSIONTYPE nVersion;      /**< OMX specification version information */
224     OMX_U32 nPortIndex;            /**< port that this structure applies to */
225     OMX_U32 nChannels;             /**< Number of channels */
226     OMX_U32 nBitRate;              /**< Bit rate of the input data.  Use 0 for variable
227                                         rate or unknown bit rates */
228     OMX_U32 nSampleRate;           /**< Sampling rate of the source data.  Use 0 for
229                                         variable or unknown sampling rate. */
230     OMX_U32 nAudioBandWidth;       /**< Audio band width (in Hz) to which an encoder should
231                                         limit the audio signal. Use 0 to let encoder decide */
232     OMX_AUDIO_CHANNELMODETYPE eChannelMode;   /**< Channel mode enumeration */
233     OMX_AUDIO_MP3STREAMFORMATTYPE eFormat;  /**< MP3 stream format */
234 } OMX_AUDIO_PARAM_MP3TYPE;
235 
236 
237 typedef enum OMX_AUDIO_AACSTREAMFORMATTYPE {
238     OMX_AUDIO_AACStreamFormatMP2ADTS = 0, /**< AAC Audio Data Transport Stream 2 format */
239     OMX_AUDIO_AACStreamFormatMP4ADTS,     /**< AAC Audio Data Transport Stream 4 format */
240     OMX_AUDIO_AACStreamFormatMP4LOAS,     /**< AAC Low Overhead Audio Stream format */
241     OMX_AUDIO_AACStreamFormatMP4LATM,     /**< AAC Low overhead Audio Transport Multiplex */
242     OMX_AUDIO_AACStreamFormatADIF,        /**< AAC Audio Data Interchange Format */
243     OMX_AUDIO_AACStreamFormatMP4FF,       /**< AAC inside MPEG-4/ISO File Format */
244     OMX_AUDIO_AACStreamFormatRAW,         /**< AAC Raw Format */
245     OMX_AUDIO_AACStreamFormatKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
246     OMX_AUDIO_AACStreamFormatVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
247     OMX_AUDIO_AACStreamFormatMax = 0x7FFFFFFF
248 } OMX_AUDIO_AACSTREAMFORMATTYPE;
249 
250 
251 /** AAC mode type.  Note that the term profile is used with the MPEG-2
252  * standard and the term object type and profile is used with MPEG-4 */
253 typedef enum OMX_AUDIO_AACPROFILETYPE{
254   OMX_AUDIO_AACObjectNull = 0,      /**< Null, not used */
255   OMX_AUDIO_AACObjectMain = 1,      /**< AAC Main object */
256   OMX_AUDIO_AACObjectLC,            /**< AAC Low Complexity object (AAC profile) */
257   OMX_AUDIO_AACObjectSSR,           /**< AAC Scalable Sample Rate object */
258   OMX_AUDIO_AACObjectLTP,           /**< AAC Long Term Prediction object */
259   OMX_AUDIO_AACObjectHE,            /**< AAC High Efficiency (object type SBR, HE-AAC profile) */
260   OMX_AUDIO_AACObjectScalable,      /**< AAC Scalable object */
261   OMX_AUDIO_AACObjectERLC = 17,     /**< ER AAC Low Complexity object (Error Resilient AAC-LC) */
262   OMX_AUDIO_AACObjectER_Scalable = 20, /**< ER AAC scalable object */
263   OMX_AUDIO_AACObjectLD = 23,       /**< AAC Low Delay object (Error Resilient) */
264   OMX_AUDIO_AACObjectHE_PS = 29,    /**< AAC High Efficiency with Parametric Stereo coding (HE-AAC v2, object type PS) */
265   OMX_AUDIO_AACObjectELD = 39,      /** AAC Enhanced Low Delay. NOTE: Pending Khronos standardization **/
266   OMX_AUDIO_AACObjectXHE = 42,      /** extended High Efficiency AAC. NOTE: Pending Khronos standardization */
267   OMX_AUDIO_AACObjectKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
268   OMX_AUDIO_AACObjectVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
269   OMX_AUDIO_AACObjectMax = 0x7FFFFFFF
270 } OMX_AUDIO_AACPROFILETYPE;
271 
272 
273 /** AAC tool usage (for nAACtools in OMX_AUDIO_PARAM_AACPROFILETYPE).
274  * Required for encoder configuration and optional as decoder info output.
275  * For MP3, OMX_AUDIO_CHANNELMODETYPE is sufficient. */
276 #define OMX_AUDIO_AACToolNone 0x00000000 /**< no AAC tools allowed (encoder config) or active (decoder info output) */
277 #define OMX_AUDIO_AACToolMS   0x00000001 /**< MS: Mid/side joint coding tool allowed or active */
278 #define OMX_AUDIO_AACToolIS   0x00000002 /**< IS: Intensity stereo tool allowed or active */
279 #define OMX_AUDIO_AACToolTNS  0x00000004 /**< TNS: Temporal Noise Shaping tool allowed or active */
280 #define OMX_AUDIO_AACToolPNS  0x00000008 /**< PNS: MPEG-4 Perceptual Noise substitution tool allowed or active */
281 #define OMX_AUDIO_AACToolLTP  0x00000010 /**< LTP: MPEG-4 Long Term Prediction tool allowed or active */
282 #define OMX_AUDIO_AACToolVendor 0x00010000 /**< NOT A KHRONOS VALUE, offset for vendor-specific additions */
283 #define OMX_AUDIO_AACToolAll  0x7FFFFFFF /**< all AAC tools allowed or active (*/
284 
285 /** MPEG-4 AAC error resilience (ER) tool usage (for nAACERtools in OMX_AUDIO_PARAM_AACPROFILETYPE).
286  * Required for ER encoder configuration and optional as decoder info output */
287 #define OMX_AUDIO_AACERNone  0x00000000  /**< no AAC ER tools allowed/used */
288 #define OMX_AUDIO_AACERVCB11 0x00000001  /**< VCB11: Virtual Code Books for AAC section data */
289 #define OMX_AUDIO_AACERRVLC  0x00000002  /**< RVLC: Reversible Variable Length Coding */
290 #define OMX_AUDIO_AACERHCR   0x00000004  /**< HCR: Huffman Codeword Reordering */
291 #define OMX_AUDIO_AACERAll   0x7FFFFFFF  /**< all AAC ER tools allowed/used */
292 
293 
294 /** AAC params */
295 typedef struct OMX_AUDIO_PARAM_AACPROFILETYPE {
296     OMX_U32 nSize;                 /**< Size of this structure, in Bytes */
297     OMX_VERSIONTYPE nVersion;      /**< OMX specification version information */
298     OMX_U32 nPortIndex;            /**< Port that this structure applies to */
299     OMX_U32 nChannels;             /**< Number of channels */
300     OMX_U32 nSampleRate;           /**< Sampling rate of the source data.  Use 0 for
301                                         variable or unknown sampling rate. */
302     OMX_U32 nBitRate;              /**< Bit rate of the input data.  Use 0 for variable
303                                         rate or unknown bit rates */
304     OMX_U32 nAudioBandWidth;       /**< Audio band width (in Hz) to which an encoder should
305                                         limit the audio signal. Use 0 to let encoder decide */
306     OMX_U32 nFrameLength;          /**< Frame length (in audio samples per channel) of the codec.
307                                         Can be 1024 or 960 (AAC-LC), 2048 (HE-AAC), 480 or 512 (AAC-LD).
308                                         Use 0 to let encoder decide */
309     OMX_U32 nAACtools;             /**< AAC tool usage */
310     OMX_U32 nAACERtools;           /**< MPEG-4 AAC error resilience tool usage */
311     OMX_AUDIO_AACPROFILETYPE eAACProfile;   /**< AAC profile enumeration */
312     OMX_AUDIO_AACSTREAMFORMATTYPE eAACStreamFormat; /**< AAC stream format enumeration */
313     OMX_AUDIO_CHANNELMODETYPE eChannelMode;   /**< Channel mode enumeration */
314 } OMX_AUDIO_PARAM_AACPROFILETYPE;
315 
316 
317 /** VORBIS params */
318 typedef struct OMX_AUDIO_PARAM_VORBISTYPE {
319     OMX_U32 nSize;            /**< size of the structure in bytes */
320     OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
321     OMX_U32 nPortIndex;       /**< port that this structure applies to */
322     OMX_U32 nChannels;        /**< Number of channels */
323     OMX_U32 nBitRate;         /**< Bit rate of the encoded data data.  Use 0 for variable
324                                    rate or unknown bit rates. Encoding is set to the
325                                    bitrate closest to specified  value (in bps) */
326     OMX_U32 nMinBitRate;      /**< Sets minimum bitrate (in bps). */
327     OMX_U32 nMaxBitRate;      /**< Sets maximum bitrate (in bps). */
328 
329     OMX_U32 nSampleRate;      /**< Sampling rate of the source data.  Use 0 for
330                                    variable or unknown sampling rate. */
331     OMX_U32 nAudioBandWidth;  /**< Audio band width (in Hz) to which an encoder should
332                                    limit the audio signal. Use 0 to let encoder decide */
333     OMX_S32 nQuality;         /**< Sets encoding quality to n, between -1 (low) and 10 (high).
334                                    In the default mode of operation, teh quality level is 3.
335                                    Normal quality range is 0 - 10. */
336     OMX_BOOL bManaged;        /**< Set  bitrate  management  mode. This turns off the
337                                    normal VBR encoding, but allows hard or soft bitrate
338                                    constraints to be enforced by the encoder. This mode can
339                                    be slower, and may also be lower quality. It is
340                                    primarily useful for streaming. */
341     OMX_BOOL bDownmix;        /**< Downmix input from stereo to mono (has no effect on
342                                    non-stereo streams). Useful for lower-bitrate encoding. */
343 } OMX_AUDIO_PARAM_VORBISTYPE;
344 
345 
346 /** FLAC params */
347 typedef struct OMX_AUDIO_PARAM_FLACTYPE {
348     OMX_U32 nSize;            /**< size of the structure in bytes */
349     OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
350     OMX_U32 nPortIndex;       /**< port that this structure applies to */
351     OMX_U32 nChannels;        /**< Number of channels */
352     OMX_U32 nSampleRate;      /**< Sampling rate of the source data.  Use 0 for
353                                    unknown sampling rate. */
354     OMX_U32 nCompressionLevel;/**< FLAC compression level, from 0 (fastest compression)
355                                    to 8 (highest compression */
356 } OMX_AUDIO_PARAM_FLACTYPE;
357 
358 
359 /** WMA Version */
360 typedef enum OMX_AUDIO_WMAFORMATTYPE {
361   OMX_AUDIO_WMAFormatUnused = 0, /**< format unused or unknown */
362   OMX_AUDIO_WMAFormat7,          /**< Windows Media Audio format 7 */
363   OMX_AUDIO_WMAFormat8,          /**< Windows Media Audio format 8 */
364   OMX_AUDIO_WMAFormat9,          /**< Windows Media Audio format 9 */
365   OMX_AUDIO_WMAFormatKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
366   OMX_AUDIO_WMAFormatVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
367   OMX_AUDIO_WMAFormatMax = 0x7FFFFFFF
368 } OMX_AUDIO_WMAFORMATTYPE;
369 
370 
371 /** WMA Profile */
372 typedef enum OMX_AUDIO_WMAPROFILETYPE {
373   OMX_AUDIO_WMAProfileUnused = 0,  /**< profile unused or unknown */
374   OMX_AUDIO_WMAProfileL1,          /**< Windows Media audio version 9 profile L1 */
375   OMX_AUDIO_WMAProfileL2,          /**< Windows Media audio version 9 profile L2 */
376   OMX_AUDIO_WMAProfileL3,          /**< Windows Media audio version 9 profile L3 */
377   OMX_AUDIO_WMAProfileKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
378   OMX_AUDIO_WMAProfileVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
379   OMX_AUDIO_WMAProfileMax = 0x7FFFFFFF
380 } OMX_AUDIO_WMAPROFILETYPE;
381 
382 
383 /** WMA params */
384 typedef struct OMX_AUDIO_PARAM_WMATYPE {
385     OMX_U32 nSize;            /**< size of the structure in bytes */
386     OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
387     OMX_U32 nPortIndex;       /**< port that this structure applies to */
388     OMX_U16 nChannels;        /**< Number of channels */
389     OMX_U32 nBitRate;         /**< Bit rate of the input data.  Use 0 for variable
390                                    rate or unknown bit rates */
391     OMX_AUDIO_WMAFORMATTYPE eFormat; /**< Version of WMA stream / data */
392     OMX_AUDIO_WMAPROFILETYPE eProfile;  /**< Profile of WMA stream / data */
393     OMX_U32 nSamplingRate;    /**< Sampling rate of the source data */
394     OMX_U16 nBlockAlign;      /**< is the block alignment, or block size, in bytes of the audio codec */
395     OMX_U16 nEncodeOptions;   /**< WMA Type-specific data */
396     OMX_U32 nSuperBlockAlign; /**< WMA Type-specific data */
397 } OMX_AUDIO_PARAM_WMATYPE;
398 
399 /**
400  * RealAudio format
401  */
402 typedef enum OMX_AUDIO_RAFORMATTYPE {
403     OMX_AUDIO_RAFormatUnused = 0, /**< Format unused or unknown */
404     OMX_AUDIO_RA8,                /**< RealAudio 8 codec */
405     OMX_AUDIO_RA9,                /**< RealAudio 9 codec */
406     OMX_AUDIO_RA10_AAC,           /**< MPEG-4 AAC codec for bitrates of more than 128kbps */
407     OMX_AUDIO_RA10_CODEC,         /**< RealAudio codec for bitrates less than 128 kbps */
408     OMX_AUDIO_RA10_LOSSLESS,      /**< RealAudio Lossless */
409     OMX_AUDIO_RA10_MULTICHANNEL,  /**< RealAudio Multichannel */
410     OMX_AUDIO_RA10_VOICE,         /**< RealAudio Voice for bitrates below 15 kbps */
411     OMX_AUDIO_RAFormatKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
412     OMX_AUDIO_RAFormatVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
413     OMX_VIDEO_RAFormatMax = 0x7FFFFFFF
414 } OMX_AUDIO_RAFORMATTYPE;
415 
416 /** RA (Real Audio) params */
417 typedef struct OMX_AUDIO_PARAM_RATYPE {
418     OMX_U32 nSize;              /**< Size of this structure, in Bytes */
419     OMX_VERSIONTYPE nVersion;   /**< OMX specification version information */
420     OMX_U32 nPortIndex;         /**< Port that this structure applies to */
421     OMX_U32 nChannels;          /**< Number of channels */
422     OMX_U32 nSamplingRate;      /**< is the sampling rate of the source data */
423     OMX_U32 nBitsPerFrame;      /**< is the value for bits per frame  */
424     OMX_U32 nSamplePerFrame;    /**< is the value for samples per frame */
425     OMX_U32 nCouplingQuantBits; /**< is the number of coupling quantization bits in the stream */
426     OMX_U32 nCouplingStartRegion;   /**< is the coupling start region in the stream  */
427     OMX_U32 nNumRegions;        /**< is the number of regions value */
428     OMX_AUDIO_RAFORMATTYPE eFormat; /**< is the RealAudio audio format */
429 } OMX_AUDIO_PARAM_RATYPE;
430 
431 
432 /** SBC Allocation Method Type */
433 typedef enum OMX_AUDIO_SBCALLOCMETHODTYPE {
434   OMX_AUDIO_SBCAllocMethodLoudness, /**< Loudness allocation method */
435   OMX_AUDIO_SBCAllocMethodSNR,      /**< SNR allocation method */
436   OMX_AUDIO_SBCAllocMethodKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
437   OMX_AUDIO_SBCAllocMethodVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
438   OMX_AUDIO_SBCAllocMethodMax = 0x7FFFFFFF
439 } OMX_AUDIO_SBCALLOCMETHODTYPE;
440 
441 
442 /** SBC params */
443 typedef struct OMX_AUDIO_PARAM_SBCTYPE {
444     OMX_U32 nSize;             /**< size of the structure in bytes */
445     OMX_VERSIONTYPE nVersion;  /**< OMX specification version information */
446     OMX_U32 nPortIndex;        /**< port that this structure applies to */
447     OMX_U32 nChannels;         /**< Number of channels */
448     OMX_U32 nBitRate;          /**< Bit rate of the input data.  Use 0 for variable
449                                     rate or unknown bit rates */
450     OMX_U32 nSampleRate;       /**< Sampling rate of the source data.  Use 0 for
451                                     variable or unknown sampling rate. */
452     OMX_U32 nBlocks;           /**< Number of blocks */
453     OMX_U32 nSubbands;         /**< Number of subbands */
454     OMX_U32 nBitPool;          /**< Bitpool value */
455     OMX_BOOL bEnableBitrate;   /**< Use bitrate value instead of bitpool */
456     OMX_AUDIO_CHANNELMODETYPE eChannelMode; /**< Channel mode enumeration */
457     OMX_AUDIO_SBCALLOCMETHODTYPE eSBCAllocType;   /**< SBC Allocation method type */
458 } OMX_AUDIO_PARAM_SBCTYPE;
459 
460 
461 /** ADPCM stream format parameters */
462 typedef struct OMX_AUDIO_PARAM_ADPCMTYPE {
463     OMX_U32 nSize;              /**< size of the structure in bytes */
464     OMX_VERSIONTYPE nVersion;   /**< OMX specification version information */
465     OMX_U32 nPortIndex;         /**< port that this structure applies to */
466     OMX_U32 nChannels;          /**< Number of channels in the data stream (not
467                                      necessarily the same as the number of channels
468                                      to be rendered. */
469     OMX_U32 nBitsPerSample;     /**< Number of bits in each sample */
470     OMX_U32 nSampleRate;        /**< Sampling rate of the source data.  Use 0 for
471                                     variable or unknown sampling rate. */
472 } OMX_AUDIO_PARAM_ADPCMTYPE;
473 
474 
475 /** G723 rate */
476 typedef enum OMX_AUDIO_G723RATE {
477     OMX_AUDIO_G723ModeUnused = 0,  /**< AMRNB Mode unused / unknown */
478     OMX_AUDIO_G723ModeLow,         /**< 5300 bps */
479     OMX_AUDIO_G723ModeHigh,        /**< 6300 bps */
480     OMX_AUDIO_G723ModeKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
481     OMX_AUDIO_G723ModeVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
482     OMX_AUDIO_G723ModeMax = 0x7FFFFFFF
483 } OMX_AUDIO_G723RATE;
484 
485 
486 /** G723 - Sample rate must be 8 KHz */
487 typedef struct OMX_AUDIO_PARAM_G723TYPE {
488     OMX_U32 nSize;                /**< size of the structure in bytes */
489     OMX_VERSIONTYPE nVersion;     /**< OMX specification version information */
490     OMX_U32 nPortIndex;           /**< port that this structure applies to */
491     OMX_U32 nChannels;            /**< Number of channels in the data stream (not
492                                        necessarily the same as the number of channels
493                                        to be rendered. */
494     OMX_BOOL bDTX;                /**< Enable Discontinuous Transmisssion */
495     OMX_AUDIO_G723RATE eBitRate;  /**< todo: Should this be moved to a config? */
496     OMX_BOOL bHiPassFilter;       /**< Enable High Pass Filter */
497     OMX_BOOL bPostFilter;         /**< Enable Post Filter */
498 } OMX_AUDIO_PARAM_G723TYPE;
499 
500 
501 /** ITU G726 (ADPCM) rate */
502 typedef enum OMX_AUDIO_G726MODE {
503     OMX_AUDIO_G726ModeUnused = 0,  /**< G726 Mode unused / unknown */
504     OMX_AUDIO_G726Mode16,          /**< 16 kbps */
505     OMX_AUDIO_G726Mode24,          /**< 24 kbps */
506     OMX_AUDIO_G726Mode32,          /**< 32 kbps, most common rate, also G721 */
507     OMX_AUDIO_G726Mode40,          /**< 40 kbps */
508     OMX_AUDIO_G726ModeKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
509     OMX_AUDIO_G726ModeVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
510     OMX_AUDIO_G726ModeMax = 0x7FFFFFFF
511 } OMX_AUDIO_G726MODE;
512 
513 
514 /** G.726 stream format parameters - must be at 8KHz */
515 typedef struct OMX_AUDIO_PARAM_G726TYPE {
516     OMX_U32 nSize;              /**< size of the structure in bytes */
517     OMX_VERSIONTYPE nVersion;   /**< OMX specification version information */
518     OMX_U32 nPortIndex;         /**< port that this structure applies to */
519     OMX_U32 nChannels;          /**< Number of channels in the data stream (not
520                                      necessarily the same as the number of channels
521                                      to be rendered. */
522      OMX_AUDIO_G726MODE eG726Mode;
523 } OMX_AUDIO_PARAM_G726TYPE;
524 
525 
526 /** G729 coder type */
527 typedef enum OMX_AUDIO_G729TYPE {
528     OMX_AUDIO_G729 = 0,           /**< ITU G.729  encoded data */
529     OMX_AUDIO_G729A,              /**< ITU G.729 annex A  encoded data */
530     OMX_AUDIO_G729B,              /**< ITU G.729 with annex B encoded data */
531     OMX_AUDIO_G729AB,             /**< ITU G.729 annexes A and B encoded data */
532     OMX_AUDIO_G729KhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
533     OMX_AUDIO_G729VendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
534     OMX_AUDIO_G729Max = 0x7FFFFFFF
535 } OMX_AUDIO_G729TYPE;
536 
537 
538 /** G729 stream format parameters - fixed 6KHz sample rate */
539 typedef struct OMX_AUDIO_PARAM_G729TYPE {
540     OMX_U32 nSize;            /**< size of the structure in bytes */
541     OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
542     OMX_U32 nPortIndex;       /**< port that this structure applies to */
543     OMX_U32 nChannels;        /**< Number of channels in the data stream (not
544                                    necessarily the same as the number of channels
545                                    to be rendered. */
546     OMX_BOOL bDTX;            /**< Enable Discontinuous Transmisssion */
547     OMX_AUDIO_G729TYPE eBitType;
548 } OMX_AUDIO_PARAM_G729TYPE;
549 
550 
551 /** AMR Frame format */
552 typedef enum OMX_AUDIO_AMRFRAMEFORMATTYPE {
553     OMX_AUDIO_AMRFrameFormatConformance = 0,  /**< Frame Format is AMR Conformance
554                                                    (Standard) Format */
555     OMX_AUDIO_AMRFrameFormatIF1,              /**< Frame Format is AMR Interface
556                                                    Format 1 */
557     OMX_AUDIO_AMRFrameFormatIF2,              /**< Frame Format is AMR Interface
558                                                    Format 2*/
559     OMX_AUDIO_AMRFrameFormatFSF,              /**< Frame Format is AMR File Storage
560                                                    Format */
561     OMX_AUDIO_AMRFrameFormatRTPPayload,       /**< Frame Format is AMR Real-Time
562                                                    Transport Protocol Payload Format */
563     OMX_AUDIO_AMRFrameFormatITU,              /**< Frame Format is ITU Format (added at Motorola request) */
564     OMX_AUDIO_AMRFrameFormatKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
565     OMX_AUDIO_AMRFrameFormatVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
566     OMX_AUDIO_AMRFrameFormatMax = 0x7FFFFFFF
567 } OMX_AUDIO_AMRFRAMEFORMATTYPE;
568 
569 
570 /** AMR band mode */
571 typedef enum OMX_AUDIO_AMRBANDMODETYPE {
572     OMX_AUDIO_AMRBandModeUnused = 0,          /**< AMRNB Mode unused / unknown */
573     OMX_AUDIO_AMRBandModeNB0,                 /**< AMRNB Mode 0 =  4750 bps */
574     OMX_AUDIO_AMRBandModeNB1,                 /**< AMRNB Mode 1 =  5150 bps */
575     OMX_AUDIO_AMRBandModeNB2,                 /**< AMRNB Mode 2 =  5900 bps */
576     OMX_AUDIO_AMRBandModeNB3,                 /**< AMRNB Mode 3 =  6700 bps */
577     OMX_AUDIO_AMRBandModeNB4,                 /**< AMRNB Mode 4 =  7400 bps */
578     OMX_AUDIO_AMRBandModeNB5,                 /**< AMRNB Mode 5 =  7950 bps */
579     OMX_AUDIO_AMRBandModeNB6,                 /**< AMRNB Mode 6 = 10200 bps */
580     OMX_AUDIO_AMRBandModeNB7,                 /**< AMRNB Mode 7 = 12200 bps */
581     OMX_AUDIO_AMRBandModeWB0,                 /**< AMRWB Mode 0 =  6600 bps */
582     OMX_AUDIO_AMRBandModeWB1,                 /**< AMRWB Mode 1 =  8850 bps */
583     OMX_AUDIO_AMRBandModeWB2,                 /**< AMRWB Mode 2 = 12650 bps */
584     OMX_AUDIO_AMRBandModeWB3,                 /**< AMRWB Mode 3 = 14250 bps */
585     OMX_AUDIO_AMRBandModeWB4,                 /**< AMRWB Mode 4 = 15850 bps */
586     OMX_AUDIO_AMRBandModeWB5,                 /**< AMRWB Mode 5 = 18250 bps */
587     OMX_AUDIO_AMRBandModeWB6,                 /**< AMRWB Mode 6 = 19850 bps */
588     OMX_AUDIO_AMRBandModeWB7,                 /**< AMRWB Mode 7 = 23050 bps */
589     OMX_AUDIO_AMRBandModeWB8,                 /**< AMRWB Mode 8 = 23850 bps */
590     OMX_AUDIO_AMRBandModeKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
591     OMX_AUDIO_AMRBandModeVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
592     OMX_AUDIO_AMRBandModeMax = 0x7FFFFFFF
593 } OMX_AUDIO_AMRBANDMODETYPE;
594 
595 
596 /** AMR Discontinuous Transmission mode */
597 typedef enum OMX_AUDIO_AMRDTXMODETYPE {
598     OMX_AUDIO_AMRDTXModeOff = 0,        /**< AMR Discontinuous Transmission Mode is disabled */
599     OMX_AUDIO_AMRDTXModeOnVAD1,         /**< AMR Discontinuous Transmission Mode using
600                                              Voice Activity Detector 1 (VAD1) is enabled */
601     OMX_AUDIO_AMRDTXModeOnVAD2,         /**< AMR Discontinuous Transmission Mode using
602                                              Voice Activity Detector 2 (VAD2) is enabled */
603     OMX_AUDIO_AMRDTXModeOnAuto,         /**< The codec will automatically select between
604                                              Off, VAD1 or VAD2 modes */
605 
606     OMX_AUDIO_AMRDTXasEFR,             /**< DTX as EFR instead of AMR standard (3GPP 26.101, frame type =8,9,10) */
607 
608     OMX_AUDIO_AMRDTXModeKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
609     OMX_AUDIO_AMRDTXModeVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
610     OMX_AUDIO_AMRDTXModeMax = 0x7FFFFFFF
611 } OMX_AUDIO_AMRDTXMODETYPE;
612 
613 
614 /** AMR params */
615 typedef struct OMX_AUDIO_PARAM_AMRTYPE {
616     OMX_U32 nSize;                          /**< size of the structure in bytes */
617     OMX_VERSIONTYPE nVersion;               /**< OMX specification version information */
618     OMX_U32 nPortIndex;                     /**< port that this structure applies to */
619     OMX_U32 nChannels;                      /**< Number of channels */
620     OMX_U32 nBitRate;                       /**< Bit rate read only field */
621     OMX_AUDIO_AMRBANDMODETYPE eAMRBandMode; /**< AMR Band Mode enumeration */
622     OMX_AUDIO_AMRDTXMODETYPE  eAMRDTXMode;  /**< AMR DTX Mode enumeration */
623     OMX_AUDIO_AMRFRAMEFORMATTYPE eAMRFrameFormat; /**< AMR frame format enumeration */
624 } OMX_AUDIO_PARAM_AMRTYPE;
625 
626 
627 /** GSM_FR (ETSI 06.10, 3GPP 46.010) stream format parameters */
628 typedef struct OMX_AUDIO_PARAM_GSMFRTYPE {
629     OMX_U32 nSize;            /**< size of the structure in bytes */
630     OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
631     OMX_U32 nPortIndex;       /**< port that this structure applies to */
632     OMX_BOOL bDTX;            /**< Enable Discontinuous Transmisssion */
633     OMX_BOOL bHiPassFilter;   /**< Enable High Pass Filter */
634 } OMX_AUDIO_PARAM_GSMFRTYPE;
635 
636 
637 /** GSM-HR (ETSI 06.20, 3GPP 46.020) stream format parameters */
638 typedef struct OMX_AUDIO_PARAM_GSMHRTYPE {
639     OMX_U32 nSize;            /**< size of the structure in bytes */
640     OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
641     OMX_U32 nPortIndex;       /**< port that this structure applies to */
642     OMX_BOOL bDTX;            /**< Enable Discontinuous Transmisssion */
643     OMX_BOOL bHiPassFilter;   /**< Enable High Pass Filter */
644 } OMX_AUDIO_PARAM_GSMHRTYPE;
645 
646 
647 /** GSM-EFR (ETSI 06.60, 3GPP 46.060) stream format parameters */
648 typedef struct OMX_AUDIO_PARAM_GSMEFRTYPE {
649     OMX_U32 nSize;            /**< size of the structure in bytes */
650     OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
651     OMX_U32 nPortIndex;       /**< port that this structure applies to */
652     OMX_BOOL bDTX;            /**< Enable Discontinuous Transmisssion */
653     OMX_BOOL bHiPassFilter;   /**< Enable High Pass Filter */
654 } OMX_AUDIO_PARAM_GSMEFRTYPE;
655 
656 
657 /** TDMA FR (TIA/EIA-136-420, VSELP 7.95kbps coder) stream format parameters */
658 typedef struct OMX_AUDIO_PARAM_TDMAFRTYPE {
659     OMX_U32 nSize;                /**< size of the structure in bytes */
660     OMX_VERSIONTYPE nVersion;     /**< OMX specification version information */
661     OMX_U32 nPortIndex;           /**< port that this structure applies to */
662     OMX_U32 nChannels;            /**< Number of channels in the data stream (not
663                                        necessarily the same as the number of channels
664                                        to be rendered. */
665     OMX_BOOL bDTX;                /**< Enable Discontinuous Transmisssion */
666     OMX_BOOL bHiPassFilter;       /**< Enable High Pass Filter */
667 } OMX_AUDIO_PARAM_TDMAFRTYPE;
668 
669 
670 /** TDMA EFR (TIA/EIA-136-410, ACELP 7.4kbps coder) stream format parameters */
671 typedef struct OMX_AUDIO_PARAM_TDMAEFRTYPE {
672     OMX_U32 nSize;                /**< size of the structure in bytes */
673     OMX_VERSIONTYPE nVersion;     /**< OMX specification version information */
674     OMX_U32 nPortIndex;           /**< port that this structure applies to */
675     OMX_U32 nChannels;            /**< Number of channels in the data stream (not
676                                        necessarily the same as the number of channels
677                                        to be rendered. */
678     OMX_BOOL bDTX;                /**< Enable Discontinuous Transmisssion */
679     OMX_BOOL bHiPassFilter;       /**< Enable High Pass Filter */
680 } OMX_AUDIO_PARAM_TDMAEFRTYPE;
681 
682 
683 /** PDC FR ( RCR-27, VSELP 6.7kbps coder) stream format parameters */
684 typedef struct OMX_AUDIO_PARAM_PDCFRTYPE {
685     OMX_U32 nSize;                /**< size of the structure in bytes */
686     OMX_VERSIONTYPE nVersion;     /**< OMX specification version information */
687     OMX_U32 nPortIndex;           /**< port that this structure applies to */
688     OMX_U32 nChannels;            /**< Number of channels in the data stream (not
689                                        necessarily the same as the number of channels
690                                        to be rendered. */
691     OMX_BOOL bDTX;                /**< Enable Discontinuous Transmisssion */
692     OMX_BOOL bHiPassFilter;       /**< Enable High Pass Filter */
693 } OMX_AUDIO_PARAM_PDCFRTYPE;
694 
695 
696 /** PDC EFR ( RCR-27, ACELP 6.7kbps coder) stream format parameters */
697 typedef struct OMX_AUDIO_PARAM_PDCEFRTYPE {
698     OMX_U32 nSize;                /**< size of the structure in bytes */
699     OMX_VERSIONTYPE nVersion;     /**< OMX specification version information */
700     OMX_U32 nPortIndex;           /**< port that this structure applies to */
701     OMX_U32 nChannels;            /**< Number of channels in the data stream (not
702                                        necessarily the same as the number of channels
703                                        to be rendered. */
704     OMX_BOOL bDTX;                /**< Enable Discontinuous Transmisssion */
705     OMX_BOOL bHiPassFilter;       /**< Enable High Pass Filter */
706 } OMX_AUDIO_PARAM_PDCEFRTYPE;
707 
708 /** PDC HR ( RCR-27, PSI-CELP 3.45kbps coder) stream format parameters */
709 typedef struct OMX_AUDIO_PARAM_PDCHRTYPE {
710     OMX_U32 nSize;                /**< size of the structure in bytes */
711     OMX_VERSIONTYPE nVersion;     /**< OMX specification version information */
712     OMX_U32 nPortIndex;           /**< port that this structure applies to */
713     OMX_U32 nChannels;            /**< Number of channels in the data stream (not
714                                        necessarily the same as the number of channels
715                                        to be rendered. */
716     OMX_BOOL bDTX;                /**< Enable Discontinuous Transmisssion */
717     OMX_BOOL bHiPassFilter;       /**< Enable High Pass Filter */
718 } OMX_AUDIO_PARAM_PDCHRTYPE;
719 
720 
721 /** CDMA Rate types */
722 typedef enum OMX_AUDIO_CDMARATETYPE {
723     OMX_AUDIO_CDMARateBlank = 0,          /**< CDMA encoded frame is blank */
724     OMX_AUDIO_CDMARateFull,               /**< CDMA encoded frame in full rate */
725     OMX_AUDIO_CDMARateHalf,               /**< CDMA encoded frame in half rate */
726     OMX_AUDIO_CDMARateQuarter,            /**< CDMA encoded frame in quarter rate */
727     OMX_AUDIO_CDMARateEighth,             /**< CDMA encoded frame in eighth rate (DTX)*/
728     OMX_AUDIO_CDMARateErasure,            /**< CDMA erasure frame */
729     OMX_AUDIO_CDMARateKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
730     OMX_AUDIO_CDMARateVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
731     OMX_AUDIO_CDMARateMax = 0x7FFFFFFF
732 } OMX_AUDIO_CDMARATETYPE;
733 
734 
735 /** QCELP8 (TIA/EIA-96, up to 8kbps coder) stream format parameters */
736 typedef struct OMX_AUDIO_PARAM_QCELP8TYPE {
737     OMX_U32 nSize;                /**< size of the structure in bytes */
738     OMX_VERSIONTYPE nVersion;     /**< OMX specification version information */
739     OMX_U32 nPortIndex;           /**< port that this structure applies to */
740     OMX_U32 nChannels;            /**< Number of channels in the data stream (not
741                                        necessarily the same as the number of channels
742                                        to be rendered. */
743     OMX_U32 nBitRate;             /**< Bit rate of the input data.  Use 0 for variable
744                                        rate or unknown bit rates */
745     OMX_AUDIO_CDMARATETYPE eCDMARate; /**< Frame rate */
746     OMX_U32 nMinBitRate;          /**< minmal rate for the encoder = 1,2,3,4, default = 1 */
747     OMX_U32 nMaxBitRate;          /**< maximal rate for the encoder = 1,2,3,4, default = 4 */
748 } OMX_AUDIO_PARAM_QCELP8TYPE;
749 
750 
751 /** QCELP13 ( CDMA, EIA/TIA-733, 13.3kbps coder) stream format parameters */
752 typedef struct OMX_AUDIO_PARAM_QCELP13TYPE {
753     OMX_U32 nSize;                /**< size of the structure in bytes */
754     OMX_VERSIONTYPE nVersion;     /**< OMX specification version information */
755     OMX_U32 nPortIndex;           /**< port that this structure applies to */
756     OMX_U32 nChannels;            /**< Number of channels in the data stream (not
757                                        necessarily the same as the number of channels
758                                        to be rendered. */
759     OMX_AUDIO_CDMARATETYPE eCDMARate; /**< Frame rate */
760     OMX_U32 nMinBitRate;          /**< minmal rate for the encoder = 1,2,3,4, default = 1 */
761     OMX_U32 nMaxBitRate;          /**< maximal rate for the encoder = 1,2,3,4, default = 4 */
762 } OMX_AUDIO_PARAM_QCELP13TYPE;
763 
764 
765 /** EVRC ( CDMA, EIA/TIA-127, RCELP up to 8.55kbps coder) stream format parameters */
766 typedef struct OMX_AUDIO_PARAM_EVRCTYPE {
767     OMX_U32 nSize;                /**< size of the structure in bytes */
768     OMX_VERSIONTYPE nVersion;     /**< OMX specification version information */
769     OMX_U32 nPortIndex;           /**< port that this structure applies to */
770     OMX_U32 nChannels;            /**< Number of channels in the data stream (not
771                                        necessarily the same as the number of channels
772                                        to be rendered. */
773     OMX_AUDIO_CDMARATETYPE eCDMARate; /**< actual Frame rate */
774     OMX_BOOL bRATE_REDUCon;       /**< RATE_REDUCtion is requested for this frame */
775     OMX_U32 nMinBitRate;          /**< minmal rate for the encoder = 1,2,3,4, default = 1 */
776     OMX_U32 nMaxBitRate;          /**< maximal rate for the encoder = 1,2,3,4, default = 4 */
777     OMX_BOOL bHiPassFilter;       /**< Enable encoder's High Pass Filter */
778     OMX_BOOL bNoiseSuppressor;    /**< Enable encoder's noise suppressor pre-processing */
779     OMX_BOOL bPostFilter;         /**< Enable decoder's post Filter */
780 } OMX_AUDIO_PARAM_EVRCTYPE;
781 
782 
783 /** SMV ( up to 8.55kbps coder) stream format parameters */
784 typedef struct OMX_AUDIO_PARAM_SMVTYPE {
785     OMX_U32 nSize;                /**< size of the structure in bytes */
786     OMX_VERSIONTYPE nVersion;     /**< OMX specification version information */
787     OMX_U32 nPortIndex;           /**< port that this structure applies to */
788     OMX_U32 nChannels;            /**< Number of channels in the data stream (not
789                                        necessarily the same as the number of channels
790                                        to be rendered. */
791     OMX_AUDIO_CDMARATETYPE eCDMARate; /**< Frame rate */
792     OMX_BOOL bRATE_REDUCon;           /**< RATE_REDUCtion is requested for this frame */
793     OMX_U32 nMinBitRate;          /**< minmal rate for the encoder = 1,2,3,4, default = 1 ??*/
794     OMX_U32 nMaxBitRate;          /**< maximal rate for the encoder = 1,2,3,4, default = 4 ??*/
795     OMX_BOOL bHiPassFilter;       /**< Enable encoder's High Pass Filter ??*/
796     OMX_BOOL bNoiseSuppressor;    /**< Enable encoder's noise suppressor pre-processing */
797     OMX_BOOL bPostFilter;         /**< Enable decoder's post Filter ??*/
798 } OMX_AUDIO_PARAM_SMVTYPE;
799 
800 
801 /** MIDI Format
802  * @ingroup midi
803  */
804 typedef enum OMX_AUDIO_MIDIFORMATTYPE
805 {
806     OMX_AUDIO_MIDIFormatUnknown = 0, /**< MIDI Format unknown or don't care */
807     OMX_AUDIO_MIDIFormatSMF0,        /**< Standard MIDI File Type 0 */
808     OMX_AUDIO_MIDIFormatSMF1,        /**< Standard MIDI File Type 1 */
809     OMX_AUDIO_MIDIFormatSMF2,        /**< Standard MIDI File Type 2 */
810     OMX_AUDIO_MIDIFormatSPMIDI,      /**< SP-MIDI */
811     OMX_AUDIO_MIDIFormatXMF0,        /**< eXtensible Music Format type 0 */
812     OMX_AUDIO_MIDIFormatXMF1,        /**< eXtensible Music Format type 1 */
813     OMX_AUDIO_MIDIFormatMobileXMF,   /**< Mobile XMF (eXtensible Music Format type 2) */
814     OMX_AUDIO_MIDIFormatKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
815     OMX_AUDIO_MIDIFormatVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
816     OMX_AUDIO_MIDIFormatMax = 0x7FFFFFFF
817 } OMX_AUDIO_MIDIFORMATTYPE;
818 
819 
820 /** MIDI params
821  * @ingroup midi
822  */
823 typedef struct OMX_AUDIO_PARAM_MIDITYPE {
824     OMX_U32 nSize;                 /**< size of the structure in bytes */
825     OMX_VERSIONTYPE nVersion;      /**< OMX specification version information */
826     OMX_U32 nPortIndex;            /**< port that this structure applies to */
827     OMX_U32 nFileSize;             /**< size of the MIDI file in bytes, where the entire
828                                         MIDI file passed in, otherwise if 0x0, the MIDI data
829                                         is merged and streamed (instead of passed as an
830                                         entire MIDI file) */
831     OMX_BU32 sMaxPolyphony;        /**< Specifies the maximum simultaneous polyphonic
832                                         voices. A value of zero indicates that the default
833                                         polyphony of the device is used  */
834     OMX_BOOL bLoadDefaultSound;    /**< Whether to load default sound
835                                         bank at initialization */
836     OMX_AUDIO_MIDIFORMATTYPE eMidiFormat; /**< Version of the MIDI file */
837 } OMX_AUDIO_PARAM_MIDITYPE;
838 
839 
840 /** Type of the MIDI sound bank
841  * @ingroup midi
842  */
843 typedef enum OMX_AUDIO_MIDISOUNDBANKTYPE {
844     OMX_AUDIO_MIDISoundBankUnused = 0,           /**< unused/unknown soundbank type */
845     OMX_AUDIO_MIDISoundBankDLS1,                 /**< DLS version 1 */
846     OMX_AUDIO_MIDISoundBankDLS2,                 /**< DLS version 2 */
847     OMX_AUDIO_MIDISoundBankMobileDLSBase,        /**< Mobile DLS, using the base functionality */
848     OMX_AUDIO_MIDISoundBankMobileDLSPlusOptions, /**< Mobile DLS, using the specification-defined optional feature set */
849     OMX_AUDIO_MIDISoundBankKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
850     OMX_AUDIO_MIDISoundBankVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
851     OMX_AUDIO_MIDISoundBankMax = 0x7FFFFFFF
852 } OMX_AUDIO_MIDISOUNDBANKTYPE;
853 
854 
855 /** Bank Layout describes how bank MSB & LSB are used in the DLS instrument definitions sound bank
856  * @ingroup midi
857  */
858 typedef enum OMX_AUDIO_MIDISOUNDBANKLAYOUTTYPE {
859    OMX_AUDIO_MIDISoundBankLayoutUnused = 0,   /**< unused/unknown soundbank type */
860    OMX_AUDIO_MIDISoundBankLayoutGM,           /**< GS layout (based on bank MSB 0x00) */
861    OMX_AUDIO_MIDISoundBankLayoutGM2,          /**< General MIDI 2 layout (using MSB 0x78/0x79, LSB 0x00) */
862    OMX_AUDIO_MIDISoundBankLayoutUser,         /**< Does not conform to any bank numbering standards */
863    OMX_AUDIO_MIDISoundBankLayoutKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
864    OMX_AUDIO_MIDISoundBankLayoutVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
865    OMX_AUDIO_MIDISoundBankLayoutMax = 0x7FFFFFFF
866 } OMX_AUDIO_MIDISOUNDBANKLAYOUTTYPE;
867 
868 
869 /** MIDI params to load/unload user soundbank
870  * @ingroup midi
871  */
872 typedef struct OMX_AUDIO_PARAM_MIDILOADUSERSOUNDTYPE {
873     OMX_U32 nSize;            /**< size of the structure in bytes */
874     OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
875     OMX_U32 nPortIndex;       /**< port that this structure applies to */
876     OMX_U32 nDLSIndex;        /**< DLS file index to be loaded */
877     OMX_U32 nDLSSize;         /**< Size in bytes */
878     OMX_PTR pDLSData;         /**< Pointer to DLS file data */
879     OMX_AUDIO_MIDISOUNDBANKTYPE eMidiSoundBank;   /**< Midi sound bank type enumeration */
880     OMX_AUDIO_MIDISOUNDBANKLAYOUTTYPE eMidiSoundBankLayout; /**< Midi sound bank layout enumeration */
881 } OMX_AUDIO_PARAM_MIDILOADUSERSOUNDTYPE;
882 
883 
884 /** Structure for Live MIDI events and MIP messages.
885  * (MIP = Maximum Instantaneous Polyphony; part of the SP-MIDI standard.)
886  * @ingroup midi
887  */
888 typedef struct OMX_AUDIO_CONFIG_MIDIIMMEDIATEEVENTTYPE {
889     OMX_U32 nSize;            /**< size of the structure in bytes */
890     OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
891     OMX_U32 nPortIndex;       /**< Port that this structure applies to */
892     OMX_U32 nMidiEventSize;   /**< Size of immediate MIDI events or MIP message in bytes  */
893     OMX_U8 nMidiEvents[1];    /**< MIDI event array to be rendered immediately, or an
894                                    array for the MIP message buffer, where the size is
895                                    indicated by nMidiEventSize */
896 } OMX_AUDIO_CONFIG_MIDIIMMEDIATEEVENTTYPE;
897 
898 
899 /** MIDI sound bank/ program pair in a given channel
900  * @ingroup midi
901  */
902 typedef struct OMX_AUDIO_CONFIG_MIDISOUNDBANKPROGRAMTYPE {
903     OMX_U32 nSize;              /**< size of the structure in bytes */
904     OMX_VERSIONTYPE nVersion;   /**< OMX specification version information */
905     OMX_U32 nPortIndex;         /**< Port that this structure applies to */
906     OMX_U32 nChannel;           /**< Valid channel values range from 1 to 16 */
907     OMX_U16 nIDProgram;         /**< Valid program ID range is 1 to 128 */
908     OMX_U16 nIDSoundBank;       /**< Sound bank ID */
909     OMX_U32 nUserSoundBankIndex;/**< User soundbank index, easier to access soundbanks
910                                      by index if multiple banks are present */
911 } OMX_AUDIO_CONFIG_MIDISOUNDBANKPROGRAMTYPE;
912 
913 
914 /** MIDI control
915  * @ingroup midi
916  */
917 typedef struct OMX_AUDIO_CONFIG_MIDICONTROLTYPE {
918     OMX_U32 nSize;                /**< size of the structure in bytes */
919     OMX_VERSIONTYPE nVersion;     /**< OMX specification version information */
920     OMX_U32 nPortIndex;           /**< port that this structure applies to */
921     OMX_BS32 sPitchTransposition; /**< Pitch transposition in semitones, stored as Q22.10
922                                        format based on JAVA MMAPI (JSR-135) requirement */
923     OMX_BU32 sPlayBackRate;       /**< Relative playback rate, stored as Q14.17 fixed-point
924                                        number based on JSR-135 requirement */
925     OMX_BU32 sTempo ;             /**< Tempo in beats per minute (BPM), stored as Q22.10
926                                        fixed-point number based on JSR-135 requirement */
927     OMX_U32 nMaxPolyphony;        /**< Specifies the maximum simultaneous polyphonic
928                                        voices. A value of zero indicates that the default
929                                        polyphony of the device is used  */
930     OMX_U32 nNumRepeat;           /**< Number of times to repeat playback */
931     OMX_U32 nStopTime;            /**< Time in milliseconds to indicate when playback
932                                        will stop automatically.  Set to zero if not used */
933     OMX_U16 nChannelMuteMask;     /**< 16 bit mask for channel mute status */
934     OMX_U16 nChannelSoloMask;     /**< 16 bit mask for channel solo status */
935     OMX_U32 nTrack0031MuteMask;   /**< 32 bit mask for track mute status. Note: This is for tracks 0-31 */
936     OMX_U32 nTrack3263MuteMask;   /**< 32 bit mask for track mute status. Note: This is for tracks 32-63 */
937     OMX_U32 nTrack0031SoloMask;   /**< 32 bit mask for track solo status. Note: This is for tracks 0-31 */
938     OMX_U32 nTrack3263SoloMask;   /**< 32 bit mask for track solo status. Note: This is for tracks 32-63 */
939 
940 } OMX_AUDIO_CONFIG_MIDICONTROLTYPE;
941 
942 
943 /** MIDI Playback States
944  * @ingroup midi
945  */
946 typedef enum OMX_AUDIO_MIDIPLAYBACKSTATETYPE {
947   OMX_AUDIO_MIDIPlayBackStateUnknown = 0,      /**< Unknown state or state does not map to
948                                                     other defined states */
949   OMX_AUDIO_MIDIPlayBackStateClosedEngaged,    /**< No MIDI resource is currently open.
950                                                     The MIDI engine is currently processing
951                                                     MIDI events. */
952   OMX_AUDIO_MIDIPlayBackStateParsing,          /**< A MIDI resource is open and is being
953                                                     primed. The MIDI engine is currently
954                                                     processing MIDI events. */
955   OMX_AUDIO_MIDIPlayBackStateOpenEngaged,      /**< A MIDI resource is open and primed but
956                                                     not playing. The MIDI engine is currently
957                                                     processing MIDI events. The transition to
958                                                     this state is only possible from the
959                                                     OMX_AUDIO_MIDIPlayBackStatePlaying state,
960                                                     when the 'playback head' reaches the end
961                                                     of media data or the playback stops due
962                                                     to stop time set.*/
963   OMX_AUDIO_MIDIPlayBackStatePlaying,          /**< A MIDI resource is open and currently
964                                                     playing. The MIDI engine is currently
965                                                     processing MIDI events.*/
966   OMX_AUDIO_MIDIPlayBackStatePlayingPartially, /**< Best-effort playback due to SP-MIDI/DLS
967                                                     resource constraints */
968   OMX_AUDIO_MIDIPlayBackStatePlayingSilently,  /**< Due to system resource constraints and
969                                                     SP-MIDI content constraints, there is
970                                                     no audible MIDI content during playback
971                                                     currently. The situation may change if
972                                                     resources are freed later.*/
973   OMX_AUDIO_MIDIPlayBackStateKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
974   OMX_AUDIO_MIDIPlayBackStateVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
975   OMX_AUDIO_MIDIPlayBackStateMax = 0x7FFFFFFF
976 } OMX_AUDIO_MIDIPLAYBACKSTATETYPE;
977 
978 
979 /** MIDI status
980  * @ingroup midi
981  */
982 typedef struct OMX_AUDIO_CONFIG_MIDISTATUSTYPE {
983     OMX_U32 nSize;              /**< size of the structure in bytes */
984     OMX_VERSIONTYPE nVersion;   /**< OMX specification version information */
985     OMX_U32 nPortIndex;         /**< port that this structure applies to */
986     OMX_U16 nNumTracks;         /**< Number of MIDI tracks in the file, read only field.
987                                      NOTE: May not return a meaningful value until the entire
988                                      file is parsed and buffered.  */
989     OMX_U32 nDuration;          /**< The length of the currently open MIDI resource
990                                      in milliseconds. NOTE: May not return a meaningful value
991                                      until the entire file is parsed and buffered.  */
992     OMX_U32 nPosition;          /**< Current Position of the MIDI resource being played
993                                      in milliseconds */
994     OMX_BOOL bVibra;            /**< Does Vibra track exist? NOTE: May not return a meaningful
995                                      value until the entire file is parsed and buffered. */
996     OMX_U32 nNumMetaEvents;     /**< Total number of MIDI Meta Events in the currently
997                                      open MIDI resource. NOTE: May not return a meaningful value
998                                      until the entire file is parsed and buffered.  */
999     OMX_U32 nNumActiveVoices;   /**< Number of active voices in the currently playing
1000                                      MIDI resource. NOTE: May not return a meaningful value until
1001                                      the entire file is parsed and buffered. */
1002     OMX_AUDIO_MIDIPLAYBACKSTATETYPE eMIDIPlayBackState;  /**< MIDI playback state enumeration, read only field */
1003 } OMX_AUDIO_CONFIG_MIDISTATUSTYPE;
1004 
1005 
1006 /** MIDI Meta Event structure one per Meta Event.
1007  *  MIDI Meta Events are like audio metadata, except that they are interspersed
1008  *  with the MIDI content throughout the file and are not localized in the header.
1009  *  As such, it is necessary to retrieve information about these Meta Events from
1010  *  the engine, as it encounters these Meta Events within the MIDI content.
1011  *  For example, SMF files can have up to 14 types of MIDI Meta Events (copyright,
1012  *  author, default tempo, etc.) scattered throughout the file.
1013  *  @ingroup midi
1014  */
1015 typedef struct OMX_AUDIO_CONFIG_MIDIMETAEVENTTYPE{
1016     OMX_U32 nSize;            /**< size of the structure in bytes */
1017     OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
1018     OMX_U32 nPortIndex;       /**< port that this structure applies to */
1019     OMX_U32 nIndex;           /**< Index of Meta Event */
1020     OMX_U8 nMetaEventType;    /**< Meta Event Type, 7bits (i.e. 0 - 127) */
1021     OMX_U32 nMetaEventSize;   /**< size of the Meta Event in bytes */
1022     OMX_U32 nTrack;           /**< track number for the meta event */
1023     OMX_U32 nPosition;        /**< Position of the meta-event in milliseconds */
1024 } OMX_AUDIO_CONFIG_MIDIMETAEVENTTYPE;
1025 
1026 
1027 /** MIDI Meta Event Data structure - one per Meta Event.
1028  * @ingroup midi
1029  */
1030 typedef struct OMX_AUDIO_CONFIG_MIDIMETAEVENTDATATYPE{
1031     OMX_U32 nSize;            /**< size of the structure in bytes */
1032     OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
1033     OMX_U32 nPortIndex;       /**< port that this structure applies to */
1034     OMX_U32 nIndex;           /**< Index of Meta Event */
1035     OMX_U32 nMetaEventSize;   /**< size of the Meta Event in bytes */
1036     OMX_U8 nData[1];          /**< array of one or more bytes of meta data
1037                                    as indicated by the nMetaEventSize field */
1038 } OMX_AUDIO_CONFIG__MIDIMETAEVENTDATATYPE;
1039 
1040 
1041 /** Audio Volume adjustment for a port */
1042 typedef struct OMX_AUDIO_CONFIG_VOLUMETYPE {
1043     OMX_U32 nSize;              /**< size of the structure in bytes */
1044     OMX_VERSIONTYPE nVersion;   /**< OMX specification version information */
1045     OMX_U32 nPortIndex;         /**< Port index indicating which port to
1046                                      set.  Select the input port to set
1047                                      just that port's volume.  Select the
1048                                      output port to adjust the master
1049                                      volume. */
1050     OMX_BOOL bLinear;           /**< Is the volume to be set in linear (0.100)
1051                                      or logarithmic scale (mB) */
1052     OMX_BS32 sVolume;           /**< Volume linear setting in the 0..100 range, OR
1053                                      Volume logarithmic setting for this port.  The values
1054                                      for volume are in mB (millibels = 1/100 dB) relative
1055                                      to a gain of 1 (e.g. the output is the same as the
1056                                      input level).  Values are in mB from nMax
1057                                      (maximum volume) to nMin mB (typically negative).
1058                                      Since the volume is "voltage"
1059                                      and not a "power", it takes a setting of
1060                                      -600 mB to decrease the volume by 1/2.  If
1061                                      a component cannot accurately set the
1062                                      volume to the requested value, it must
1063                                      set the volume to the closest value BELOW
1064                                      the requested value.  When getting the
1065                                      volume setting, the current actual volume
1066                                      must be returned. */
1067 } OMX_AUDIO_CONFIG_VOLUMETYPE;
1068 
1069 
1070 /** Audio Volume adjustment for a channel */
1071 typedef struct OMX_AUDIO_CONFIG_CHANNELVOLUMETYPE {
1072     OMX_U32 nSize;              /**< size of the structure in bytes */
1073     OMX_VERSIONTYPE nVersion;   /**< OMX specification version information */
1074     OMX_U32 nPortIndex;         /**< Port index indicating which port to
1075                                      set.  Select the input port to set
1076                                      just that port's volume.  Select the
1077                                      output port to adjust the master
1078                                      volume. */
1079     OMX_U32 nChannel;           /**< channel to select from 0 to N-1,
1080                                      using OMX_ALL to apply volume settings
1081                                      to all channels */
1082     OMX_BOOL bLinear;           /**< Is the volume to be set in linear (0.100) or
1083                                      logarithmic scale (mB) */
1084     OMX_BS32 sVolume;           /**< Volume linear setting in the 0..100 range, OR
1085                                      Volume logarithmic setting for this port.
1086                                      The values for volume are in mB
1087                                      (millibels = 1/100 dB) relative to a gain
1088                                      of 1 (e.g. the output is the same as the
1089                                      input level).  Values are in mB from nMax
1090                                      (maximum volume) to nMin mB (typically negative).
1091                                      Since the volume is "voltage"
1092                                      and not a "power", it takes a setting of
1093                                      -600 mB to decrease the volume by 1/2.  If
1094                                      a component cannot accurately set the
1095                                      volume to the requested value, it must
1096                                      set the volume to the closest value BELOW
1097                                      the requested value.  When getting the
1098                                      volume setting, the current actual volume
1099                                      must be returned. */
1100     OMX_BOOL bIsMIDI;           /**< TRUE if nChannel refers to a MIDI channel,
1101                                      FALSE otherwise */
1102 } OMX_AUDIO_CONFIG_CHANNELVOLUMETYPE;
1103 
1104 
1105 /** Audio balance setting */
1106 typedef struct OMX_AUDIO_CONFIG_BALANCETYPE {
1107     OMX_U32 nSize;              /**< size of the structure in bytes */
1108     OMX_VERSIONTYPE nVersion;   /**< OMX specification version information */
1109     OMX_U32 nPortIndex;         /**< Port index indicating which port to
1110                                      set.  Select the input port to set
1111                                      just that port's balance.  Select the
1112                                      output port to adjust the master
1113                                      balance. */
1114     OMX_S32 nBalance;           /**< balance setting for this port
1115                                      (-100 to 100, where -100 indicates
1116                                      all left, and no right */
1117 } OMX_AUDIO_CONFIG_BALANCETYPE;
1118 
1119 
1120 /** Audio Port mute */
1121 typedef struct OMX_AUDIO_CONFIG_MUTETYPE {
1122     OMX_U32 nSize;              /**< size of the structure in bytes */
1123     OMX_VERSIONTYPE nVersion;   /**< OMX specification version information */
1124     OMX_U32 nPortIndex;         /**< Port index indicating which port to
1125                                      set.  Select the input port to set
1126                                      just that port's mute.  Select the
1127                                      output port to adjust the master
1128                                      mute. */
1129     OMX_BOOL bMute;             /**< Mute setting for this port */
1130 } OMX_AUDIO_CONFIG_MUTETYPE;
1131 
1132 
1133 /** Audio Channel mute */
1134 typedef struct OMX_AUDIO_CONFIG_CHANNELMUTETYPE {
1135     OMX_U32 nSize;              /**< size of the structure in bytes */
1136     OMX_VERSIONTYPE nVersion;   /**< OMX specification version information */
1137     OMX_U32 nPortIndex;         /**< port that this structure applies to */
1138     OMX_U32 nChannel;           /**< channel to select from 0 to N-1,
1139                                      using OMX_ALL to apply mute settings
1140                                      to all channels */
1141     OMX_BOOL bMute;             /**< Mute setting for this channel */
1142     OMX_BOOL bIsMIDI;           /**< TRUE if nChannel refers to a MIDI channel,
1143                                      FALSE otherwise */
1144 } OMX_AUDIO_CONFIG_CHANNELMUTETYPE;
1145 
1146 
1147 
1148 /** Enable / Disable for loudness control, which boosts bass and to a
1149  *  smaller extent high end frequencies to compensate for hearing
1150  *  ability at the extreme ends of the audio spectrum
1151  */
1152 typedef struct OMX_AUDIO_CONFIG_LOUDNESSTYPE {
1153     OMX_U32 nSize;             /**< size of the structure in bytes */
1154     OMX_VERSIONTYPE nVersion;  /**< OMX specification version information */
1155     OMX_U32 nPortIndex;        /**< port that this structure applies to */
1156     OMX_BOOL bLoudness;        /**< Enable/disable for loudness */
1157 } OMX_AUDIO_CONFIG_LOUDNESSTYPE;
1158 
1159 
1160 /** Enable / Disable for bass, which controls low frequencies
1161  */
1162 typedef struct OMX_AUDIO_CONFIG_BASSTYPE {
1163     OMX_U32 nSize;             /**< size of the structure in bytes */
1164     OMX_VERSIONTYPE nVersion;  /**< OMX specification version information */
1165     OMX_U32 nPortIndex;        /**< port that this structure applies to */
1166     OMX_BOOL bEnable;          /**< Enable/disable for bass control */
1167     OMX_S32 nBass;             /**< bass setting for the port, as a
1168                                     continuous value from -100 to 100
1169                                     (0 means no change in bass level)*/
1170 } OMX_AUDIO_CONFIG_BASSTYPE;
1171 
1172 
1173 /** Enable / Disable for treble, which controls high frequencies tones
1174  */
1175 typedef struct OMX_AUDIO_CONFIG_TREBLETYPE {
1176     OMX_U32 nSize;             /**< size of the structure in bytes */
1177     OMX_VERSIONTYPE nVersion;  /**< OMX specification version information */
1178     OMX_U32 nPortIndex;        /**< port that this structure applies to */
1179     OMX_BOOL bEnable;          /**< Enable/disable for treble control */
1180     OMX_S32  nTreble;          /**< treble setting for the port, as a
1181                                     continuous value from -100 to 100
1182                                     (0 means no change in treble level) */
1183 } OMX_AUDIO_CONFIG_TREBLETYPE;
1184 
1185 
1186 /** An equalizer is typically used for two reasons: to compensate for an
1187  *  sub-optimal frequency response of a system to make it sound more natural
1188  *  or to create intentionally some unnatural coloring to the sound to create
1189  *  an effect.
1190  *  @ingroup effects
1191  */
1192 typedef struct OMX_AUDIO_CONFIG_EQUALIZERTYPE {
1193     OMX_U32 nSize;             /**< size of the structure in bytes */
1194     OMX_VERSIONTYPE nVersion;  /**< OMX specification version information */
1195     OMX_U32 nPortIndex;        /**< port that this structure applies to */
1196     OMX_BOOL bEnable;          /**< Enable/disable for equalizer */
1197     OMX_BU32 sBandIndex;       /**< Band number to be set.  Upper Limit is
1198                                     N-1, where N is the number of bands, lower limit is 0 */
1199     OMX_BU32 sCenterFreq;      /**< Center frequecies in Hz.  This is a
1200                                     read only element and is used to determine
1201                                     the lower, center and upper frequency of
1202                                     this band.  */
1203     OMX_BS32 sBandLevel;       /**< band level in millibels */
1204 } OMX_AUDIO_CONFIG_EQUALIZERTYPE;
1205 
1206 
1207 /** Stereo widening mode type
1208  * @ingroup effects
1209  */
1210 typedef enum OMX_AUDIO_STEREOWIDENINGTYPE {
1211     OMX_AUDIO_StereoWideningHeadphones,    /**< Stereo widening for loudspeakers */
1212     OMX_AUDIO_StereoWideningLoudspeakers,  /**< Stereo widening for closely spaced loudspeakers */
1213     OMX_AUDIO_StereoWideningKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
1214     OMX_AUDIO_StereoWideningVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
1215     OMX_AUDIO_StereoWideningMax = 0x7FFFFFFF
1216 } OMX_AUDIO_STEREOWIDENINGTYPE;
1217 
1218 
1219 /** Control for stereo widening, which is a special 2-channel
1220  *  case of the audio virtualizer effect. For example, for 5.1-channel
1221  *  output, it translates to virtual surround sound.
1222  * @ingroup effects
1223  */
1224 typedef struct OMX_AUDIO_CONFIG_STEREOWIDENINGTYPE {
1225     OMX_U32 nSize;             /**< size of the structure in bytes */
1226     OMX_VERSIONTYPE nVersion;  /**< OMX specification version information */
1227     OMX_U32 nPortIndex;        /**< port that this structure applies to */
1228     OMX_BOOL bEnable;          /**< Enable/disable for stereo widening control */
1229     OMX_AUDIO_STEREOWIDENINGTYPE eWideningType; /**< Stereo widening algorithm type */
1230     OMX_U32  nStereoWidening;  /**< stereo widening setting for the port,
1231                                     as a continuous value from 0 to 100  */
1232 } OMX_AUDIO_CONFIG_STEREOWIDENINGTYPE;
1233 
1234 
1235 /** The chorus effect (or ``choralizer'') is any signal processor which makes
1236  *  one sound source (such as a voice) sound like many such sources singing
1237  *  (or playing) in unison. Since performance in unison is never exact, chorus
1238  *  effects simulate this by making independently modified copies of the input
1239  *  signal. Modifications may include (1) delay, (2) frequency shift, and
1240  *  (3) amplitude modulation.
1241  * @ingroup effects
1242  */
1243 typedef struct OMX_AUDIO_CONFIG_CHORUSTYPE {
1244     OMX_U32 nSize;             /**< size of the structure in bytes */
1245     OMX_VERSIONTYPE nVersion;  /**< OMX specification version information */
1246     OMX_U32 nPortIndex;        /**< port that this structure applies to */
1247     OMX_BOOL bEnable;          /**< Enable/disable for chorus */
1248     OMX_BU32 sDelay;           /**< average delay in milliseconds */
1249     OMX_BU32 sModulationRate;  /**< rate of modulation in millihertz */
1250     OMX_U32 nModulationDepth;  /**< depth of modulation as a percentage of
1251                                     delay (i.e. 0 to 100) */
1252     OMX_BU32 nFeedback;        /**< Feedback from chorus output to input in percentage */
1253 } OMX_AUDIO_CONFIG_CHORUSTYPE;
1254 
1255 
1256 /** Reverberation is part of the reflected sound that follows the early
1257  *  reflections. In a typical room, this consists of a dense succession of
1258  *  echoes whose energy decays exponentially. The reverberation effect structure
1259  *  as defined here includes both (early) reflections as well as (late) reverberations.
1260  * @ingroup effects
1261  */
1262 typedef struct OMX_AUDIO_CONFIG_REVERBERATIONTYPE {
1263     OMX_U32 nSize;                /**< size of the structure in bytes */
1264     OMX_VERSIONTYPE nVersion;     /**< OMX specification version information */
1265     OMX_U32 nPortIndex;           /**< port that this structure applies to */
1266     OMX_BOOL bEnable;             /**< Enable/disable for reverberation control */
1267     OMX_BS32 sRoomLevel;          /**< Intensity level for the whole room effect
1268                                        (i.e. both early reflections and late
1269                                        reverberation) in millibels */
1270     OMX_BS32 sRoomHighFreqLevel;  /**< Attenuation at high frequencies
1271                                        relative to the intensity at low
1272                                        frequencies in millibels */
1273     OMX_BS32 sReflectionsLevel;   /**< Intensity level of early reflections
1274                                        (relative to room value), in millibels */
1275     OMX_BU32 sReflectionsDelay;   /**< Delay time of the first reflection relative
1276                                        to the direct path, in milliseconds */
1277     OMX_BS32 sReverbLevel;        /**< Intensity level of late reverberation
1278                                        relative to room level, in millibels */
1279     OMX_BU32 sReverbDelay;        /**< Time delay from the first early reflection
1280                                        to the beginning of the late reverberation
1281                                        section, in milliseconds */
1282     OMX_BU32 sDecayTime;          /**< Late reverberation decay time at low
1283                                        frequencies, in milliseconds */
1284     OMX_BU32 nDecayHighFreqRatio; /**< Ratio of high frequency decay time relative
1285                                        to low frequency decay time in percent  */
1286     OMX_U32 nDensity;             /**< Modal density in the late reverberation decay,
1287                                        in percent (i.e. 0 - 100) */
1288     OMX_U32 nDiffusion;           /**< Echo density in the late reverberation decay,
1289                                        in percent (i.e. 0 - 100) */
1290     OMX_BU32 sReferenceHighFreq;  /**< Reference high frequency in Hertz. This is
1291                                        the frequency used as the reference for all
1292                                        the high-frequency settings above */
1293 
1294 } OMX_AUDIO_CONFIG_REVERBERATIONTYPE;
1295 
1296 
1297 /** Possible settings for the Echo Cancelation structure to use
1298  * @ingroup effects
1299  */
1300 typedef enum OMX_AUDIO_ECHOCANTYPE {
1301    OMX_AUDIO_EchoCanOff = 0,    /**< Echo Cancellation is disabled */
1302    OMX_AUDIO_EchoCanNormal,     /**< Echo Cancellation normal operation -
1303                                      echo from plastics and face */
1304    OMX_AUDIO_EchoCanHFree,      /**< Echo Cancellation optimized for
1305                                      Hands Free operation */
1306    OMX_AUDIO_EchoCanCarKit,    /**< Echo Cancellation optimized for
1307                                      Car Kit (longer echo) */
1308    OMX_AUDIO_EchoCanKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
1309    OMX_AUDIO_EchoCanVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
1310    OMX_AUDIO_EchoCanMax = 0x7FFFFFFF
1311 } OMX_AUDIO_ECHOCANTYPE;
1312 
1313 
1314 /** Enable / Disable for echo cancelation, which removes undesired echo's
1315  *  from the audio
1316  * @ingroup effects
1317  */
1318 typedef struct OMX_AUDIO_CONFIG_ECHOCANCELATIONTYPE {
1319     OMX_U32 nSize;             /**< size of the structure in bytes */
1320     OMX_VERSIONTYPE nVersion;  /**< OMX specification version information */
1321     OMX_U32 nPortIndex;        /**< port that this structure applies to */
1322     OMX_AUDIO_ECHOCANTYPE eEchoCancelation; /**< Echo cancelation settings */
1323 } OMX_AUDIO_CONFIG_ECHOCANCELATIONTYPE;
1324 
1325 
1326 /** Enable / Disable for noise reduction, which undesired noise from
1327  * the audio
1328  * @ingroup effects
1329  */
1330 typedef struct OMX_AUDIO_CONFIG_NOISEREDUCTIONTYPE {
1331     OMX_U32 nSize;             /**< size of the structure in bytes */
1332     OMX_VERSIONTYPE nVersion;  /**< OMX specification version information */
1333     OMX_U32 nPortIndex;        /**< port that this structure applies to */
1334     OMX_BOOL bNoiseReduction;  /**< Enable/disable for noise reduction */
1335 } OMX_AUDIO_CONFIG_NOISEREDUCTIONTYPE;
1336 
1337 /** @} */
1338 
1339 #ifdef __cplusplus
1340 }
1341 #endif /* __cplusplus */
1342 
1343 #endif
1344 /* File EOF */
1345