• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2012, Collabora Ltd.
3  *   Author: Sebastian Dröge <sebastian.droege@collabora.co.uk>
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation
8  * version 2.1 of the License.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301 USA
18  *
19  */
20 
21 #ifndef __GST_AMC_CONSTANTS_H__
22 #define __GST_AMC_CONSTANTS_H__
23 
24 /* FIXME: We might need to get these values from Java if there's
25  * ever a device or Android version that changes these values
26  */
27 
28 /* Copies from MediaCodec.java */
29 
30 enum
31 {
32   BUFFER_FLAG_SYNC_FRAME = 1,
33   BUFFER_FLAG_CODEC_CONFIG = 2,
34   BUFFER_FLAG_END_OF_STREAM = 4
35 };
36 
37 enum
38 {
39   CONFIGURE_FLAG_ENCODE = 1
40 };
41 
42 enum
43 {
44   INFO_TRY_AGAIN_LATER = -1,
45   INFO_OUTPUT_FORMAT_CHANGED = -2,
46   INFO_OUTPUT_BUFFERS_CHANGED = -3
47 };
48 
49 /* Copies from MediaCodecInfo.java */
50 enum
51 {
52   COLOR_FormatMonochrome = 1,
53   COLOR_Format8bitRGB332 = 2,
54   COLOR_Format12bitRGB444 = 3,
55   COLOR_Format16bitARGB4444 = 4,
56   COLOR_Format16bitARGB1555 = 5,
57   COLOR_Format16bitRGB565 = 6,
58   COLOR_Format16bitBGR565 = 7,
59   COLOR_Format18bitRGB666 = 8,
60   COLOR_Format18bitARGB1665 = 9,
61   COLOR_Format19bitARGB1666 = 10,
62   COLOR_Format24bitRGB888 = 11,
63   COLOR_Format24bitBGR888 = 12,
64   COLOR_Format24bitARGB1887 = 13,
65   COLOR_Format25bitARGB1888 = 14,
66   COLOR_Format32bitBGRA8888 = 15,
67   COLOR_Format32bitARGB8888 = 16,
68   COLOR_FormatYUV411Planar = 17,
69   COLOR_FormatYUV411PackedPlanar = 18,
70   COLOR_FormatYUV420Planar = 19,
71   COLOR_FormatYUV420PackedPlanar = 20,
72   COLOR_FormatYUV420SemiPlanar = 21,
73   COLOR_FormatYUV422Planar = 22,
74   COLOR_FormatYUV422PackedPlanar = 23,
75   COLOR_FormatYUV422SemiPlanar = 24,
76   COLOR_FormatYCbYCr = 25,
77   COLOR_FormatYCrYCb = 26,
78   COLOR_FormatCbYCrY = 27,
79   COLOR_FormatCrYCbY = 28,
80   COLOR_FormatYUV444Interleaved = 29,
81   COLOR_FormatRawBayer8bit = 30,
82   COLOR_FormatRawBayer10bit = 31,
83   COLOR_FormatRawBayer8bitcompressed = 32,
84   COLOR_FormatL2 = 33,
85   COLOR_FormatL4 = 34,
86   COLOR_FormatL8 = 35,
87   COLOR_FormatL16 = 36,
88   COLOR_FormatL24 = 37,
89   COLOR_FormatL32 = 38,
90   COLOR_FormatYUV420PackedSemiPlanar = 39,
91   COLOR_FormatYUV422PackedSemiPlanar = 40,
92   COLOR_Format18BitBGR666 = 41,
93   COLOR_Format24BitARGB6666 = 42,
94   COLOR_Format24BitABGR6666 = 43,
95   COLOR_FormatAndroidOpaque = 0x7F000789,
96   COLOR_TI_FormatYUV420PackedSemiPlanar = 0x7f000100,
97   COLOR_INTEL_FormatYUV420PackedSemiPlanar = 0x7fa00e00,
98   COLOR_INTEL_FormatYUV420PackedSemiPlanar_Tiled = 0x7fa00f00,
99   COLOR_QCOM_FormatYUV420SemiPlanar = 0x7fa30c00,
100   COLOR_QCOM_FormatYUV420PackedSemiPlanar64x32Tile2m8ka = 0x7fa30c03,
101   /* NV12 but with stride and plane heights aligned to 32 */
102   COLOR_QCOM_FormatYVU420SemiPlanar32m = 0x7fa30c04,
103   /* NV12 but with stride and plane heights aligned to 32, Stores two images,
104    * one after the other in top-bottom layout */
105   COLOR_QCOM_FormatYVU420SemiPlanar32mMultiView = 0x7fa30c05,
106   /* From hardware/ti/omap4xxx/domx/omx_core/inc/OMX_TI_IVCommon.h */
107   COLOR_TI_FormatYUV420PackedSemiPlanarInterlaced = 0x7f000001,
108   COLOR_FormatYUV420Flexible = 0x7f420888,
109   /* This format is Exynos specific from the OMX vendor-specific
110    * numeric range, but is defined in the Android OMX headers, so
111    * we shouldn't find incompatible usage and crash horribly... right?
112    * FIXME: Not actually implemented in the video decoder, it will just error out
113    * The format seems to be equiv to V4L2_PIX_FMT_NV12MT_16X16 */
114   COLOR_OMX_SEC_FormatNV12Tiled = 0x7fc00002,
115   /* YV12: http://developer.android.com/reference/android/graphics/ImageFormat.html#YV12 */
116   COLOR_FormatYV12 = 0x32315659,
117 };
118 
119 enum
120 {
121   HEVCProfileMain    = 0x01,
122   HEVCProfileMain10  = 0x02
123 };
124 
125 enum
126 {
127   HEVCMainTierLevel1  = 0x1,
128   HEVCHighTierLevel1  = 0x2,
129   HEVCMainTierLevel2  = 0x4,
130   HEVCHighTierLevel2  = 0x8,
131   HEVCMainTierLevel21 = 0x10,
132   HEVCHighTierLevel21 = 0x20,
133   HEVCMainTierLevel3  = 0x40,
134   HEVCHighTierLevel3  = 0x80,
135   HEVCMainTierLevel31 = 0x100,
136   HEVCHighTierLevel31 = 0x200,
137   HEVCMainTierLevel4  = 0x400,
138   HEVCHighTierLevel4  = 0x800,
139   HEVCMainTierLevel41 = 0x1000,
140   HEVCHighTierLevel41 = 0x2000,
141   HEVCMainTierLevel5  = 0x4000,
142   HEVCHighTierLevel5  = 0x8000,
143   HEVCMainTierLevel51 = 0x10000,
144   HEVCHighTierLevel51 = 0x20000,
145   HEVCMainTierLevel52 = 0x40000,
146   HEVCHighTierLevel52 = 0x80000,
147   HEVCMainTierLevel6  = 0x100000,
148   HEVCHighTierLevel6  = 0x200000,
149   HEVCMainTierLevel61 = 0x400000,
150   HEVCHighTierLevel61 = 0x800000,
151   HEVCMainTierLevel62 = 0x1000000,
152   HEVCHighTierLevel62 = 0x2000000
153 };
154 
155 enum
156 {
157   AVCProfileBaseline = 0x01,
158   AVCProfileMain = 0x02,
159   AVCProfileExtended = 0x04,
160   AVCProfileHigh = 0x08,
161   AVCProfileHigh10 = 0x10,
162   AVCProfileHigh422 = 0x20,
163   AVCProfileHigh444 = 0x40
164 };
165 
166 enum
167 {
168   AVCLevel1 = 0x01,
169   AVCLevel1b = 0x02,
170   AVCLevel11 = 0x04,
171   AVCLevel12 = 0x08,
172   AVCLevel13 = 0x10,
173   AVCLevel2 = 0x20,
174   AVCLevel21 = 0x40,
175   AVCLevel22 = 0x80,
176   AVCLevel3 = 0x100,
177   AVCLevel31 = 0x200,
178   AVCLevel32 = 0x400,
179   AVCLevel4 = 0x800,
180   AVCLevel41 = 0x1000,
181   AVCLevel42 = 0x2000,
182   AVCLevel5 = 0x4000,
183   AVCLevel51 = 0x8000
184 };
185 
186 enum
187 {
188   H263ProfileBaseline = 0x01,
189   H263ProfileH320Coding = 0x02,
190   H263ProfileBackwardCompatible = 0x04,
191   H263ProfileISWV2 = 0x08,
192   H263ProfileISWV3 = 0x10,
193   H263ProfileHighCompression = 0x20,
194   H263ProfileInternet = 0x40,
195   H263ProfileInterlace = 0x80,
196   H263ProfileHighLatency = 0x100
197 };
198 
199 enum
200 {
201   H263Level10 = 0x01,
202   H263Level20 = 0x02,
203   H263Level30 = 0x04,
204   H263Level40 = 0x08,
205   H263Level45 = 0x10,
206   H263Level50 = 0x20,
207   H263Level60 = 0x40,
208   H263Level70 = 0x80
209 };
210 
211 enum
212 {
213   MPEG4ProfileSimple = 0x01,
214   MPEG4ProfileSimpleScalable = 0x02,
215   MPEG4ProfileCore = 0x04,
216   MPEG4ProfileMain = 0x08,
217   MPEG4ProfileNbit = 0x10,
218   MPEG4ProfileScalableTexture = 0x20,
219   MPEG4ProfileSimpleFace = 0x40,
220   MPEG4ProfileSimpleFBA = 0x80,
221   MPEG4ProfileBasicAnimated = 0x100,
222   MPEG4ProfileHybrid = 0x200,
223   MPEG4ProfileAdvancedRealTime = 0x400,
224   MPEG4ProfileCoreScalable = 0x800,
225   MPEG4ProfileAdvancedCoding = 0x1000,
226   MPEG4ProfileAdvancedCore = 0x2000,
227   MPEG4ProfileAdvancedScalable = 0x4000,
228   MPEG4ProfileAdvancedSimple = 0x8000
229 };
230 
231 enum
232 {
233   MPEG4Level0 = 0x01,
234   MPEG4Level0b = 0x02,
235   MPEG4Level1 = 0x04,
236   MPEG4Level2 = 0x08,
237   MPEG4Level3 = 0x10,
238   MPEG4Level4 = 0x20,
239   MPEG4Level4a = 0x40,
240   MPEG4Level5 = 0x80
241 };
242 
243 enum
244 {
245   AACObjectMain = 1,
246   AACObjectLC = 2,
247   AACObjectSSR = 3,
248   AACObjectLTP = 4,
249   AACObjectHE = 5,
250   AACObjectScalable = 6,
251   AACObjectERLC = 17,
252   AACObjectLD = 23,
253   AACObjectHE_PS = 29,
254   AACObjectELD = 39
255 };
256 
257 /* Copies from AudioFormat.java */
258 enum
259 {
260   CHANNEL_OUT_FRONT_LEFT = 0x4,
261   CHANNEL_OUT_FRONT_RIGHT = 0x8,
262   CHANNEL_OUT_FRONT_CENTER = 0x10,
263   CHANNEL_OUT_LOW_FREQUENCY = 0x20,
264   CHANNEL_OUT_BACK_LEFT = 0x40,
265   CHANNEL_OUT_BACK_RIGHT = 0x80,
266   CHANNEL_OUT_FRONT_LEFT_OF_CENTER = 0x100,
267   CHANNEL_OUT_FRONT_RIGHT_OF_CENTER = 0x200,
268   CHANNEL_OUT_BACK_CENTER = 0x400,
269   CHANNEL_OUT_SIDE_LEFT = 0x800,
270   CHANNEL_OUT_SIDE_RIGHT = 0x1000,
271   CHANNEL_OUT_TOP_CENTER = 0x2000,
272   CHANNEL_OUT_TOP_FRONT_LEFT = 0x4000,
273   CHANNEL_OUT_TOP_FRONT_CENTER = 0x8000,
274   CHANNEL_OUT_TOP_FRONT_RIGHT = 0x10000,
275   CHANNEL_OUT_TOP_BACK_LEFT = 0x20000,
276   CHANNEL_OUT_TOP_BACK_CENTER = 0x40000,
277   CHANNEL_OUT_TOP_BACK_RIGHT = 0x80000
278 };
279 
280 #endif
281