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