1/*--------------------------------------------------------------------------
2Copyright (c) 2009, Code Aurora Forum. 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 Code Aurora 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
64typedef enum QOMX_AUDIO_AMRBANDMODETYPE {
65    QOMX_AUDIO_AMRBandModeWB9              = 0x7F000001,/**< AMRWB Mode 9 = SID*/
66    QOMX_AUDIO_AMRBandModeWB10             = 0x7F000002,/**< AMRWB Mode 10 = 13600 bps */
67    QOMX_AUDIO_AMRBandModeWB11             = 0x7F000003,/**< AMRWB Mode 11 = 18000 bps */
68    QOMX_AUDIO_AMRBandModeWB12             = 0x7F000004,/**< AMRWB Mode 12 = 24000 bps */
69    QOMX_AUDIO_AMRBandModeWB13             = 0x7F000005,/**< AMRWB Mode 13 = 24000 bps */
70    QOMX_AUDIO_AMRBandModeWB14             = 0x7F000006,/**< AMRWB Mode 14 = FRAME_ERASE*/
71    QOMX_AUDIO_AMRBandModeWB15             = 0x7F000007,/**< AMRWB Mode 15 = NO_DATA */
72}QOMX_AUDIO_AMRBANDMODETYPE;
73
74/**
75 * AMR WB PLUS type
76 *
77 *  STRUCT MEMBERS:
78 *  nSize           : Size of the structure in bytes
79 *  nVersion        : OMX specification version information
80 *  nPortIndex      : Port that this structure applies to
81 *  nChannels       : Number of channels
82 *  nBitRate        : Bit rate read only field
83 *  nSampleRate     : Sampling frequency for the clip(16/24/32/48KHz)
84 *  eAMRBandMode    : AMR Band Mode enumeration
85 *  eAMRDTXMode     : AMR DTX Mode enumeration
86 *  eAMRFrameFormat : AMR frame format enumeration
87 */
88
89typedef struct QOMX_AUDIO_PARAM_AMRWBPLUSTYPE {
90    OMX_U32 nSize;
91    OMX_VERSIONTYPE nVersion;
92    OMX_U32 nPortIndex;
93    OMX_U32 nChannels;
94    OMX_U32 nBitRate;
95    OMX_U32 nSampleRate;
96    QOMX_AUDIO_AMRBANDMODETYPE   eAMRBandMode;
97    OMX_AUDIO_AMRDTXMODETYPE     eAMRDTXMode;
98    OMX_AUDIO_AMRFRAMEFORMATTYPE eAMRFrameFormat;
99} QOMX_AUDIO_PARAM_AMRWBPLUSTYPE;
100
101typedef enum QOMX_AUDIO_WMAFORMATTYPE {
102    QOMX_AUDIO_WMAFormat10Pro = 0x7F000001, /**< Windows Media Audio format 10*/
103} QOMX_AUDIO_WMAFORMATTYPE;
104
105/**
106 * WMA 10 PRO 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 *  eFormat            : Version of WMA stream / data
115 *  eProfile           : Profile of WMA stream / data
116 *  nSamplingRate      : Sampling rate of the source data
117 *  nBlockAlign        : block alignment, or block size, in bytes of the audio codec
118 *  nEncodeOptions     : WMA Type-specific data
119 *  nSuperBlockAlign   : WMA Type-specific data
120 *  validBitsPerSample : encoded stream (24-bit or 16-bit)
121 *  formatTag          : codec ID(0x162 or 0x166)
122 *  advancedEncodeOpt  : bit packed words indicating the features supported for LBR bitstream
123 *  advancedEncodeOpt2 : bit packed words indicating the features supported for LBR bitstream
124 */
125typedef struct QOMX_AUDIO_PARAM_WMA10PROTYPE {
126    OMX_U32 nSize;
127    OMX_VERSIONTYPE nVersion;
128    OMX_U32 nPortIndex;
129    OMX_U16 nChannels;
130    OMX_U32 nBitRate;
131    QOMX_AUDIO_WMAFORMATTYPE eFormat;
132    OMX_AUDIO_WMAPROFILETYPE eProfile;
133    OMX_U32 nSamplingRate;
134    OMX_U16 nBlockAlign;
135    OMX_U16 nEncodeOptions;
136    OMX_U32 nSuperBlockAlign;
137    OMX_U32 validBitsPerSample;
138    OMX_U32 formatTag;
139    OMX_U32 advancedEncodeOpt;
140    OMX_U32 advancedEncodeOpt2;
141} QOMX_AUDIO_PARAM_WMA10PROTYPE;
142
143/**
144 * Stream info data
145 *
146 *  STRUCT MEMBERS:
147 *  sessionId :  session Id for alsa to route data
148 */
149typedef struct QOMX_AUDIO_STREAM_INFO_DATA {
150    OMX_U8  sessionId;
151} QOMX_AUDIO_STREAM_INFO_DATA;
152
153
154/**
155 * Record Path
156 *
157 * STRUCT MEMBERS:
158 * recPath : Record Path for encoding
159 */
160typedef enum{
161
162QOMX_AUDIO_VOICE_TX,
163QOMX_AUDIO_VOICE_RX,
164QOMX_AUDIO_VOICE_MIXED,
165
166} QOMX_AUDIO_VOICERECORDMODETYPE;
167typedef struct QOMX_AUDIO_CONFIG_VOICERECORDTYPE {
168
169OMX_U32                            nSize;
170OMX_VERSIONTYPE                    nVersion;
171QOMX_AUDIO_VOICERECORDMODETYPE     eVoiceRecordMode;
172}  QOMX_AUDIO_CONFIG_VOICERECORDTYPE;
173
174
175
176
177#if defined( __cplusplus )
178}
179#endif /* end of macro __cplusplus */
180
181#endif /* end of macro __H_QOMX_AUDIOEXTENSIONS_H__ */
182