1 /*--------------------------------------------------------------------------
2 Copyright (c) 2009, 2011, 2015 The Linux Foundation. All rights reserved.
3 
4 Redistribution and use in source and binary forms, with or without
5 modification, are permitted provided that the following conditions are met:
6     * Redistributions of source code must retain the above copyright
7       notice, this list of conditions and the following disclaimer.
8     * Redistributions in binary form must reproduce the above copyright
9       notice, this list of conditions and the following disclaimer in the
10       documentation and/or other materials provided with the distribution.
11     * Neither the name of The Linux Foundation nor
12       the names of its contributors may be used to endorse or promote
13       products derived from this software without specific prior written
14       permission.
15 
16 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19 NON-INFRINGEMENT ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR
20 CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
21 EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
22 PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
23 OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
24 WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
25 OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
26 ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 --------------------------------------------------------------------------*/
28 /*============================================================================
29                             O p e n M A X   w r a p p e r s
30                              O p e n  M A X   C o r e
31 
32 *//** @file QOMX_AudioExtensions.h
33   This module contains the extensions for Audio
34 
35 *//*========================================================================*/
36 
37 #ifndef __H_QOMX_AUDIOEXTENSIONS_H__
38 #define __H_QOMX_AUDIOEXTENSIONS_H__
39 
40 /*========================================================================
41 
42                      INCLUDE FILES FOR MODULE
43 
44 ========================================================================== */
45 #include <OMX_Audio.h>
46 
47 /*========================================================================
48 
49                       DEFINITIONS AND DECLARATIONS
50 
51 ========================================================================== */
52 
53 #if defined( __cplusplus )
54 extern "C"
55 {
56 #endif /* end of macro __cplusplus */
57 
58 /* Audio extension strings */
59 #define OMX_QCOM_INDEX_PARAM_AMRWBPLUS       "OMX.Qualcomm.index.audio.amrwbplus"
60 #define OMX_QCOM_INDEX_PARAM_WMA10PRO        "OMX.Qualcomm.index.audio.wma10pro"
61 #define OMX_QCOM_INDEX_PARAM_SESSIONID       "OMX.Qualcomm.index.audio.sessionId"
62 #define OMX_QCOM_INDEX_PARAM_VOICERECORDTYPE "OMX.Qualcomm.index.audio.VoiceRecord"
63 #define OMX_QCOM_INDEX_PARAM_AC3TYPE         "OMX.Qualcomm.index.audio.ac3"
64 #define OMX_QCOM_INDEX_PARAM_AC3PP           "OMX.Qualcomm.index.audio.postproc.ac3"
65 #define OMX_QCOM_INDEX_PARAM_DAK_BUNDLE      "OMX.Qualcomm.index.audio.dakbundle"
66 #define OMX_QCOM_INDEX_PARAM_DAK_M2S         "OMX.Qualcomm.index.audio.dak_m2s"
67 #define OMX_QCOM_INDEX_PARAM_DAK_SSE         "OMX.Qualcomm.index.audio.dak_sse"
68 #define OMX_QCOM_INDEX_PARAM_DAK_SLC         "OMX.Qualcomm.index.audio.dak_slc"
69 #define OMX_QCOM_INDEX_PARAM_DAK_VOL         "OMX.Qualcomm.index.audio.dak_vol"
70 #define OMX_QCOM_INDEX_PARAM_DAK_NB          "OMX.Qualcomm.index.audio.dak_nb"
71 #define OMX_QCOM_INDEX_PARAM_DAK_GEQ         "OMX.Qualcomm.index.audio.dak_geq"
72 #define OMX_QCOM_INDEX_PARAM_DAK_MSR         "OMX.Qualcomm.index.audio.dak_msr"
73 #define OMX_QCOM_INDEX_PARAM_DAK_HFE         "OMX.Qualcomm.index.audio.dak_hfe"
74 #define OMX_QCOM_INDEX_PARAM_DAK_FADE        "OMX.Qualcomm.index.audio.dak_fade"
75 #define OMX_QCOM_INDEX_PARAM_DAK_SEQ         "OMX.Qualcomm.index.audio.dak_seq"
76 #define OMX_QCOM_INDEX_CONFIG_DUALMONO       "OMX.Qualcomm.index.audio.dualmono"
77 #define OMX_QCOM_INDEX_CONFIG_AAC_SEL_MIX_COEF "OMX.Qualcomm.index.audio.aac_sel_mix_coef"
78 #define OMX_QCOM_INDEX_PARAM_ALAC            "OMX.Qualcomm.index.audio.alac"
79 #define OMX_QCOM_INDEX_PARAM_APE             "OMX.Qualcomm.index.audio.ape"
80 #define OMX_QCOM_INDEX_PARAM_FLAC_DEC        "OMX.Qualcomm.index.audio.flacdec"
81 
82 #define ALAC_CSD_SIZE 24
83 #define APE_CSD_SIZE 32
84 
85 typedef enum QOMX_AUDIO_AMRBANDMODETYPE {
86     QOMX_AUDIO_AMRBandModeWB9              = 0x7F000001,/**< AMRWB Mode 9 = SID*/
87     QOMX_AUDIO_AMRBandModeWB10             = 0x7F000002,/**< AMRWB Mode 10 = 13600 bps */
88     QOMX_AUDIO_AMRBandModeWB11             = 0x7F000003,/**< AMRWB Mode 11 = 18000 bps */
89     QOMX_AUDIO_AMRBandModeWB12             = 0x7F000004,/**< AMRWB Mode 12 = 24000 bps */
90     QOMX_AUDIO_AMRBandModeWB13             = 0x7F000005,/**< AMRWB Mode 13 = 24000 bps */
91     QOMX_AUDIO_AMRBandModeWB14             = 0x7F000006,/**< AMRWB Mode 14 = FRAME_ERASE*/
92     QOMX_AUDIO_AMRBandModeWB15             = 0x7F000007,/**< AMRWB Mode 15 = NO_DATA */
93 }QOMX_AUDIO_AMRBANDMODETYPE;
94 
95 typedef enum QOMX_AUDIO_CODINGTYPE {
96    QOMX_AUDIO_CodingVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
97    QOMX_AUDIO_CodingEVRCB  = 0x7F000001,
98    QOMX_AUDIO_CodingEVRCWB = 0x7F000002,
99    QOMX_AUDIO_CodingFLAC   = 0x7F000003,
100    QOMX_AUDIO_CodingMax = 0x7FFFFFFF
101 }QOMX_AUDIO_CODINGTYPE;
102 
103 
104 /**
105  * AMR WB PLUS type
106  *
107  *  STRUCT MEMBERS:
108  *  nSize           : Size of the structure in bytes
109  *  nVersion        : OMX specification version information
110  *  nPortIndex      : Port that this structure applies to
111  *  nChannels       : Number of channels
112  *  nBitRate        : Bit rate read only field
113  *  nSampleRate     : Sampling frequency for the clip(16/24/32/48KHz)
114  *  eAMRBandMode    : AMR Band Mode enumeration
115  *  eAMRDTXMode     : AMR DTX Mode enumeration
116  *  eAMRFrameFormat : AMR frame format enumeration
117  */
118 
119 typedef struct QOMX_AUDIO_PARAM_AMRWBPLUSTYPE {
120     OMX_U32 nSize;
121     OMX_VERSIONTYPE nVersion;
122     OMX_U32 nPortIndex;
123     OMX_U32 nChannels;
124     OMX_U32 nBitRate;
125     OMX_U32 nSampleRate;
126     OMX_AUDIO_AMRBANDMODETYPE   eAMRBandMode;
127     OMX_AUDIO_AMRDTXMODETYPE     eAMRDTXMode;
128     OMX_AUDIO_AMRFRAMEFORMATTYPE eAMRFrameFormat;
129 } QOMX_AUDIO_PARAM_AMRWBPLUSTYPE;
130 
131 typedef enum QOMX_AUDIO_WMAFORMATTYPE {
132     QOMX_AUDIO_WMAFormat10Pro = 0x7F000001, /**< Windows Media Audio format 10*/
133 } QOMX_AUDIO_WMAFORMATTYPE;
134 
135 /**
136  * WMA 10 PRO type
137  *
138  *  STRUCT MEMBERS:
139  *  nSize              : Size of the structure in bytes
140  *  nVersion           : OMX specification version information
141  *  nPortIndex         : Port that this structure applies to
142  *  nChannels          : Number of channels
143  *  nBitRate           : Bit rate read only field
144  *  eFormat            : Version of WMA stream / data
145  *  eProfile           : Profile of WMA stream / data
146  *  nSamplingRate      : Sampling rate of the source data
147  *  nBlockAlign        : block alignment, or block size, in bytes of the audio codec
148  *  nEncodeOptions     : WMA Type-specific data
149  *  nSuperBlockAlign   : WMA Type-specific data
150  *  validBitsPerSample : encoded stream (24-bit or 16-bit)
151  *  formatTag          : codec ID(0x162 or 0x166)
152  *  advancedEncodeOpt  : bit packed words indicating the features supported for LBR bitstream
153  *  advancedEncodeOpt2 : bit packed words indicating the features supported for LBR bitstream
154  */
155 typedef struct QOMX_AUDIO_PARAM_WMA10PROTYPE {
156     OMX_U32 nSize;
157     OMX_VERSIONTYPE nVersion;
158     OMX_U32 nPortIndex;
159     OMX_U16 nChannels;
160     OMX_U32 nBitRate;
161     QOMX_AUDIO_WMAFORMATTYPE eFormat;
162     OMX_AUDIO_WMAPROFILETYPE eProfile;
163     OMX_U32 nSamplingRate;
164     OMX_U16 nBlockAlign;
165     OMX_U16 nEncodeOptions;
166     OMX_U32 nSuperBlockAlign;
167     OMX_U32 validBitsPerSample;
168     OMX_U32 formatTag;
169     OMX_U32 advancedEncodeOpt;
170     OMX_U32 advancedEncodeOpt2;
171     OMX_U16 nVirtualPktSize;
172 } QOMX_AUDIO_PARAM_WMA10PROTYPE;
173 
174 
175 typedef enum OMX_AUDIO_AC3FORMATTYPE {
176    omx_audio_ac3       = 0x7f000001, /**< ac-3 */
177    omx_audio_eac3      = 0x7f000002  /**< eac-3 */
178 } OMX_AUDIO_AC3FORMATTYPE;
179 
180 typedef enum OMX_AUDIO_AC3_CHANNEL_CONFIG
181 {
182    OMX_AUDIO_AC3_CHANNEL_CONFIG_RSVD = 0,
183    OMX_AUDIO_AC3_CHANNEL_CONFIG_1_0,
184    OMX_AUDIO_AC3_CHANNEL_CONFIG_2_0,
185    OMX_AUDIO_AC3_CHANNEL_CONFIG_3_0,
186    OMX_AUDIO_AC3_CHANNEL_CONFIG_2_1,
187    OMX_AUDIO_AC3_CHANNEL_CONFIG_3_1,
188    OMX_AUDIO_AC3_CHANNEL_CONFIG_2_2,
189    OMX_AUDIO_AC3_CHANNEL_CONFIG_3_2,
190    OMX_AUDIO_AC3_CHANNEL_CONFIG_3_0_1,
191    OMX_AUDIO_AC3_CHANNEL_CONFIG_2_2_1,
192    OMX_AUDIO_AC3_CHANNEL_CONFIG_3_2_1,
193    OMX_AUDIO_AC3_CHANNEL_CONFIG_3_0_2,
194    OMX_AUDIO_AC3_CHANNEL_CONFIG_2_2_2,
195    OMX_AUDIO_AC3_CHANNEL_CONFIG_3_2_2,
196    OMX_AUDIO_AC3_CHANNEL_CONFIG_DEFAULT = 0xFFFF
197 } OMX_AUDIO_AC3_CHANNEL_CONFIG;
198 
199 /**
200  * AC-3 type
201  *
202  *  STRUCT MEMBERS:
203  *  nSize               : Size of the structure in bytes
204  *  nVersion            : OMX specification version information
205  *  nPortIndex          : Port that this structure applies to
206  *  nChannels           : Number of channels
207  *  nBitRate            : Bitrate
208  *  nSamplingRate       : Sampling rate, 32K, 44.1K, 48K only supported
209  *  eFormat             : AC-3 or EAC-3
210  *  eChannelConfig      : Channel configuration
211  *  nProgramID          : Indication of ProgramID, 0-7
212  *  bCompressionOn      : Flag to enable Compression
213  *  bLfeOn              : Flag for LFE on/off
214  *  bDelaySurroundChannels : Flag to put delay on surround channels
215  *
216  */
217 typedef struct QOMX_AUDIO_PARAM_AC3TYPE {
218    OMX_U32 nSize;
219    OMX_VERSIONTYPE nVersion;
220    OMX_U32 nPortIndex;
221    OMX_U16 nChannels;
222    OMX_U32 nBitRate;
223    OMX_U32 nSamplingRate;
224    OMX_AUDIO_AC3FORMATTYPE eFormat;
225    OMX_AUDIO_AC3_CHANNEL_CONFIG eChannelConfig;
226    OMX_U8 nProgramID;
227    OMX_BOOL bCompressionOn;
228    OMX_BOOL bLfeOn;
229    OMX_BOOL bDelaySurroundChannels;
230 } QOMX_AUDIO_PARAM_AC3TYPE;
231 
232 typedef enum OMX_AUDIO_AC3_CHANNEL_ROUTING
233 {
234    OMX_AUDIO_AC3_CHANNEL_LEFT,
235    OMX_AUDIO_AC3_CHANNEL_CENTER,
236    OMX_AUDIO_AC3_CHANNEL_RIGHT,
237    OMX_AUDIO_AC3_CHANNEL_LEFT_SURROUND,
238    OMX_AUDIO_AC3_CHANNEL_RIGHT_SURROUND,
239    OMX_AUDIO_AC3_CHANNEL_SURROUND,
240    OMX_AUDIO_AC3_CHANNEL_EXTENSION_1,
241    OMX_AUDIO_AC3_CHANNEL_EXTENSION_2,
242    OMX_AUDIO_AC3_CHANNEL_DEFAULT = 0xFFFF
243 } OMX_AUDIO_AC3_CHANNEL_ROUTING;
244 
245 typedef enum OMX_AUDIO_AC3_COMPRESSION_MODE
246 {
247    OMX_AUDIO_AC3_COMPRESSION_MODE_ANALOG_DIALNORM,
248    OMX_AUDIO_AC3_COMPRESSION_MODE_DIGITAL_DIALNORM,
249    OMX_AUDIO_AC3_COMPRESSION_MODE_LINE_OUT,
250    OMX_AUDIO_AC3_COMPRESSION_MODE_RF_REMOD
251 } OMX_AUDIO_AC3_COMPRESSION_MODE;
252 
253 typedef enum OMX_AUDIO_AC3_STEREO_MODE
254 {
255    OMX_AUDIO_AC3_STEREO_MODE_AUTO_DETECT,
256    OMX_AUDIO_AC3_STEREO_MODE_LT_RT,
257    OMX_AUDIO_AC3_STEREO_MODE_LO_RO,
258    OMX_AUDIO_AC3_STEREO_MODE_DEFAULT = 0xFFFF
259 } OMX_AUDIO_AC3_STEREO_MODE;
260 
261 typedef enum OMX_AUDIO_AC3_DUAL_MONO_MODE
262 {
263    OMX_AUDIO_AC3_DUAL_MONO_MODE_STEREO,
264    OMX_AUDIO_AC3_DUAL_MONO_MODE_LEFT_MONO,
265    OMX_AUDIO_AC3_DUAL_MONO_MODE_RIGHT_MONO,
266    OMX_AUDIO_AC3_DUAL_MONO_MODE_MIXED_MONO,
267    OMX_AUDIO_AC3_DUAL_MONO_MODE_DEFAULT = 0xFFFF
268 } OMX_AUDIO_AC3_DUAL_MONO_MODE;
269 
270 typedef enum OMX_AUDIO_AC3_KARAOKE_MODE
271 {
272    OMX_AUDIO_AC3_KARAOKE_MODE_NO_VOCAL,
273    OMX_AUDIO_AC3_KARAOKE_MODE_LEFT_VOCAL,
274    OMX_AUDIO_AC3_KARAOKE_MODE_RIGHT_VOCAL,
275    OMX_AUDIO_AC3_KARAOKE_MODE_BOTH_VOCAL,
276    OMX_AUDIO_AC3_KARAOKE_MODE_DEFAULT = 0xFFFF
277 } OMX_AUDIO_AC3_KARAOKE_MODE;
278 
279 
280 typedef struct QOMX_AUDIO_PARAM_AC3PP
281 {
282    OMX_U32 nSize;
283    OMX_VERSIONTYPE nVersion;
284    OMX_U32 nPortIndex;
285    OMX_AUDIO_AC3_CHANNEL_ROUTING eChannelRouting[8];
286    OMX_AUDIO_AC3_COMPRESSION_MODE eCompressionMode;
287    OMX_AUDIO_AC3_STEREO_MODE eStereoMode;
288    OMX_AUDIO_AC3_DUAL_MONO_MODE eDualMonoMode;
289    OMX_U32 usPcmScale;
290    OMX_U32 usDynamicScaleBoost;
291    OMX_U32 usDynamicScaleCut;
292    OMX_AUDIO_AC3_KARAOKE_MODE eKaraokeMode;
293 } QOMX_AUDIO_PARAM_AC3PP;
294 
295 
296 /**
297  * Stream info data
298  *
299  *  STRUCT MEMBERS:
300  *  sessionId :  session Id for alsa to route data
301  */
302 typedef struct QOMX_AUDIO_STREAM_INFO_DATA {
303     OMX_U8  sessionId;
304 } QOMX_AUDIO_STREAM_INFO_DATA;
305 
306 
307 /**
308  * Record Path
309  *
310  * STRUCT MEMBERS:
311  * recPath : Record Path for encoding
312  */
313 typedef enum{
314 
315 QOMX_AUDIO_VOICE_TX,
316 QOMX_AUDIO_VOICE_RX,
317 QOMX_AUDIO_VOICE_MIXED,
318 
319 } QOMX_AUDIO_VOICERECORDMODETYPE;
320 typedef struct QOMX_AUDIO_CONFIG_VOICERECORDTYPE {
321 
322 OMX_U32                            nSize;
323 OMX_VERSIONTYPE                    nVersion;
324 QOMX_AUDIO_VOICERECORDMODETYPE     eVoiceRecordMode;
325 }  QOMX_AUDIO_CONFIG_VOICERECORDTYPE;
326 
327 /* Enum for mapping dual-mono contents to left and right channels */
328 typedef enum OMX_AUDIO_DUAL_MONO_CHANNEL_CONFIG {
329  OMX_AUDIO_DUAL_MONO_MODE_FL_FR,/* 1st SCE to left & right */
330  OMX_AUDIO_DUAL_MONO_MODE_SL_SR,/* 2nd SCE to left & right */
331  OMX_AUDIO_DUAL_MONO_MODE_SL_FR,/* 2nd SCE to left, 1st SCE to right */
332  OMX_AUDIO_DUAL_MONO_MODE_FL_SR,/* 1st SCE to left, 2nd SCE to right default */
333  OMX_AUDIO_DUAL_MONO_MODE_DEFAULT = OMX_AUDIO_DUAL_MONO_MODE_FL_SR,
334  OMX_AUDIO_DUAL_MONO_MODE_INVALID = -1
335 } OMX_AUDIO_DUAL_MONO_CHANNEL_CONFIG;
336 
337 /************************************/
338 /* DAK */
339 /*************************************/
340 
341 /** this is the list of custom vendor index */
342 typedef enum OMX_INDEX_DAK_TYPE {
343     OMX_IndexConfigDAK_BUNDLE = OMX_IndexVendorStartUnused /*0x7F000000*/,    /**< reference: OMX_DAK_CONFIG_BUNDLETYPE */
344     OMX_IndexConfigDAK_M2S,    /**< reference: OMX_DAK_CONFIG_M2STYPE */
345     OMX_IndexConfigDAK_SSE,    /**< reference: OMX_DAK_CONFIG_SSETYPE */
346     OMX_IndexConfigDAK_SLC,    /**< reference: OMX_DAK_CONFIG_SLCTYPE */
347     OMX_IndexConfigDAK_VOL,    /**< reference: OMX_DAK_CONFIG_VOLTYPE */
348     OMX_IndexConfigDAK_NB,     /**< reference: OMX_DAK_CONFIG_NBTYPE */
349     OMX_IndexConfigDAK_GEQ,    /**< reference: OMX_DAK_CONFIG_GEQTYPE */
350     OMX_IndexConfigDAK_MSR,    /**< reference: OMX_DAK_CONFIG_MSRTYPE */
351     OMX_IndexConfigDAK_HFE,    /**< reference: OMX_DAK_CONFIG_HFETYPE */
352     OMX_IndexConfigDAK_FADE,   /**< reference: OMX_DAK_CONFIG_FADETYPE */
353     OMX_IndexConfigDAK_SEQ,    /**< reference: OMX_DAK_CONFIG_SEQTYPE */
354 
355 } OMX_INDEX_DAK_TYPE;
356 
357 
358 /** Dolby Audio Kernel TDAS bundle */
359 typedef struct OMX_DAK_CONFIG_BUNDLETYPE {
360     OMX_U32 nSize;                 /**< size of the structure in bytes */
361     OMX_VERSIONTYPE nVersion;      /**< OMX specification version information */
362     OMX_U32 nDAK_Version;          /**< Dolby Audio Kernel version information */
363     OMX_U32 nDAK_Revision;         /**< Dolby Audio Kernel revision information */
364     OMX_U8 nLfeMixLevel;           /**< level at which the LFE channel is mixed into the output audio */
365     OMX_U8 nSampleRateIndex;       /**< Output sample rate */
366     OMX_U8 nInChans;               /**< Channel format of input audio */
367     OMX_U8 nInMatrix;              /**< L/R mixing specification for stereo audio input */
368     OMX_U8 nBypass;                /**< Audio Processing bypass */
369     OMX_U8 nRateMultipier;         /**< Sample-rate multiplier (output with respect to input) */
370     OMX_U8 nInChanFormat;          /**< Input/Output channel format */
371     OMX_U8 nMsrMaxProfile;         /**< Maximum number of virtual rendering channels in Mobile Surround */
372     OMX_BOOL bPortablemodeEnable;  /**< Enable or disable Pulse Portable Mode */
373     OMX_S16 nPotablemodeGain;      /**< Send the Portable Mode gain value from the Pulse decoder */
374     OMX_U8 nORL;                   /**< Device specific target signal level (output reference level) */
375     OMX_BOOL bPulsedownmixEnable;  /**< Enable the Pulse Downmix compensation */
376     OMX_S8 nPulsedownmixAtten;     /**< Attenuation value that Pulse is currently applying */
377     OMX_U8 nOutChans;              /**< Channel format of output audio */
378 
379 } OMX_DAK_CONFIG_BUNDLETYPE;
380 
381 /** Dolby Audio Kernel Mono-to-Stereo Creator */
382 typedef struct OMX_DAK_CONFIG_M2STYPE {
383     OMX_U32 nSize;             /**< size of the structure in bytes */
384     OMX_VERSIONTYPE nVersion;  /**< OMX specification version information */
385     OMX_BOOL bEnable;          /**< Mono-to-Stereo Creator enable */
386     OMX_BOOL bDetector;        /**< Stereo detector status */
387 } OMX_DAK_CONFIG_M2STYPE;
388 
389 /** Dolby Audio Kernel Sound Space Expander */
390 typedef struct OMX_DAK_CONFIG_SSETYPE {
391     OMX_U32 nSize;             /**< size of the structure in bytes */
392     OMX_VERSIONTYPE nVersion;  /**< OMX specification version information */
393     OMX_BOOL bEnable;          /**< Sound Space Expander enable */
394     OMX_U8 nWidth;             /**< Width of expansion effect */
395     OMX_U8 nSpkMode;           /**< Speaker Mode */
396 } OMX_DAK_CONFIG_SSETYPE;
397 
398 /** Dolby Audio Kernel Sound Level Controller */
399 typedef struct OMX_DAK_CONFIG_SLCTYPE {
400     OMX_U32 nSize;             /**< size of the structure in bytes */
401     OMX_VERSIONTYPE nVersion;  /**< OMX specification version information */
402     OMX_BOOL bEnable;          /**< Sound Level Controller enable */
403     OMX_U8 nLevel;             /**< Source audio RMS level */
404     OMX_U8 nDepth;             /**< Depth of effect */
405 } OMX_DAK_CONFIG_SLCTYPE;
406 
407 /** Dolby Audio Kernel Volume */
408 typedef struct OMX_DAK_CONFIG_VOLTYPE {
409     OMX_U32 nSize;             /**< size of the structure in bytes */
410     OMX_VERSIONTYPE nVersion;  /**< OMX specification version information */
411     OMX_BOOL bEnable;          /**< Volume enable */
412     OMX_U8 nGainType;          /**< Linear/Logarithmic audio scaling */
413     OMX_U8 nInternalGain;      /**< Audio volume scale */
414     OMX_U8 nExternalGain;      /**< Audio volume scale applied by external volume control */
415     OMX_S8 nBalance;           /**< L/R panning for output audio */
416     OMX_BOOL bMute;            /**< Audio Mute */
417 } OMX_DAK_CONFIG_VOLTYPE;
418 
419 /** Dolby Audio Kernel Natural Bass */
420 typedef struct OMX_DAK_CONFIG_NBTYPE {
421     OMX_U32 nSize;             /**< size of the structure in bytes */
422     OMX_VERSIONTYPE nVersion;  /**< OMX specification version information */
423     OMX_BOOL bEnable;          /**< Natural Bass enable */
424     OMX_U8 nCutoff;            /**< Speakers/headphones lower cutoff frequency */
425     OMX_U8 nBoost;             /**< Strength of effect */
426     OMX_U8 nLevel;             /**< Maximum output level capability of speakers/headphones */
427 } OMX_DAK_CONFIG_NBTYPE;
428 
429 /** Dolby Audio Kernel Graphic EQ */
430 typedef struct OMX_DAK_CONFIG_GEQTYPE {
431     OMX_U32 nSize;             /**< size of the structure in bytes */
432     OMX_VERSIONTYPE nVersion;  /**< OMX specification version information */
433     OMX_BOOL bEnable;          /**< Graphic EQ enable */
434     OMX_U8 nNbands;            /**< Number of frequency bands */
435     OMX_S8 nPreamp;            /**< Global attenuation to apply prior to band level adjustment */
436     OMX_U8 nMaxboost;          /**< Maximum absolute boost with respect to the source audio */
437     OMX_S8 nBand1;             /**< Boost/cut for 1st frequency band */
438     OMX_S8 nBand2;             /**< Boost/cut for 2nd frequency band */
439     OMX_S8 nBand3;             /**< Boost/cut for 3rd frequency band */
440     OMX_S8 nBand4;             /**< Boost/cut for 4th frequency band */
441     OMX_S8 nBand5;             /**< Boost/cut for 5th frequency band */
442     OMX_S8 nBand6;             /**< Boost/cut for 6th frequency band */
443     OMX_S8 nBand7;             /**< Boost/cut for 7th frequency band */
444 } OMX_DAK_CONFIG_GEQTYPE;
445 
446 /** Dolby Audio Kernel, Mobile Surround and Surround Upmixer */
447 typedef struct OMX_DAK_CONFIG_MSRTYPE {
448     OMX_U32 nSize;             /**< size of the structure in bytes */
449     OMX_VERSIONTYPE nVersion;  /**< OMX specification version information */
450     OMX_BOOL bMsrEnable;       /**< Mobile Surround enable */
451     OMX_U8 nMsrRoom;           /**< Room Size control */
452     OMX_U8 nMsrBright;         /**< Brightness control */
453     OMX_BOOL bMupEnable;       /**< Mobile Surround Upmixer enable */
454 } OMX_DAK_CONFIG_MSRTYPE;
455 
456 /** Dolby Audio Kernel High Frequency Enhancer */
457 typedef struct OMX_DAK_CONFIG_HFETYPE {
458     OMX_U32 nSize;             /**< size of the structure in bytes */
459     OMX_VERSIONTYPE nVersion;  /**< OMX specification version information */
460     OMX_BOOL bEnable;          /**< High Frequency Enhancer enable */
461     OMX_U8 nDepth;             /**< Strength of effect */
462 } OMX_DAK_CONFIG_HFETYPE;
463 
464 /** Dolby Audio Kernel Fade */
465 typedef struct OMX_DAK_CONFIG_FADETYPE {
466     OMX_U32 nSize;             /**< size of the structure in bytes */
467     OMX_VERSIONTYPE nVersion;  /**< OMX specification version information */
468     OMX_BOOL bEnable;          /**< Fade enable */
469     OMX_U8 nTarget;            /**< Target fade level */
470     OMX_U16 nTime;             /**< Fade time interval */
471 } OMX_DAK_CONFIG_FADETYPE;
472 
473 /** Dolby Audio Kernel Speaker EQ */
474 typedef struct OMX_DAK_CONFIG_SEQTYPE {
475     OMX_U32 nSize;             /**< size of the structure in bytes */
476     OMX_VERSIONTYPE nVersion;  /**< OMX specification version information */
477     OMX_BOOL bEnable;          /**< Speaker EQ enable */
478     OMX_S8 nLeftGainDB;        /**< Additional gain for Left channel */
479     OMX_S8 nRightGainDB;       /**< Additional gain for Right channel */
480     OMX_U8 nCoef48000Size;     /**< Length of the block of coefficients for 48KHz Sampling Rate case */
481     OMX_PTR pCoef48000;        /**< Pointer to the block of coefficients for the 48KHz case */
482     OMX_U8 nCoef44100Size;     /**< Length of the block of coefficients for 44.1KHz Sampling Rate case */
483     OMX_PTR pCoef44100;        /**< Pointer to the block of coefficients for the 44.1KHz case */
484     OMX_U8 nCoef32000Size;     /**< Length of the block of coefficients for 32KHz Sampling Rate case */
485     OMX_PTR pCoef32000;        /**< Pointer to the block of coefficients for the 32KHz case */
486     OMX_U8 nCoef24000Size;     /**< Length of the block of coefficients for 24KHz Sampling Rate case */
487     OMX_PTR pCoef24000;        /**< Pointer to the block of coefficients for the 24KHz case */
488 
489 } OMX_DAK_CONFIG_SEQTYPE;
490 
491 
492 typedef enum OMX_AUDIO_CHANNELTYPE_EXTENSION {
493     OMX_AUDIO_ChannelTS = OMX_AUDIO_ChannelVendorStartUnused,  /**< Top Surround */
494     OMX_AUDIO_ChannelCVH       /**< Central Vertical Height */
495 } OMX_AUDIO_CHANNELTYPE_EXTENSION;
496 
497 /**
498  * DUAL-MONO type
499  *
500  *  STRUCT MEMBERS:
501  *  nSize               : Size of the structure in bytes
502  *  nVersion            : OMX specification version information
503  *  nPortIndex          : Port that this structure applies to
504  *  eChannelConfig      : Enum for channel config
505  *
506  */
507 typedef struct QOMX_AUDIO_CONFIG_DUALMONOTYPE {
508    OMX_U32 nSize;
509    OMX_VERSIONTYPE nVersion;
510    OMX_U32 nPortIndex;
511    OMX_AUDIO_DUAL_MONO_CHANNEL_CONFIG eChannelConfig;
512 } QOMX_AUDIO_CONFIG_DUALMONOTYPE;
513 
514 typedef struct QOMX_AUDIO_PARAM_ALACTYPE {
515     OMX_U32 nSize; /* Size of the structure in bytes */
516     OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
517     OMX_U32 nPortIndex; /* Port that this structure applies to */
518     OMX_BOOL bBytesStreamMode; /*enable byte stream mode*/
519     OMX_U32 nFrameLength; /* Frames per packet when no explicit frames per packet setting is present in the packet header */
520     OMX_U8 nCompatibleVersion; /* Indicates the compatible version */
521     OMX_U8 nBitDepth; /* Bit depth of the source PCM data */
522     OMX_U8 nPb; /* Tuning Parameter; currently not used */
523     OMX_U8 nMb; /* Tuning Parameter; currently not used */
524     OMX_U8 nKb; /* Tuning Parameter; currently not used */
525     OMX_U8 nChannels; /* Number of channels for multichannel decoding */
526     OMX_U16 nMaxRun; /* Currently not used */
527     OMX_U32 nMaxFrameBytes; /* Max size of an Apple Lossless packet within the encoded stream */
528     OMX_U32 nAvgBitRate; /* Average bit rate in bits per second of the Apple Lossless stream */
529     OMX_U32 nSampleRate; /* Number of samples per second in Hertz */
530     OMX_U32 nChannelLayoutTag; /*Indicates whether channel layout information is present in the bitstream */
531 } QOMX_AUDIO_PARAM_ALACTYPE;
532 
533 typedef struct QOMX_AUDIO_PARAM_APETYPE {
534     OMX_U32 nSize; /* Size of the structure in bytes */
535     OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
536     OMX_U32 nPortIndex; /* Port that this structure applies to */
537     OMX_BOOL bBytesStreamMode; /*enable byte stream mode*/
538     OMX_U16 nCompatibleVersion; /* Indicates the compatible version */
539     OMX_U16 nCompressionLevel; /* The compression level present in the encoded packet */
540     OMX_U32 nFormatFlags; /* Reserved parameter for future use */
541     OMX_U32 nBlocksPerFrame; /* Indicates the number of audio blocks in one frame present in the encoded packet header */
542     OMX_U32 nFinalFrameBlocks; /* Indicates the number of audio blocks in the final frame present in the encoded packet header */
543     OMX_U32 nTotalFrames; /* Indicates the total number of frames */
544     OMX_U16 nBitsPerSample; /* Bit depth of the source PCM data */
545     OMX_U16 nChannels; /* Number of channels for decoding */
546     OMX_U32 nSampleRate; /* Samples per second in Hertz */
547     OMX_U32 nSeekTablePresent; /* Flag to indicate if seek table is present or not */
548 } QOMX_AUDIO_PARAM_APETYPE;
549 
550 typedef struct QOMX_AUDIO_PARAM_FLAC_DEC_TYPE {
551     OMX_U32 nSize;
552     OMX_VERSIONTYPE nVersion;
553     OMX_U32 nPortIndex;
554     OMX_U32 nChannels;
555     OMX_U32 nSampleRate;
556     OMX_U32 nBitsPerSample;
557     OMX_U32 nMinBlkSize;
558     OMX_U32 nMaxBlkSize;
559     OMX_U32 nMinFrmSize;
560     OMX_U32 nMaxFrmSize;
561 } QOMX_AUDIO_PARAM_FLAC_DEC_TYPE;
562 
563 enum {
564     kKeyIndexAlacFrameLength = 0,
565     kKeyIndexAlacCompatibleVersion = 4,
566     kKeyIndexAlacBitDepth = 5,
567     kKeyIndexAlacPb = 6,
568     kKeyIndexAlacMb = 7,
569     kKeyIndexAlacKb = 8,
570     kKeyIndexAlacNumChannels = 9,
571     kKeyIndexAlacMaxRun = 10,
572     kKeyIndexAlacMaxFrameBytes = 12,
573     kKeyIndexAlacAvgBitRate = 16,
574     kKeyIndexAlacSamplingRate = 20,
575     kKeyIndexAlacChannelLayoutTag = 24,
576     kKeyIndexAlacMax = kKeyIndexAlacChannelLayoutTag,
577 };
578 
579 enum {
580     kKeyIndexApeCompatibleVersion = 0,
581     kKeyIndexApeCompressionLevel = 2,
582     kKeyIndexApeFormatFlags = 4,
583     kKeyIndexApeBlocksPerFrame = 8,
584     kKeyIndexApeFinalFrameBlocks = 12,
585     kKeyIndexApeTotalFrames = 16,
586     kKeyIndexApeBitsPerSample = 20,
587     kKeyIndexApeNumChannels = 22,
588     kKeyIndexApeSampleRate = 24,
589     kKeyIndexApeSeekTablePresent = 28,
590     kKeyIndexApeMax = kKeyIndexApeSeekTablePresent,
591 };
592 
593 enum {
594     APE_COMPRESSION_LEVEL_FAST = 1000,
595     APE_COMPRESSION_LEVEL_NORMAL = 2000,
596     APE_COMPRESSION_LEVEL_HIGH = 3000,
597     APE_COMPRESSION_LEVEL_EXTRA_HIGH = 4000,
598     APE_COMPRESSION_LEVEL_INSANE = 5000,
599 };
600 
601 #if defined( __cplusplus )
602 }
603 #endif /* end of macro __cplusplus */
604 
605 #endif /* end of macro __H_QOMX_AUDIOEXTENSIONS_H__ */
606