• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2019 The Android Open Source Project
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 express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17  // This file has been semi-automatically generated using hidl2aidl from its counterpart in
18  // hardware/interfaces/audio/common/5.0/types.hal
19 
20 package android.media.audio.common;
21 
22 /**
23  * Audio format  is a 32-bit word that consists of:
24  *   main format field (upper 8 bits)
25  *   sub format field (lower 24 bits).
26  *
27  * The main format indicates the main codec type. The sub format field indicates
28  * options and parameters for each format. The sub format is mainly used for
29  * record to indicate for instance the requested bitrate or profile.  It can
30  * also be used for certain formats to give informations not present in the
31  * encoded audio stream (e.g. octet alignement for AMR).
32  *
33  * {@hide}
34  */
35 @Backing(type="int")
36 enum AudioFormat {
37    INVALID = 0xFFFFFFFF,
38    DEFAULT = 0,
39    PCM = 0x00000000,
40    MP3 = 0x01000000,
41    AMR_NB = 0x02000000,
42    AMR_WB = 0x03000000,
43    AAC = 0x04000000,
44    /**
45     * Deprecated, Use AAC_HE_V1
46     */
47    HE_AAC_V1 = 0x05000000,
48    /**
49     * Deprecated, Use AAC_HE_V2
50     */
51    HE_AAC_V2 = 0x06000000,
52    VORBIS = 0x07000000,
53    OPUS = 0x08000000,
54    AC3 = 0x09000000,
55    E_AC3 = 0x0A000000,
56    DTS = 0x0B000000,
57    DTS_HD = 0x0C000000,
58    /**
59     * IEC61937 is encoded audio wrapped in 16-bit PCM.
60     */
61    IEC61937 = 0x0D000000,
62    DOLBY_TRUEHD = 0x0E000000,
63    EVRC = 0x10000000,
64    EVRCB = 0x11000000,
65    EVRCWB = 0x12000000,
66    EVRCNW = 0x13000000,
67    AAC_ADIF = 0x14000000,
68    WMA = 0x15000000,
69    WMA_PRO = 0x16000000,
70    AMR_WB_PLUS = 0x17000000,
71    MP2 = 0x18000000,
72    QCELP = 0x19000000,
73    DSD = 0x1A000000,
74    FLAC = 0x1B000000,
75    ALAC = 0x1C000000,
76    APE = 0x1D000000,
77    AAC_ADTS = 0x1E000000,
78    SBC = 0x1F000000,
79    APTX = 0x20000000,
80    APTX_HD = 0x21000000,
81    AC4 = 0x22000000,
82    LDAC = 0x23000000,
83    /**
84     * Dolby Metadata-enhanced Audio Transmission
85     */
86    MAT = 0x24000000,
87    AAC_LATM = 0x25000000,
88    CELT = 0x26000000,
89    APTX_ADAPTIVE = 0x27000000,
90    LHDC = 0x28000000,
91    LHDC_LL = 0x29000000,
92    APTX_TWSP = 0x2A000000,
93    /**
94     * Deprecated
95     */
96    MAIN_MASK = 0xFF000000,
97    SUB_MASK = 0x00FFFFFF,
98    /**
99     * Subformats
100     */
101    PCM_SUB_16_BIT = 0x1,
102    PCM_SUB_8_BIT = 0x2,
103    PCM_SUB_32_BIT = 0x3,
104    PCM_SUB_8_24_BIT = 0x4,
105    PCM_SUB_FLOAT = 0x5,
106    PCM_SUB_24_BIT_PACKED = 0x6,
107    MP3_SUB_NONE = 0x0,
108    AMR_SUB_NONE = 0x0,
109    AAC_SUB_MAIN = 0x1,
110    AAC_SUB_LC = 0x2,
111    AAC_SUB_SSR = 0x4,
112    AAC_SUB_LTP = 0x8,
113    AAC_SUB_HE_V1 = 0x10,
114    AAC_SUB_SCALABLE = 0x20,
115    AAC_SUB_ERLC = 0x40,
116    AAC_SUB_LD = 0x80,
117    AAC_SUB_HE_V2 = 0x100,
118    AAC_SUB_ELD = 0x200,
119    AAC_SUB_XHE = 0x300,
120    VORBIS_SUB_NONE = 0x0,
121    E_AC3_SUB_JOC = 0x1,
122    MAT_SUB_1_0 = 0x1,
123    MAT_SUB_2_0 = 0x2,
124    MAT_SUB_2_1 = 0x3,
125 // TODO(ytai): Aliases not currently supported in AIDL - can inline the values.
126 //   /**
127 //    * Aliases
128 //    *
129 //    *
130 //    * note != AudioFormat.ENCODING_PCM_16BIT
131 //    */
132 //   PCM_16_BIT = (PCM | PCM_SUB_16_BIT),
133 //   /**
134 //    * note != AudioFormat.ENCODING_PCM_8BIT
135 //    */
136 //   PCM_8_BIT = (PCM | PCM_SUB_8_BIT),
137 //   PCM_32_BIT = (PCM | PCM_SUB_32_BIT),
138 //   PCM_8_24_BIT = (PCM | PCM_SUB_8_24_BIT),
139 //   PCM_FLOAT = (PCM | PCM_SUB_FLOAT),
140 //   PCM_24_BIT_PACKED = (PCM | PCM_SUB_24_BIT_PACKED),
141 //   AAC_MAIN = (AAC | AAC_SUB_MAIN),
142 //   AAC_LC = (AAC | AAC_SUB_LC),
143 //   AAC_SSR = (AAC | AAC_SUB_SSR),
144 //   AAC_LTP = (AAC | AAC_SUB_LTP),
145 //   AAC_HE_V1 = (AAC | AAC_SUB_HE_V1),
146 //   AAC_SCALABLE = (AAC | AAC_SUB_SCALABLE),
147 //   AAC_ERLC = (AAC | AAC_SUB_ERLC),
148 //   AAC_LD = (AAC | AAC_SUB_LD),
149 //   AAC_HE_V2 = (AAC | AAC_SUB_HE_V2),
150 //   AAC_ELD = (AAC | AAC_SUB_ELD),
151 //   AAC_XHE = (AAC | AAC_SUB_XHE),
152 //   AAC_ADTS_MAIN = (AAC_ADTS | AAC_SUB_MAIN),
153 //   AAC_ADTS_LC = (AAC_ADTS | AAC_SUB_LC),
154 //   AAC_ADTS_SSR = (AAC_ADTS | AAC_SUB_SSR),
155 //   AAC_ADTS_LTP = (AAC_ADTS | AAC_SUB_LTP),
156 //   AAC_ADTS_HE_V1 = (AAC_ADTS | AAC_SUB_HE_V1),
157 //   AAC_ADTS_SCALABLE = (AAC_ADTS | AAC_SUB_SCALABLE),
158 //   AAC_ADTS_ERLC = (AAC_ADTS | AAC_SUB_ERLC),
159 //   AAC_ADTS_LD = (AAC_ADTS | AAC_SUB_LD),
160 //   AAC_ADTS_HE_V2 = (AAC_ADTS | AAC_SUB_HE_V2),
161 //   AAC_ADTS_ELD = (AAC_ADTS | AAC_SUB_ELD),
162 //   AAC_ADTS_XHE = (AAC_ADTS | AAC_SUB_XHE),
163 //   E_AC3_JOC = (E_AC3 | E_AC3_SUB_JOC),
164 //   MAT_1_0 = (MAT | MAT_SUB_1_0),
165 //   MAT_2_0 = (MAT | MAT_SUB_2_0),
166 //   MAT_2_1 = (MAT | MAT_SUB_2_1),
167 //   AAC_LATM_LC = (AAC_LATM | AAC_SUB_LC),
168 //   AAC_LATM_HE_V1 = (AAC_LATM | AAC_SUB_HE_V1),
169 //   AAC_LATM_HE_V2 = (AAC_LATM | AAC_SUB_HE_V2),
170 }
171