blob: 1a2f0b59e76c80e4102175e4e5ef9be3d9aa8a73 [file] [log] [blame]
Kunter Gultekin203f89a2013-02-06 18:03:47 +02001/*
2 * Copyright (c) 2010 The Khronos Group Inc.
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining
5 * a copy of this software and associated documentation files (the
6 * "Software"), to deal in the Software without restriction, including
7 * without limitation the rights to use, copy, modify, merge, publish,
8 * distribute, sublicense, and/or sell copies of the Software, and to
9 * permit persons to whom the Software is furnished to do so, subject
10 * to the following conditions:
11 * The above copyright notice and this permission notice shall be included
12 * in all copies or substantial portions of the Software.
13 *
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
15 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
17 * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
18 * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
19 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
20 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21 *
22 */
23
24/** OMX_VideoExt.h - OpenMax IL version 1.1.2
25 * The OMX_VideoExt header file contains extensions to the
26 * definitions used by both the application and the component to
27 * access video items.
28 */
29
30#ifndef OMX_VideoExt_h
31#define OMX_VideoExt_h
32
33#ifdef __cplusplus
34extern "C" {
35#endif /* __cplusplus */
36
37/* Each OMX header shall include all required header files to allow the
38 * header to compile without errors. The includes below are required
39 * for this header file to compile successfully
40 */
41#include <OMX_Core.h>
42
43/** NALU Formats */
44typedef enum OMX_NALUFORMATSTYPE {
45 OMX_NaluFormatStartCodes = 1,
46 OMX_NaluFormatOneNaluPerBuffer = 2,
47 OMX_NaluFormatOneByteInterleaveLength = 4,
48 OMX_NaluFormatTwoByteInterleaveLength = 8,
49 OMX_NaluFormatFourByteInterleaveLength = 16,
50 OMX_NaluFormatCodingMax = 0x7FFFFFFF
51} OMX_NALUFORMATSTYPE;
52
53/** NAL Stream Format */
54typedef struct OMX_NALSTREAMFORMATTYPE{
55 OMX_U32 nSize;
56 OMX_VERSIONTYPE nVersion;
57 OMX_U32 nPortIndex;
58 OMX_NALUFORMATSTYPE eNaluFormat;
59} OMX_NALSTREAMFORMATTYPE;
60
Kunter Gultekin203f89a2013-02-06 18:03:47 +020061/** VP8 profiles */
62typedef enum OMX_VIDEO_VP8PROFILETYPE {
63 OMX_VIDEO_VP8ProfileMain = 0x01,
64 OMX_VIDEO_VP8ProfileUnknown = 0x6EFFFFFF,
65 OMX_VIDEO_VP8ProfileMax = 0x7FFFFFFF
66} OMX_VIDEO_VP8PROFILETYPE;
67
68/** VP8 levels */
69typedef enum OMX_VIDEO_VP8LEVELTYPE {
70 OMX_VIDEO_VP8Level_Version0 = 0x01,
71 OMX_VIDEO_VP8Level_Version1 = 0x02,
72 OMX_VIDEO_VP8Level_Version2 = 0x04,
73 OMX_VIDEO_VP8Level_Version3 = 0x08,
74 OMX_VIDEO_VP8LevelUnknown = 0x6EFFFFFF,
75 OMX_VIDEO_VP8LevelMax = 0x7FFFFFFF
76} OMX_VIDEO_VP8LEVELTYPE;
77
Ronghua Wucc505382016-01-15 16:30:57 -080078/** VP9 profiles */
79typedef enum OMX_VIDEO_VP9PROFILETYPE {
80 OMX_VIDEO_VP9Profile0 = 0x0,
81 OMX_VIDEO_VP9Profile1 = 0x1,
82 OMX_VIDEO_VP9Profile2 = 0x2,
83 OMX_VIDEO_VP9Profile3 = 0x3,
84 OMX_VIDEO_VP9ProfileUnknown = 0x6EFFFFFF,
85 OMX_VIDEO_VP9ProfileMax = 0x7FFFFFFF
86} OMX_VIDEO_VP9PROFILETYPE;
87
88/** VP9 levels */
89typedef enum OMX_VIDEO_VP9LEVELTYPE {
90 OMX_VIDEO_VP9Level1 = 0x0,
91 OMX_VIDEO_VP9Level11 = 0x1,
92 OMX_VIDEO_VP9Level2 = 0x2,
93 OMX_VIDEO_VP9Level21 = 0x4,
94 OMX_VIDEO_VP9Level3 = 0x8,
95 OMX_VIDEO_VP9Level31 = 0x10,
96 OMX_VIDEO_VP9Level4 = 0x20,
97 OMX_VIDEO_VP9Level41 = 0x40,
98 OMX_VIDEO_VP9Level5 = 0x80,
99 OMX_VIDEO_VP9Level51 = 0x100,
100 OMX_VIDEO_VP9Level52 = 0x200,
101 OMX_VIDEO_VP9Level6 = 0x400,
102 OMX_VIDEO_VP9Level61 = 0x800,
103 OMX_VIDEO_VP9Level62 = 0x1000,
104 OMX_VIDEO_VP9LevelUnknown = 0x6EFFFFFF,
105 OMX_VIDEO_VP9LevelMax = 0x7FFFFFFF
106} OMX_VIDEO_VP9LEVELTYPE;
107
Kunter Gultekin203f89a2013-02-06 18:03:47 +0200108/** VP8 Param */
109typedef struct OMX_VIDEO_PARAM_VP8TYPE {
110 OMX_U32 nSize;
111 OMX_VERSIONTYPE nVersion;
112 OMX_U32 nPortIndex;
113 OMX_VIDEO_VP8PROFILETYPE eProfile;
114 OMX_VIDEO_VP8LEVELTYPE eLevel;
115 OMX_U32 nDCTPartitions;
116 OMX_BOOL bErrorResilientMode;
117} OMX_VIDEO_PARAM_VP8TYPE;
118
119/** Structure for configuring VP8 reference frames */
120typedef struct OMX_VIDEO_VP8REFERENCEFRAMETYPE {
121 OMX_U32 nSize;
122 OMX_VERSIONTYPE nVersion;
123 OMX_U32 nPortIndex;
124 OMX_BOOL bPreviousFrameRefresh;
125 OMX_BOOL bGoldenFrameRefresh;
126 OMX_BOOL bAlternateFrameRefresh;
127 OMX_BOOL bUsePreviousFrame;
128 OMX_BOOL bUseGoldenFrame;
129 OMX_BOOL bUseAlternateFrame;
130} OMX_VIDEO_VP8REFERENCEFRAMETYPE;
131
132/** Structure for querying VP8 reference frame type */
133typedef struct OMX_VIDEO_VP8REFERENCEFRAMEINFOTYPE {
134 OMX_U32 nSize;
135 OMX_VERSIONTYPE nVersion;
136 OMX_U32 nPortIndex;
137 OMX_BOOL bIsIntraFrame;
138 OMX_BOOL bIsGoldenOrAlternateFrame;
139} OMX_VIDEO_VP8REFERENCEFRAMEINFOTYPE;
140
Alex Glaznev5b155b82014-04-07 11:09:56 -0700141/** Maximum number of VP8 temporal layers */
142#define OMX_VIDEO_ANDROID_MAXVP8TEMPORALLAYERS 3
143
144/** VP8 temporal layer patterns */
145typedef enum OMX_VIDEO_ANDROID_VPXTEMPORALLAYERPATTERNTYPE {
146 OMX_VIDEO_VPXTemporalLayerPatternNone = 0,
147 OMX_VIDEO_VPXTemporalLayerPatternWebRTC = 1,
148 OMX_VIDEO_VPXTemporalLayerPatternMax = 0x7FFFFFFF
149} OMX_VIDEO_ANDROID_VPXTEMPORALLAYERPATTERNTYPE;
150
151/**
152 * Android specific VP8 encoder params
153 *
154 * STRUCT MEMBERS:
155 * nSize : Size of the structure in bytes
156 * nVersion : OMX specification version information
157 * nPortIndex : Port that this structure applies to
158 * nKeyFrameInterval : Key frame interval in frames
159 * eTemporalPattern : Type of temporal layer pattern
160 * nTemporalLayerCount : Number of temporal coding layers
161 * nTemporalLayerBitrateRatio : Bitrate ratio allocation between temporal
162 * streams in percentage
163 * nMinQuantizer : Minimum (best quality) quantizer
164 * nMaxQuantizer : Maximum (worst quality) quantizer
165 */
166typedef struct OMX_VIDEO_PARAM_ANDROID_VP8ENCODERTYPE {
167 OMX_U32 nSize;
168 OMX_VERSIONTYPE nVersion;
169 OMX_U32 nPortIndex;
170 OMX_U32 nKeyFrameInterval;
171 OMX_VIDEO_ANDROID_VPXTEMPORALLAYERPATTERNTYPE eTemporalPattern;
172 OMX_U32 nTemporalLayerCount;
173 OMX_U32 nTemporalLayerBitrateRatio[OMX_VIDEO_ANDROID_MAXVP8TEMPORALLAYERS];
174 OMX_U32 nMinQuantizer;
175 OMX_U32 nMaxQuantizer;
Lajos Molnar64f5ec52014-06-05 22:33:17 -0700176} OMX_VIDEO_PARAM_ANDROID_VP8ENCODERTYPE;
Alex Glaznev5b155b82014-04-07 11:09:56 -0700177
Rachad184077d2014-05-01 18:42:43 -0700178/** HEVC Profile enum type */
179typedef enum OMX_VIDEO_HEVCPROFILETYPE {
Ronghua Wu0471d0a2016-02-24 16:28:13 -0800180 OMX_VIDEO_HEVCProfileUnknown = 0x0,
181 OMX_VIDEO_HEVCProfileMain = 0x1,
182 OMX_VIDEO_HEVCProfileMain10 = 0x2,
183 // Main10 profile with HDR SEI support.
184 OMX_VIDEO_HEVCProfileMain10HDR10 = 0x1000,
185 OMX_VIDEO_HEVCProfileMax = 0x7FFFFFFF
Rachad184077d2014-05-01 18:42:43 -0700186} OMX_VIDEO_HEVCPROFILETYPE;
187
188/** HEVC Level enum type */
189typedef enum OMX_VIDEO_HEVCLEVELTYPE {
190 OMX_VIDEO_HEVCLevelUnknown = 0x0,
191 OMX_VIDEO_HEVCMainTierLevel1 = 0x1,
192 OMX_VIDEO_HEVCHighTierLevel1 = 0x2,
193 OMX_VIDEO_HEVCMainTierLevel2 = 0x4,
194 OMX_VIDEO_HEVCHighTierLevel2 = 0x8,
195 OMX_VIDEO_HEVCMainTierLevel21 = 0x10,
196 OMX_VIDEO_HEVCHighTierLevel21 = 0x20,
197 OMX_VIDEO_HEVCMainTierLevel3 = 0x40,
198 OMX_VIDEO_HEVCHighTierLevel3 = 0x80,
199 OMX_VIDEO_HEVCMainTierLevel31 = 0x100,
200 OMX_VIDEO_HEVCHighTierLevel31 = 0x200,
201 OMX_VIDEO_HEVCMainTierLevel4 = 0x400,
202 OMX_VIDEO_HEVCHighTierLevel4 = 0x800,
203 OMX_VIDEO_HEVCMainTierLevel41 = 0x1000,
204 OMX_VIDEO_HEVCHighTierLevel41 = 0x2000,
205 OMX_VIDEO_HEVCMainTierLevel5 = 0x4000,
206 OMX_VIDEO_HEVCHighTierLevel5 = 0x8000,
207 OMX_VIDEO_HEVCMainTierLevel51 = 0x10000,
208 OMX_VIDEO_HEVCHighTierLevel51 = 0x20000,
209 OMX_VIDEO_HEVCMainTierLevel52 = 0x40000,
210 OMX_VIDEO_HEVCHighTierLevel52 = 0x80000,
211 OMX_VIDEO_HEVCMainTierLevel6 = 0x100000,
212 OMX_VIDEO_HEVCHighTierLevel6 = 0x200000,
213 OMX_VIDEO_HEVCMainTierLevel61 = 0x400000,
214 OMX_VIDEO_HEVCHighTierLevel61 = 0x800000,
215 OMX_VIDEO_HEVCMainTierLevel62 = 0x1000000,
216 OMX_VIDEO_HEVCHighTierLevel62 = 0x2000000,
217 OMX_VIDEO_HEVCHighTiermax = 0x7FFFFFFF
218} OMX_VIDEO_HEVCLEVELTYPE;
219
Wonsik Kim639f71f2015-12-08 23:21:36 +0900220/** Structure for controlling HEVC video encoding */
Rachad184077d2014-05-01 18:42:43 -0700221typedef struct OMX_VIDEO_PARAM_HEVCTYPE {
222 OMX_U32 nSize;
223 OMX_VERSIONTYPE nVersion;
224 OMX_U32 nPortIndex;
225 OMX_VIDEO_HEVCPROFILETYPE eProfile;
226 OMX_VIDEO_HEVCLEVELTYPE eLevel;
Wonsik Kim639f71f2015-12-08 23:21:36 +0900227 OMX_U32 nKeyFrameInterval;
Rachad184077d2014-05-01 18:42:43 -0700228} OMX_VIDEO_PARAM_HEVCTYPE;
229
230/** Structure to define if dependent slice segments should be used */
231typedef struct OMX_VIDEO_SLICESEGMENTSTYPE {
232 OMX_U32 nSize;
233 OMX_VERSIONTYPE nVersion;
234 OMX_U32 nPortIndex;
235 OMX_BOOL bDepedentSegments;
236 OMX_BOOL bEnableLoopFilterAcrossSlices;
237} OMX_VIDEO_SLICESEGMENTSTYPE;
Kunter Gultekin203f89a2013-02-06 18:03:47 +0200238
Lajos Molnarbcaa8d52015-08-07 10:07:07 -0700239/** Structure to return timestamps of rendered output frames as well as EOS
240 * for tunneled components.
241 */
Lajos Molnare21d7f52015-06-05 17:49:25 -0700242typedef struct OMX_VIDEO_RENDEREVENTTYPE {
243 OMX_S64 nMediaTimeUs; // timestamp of rendered video frame
244 OMX_S64 nSystemTimeNs; // system monotonic time at the time frame was rendered
Lajos Molnarbcaa8d52015-08-07 10:07:07 -0700245 // Use INT64_MAX for nMediaTimeUs to signal that the EOS
246 // has been reached. In this case, nSystemTimeNs MUST be
247 // the system time when the last frame was rendered.
248 // This MUST be done in addition to returning (and
249 // following) the render information for the last frame.
Lajos Molnare21d7f52015-06-05 17:49:25 -0700250} OMX_VIDEO_RENDEREVENTTYPE;
251
Ronghua Wuc92c19e2016-01-26 16:47:09 -0800252/** Dolby Vision Profile enum type */
253typedef enum OMX_VIDEO_DOLBYVISIONPROFILETYPE {
254 OMX_VIDEO_DolbyVisionProfileUnknown = 0x0,
255 OMX_VIDEO_DolbyVisionProfileDvavDer = 0x1,
256 OMX_VIDEO_DolbyVisionProfileDvavDen = 0x2,
257 OMX_VIDEO_DolbyVisionProfileDvheDer = 0x3,
258 OMX_VIDEO_DolbyVisionProfileDvheDen = 0x4,
259 OMX_VIDEO_DolbyVisionProfileDvheDtr = 0x5,
260 OMX_VIDEO_DolbyVisionProfileDvheStn = 0x6,
261 OMX_VIDEO_DolbyVisionProfileMax = 0x7FFFFFFF
262} OMX_VIDEO_DOLBYVISIONPROFILETYPE;
263
264/** Dolby Vision Level enum type */
265typedef enum OMX_VIDEO_DOLBYVISIONLEVELTYPE {
266 OMX_VIDEO_DolbyVisionLevelUnknown = 0x0,
267 OMX_VIDEO_DolbyVisionLevelHd24 = 0x1,
268 OMX_VIDEO_DolbyVisionLevelHd30 = 0x2,
269 OMX_VIDEO_DolbyVisionLevelFhd24 = 0x4,
270 OMX_VIDEO_DolbyVisionLevelFhd30 = 0x8,
271 OMX_VIDEO_DolbyVisionLevelFhd60 = 0x10,
272 OMX_VIDEO_DolbyVisionLevelUhd24 = 0x20,
273 OMX_VIDEO_DolbyVisionLevelUhd30 = 0x40,
274 OMX_VIDEO_DolbyVisionLevelUhd48 = 0x80,
275 OMX_VIDEO_DolbyVisionLevelUhd60 = 0x100,
276 OMX_VIDEO_DolbyVisionLevelmax = 0x7FFFFFFF
277} OMX_VIDEO_DOLBYVISIONLEVELTYPE;
278
Hangyu Kuangdbadc842016-01-28 09:51:14 -0800279/**
280 * Structure for configuring video compression intra refresh period
281 *
282 * STRUCT MEMBERS:
283 * nSize : Size of the structure in bytes
284 * nVersion : OMX specification version information
285 * nPortIndex : Port that this structure applies to
286 * nRefreshPeriod : Intra refreh period in frames. Value 0 means disable intra refresh
287*/
288typedef struct OMX_VIDEO_CONFIG_ANDROID_INTRAREFRESHTYPE {
289 OMX_U32 nSize;
290 OMX_VERSIONTYPE nVersion;
291 OMX_U32 nPortIndex;
Hangyu Kuang70f744b2016-02-05 14:14:15 -0800292 OMX_U32 nRefreshPeriod;
Hangyu Kuangdbadc842016-01-28 09:51:14 -0800293} OMX_VIDEO_CONFIG_ANDROID_INTRAREFRESHTYPE;
294
Kunter Gultekin203f89a2013-02-06 18:03:47 +0200295#ifdef __cplusplus
296}
297#endif /* __cplusplus */
298
299#endif /* OMX_VideoExt_h */
300/* File EOF */