1 /*--------------------------------------------------------------------------
2 Copyright (c) 2009-2017, The Linux Foundation. All rights reserved.
3 
4 Redistribution and use in source and binary forms, with or without
5 modification, 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 
16 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19 NON-INFRINGEMENT ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR
20 CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
21 EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
22 PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
23 OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
24 WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
25 OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
26 ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 --------------------------------------------------------------------------*/
28 #ifndef __OMX_QCOM_EXTENSIONS_H__
29 #define __OMX_QCOM_EXTENSIONS_H__
30 
31 #ifdef __cplusplus
32 extern "C" {
33 #endif /* __cplusplus */
34 
35 /*============================================================================
36 *//** @file OMX_QCOMExtns.h
37   This header contains constants and type definitions that specify the
38   extensions added to the OpenMAX Vendor specific APIs.
39 
40 *//*========================================================================*/
41 
42 
43 ///////////////////////////////////////////////////////////////////////////////
44 //                             Include Files
45 ///////////////////////////////////////////////////////////////////////////////
46 #include "OMX_Core.h"
47 #include "OMX_Video.h"
48 
49 #define OMX_VIDEO_MAX_HP_LAYERS 6
50 
51 /**
52  * These MACROS used by Camera and Video to decide buffer count.
53  * This is to avoid mismatch of buffer count between Camera and Video.
54  * In Meta mode, read this count as buffer count in Camera and Header
55  * count in Video.
56  * 1) Number of buffers in Non-DCVS mode.
57  * 2) DCVS resolution.
58  * 3) Buffer count when Current resolution is greater than DCVS resolution
59  * defined in 2)
60  */
61 
62 #define OMX_VIDEO_MIN_CAMERA_BUFFERS 9
63 #define OMX_VIDEO_ENC_DCVS_RESOLUTION 3840 * 2160
64 #define OMX_VIDEO_MIN_CAMERA_BUFFERS_DCVS 11
65 
66 /**
67  * This count indicates the number of Ints in the legacy Camera payload
68  * used for HAL1
69  */
70 
71 #define VIDEO_METADATA_NUM_COMMON_INTS 1
72 
73 /**
74  * This extension is used to register mapping of a virtual
75  * address to a physical address. This extension is a parameter
76  * which can be set using the OMX_SetParameter macro. The data
77  * pointer corresponding to this extension is
78  * OMX_QCOM_MemMapEntry. This parameter is a 'write only'
79  * parameter (Current value cannot be queried using
80  * OMX_GetParameter macro).
81  */
82 #define OMX_QCOM_EXTN_REGISTER_MMAP     "OMX.QCOM.index.param.register_mmap"
83 
84 /**
85  * This structure describes the data pointer corresponding to
86  * the OMX_QCOM_MMAP_REGISTER_EXTN extension. This parameter
87  * must be set only 'after' populating a port with a buffer
88  * using OMX_UseBuffer, wherein the data pointer of the buffer
89  * corresponds to the virtual address as specified in this
90  * structure.
91  */
92 struct OMX_QCOM_PARAM_MEMMAPENTRYTYPE
93 {
94     OMX_U32 nSize;              /** Size of the structure in bytes */
95     OMX_VERSIONTYPE nVersion;   /**< OMX specification version information */
96     OMX_U32 nPortIndex;         /**< Port number the structure applies to */
97 
98     /**
99      * The virtual address of memory block
100      */
101     OMX_U64 nVirtualAddress;
102 
103     /**
104      * The physical address corresponding to the virtual address. The physical
105      * address is contiguous for the entire valid range of the virtual
106      * address.
107      */
108     OMX_U64 nPhysicalAddress;
109 };
110 
111 #define QOMX_VIDEO_IntraRefreshRandom (OMX_VIDEO_IntraRefreshVendorStartUnused + 0)
112 
113 /* This error event is used for H.264 long-term reference (LTR) encoding.
114  * When IL client specifies an LTR frame with its identifier via
115  * OMX_QCOM_INDEX_CONFIG_VIDEO_LTRUSE to the encoder, if the specified
116  * LTR frame can not be located by the encoder in its LTR list, the encoder
117  * issues this error event to IL client to notify the failure of LTRUse config.
118  */
119 #define QOMX_ErrorLTRUseFailed        (OMX_ErrorVendorStartUnused + 1)
120 
121 /*
122  * This rate control will be used for low bitrate applications to get better
123  * video quality for a given bitrate.
124  */
125 #define QOMX_Video_ControlRateMaxBitrate (OMX_Video_ControlRateVendorStartUnused + 1)
126 
127 #define QOMX_Video_ControlRateMaxBitrateSkipFrames (OMX_Video_ControlRateVendorStartUnused + 2)
128 
129 #define QOMX_VIDEO_BUFFERFLAG_BFRAME 0x00100000
130 
131 #define QOMX_VIDEO_BUFFERFLAG_EOSEQ  0x00200000
132 
133 #define QOMX_VIDEO_BUFFERFLAG_MBAFF  0x00400000
134 
135 #define QOMX_VIDEO_BUFFERFLAG_CANCEL 0x00800000
136 
137 #define OMX_QCOM_PORTDEFN_EXTN   "OMX.QCOM.index.param.portdefn"
138 /* Allowed APIs on the above Index: OMX_GetParameter() and OMX_SetParameter() */
139 
140 typedef enum OMX_QCOMMemoryRegion
141 {
142     OMX_QCOM_MemRegionInvalid,
143     OMX_QCOM_MemRegionEBI1,
144     OMX_QCOM_MemRegionSMI,
145     OMX_QCOM_MemRegionMax = 0X7FFFFFFF
146 } OMX_QCOMMemoryRegion;
147 
148 typedef enum OMX_QCOMCacheAttr
149 {
150     OMX_QCOM_CacheAttrNone,
151     OMX_QCOM_CacheAttrWriteBack,
152     OMX_QCOM_CacheAttrWriteThrough,
153     OMX_QCOM_CacheAttrMAX = 0X7FFFFFFF
154 } OMX_QCOMCacheAttr;
155 
156 typedef struct OMX_QCOMRectangle
157 {
158    OMX_S32 x;
159    OMX_S32 y;
160    OMX_S32 dx;
161    OMX_S32 dy;
162 } OMX_QCOMRectangle;
163 
164 /** OMX_QCOMFramePackingFormat
165   * Input or output buffer format
166   */
167 typedef enum OMX_QCOMFramePackingFormat
168 {
169   /* 0 - unspecified
170    */
171   OMX_QCOM_FramePacking_Unspecified,
172 
173   /*  1 - Partial frames may be present OMX IL 1.1.1 Figure 2-10:
174    *  Case 1??Each Buffer Filled In Whole or In Part
175    */
176   OMX_QCOM_FramePacking_Arbitrary,
177 
178   /*  2 - Multiple complete frames per buffer (integer number)
179    *  OMX IL 1.1.1 Figure 2-11: Case 2�Each Buffer Filled with
180    *  Only Complete Frames of Data
181    */
182   OMX_QCOM_FramePacking_CompleteFrames,
183 
184   /*  3 - Only one complete frame per buffer, no partial frame
185    *  OMX IL 1.1.1 Figure 2-12: Case 3�Each Buffer Filled with
186    *  Only One Frame of Compressed Data. Usually at least one
187    *  complete unit of data will be delivered in a buffer for
188    *  uncompressed data formats.
189    */
190   OMX_QCOM_FramePacking_OnlyOneCompleteFrame,
191 
192   /*  4 - Only one complete subframe per buffer, no partial subframe
193    *  Example: In H264, one complete NAL per buffer, where one frame
194    *  can contatin multiple NAL
195    */
196   OMX_QCOM_FramePacking_OnlyOneCompleteSubFrame,
197 
198   OMX_QCOM_FramePacking_MAX = 0X7FFFFFFF
199 } OMX_QCOMFramePackingFormat;
200 
201 typedef struct OMX_QCOM_PARAM_PORTDEFINITIONTYPE {
202  OMX_U32 nSize;           /** Size of the structure in bytes */
203  OMX_VERSIONTYPE nVersion;/** OMX specification version information */
204  OMX_U32 nPortIndex;    /** Portindex which is extended by this structure */
205 
206  /** Platform specific memory region EBI1, SMI, etc.,*/
207  OMX_QCOMMemoryRegion nMemRegion;
208 
209  OMX_QCOMCacheAttr nCacheAttr; /** Cache attributes */
210 
211  /** Input or output buffer format */
212  OMX_U32 nFramePackingFormat;
213 
214 } OMX_QCOM_PARAM_PORTDEFINITIONTYPE;
215 
216 typedef struct OMX_QCOM_VIDEO_PARAM_QPRANGETYPE {
217     OMX_U32 nSize;
218     OMX_VERSIONTYPE nVersion;
219     OMX_U32 nPortIndex;
220     OMX_U32 minQP;
221     OMX_U32 maxQP;
222 } OMX_QCOM_VIDEO_PARAM_QPRANGETYPE;
223 
224 typedef struct OMX_QCOM_VIDEO_PARAM_IPB_QPRANGETYPE {
225     OMX_U32 nSize;
226     OMX_VERSIONTYPE nVersion;
227     OMX_U32 nPortIndex;
228     OMX_U32 minIQP;
229     OMX_U32 maxIQP;
230     OMX_U32 minPQP;
231     OMX_U32 maxPQP;
232     OMX_U32 minBQP;
233     OMX_U32 maxBQP;
234 } OMX_QCOM_VIDEO_PARAM_IPB_QPRANGETYPE;
235 
236 #define OMX_QCOM_PLATFORMPVT_EXTN   "OMX.QCOM.index.param.platformprivate"
237 /** Allowed APIs on the above Index: OMX_SetParameter() */
238 
239 typedef enum OMX_QCOM_PLATFORM_PRIVATE_ENTRY_TYPE
240 {
241     /** Enum for PMEM information */
242     OMX_QCOM_PLATFORM_PRIVATE_PMEM = 0x1
243 } OMX_QCOM_PLATFORM_PRIVATE_ENTRY_TYPE;
244 
245 /** IL client will set the following structure. A failure
246  *  code will be returned if component does not support the
247  *  value provided for 'type'.
248  */
249 struct OMX_QCOM_PLATFORMPRIVATE_EXTN
250 {
251     OMX_U32 nSize;        /** Size of the structure in bytes */
252     OMX_VERSIONTYPE nVersion; /** OMX spec version information */
253     OMX_U32 nPortIndex;  /** Port number on which usebuffer extn is applied */
254 
255     /** Type of extensions should match an entry from
256      OMX_QCOM_PLATFORM_PRIVATE_ENTRY_TYPE
257     */
258     OMX_QCOM_PLATFORM_PRIVATE_ENTRY_TYPE type;
259 };
260 
261 typedef struct OMX_QCOM_PLATFORM_PRIVATE_PMEM_INFO
262 {
263     /** pmem file descriptor */
264     unsigned long pmem_fd;
265     /** Offset from pmem device base address */
266     OMX_U32 offset;
267     OMX_U32 size;
268     OMX_U32 mapped_size;
269     OMX_PTR buffer;
270 }OMX_QCOM_PLATFORM_PRIVATE_PMEM_INFO;
271 
272 typedef struct OMX_QCOM_PLATFORM_PRIVATE_ENTRY
273 {
274     /** Entry type */
275     OMX_QCOM_PLATFORM_PRIVATE_ENTRY_TYPE type;
276 
277     /** Pointer to platform specific entry */
278     OMX_PTR entry;
279 }OMX_QCOM_PLATFORM_PRIVATE_ENTRY;
280 
281 typedef struct OMX_QCOM_PLATFORM_PRIVATE_LIST
282 {
283     /** Number of entries */
284     OMX_U32 nEntries;
285 
286     /** Pointer to array of platform specific entries *
287      * Contiguous block of OMX_QCOM_PLATFORM_PRIVATE_ENTRY element
288     */
289     OMX_QCOM_PLATFORM_PRIVATE_ENTRY* entryList;
290 }OMX_QCOM_PLATFORM_PRIVATE_LIST;
291 
292 #define OMX_QCOM_FRAME_PACKING_FORMAT   "OMX.QCOM.index.param.framepackfmt"
293 /* Allowed API call: OMX_GetParameter() */
294 /* IL client can use this index to rerieve the list of frame formats *
295  * supported by the component */
296 
297 typedef struct OMX_QCOM_FRAME_PACKINGFORMAT_TYPE {
298     OMX_U32 nSize;
299     OMX_VERSIONTYPE nVersion;
300     OMX_U32 nPortIndex;
301     OMX_U32 nIndex;
302     OMX_QCOMFramePackingFormat eframePackingFormat;
303 } OMX_QCOM_FRAME_PACKINGFORMAT_TYPE;
304 
305 
306 /**
307  * Following is the enum for color formats supported on Qualcomm
308  * MSMs YVU420SemiPlanar color format is not defined in OpenMAX
309  * 1.1.1 and prior versions of OpenMAX specification.
310  */
311 
312 enum OMX_QCOM_COLOR_FORMATTYPE
313 {
314 
315 /** YVU420SemiPlanar: YVU planar format, organized with a first
316  *  plane containing Y pixels, and a second plane containing
317  *  interleaved V and U pixels. V and U pixels are sub-sampled
318  *  by a factor of two both horizontally and vertically.
319  */
320     QOMX_COLOR_FormatYVU420SemiPlanar = 0x7FA30C00,
321     QOMX_COLOR_FormatYVU420PackedSemiPlanar32m4ka,
322     QOMX_COLOR_FormatYUV420PackedSemiPlanar16m2ka,
323     QOMX_COLOR_FormatYUV420PackedSemiPlanar64x32Tile2m8ka,
324     QOMX_COLOR_FORMATYUV420PackedSemiPlanar32m,
325     QOMX_COLOR_FORMATYUV420PackedSemiPlanar32mMultiView,
326     QOMX_COLOR_FORMATYUV420PackedSemiPlanar32mCompressed,
327     QOMX_COLOR_Format32bitRGBA8888,
328     QOMX_COLOR_Format32bitRGBA8888Compressed,
329     QOMX_COLOR_FORMATYUV420PackedSemiPlanar32m10bitCompressed,
330     QOMX_COLOR_FormatAndroidOpaque = (OMX_COLOR_FORMATTYPE) OMX_COLOR_FormatVendorStartUnused  + 0x789,
331 };
332 
333 enum OMX_QCOM_VIDEO_CODINGTYPE
334 {
335 /** Codecs support by qualcomm which are not listed in OMX 1.1.x
336  *  spec
337  *   */
338     OMX_QCOM_VIDEO_CodingVC1  = 0x7FA30C00 ,
339     OMX_QCOM_VIDEO_CodingWMV9 = 0x7FA30C01,
340     QOMX_VIDEO_CodingDivx = 0x7FA30C02,     /**< Value when coding is Divx */
341     QOMX_VIDEO_CodingSpark = 0x7FA30C03,     /**< Value when coding is Sorenson Spark */
342     QOMX_VIDEO_CodingVp = 0x7FA30C04,
343     QOMX_VIDEO_CodingVp8 = OMX_VIDEO_CodingVP8,   /**< keeping old enum for backwards compatibility*/
344     QOMX_VIDEO_CodingHevc = OMX_VIDEO_CodingHEVC, /**< keeping old enum for backwards compatibility*/
345     QOMX_VIDEO_CodingMVC = 0x7FA30C07,
346     QOMX_VIDEO_CodingVp9 = OMX_VIDEO_CodingVP9,   /**< keeping old enum for backwards compatibility*/
347 };
348 
349 enum OMX_QCOM_EXTN_INDEXTYPE
350 {
351     /** Qcom proprietary extension index list */
352 
353     /* "OMX.QCOM.index.param.register_mmap" */
354     OMX_QcomIndexRegmmap = 0x7F000000,
355 
356     /* "OMX.QCOM.index.param.platformprivate" */
357     OMX_QcomIndexPlatformPvt = 0x7F000001,
358 
359     /* "OMX.QCOM.index.param.portdefn" */
360     OMX_QcomIndexPortDefn = 0x7F000002,
361 
362     /* "OMX.QCOM.index.param.framepackingformat" */
363     OMX_QcomIndexPortFramePackFmt = 0x7F000003,
364 
365     /*"OMX.QCOM.index.param.Interlaced */
366     OMX_QcomIndexParamInterlaced = 0x7F000004,
367 
368     /*"OMX.QCOM.index.config.interlaceformat */
369     OMX_QcomIndexConfigInterlaced = 0x7F000005,
370 
371     /*"OMX.QCOM.index.param.syntaxhdr" */
372     QOMX_IndexParamVideoSyntaxHdr = 0x7F000006,
373 
374     /*"OMX.QCOM.index.config.intraperiod" */
375     QOMX_IndexConfigVideoIntraperiod = 0x7F000007,
376 
377     /*"OMX.QCOM.index.config.randomIntrarefresh" */
378     QOMX_IndexConfigVideoIntraRefresh = 0x7F000008,
379 
380     /*"OMX.QCOM.index.config.video.TemporalSpatialTradeOff" */
381     QOMX_IndexConfigVideoTemporalSpatialTradeOff = 0x7F000009,
382 
383     /*"OMX.QCOM.index.param.video.EncoderMode" */
384     QOMX_IndexParamVideoEncoderMode = 0x7F00000A,
385 
386     /*"OMX.QCOM.index.param.Divxtype */
387     OMX_QcomIndexParamVideoDivx = 0x7F00000B,
388 
389     /*"OMX.QCOM.index.param.Sparktype */
390     OMX_QcomIndexParamVideoSpark = 0x7F00000C,
391 
392     /*"OMX.QCOM.index.param.Vptype */
393     OMX_QcomIndexParamVideoVp = 0x7F00000D,
394 
395     OMX_QcomIndexQueryNumberOfVideoDecInstance = 0x7F00000E,
396 
397     OMX_QcomIndexParamVideoSyncFrameDecodingMode = 0x7F00000F,
398 
399     OMX_QcomIndexParamVideoDecoderPictureOrder = 0x7F000010,
400 
401     /* "OMX.QCOM.index.config.video.FramePackingInfo" */
402     OMX_QcomIndexConfigVideoFramePackingArrangement = 0x7F000011,
403 
404     OMX_QcomIndexParamConcealMBMapExtraData = 0x7F000012,
405 
406     OMX_QcomIndexParamFrameInfoExtraData = 0x7F000013,
407 
408     OMX_QcomIndexParamInterlaceExtraData = 0x7F000014,
409 
410     OMX_QcomIndexParamH264TimeInfo = 0x7F000015,
411 
412     OMX_QcomIndexParamIndexExtraDataType = 0x7F000016,
413 
414     OMX_GoogleAndroidIndexEnableAndroidNativeBuffers = 0x7F000017,
415 
416     OMX_GoogleAndroidIndexUseAndroidNativeBuffer = 0x7F000018,
417 
418     OMX_GoogleAndroidIndexGetAndroidNativeBufferUsage = 0x7F000019,
419 
420     /*"OMX.QCOM.index.config.video.QPRange" */
421     OMX_QcomIndexConfigVideoQPRange = 0x7F00001A,
422 
423     /*"OMX.QCOM.index.param.EnableTimeStampReoder"*/
424     OMX_QcomIndexParamEnableTimeStampReorder = 0x7F00001B,
425 
426     /*"OMX.google.android.index.storeMetaDataInBuffers"*/
427     OMX_QcomIndexParamVideoMetaBufferMode = 0x7F00001C,
428 
429     /*"OMX.google.android.index.useAndroidNativeBuffer2"*/
430     OMX_GoogleAndroidIndexUseAndroidNativeBuffer2 = 0x7F00001D,
431 
432     /*"OMX.QCOM.index.param.VideoMaxAllowedBitrateCheck"*/
433     OMX_QcomIndexParamVideoMaxAllowedBitrateCheck = 0x7F00001E,
434 
435     OMX_QcomIndexEnableSliceDeliveryMode = 0x7F00001F,
436 
437     /* "OMX.QCOM.index.param.video.ExtnUserExtraData" */
438     OMX_QcomIndexEnableExtnUserData = 0x7F000020,
439 
440     /*"OMX.QCOM.index.param.video.EnableSmoothStreaming"*/
441     OMX_QcomIndexParamEnableSmoothStreaming = 0x7F000021,
442 
443     /*"OMX.QCOM.index.param.video.QPRange" */
444     OMX_QcomIndexParamVideoQPRange = 0x7F000022,
445 
446     OMX_QcomIndexEnableH263PlusPType = 0x7F000023,
447 
448     /*"OMX.QCOM.index.param.video.LTRCountRangeSupported"*/
449     QOMX_IndexParamVideoLTRCountRangeSupported = 0x7F000024,
450 
451     /*"OMX.QCOM.index.param.video.LTRMode"*/
452     QOMX_IndexParamVideoLTRMode = 0x7F000025,
453 
454     /*"OMX.QCOM.index.param.video.LTRCount"*/
455     QOMX_IndexParamVideoLTRCount = 0x7F000026,
456 
457     /*"OMX.QCOM.index.config.video.LTRPeriod"*/
458     QOMX_IndexConfigVideoLTRPeriod = 0x7F000027,
459 
460     /*"OMX.QCOM.index.config.video.LTRUse"*/
461     QOMX_IndexConfigVideoLTRUse = 0x7F000028,
462 
463     /*"OMX.QCOM.index.config.video.LTRMark"*/
464     QOMX_IndexConfigVideoLTRMark = 0x7F000029,
465 
466     /* OMX.google.android.index.prependSPSPPSToIDRFrames */
467     OMX_QcomIndexParamSequenceHeaderWithIDR = 0x7F00002A,
468 
469     OMX_QcomIndexParamH264AUDelimiter = 0x7F00002B,
470 
471     OMX_QcomIndexParamVideoDownScalar = 0x7F00002C,
472 
473     /* "OMX.QCOM.index.param.video.FramePackingExtradata" */
474     OMX_QcomIndexParamVideoFramePackingExtradata = 0x7F00002D,
475 
476     /* "OMX.QCOM.index.config.activeregiondetection" */
477     OMX_QcomIndexConfigActiveRegionDetection = 0x7F00002E,
478 
479     /* "OMX.QCOM.index.config.activeregiondetectionstatus" */
480     OMX_QcomIndexConfigActiveRegionDetectionStatus = 0x7F00002F,
481 
482     /* "OMX.QCOM.index.config.scalingmode" */
483     OMX_QcomIndexConfigScalingMode = 0x7F000030,
484 
485     /* "OMX.QCOM.index.config.noisereduction" */
486     OMX_QcomIndexConfigNoiseReduction = 0x7F000031,
487 
488     /* "OMX.QCOM.index.config.imageenhancement" */
489     OMX_QcomIndexConfigImageEnhancement = 0x7F000032,
490 
491     /* google smooth-streaming support */
492     OMX_QcomIndexParamVideoAdaptivePlaybackMode = 0x7F000033,
493 
494     /* H.264 MVC codec index */
495     QOMX_IndexParamVideoMvc = 0x7F000034,
496 
497     /* "OMX.QCOM.index.param.video.QPExtradata" */
498     OMX_QcomIndexParamVideoQPExtraData = 0x7F000035,
499 
500     /* "OMX.QCOM.index.param.video.InputBitsInfoExtradata" */
501     OMX_QcomIndexParamVideoInputBitsInfoExtraData = 0x7F000036,
502 
503     /* VP8 Hierarchical P support */
504     OMX_QcomIndexHierarchicalStructure = 0x7F000037,
505 
506     OMX_QcomIndexParamPerfLevel = 0x7F000038,
507 
508     OMX_QcomIndexParamH264VUITimingInfo = 0x7F000039,
509 
510     OMX_QcomIndexParamPeakBitrate = 0x7F00003A,
511 
512     /* Enable InitialQP index */
513     QOMX_IndexParamVideoInitialQp = 0x7F00003B,
514 
515     OMX_QcomIndexParamSetMVSearchrange = 0x7F00003C,
516 
517     OMX_QcomIndexConfigPerfLevel = 0x7F00003D,
518 
519     /*"OMX.QCOM.index.param.video.LTRCount"*/
520     OMX_QcomIndexParamVideoLTRCount = QOMX_IndexParamVideoLTRCount,
521 
522     /*"OMX.QCOM.index.config.video.LTRUse"*/
523     OMX_QcomIndexConfigVideoLTRUse = QOMX_IndexConfigVideoLTRUse,
524 
525     /*"OMX.QCOM.index.config.video.LTRMark"*/
526     OMX_QcomIndexConfigVideoLTRMark = QOMX_IndexConfigVideoLTRMark,
527 
528     /*"OMX.QCOM.index.param.video.CustomBufferSize"*/
529     OMX_QcomIndexParamVideoCustomBufferSize = 0x7F00003E,
530 
531     /* Max Hierarchical P layers */
532     OMX_QcomIndexMaxHierarchicallayers = 0x7F000041,
533 
534     /* Set Encoder Performance Index */
535     OMX_QcomIndexConfigVideoVencPerfMode = 0x7F000042,
536 
537     /* Set Hybrid Hier-p layers */
538     OMX_QcomIndexParamVideoHybridHierpMode = 0x7F000043,
539 
540     OMX_QcomIndexFlexibleYUVDescription = 0x7F000044,
541 
542     /* Vpp Hqv Control Type */
543     OMX_QcomIndexParamVppHqvControl = 0x7F000045,
544 
545     /* Enable VPP */
546     OMX_QcomIndexParamEnableVpp = 0x7F000046,
547 
548     /* MBI statistics mode */
549     OMX_QcomIndexParamMBIStatisticsMode = 0x7F000047,
550 
551     /* Set PictureTypeDecode */
552     OMX_QcomIndexConfigPictureTypeDecode = 0x7F000048,
553 
554     OMX_QcomIndexConfigH264EntropyCodingCabac = 0x7F000049,
555 
556     /* "OMX.QCOM.index.param.video.InputBatch" */
557     OMX_QcomIndexParamBatchSize = 0x7F00004A,
558 
559     OMX_QcomIndexConfigNumHierPLayers = 0x7F00004B,
560 
561     OMX_QcomIndexConfigRectType = 0x7F00004C,
562 
563     OMX_QcomIndexConfigBaseLayerId = 0x7F00004E,
564 
565     OMX_QcomIndexParamDriverVersion = 0x7F00004F,
566 
567     OMX_QcomIndexConfigQp = 0x7F000050,
568 
569     OMX_QcomIndexParamVencAspectRatio = 0x7F000051,
570 
571     OMX_QTIIndexParamVQZipSEIExtraData = 0x7F000052,
572 
573     /* Enable VQZIP SEI NAL type */
574     OMX_QTIIndexParamVQZIPSEIType = 0x7F000053,
575 
576     OMX_QTIIndexParamPassInputBufferFd = 0x7F000054,
577 
578     /* Set Prefer-adaptive playback*/
579     /* "OMX.QTI.index.param.video.PreferAdaptivePlayback" */
580     OMX_QTIIndexParamVideoPreferAdaptivePlayback = 0x7F000055,
581 
582     /* Set time params */
583     OMX_QTIIndexConfigSetTimeData = 0x7F000056,
584     /* Force Compressed format for DPB when resolution <=1080p
585      * and OPB is cpu_access */
586     /* OMX.QTI.index.param.video.ForceCompressedForDPB */
587     OMX_QTIIndexParamForceCompressedForDPB = 0x7F000057,
588 
589     /* Enable ROI info */
590     OMX_QTIIndexParamVideoEnableRoiInfo = 0x7F000058,
591 
592     /* Configure ROI info */
593     OMX_QTIIndexConfigVideoRoiInfo = 0x7F000059,
594 
595     /* Encoder Low Latency mode */
596     OMX_QcomIndexConfigVideoVencLowLatencyMode = 0x7F00005A,
597 
598     /* Set Low Latency Mode */
599     OMX_QTIIndexParamLowLatencyMode = 0x7F00005B,
600 
601     /* Force OPB to UnCompressed mode */
602     OMX_QTIIndexParamForceUnCompressedForOPB = 0x7F00005C,
603 
604     /* OMX.google.android.index.allocateNativeHandle */
605     OMX_GoogleAndroidIndexAllocateNativeHandle = 0x7F00005D,
606 
607     /* Configure BLUR resolution for encode */
608     OMX_QTIIndexConfigVideoBlurResolution = 0x7F00005E,
609 
610     /* QP range for I frame B frame P frame */
611     OMX_QcomIndexParamVideoIPBQPRange = 0x7F00005F,
612 
613     /* Enable client extradata */
614     OMX_QTIIndexParamVideoClientExtradata = 0x7F000060,
615 
616     /* H264 transform 8x8 mode */
617     OMX_QcomIndexConfigH264Transform8x8 = 0x7F000061,
618 
619     /*"OMX.google.android.index.describeColorAspects"*/
620     OMX_QTIIndexConfigDescribeColorAspects = 0x7F000062,
621 
622     OMX_QTIIndexParamVUIExtraDataExtraData = 0x7F000063,
623 
624     OMX_QTIIndexParamMPEG2SeqDispExtraData = 0x7F000064,
625 
626     OMX_QTIIndexParamVC1SeqDispExtraData = 0x7F000065,
627 
628     OMX_QTIIndexParamVPXColorSpaceExtraData = 0x7F000066,
629 
630     /*"OMX.google.android.index.describeHDRStaticInfo"*/
631     OMX_QTIIndexConfigDescribeHDRColorInfo = 0x7F000067,
632 
633     /* Configure to disable PQ*/
634     OMX_QTIIndexParamDisablePQ = 0x7F000068,
635 
636     /* Dither control for 10bit */
637     OMX_QTIIndexParamDitherControl = 0x7F000069,
638 
639     /* Suggest how big Iframe sizes should be */
640     OMX_QTIIndexParamIframeSizeType = 0x7F000070,
641 };
642 
643 /**
644 * This is custom extension to configure Low Latency Mode.
645 *
646 * STRUCT MEMBERS
647 *
648 * nSize         : Size of Structure in bytes
649 * nVersion      : OpenMAX IL specification version information
650 * bLowLatencyMode   : Enable/Disable Low Latency mode
651 */
652 
653 typedef struct QOMX_EXTNINDEX_VIDEO_VENC_LOW_LATENCY_MODE
654 {
655    OMX_U32 nSize;
656    OMX_VERSIONTYPE nVersion;
657    OMX_BOOL bLowLatencyMode;
658 } QOMX_EXTNINDEX_VIDEO_VENC_LOW_LATENCY_MODE;
659 
660 /**
661 * This is custom extension to configure Encoder Aspect Ratio.
662 *
663 * STRUCT MEMBERS
664 *
665 * nSize         : Size of Structure in bytes
666 * nVersion      : OpenMAX IL specification version information
667 * nSARWidth     : Horizontal aspect size
668 * nSARHeight    : Vertical aspect size
669 */
670 
671 typedef struct QOMX_EXTNINDEX_VIDEO_VENC_SAR
672 {
673    OMX_U32 nSize;
674    OMX_VERSIONTYPE nVersion;
675    OMX_U32 nSARWidth;
676    OMX_U32 nSARHeight;
677 } QOMX_EXTNINDEX_VIDEO_VENC_SAR;
678 
679 /**
680 * This is custom extension to configure Hier-p layers.
681 * This mode configures Hier-p layers dynamically.
682 *
683 * STRUCT MEMBERS
684 *
685 * nSize         : Size of Structure in bytes
686 * nVersion      : OpenMAX IL specification version information
687 * nNumHierLayers: Set the number of Hier-p layers for the session
688 *                  - This should be less than the MAX Hier-P
689 *                    layers set for the session.
690 */
691 
692 typedef struct QOMX_EXTNINDEX_VIDEO_HIER_P_LAYERS {
693    OMX_U32 nSize;
694    OMX_VERSIONTYPE nVersion;
695    OMX_U32 nNumHierLayers;
696 } QOMX_EXTNINDEX_VIDEO_HIER_P_LAYERS;
697 
698 
699 /**
700 * This is custom extension to configure Hybrid Hier-p settings.
701 * This mode is different from enabling Hier-p mode. This
702 * property enables Hier-p encoding with LTR referencing in each
703 * sub-GOP.
704 *
705 * STRUCT MEMBERS
706 *
707 * nSize         : Size of Structure in bytes
708 * nVersion      : OpenMAX IL specification version information
709 * nKeyFrameInterval : Indicates the I frame interval
710 * nHpLayers     : Set the number of Hier-p layers for the session
711 *                  - This should be <= 6. (1 Base layer +
712 *                    5 Enhancement layers)
713 * nTemporalLayerBitrateRatio[OMX_VIDEO_MAX_HP_LAYERS] : Bitrate to
714 *                    be set for each enhancement layer
715 * nMinQuantizer  : minimum session QP
716 * nMaxQuantizer  : Maximun session QP
717 */
718 
719 typedef struct QOMX_EXTNINDEX_VIDEO_HYBRID_HP_MODE {
720    OMX_U32 nSize;
721    OMX_VERSIONTYPE nVersion;
722    OMX_U32 nKeyFrameInterval;
723    OMX_U32 nTemporalLayerBitrateRatio[OMX_VIDEO_MAX_HP_LAYERS];
724    OMX_U32 nMinQuantizer;
725    OMX_U32 nMaxQuantizer;
726    OMX_U32 nHpLayers;
727 } QOMX_EXTNINDEX_VIDEO_HYBRID_HP_MODE;
728 
729 /**
730  * Encoder Performance Mode.  This structure is used to set
731  * performance mode or power save mode when encoding. The search
732  * range is modified to save power or improve quality.
733  *
734  * STRUCT MEMBERS:
735  * OMX_U32 nPerfMode  : Performance mode:
736  *                                      1: MAX_QUALITY
737  *                                      2: POWER_SAVE
738  */
739 
740 typedef struct QOMX_EXTNINDEX_VIDEO_PERFMODE {
741     OMX_U32 nSize;
742     OMX_VERSIONTYPE nVersion;
743     OMX_U32 nPerfMode;
744 } QOMX_EXTNINDEX_VIDEO_PERFMODE;
745 
746 /**
747  * Initial QP parameter.  This structure is used to enable
748  * vendor specific extension to let client enable setting
749  * initial QP values to I P B Frames
750  *
751  * STRUCT MEMBERS:
752  *  nSize              : Size of Structure in bytes
753  *  nVersion           : OpenMAX IL specification version information
754  *  nPortIndex         : Index of the port to which this structure applies
755  *  OMX_U32 nQpI       : First Iframe QP
756  *  OMX_U32 nQpP       : First Pframe QP
757  *  OMX_U32 nQpB       : First Bframe QP
758  *  OMX_U32 bEnableInitQp : Bit field indicating which frame type(s) shall
759  *                             use the specified initial QP.
760  *                          Bit 0: Enable initial QP for I/IDR
761  *                                 and use value specified in nInitQpI
762  *                          Bit 1: Enable initial QP for P
763  *                                 and use value specified in nInitQpP
764  *                          Bit 2: Enable initial QP for B
765  *                                 and use value specified in nInitQpB
766  */
767 
768 typedef struct QOMX_EXTNINDEX_VIDEO_INITIALQP {
769     OMX_U32 nSize;
770     OMX_VERSIONTYPE nVersion;
771     OMX_U32 nPortIndex;
772     OMX_U32 nQpI;
773     OMX_U32 nQpP;
774     OMX_U32 nQpB;
775     OMX_U32 bEnableInitQp;
776 } QOMX_EXTNINDEX_VIDEO_INITIALQP;
777 
778 /**
779  * Extension index parameter.  This structure is used to enable
780  * vendor specific extension on input/output port and
781  * to pass the required flags and data, if any.
782  * The format of flags and data being passed is known to
783  * the client and component apriori.
784  *
785  * STRUCT MEMBERS:
786  *  nSize              : Size of Structure plus pData size
787  *  nVersion           : OMX specification version information
788  *  nPortIndex         : Indicates which port to set
789  *  bEnable            : Extension index enable (1) or disable (0)
790  *  nFlags             : Extension index flags, if any
791  *  nDataSize          : Size of the extension index data to follow
792  *  pData              : Extension index data, if present.
793  */
794 typedef struct QOMX_EXTNINDEX_PARAMTYPE {
795     OMX_U32 nSize;
796     OMX_VERSIONTYPE nVersion;
797     OMX_U32 nPortIndex;
798     OMX_BOOL bEnable;
799     OMX_U32 nFlags;
800     OMX_U32 nDataSize;
801     OMX_PTR pData;
802 } QOMX_EXTNINDEX_PARAMTYPE;
803 
804 /**
805  * Range index parameter.  This structure is used to enable
806  * vendor specific extension on input/output port and
807  * to pass the required minimum and maximum values
808  *
809  * STRUCT MEMBERS:
810  *  nSize              : Size of Structure in bytes
811  *  nVersion           : OpenMAX IL specification version information
812  *  nPortIndex         : Index of the port to which this structure applies
813  *  nMin               : Minimum value
814  *  nMax               : Maximum value
815  *  nSteSize           : Step size
816  */
817 typedef struct QOMX_EXTNINDEX_RANGETYPE {
818     OMX_U32 nSize;
819     OMX_VERSIONTYPE nVersion;
820     OMX_U32 nPortIndex;
821     OMX_S32 nMin;
822     OMX_S32 nMax;
823     OMX_S32 nStepSize;
824 } QOMX_EXTNINDEX_RANGETYPE;
825 
826 /**
827  *   Specifies LTR mode types.
828  */
829 typedef enum QOMX_VIDEO_LTRMODETYPE
830 {
831     QOMX_VIDEO_LTRMode_Disable    = 0x0, /**< LTR encoding is disabled */
832     QOMX_VIDEO_LTRMode_Manual     = 0x1, /**< In this mode, IL client configures
833                                            **  the encoder the LTR count and manually
834                                            **  controls the marking and use of LTR
835                                            **  frames during video encoding.
836                                            */
837     QOMX_VIDEO_LTRMode_Auto       = 0x2, /**< In this mode, IL client configures
838                                            **  the encoder the LTR count and LTR
839                                            **  period. The encoder marks LTR frames
840                                            **  automatically based on the LTR period
841                                            **  during video encoding. IL client controls
842                                            **  the use of LTR frames.
843                                            */
844     QOMX_VIDEO_LTRMode_MAX    = 0x7FFFFFFF /** Maximum LTR Mode type */
845 } QOMX_VIDEO_LTRMODETYPE;
846 
847 /**
848  * LTR mode index parameter.  This structure is used
849  * to enable vendor specific extension on output port
850  * to pass the LTR mode information.
851  *
852  * STRUCT MEMBERS:
853  *  nSize              : Size of Structure in bytes
854  *  nVersion           : OpenMAX IL specification version information
855  *  nPortIndex         : Index of the port to which this structure applies
856  *  eLTRMode           : Specifies the LTR mode used in encoder
857  */
858 typedef struct QOMX_VIDEO_PARAM_LTRMODE_TYPE {
859     OMX_U32 nSize;
860     OMX_VERSIONTYPE nVersion;
861     OMX_U32 nPortIndex;
862     QOMX_VIDEO_LTRMODETYPE eLTRMode;
863 } QOMX_VIDEO_PARAM_LTRMODE_TYPE;
864 
865 /**
866  * LTR count index parameter.  This structure is used
867  * to enable vendor specific extension on output port
868  * to pass the LTR count information.
869  *
870  * STRUCT MEMBERS:
871  *  nSize              : Size of Structure in bytes
872  *  nVersion           : OpenMAX IL specification version information
873  *  nPortIndex         : Index of the port to which this structure applies
874  *  nCount             : Specifies the number of LTR frames stored in the
875  *                       encoder component
876  */
877 typedef struct QOMX_VIDEO_PARAM_LTRCOUNT_TYPE {
878     OMX_U32 nSize;
879     OMX_VERSIONTYPE nVersion;
880     OMX_U32 nPortIndex;
881     OMX_U32 nCount;
882 } QOMX_VIDEO_PARAM_LTRCOUNT_TYPE;
883 
884 
885 /**
886  * This should be used with OMX_QcomIndexParamVideoLTRCount extension.
887  */
888 typedef QOMX_VIDEO_PARAM_LTRCOUNT_TYPE OMX_QCOM_VIDEO_PARAM_LTRCOUNT_TYPE;
889 
890 /**
891  * LTR period index parameter.  This structure is used
892  * to enable vendor specific extension on output port
893  * to pass the LTR period information.
894  *
895  * STRUCT MEMBERS:
896  *  nSize              : Size of Structure in bytes
897  *  nVersion           : OpenMAX IL specification version information
898  *  nPortIndex         : Index of the port to which this structure applies
899  *  nFrames            : Specifies the number of frames between two consecutive
900  *                       LTR frames.
901  */
902 typedef struct QOMX_VIDEO_CONFIG_LTRPERIOD_TYPE {
903     OMX_U32 nSize;
904     OMX_VERSIONTYPE nVersion;
905     OMX_U32 nPortIndex;
906     OMX_U32 nFrames;
907 } QOMX_VIDEO_CONFIG_LTRPERIOD_TYPE;
908 
909 /**
910  * Marks the next encoded frame as an LTR frame.
911  * STRUCT MEMBERS:
912  *  nSize              : Size of Structure in bytes
913  *  nVersion           : OpenMAX IL specification version information
914  *  nPortIndex         : Index of the port to which this structure applies
915  *  nID                : Specifies the identifier of the LTR frame to be marked
916  *                       as reference frame for encoding subsequent frames.
917  */
918 typedef struct QOMX_VIDEO_CONFIG_LTRMARK_TYPE {
919     OMX_U32 nSize;
920     OMX_VERSIONTYPE nVersion;
921     OMX_U32 nPortIndex;
922     OMX_U32 nID;
923 } QOMX_VIDEO_CONFIG_LTRMARK_TYPE;
924 
925 /**
926  * This should be used with OMX_QcomIndexConfigVideoLTRMark extension.
927  */
928 typedef QOMX_VIDEO_CONFIG_LTRMARK_TYPE OMX_QCOM_VIDEO_CONFIG_LTRMARK_TYPE;
929 
930 /**
931  * Specifies an LTR frame to encode subsequent frames.
932  * STRUCT MEMBERS:
933  *  nSize              : Size of Structure in bytes
934  *  nVersion           : OpenMAX IL specification version information
935  *  nPortIndex         : Index of the port to which this structure applies
936  *  nID                : Specifies the identifier of the LTR frame to be used
937                          as reference frame for encoding subsequent frames.
938  *  nFrames            : Specifies the number of subsequent frames to be
939                          encoded using the LTR frame with its identifier
940                          nID as reference frame. Short-term reference frames
941                          will be used thereafter. The value of 0xFFFFFFFF
942                          indicates that all subsequent frames will be
943                          encodedusing this LTR frame as reference frame.
944  */
945 typedef struct QOMX_VIDEO_CONFIG_LTRUSE_TYPE {
946     OMX_U32 nSize;
947     OMX_VERSIONTYPE nVersion;
948     OMX_U32 nPortIndex;
949     OMX_U32 nID;
950     OMX_U32 nFrames;
951 } QOMX_VIDEO_CONFIG_LTRUSE_TYPE;
952 
953 /**
954  * This should be used with OMX_QcomIndexConfigVideoLTRUse extension.
955  */
956 typedef QOMX_VIDEO_CONFIG_LTRUSE_TYPE OMX_QCOM_VIDEO_CONFIG_LTRUSE_TYPE;
957 
958 /**
959  * Enumeration used to define the video encoder modes
960  *
961  * ENUMS:
962  *  EncoderModeDefault : Default video recording mode.
963  *                       All encoder settings made through
964  *                       OMX_SetParameter/OMX_SetConfig are applied. No
965  *                       parameter is overridden.
966  *  EncoderModeMMS : Video recording mode for MMS (Multimedia Messaging
967  *                   Service). This mode is similar to EncoderModeDefault
968  *                   except that here the Rate control mode is overridden
969  *                   internally and set as a variant of variable bitrate with
970  *                   variable frame rate. After this mode is set if the IL
971  *                   client tries to set OMX_VIDEO_CONTROLRATETYPE via
972  *                   OMX_IndexParamVideoBitrate that would be rejected. For
973  *                   this, client should set mode back to EncoderModeDefault
974  *                   first and then change OMX_VIDEO_CONTROLRATETYPE.
975  */
976 typedef enum QOMX_VIDEO_ENCODERMODETYPE
977 {
978     QOMX_VIDEO_EncoderModeDefault        = 0x00,
979     QOMX_VIDEO_EncoderModeMMS            = 0x01,
980     QOMX_VIDEO_EncoderModeMax            = 0x7FFFFFFF
981 } QOMX_VIDEO_ENCODERMODETYPE;
982 
983 /**
984  * This structure is used to set the video encoder mode.
985  *
986  * STRUCT MEMBERS:
987  *  nSize      : Size of the structure in bytes
988  *  nVersion   : OMX specification version info
989  *  nPortIndex : Port that this structure applies to
990  *  nMode : defines the video encoder mode
991  */
992 typedef struct QOMX_VIDEO_PARAM_ENCODERMODETYPE {
993     OMX_U32 nSize;
994     OMX_VERSIONTYPE nVersion;
995     OMX_U32 nPortIndex;
996     QOMX_VIDEO_ENCODERMODETYPE nMode;
997 } QOMX_VIDEO_PARAM_ENCODERMODETYPE;
998 
999 /**
1000  * This structure describes the parameters corresponding to the
1001  * QOMX_VIDEO_SYNTAXHDRTYPE extension. This parameter can be queried
1002  * during the loaded state.
1003  */
1004 
1005 typedef struct QOMX_VIDEO_SYNTAXHDRTYPE
1006 {
1007    OMX_U32 nSize;           /** Size of the structure in bytes */
1008    OMX_VERSIONTYPE nVersion;/** OMX specification version information */
1009    OMX_U32 nPortIndex;      /** Portindex which is extended by this structure */
1010    OMX_U32 nBytes;          /** The number of bytes filled in to the buffer */
1011    OMX_U8 data[1];          /** Buffer to store the header information */
1012 } QOMX_VIDEO_SYNTAXHDRTYPE;
1013 
1014 /**
1015  * This structure describes the parameters corresponding to the
1016  * QOMX_VIDEO_TEMPORALSPATIALTYPE extension. This parameter can be set
1017  * dynamically during any state except the state invalid.  This is primarily
1018  * used for setting MaxQP from the application.  This is set on the out port.
1019  */
1020 
1021 typedef struct QOMX_VIDEO_TEMPORALSPATIALTYPE
1022 {
1023    OMX_U32 nSize;           /** Size of the structure in bytes */
1024    OMX_VERSIONTYPE nVersion;/** OMX specification version information */
1025    OMX_U32 nPortIndex;      /** Portindex which is extended by this structure */
1026    OMX_U32 nTSFactor;       /** Temoral spatial tradeoff factor value in 0-100 */
1027 } QOMX_VIDEO_TEMPORALSPATIALTYPE;
1028 
1029 /**
1030  * This structure describes the parameters corresponding to the
1031  * OMX_QCOM_VIDEO_CONFIG_INTRAPERIODTYPE extension. This parameter can be set
1032  * dynamically during any state except the state invalid.  This is set on the out port.
1033  */
1034 
1035 typedef struct QOMX_VIDEO_INTRAPERIODTYPE
1036 {
1037    OMX_U32 nSize;           /** Size of the structure in bytes */
1038    OMX_VERSIONTYPE nVersion;/** OMX specification version information */
1039    OMX_U32 nPortIndex;      /** Portindex which is extended by this structure */
1040    OMX_U32 nIDRPeriod;      /** This specifies coding a frame as IDR after every nPFrames
1041                                 of intra frames. If this parameter is set to 0, only the
1042                                 first frame of the encode session is an IDR frame. This
1043                                 field is ignored for non-AVC codecs and is used only for
1044                                 codecs that support IDR Period */
1045    OMX_U32 nPFrames;         /** The number of "P" frames between two "I" frames */
1046    OMX_U32 nBFrames;         /** The number of "B" frames between two "I" frames */
1047 } QOMX_VIDEO_INTRAPERIODTYPE;
1048 
1049 /**
1050  * This structure describes the parameters corresponding to the
1051  * OMX_QCOM_VIDEO_CONFIG_ULBUFFEROCCUPANCYTYPE extension. This parameter can be set
1052  * dynamically during any state except the state invalid. This is used for the buffer negotiation
1053  * with other clients.  This is set on the out port.
1054  */
1055 typedef struct OMX_QCOM_VIDEO_CONFIG_ULBUFFEROCCUPANCYTYPE
1056 {
1057    OMX_U32 nSize;            /** Size of the structure in bytes */
1058    OMX_VERSIONTYPE nVersion; /** OMX specification version information */
1059    OMX_U32 nPortIndex;       /** Portindex which is extended by this structure */
1060    OMX_U32 nBufferOccupancy; /** The number of bytes to be set for the buffer occupancy */
1061 } OMX_QCOM_VIDEO_CONFIG_ULBUFFEROCCUPANCYTYPE;
1062 
1063 /**
1064  * This structure describes the parameters corresponding to the
1065  * OMX_QCOM_VIDEO_CONFIG_RANDOMINTRAREFRESHTYPE extension. This parameter can be set
1066  * dynamically during any state except the state invalid. This is primarily used for the dynamic/random
1067  * intrarefresh.  This is set on the out port.
1068  */
1069 typedef struct OMX_QCOM_VIDEO_CONFIG_RANDOMINTRAREFRESHTYPE
1070 {
1071    OMX_U32 nSize;           /** Size of the structure in bytes */
1072    OMX_VERSIONTYPE nVersion;/** OMX specification version information */
1073    OMX_U32 nPortIndex;      /** Portindex which is extended by this structure */
1074    OMX_U32 nRirMBs;         /** The number of MBs to be set for intrarefresh */
1075 } OMX_QCOM_VIDEO_CONFIG_RANDOMINTRAREFRESHTYPE;
1076 
1077 
1078 /**
1079  * This structure describes the parameters corresponding to the
1080  * OMX_QCOM_VIDEO_CONFIG_QPRANGE extension. This parameter can be set
1081  * dynamically during any state except the state invalid. This is primarily
1082  * used for the min/max QP to be set from the application.  This
1083  * is set on the out port.
1084  */
1085 typedef struct OMX_QCOM_VIDEO_CONFIG_QPRANGE
1086 {
1087    OMX_U32 nSize;           /** Size of the structure in bytes */
1088    OMX_VERSIONTYPE nVersion;/** OMX specification version information */
1089    OMX_U32 nPortIndex;      /** Portindex which is extended by this structure */
1090    OMX_U32 nMinQP;          /** The number for minimum quantization parameter */
1091    OMX_U32 nMaxQP;          /** The number for maximum quantization parameter */
1092 } OMX_QCOM_VIDEO_CONFIG_QPRANGE;
1093 
1094 /**
1095  * This structure describes the parameters for the
1096  * OMX_QcomIndexParamH264AUDelimiter extension.  It enables/disables
1097  * the AU delimiters in the H264 stream, which is used by WFD.
1098  */
1099 typedef struct OMX_QCOM_VIDEO_CONFIG_H264_AUD
1100 {
1101    OMX_U32 nSize;           /** Size of the structure in bytes */
1102    OMX_VERSIONTYPE nVersion;/** OMX specification version information */
1103    OMX_BOOL bEnable;        /** Enable/disable the setting */
1104 } OMX_QCOM_VIDEO_CONFIG_H264_AUD;
1105 
1106 typedef enum QOMX_VIDEO_PERF_LEVEL
1107 {
1108     OMX_QCOM_PerfLevelNominal,
1109     OMX_QCOM_PerfLevelTurbo
1110 } QOMX_VIDEO_PERF_LEVEL;
1111 
1112 /**
1113  * This structure describes the parameters corresponding
1114  * to OMX_QcomIndexParamPerfLevel extension. It will set
1115  * the performance mode specified as QOMX_VIDEO_PERF_LEVEL.
1116  */
1117 typedef struct OMX_QCOM_VIDEO_PARAM_PERF_LEVEL {
1118     OMX_U32 nSize;                      /** Size of the structure in bytes */
1119     OMX_VERSIONTYPE nVersion;           /** OMX specification version information */
1120     QOMX_VIDEO_PERF_LEVEL ePerfLevel;   /** Performance level */
1121 } OMX_QCOM_VIDEO_PARAM_PERF_LEVEL;
1122 
1123 /**
1124  * This structure describes the parameters corresponding
1125  * to OMX_QcomIndexConfigPerfLevel extension. It will set
1126  * the performance mode specified as QOMX_VIDEO_PERF_LEVEL.
1127  */
1128 typedef struct OMX_QCOM_VIDEO_CONFIG_PERF_LEVEL {
1129     OMX_U32 nSize;                      /** Size of the structure in bytes */
1130     OMX_VERSIONTYPE nVersion;           /** OMX specification version information */
1131     QOMX_VIDEO_PERF_LEVEL ePerfLevel;   /** Performance level */
1132 } OMX_QCOM_VIDEO_CONFIG_PERF_LEVEL;
1133 
1134 typedef enum QOMX_VIDEO_PICTURE_TYPE_DECODE
1135 {
1136     OMX_QCOM_PictypeDecode_IPB,
1137     OMX_QCOM_PictypeDecode_I
1138 } QOMX_VIDEO_PICTURE_TYPE_DECODE;
1139 
1140 /**
1141  * This structure describes the parameters corresponding
1142  * to OMX_QcomIndexConfigPictureTypeDecode extension. It
1143  * will set the picture type decode specified by eDecodeType.
1144  */
1145 typedef struct OMX_QCOM_VIDEO_CONFIG_PICTURE_TYPE_DECODE {
1146     OMX_U32 nSize;                      /** Size of the structure in bytes */
1147     OMX_VERSIONTYPE nVersion;           /** OMX specification version information */
1148     QOMX_VIDEO_PICTURE_TYPE_DECODE eDecodeType;   /** Decode type */
1149 } OMX_QCOM_VIDEO_CONFIG_PICTURE_TYPE_DECODE;
1150 
1151 /**
1152  * This structure describes the parameters corresponding
1153  * to OMX_QcomIndexParamH264VUITimingInfo extension. It
1154  * will enable/disable the VUI timing info.
1155  */
1156 typedef struct OMX_QCOM_VIDEO_PARAM_VUI_TIMING_INFO {
1157     OMX_U32 nSize;              /** Size of the structure in bytes */
1158     OMX_VERSIONTYPE nVersion;   /** OMX specification version information */
1159     OMX_BOOL bEnable;           /** Enable/disable the setting */
1160 } OMX_QCOM_VIDEO_PARAM_VUI_TIMING_INFO;
1161 
1162 /**
1163  * This structure describes the parameters corresponding
1164  * to OMX_QcomIndexParamVQZIPSEIType extension. It
1165  * will enable/disable the VQZIP SEI info.
1166  */
1167 typedef struct OMX_QTI_VIDEO_PARAM_VQZIP_SEI_TYPE {
1168     OMX_U32 nSize;              /** Size of the structure in bytes */
1169     OMX_VERSIONTYPE nVersion;   /** OMX specification version information */
1170     OMX_BOOL bEnable;           /** Enable/disable the setting */
1171 } OMX_QTI_VIDEO_PARAM_VQZIP_SEI_TYPE;
1172 
1173 /**
1174  * This structure describes the parameters corresponding
1175  * to OMX_QcomIndexParamPeakBitrate extension. It will
1176  * set the peak bitrate specified by nPeakBitrate.
1177  */
1178 typedef struct OMX_QCOM_VIDEO_PARAM_PEAK_BITRATE {
1179     OMX_U32 nSize;              /** Size of the structure in bytes */
1180     OMX_VERSIONTYPE nVersion;   /** OMX specification version information */
1181     OMX_U32 nPeakBitrate;       /** Peak bitrate value */
1182 } OMX_QCOM_VIDEO_PARAM_PEAK_BITRATE;
1183 
1184 /**
1185  * This structure describes the parameters corresponding
1186  * to OMX_QTIIndexParamForceCompressedForDPB extension. Enabling
1187  * this extension will force the split mode DPB(compressed)/OPB(Linear)
1188  * for all resolutions.On some chipsets preferred mode would be combined
1189  * Linear for both DPB/OPB to save memory. For example on 8996 preferred mode
1190  * would be combined linear for resolutions <= 1080p .
1191  * Enabling this might save power but with the cost
1192  * of increased memory i.e almost double the number on output YUV buffers.
1193  */
1194 typedef struct OMX_QTI_VIDEO_PARAM_FORCE_COMPRESSED_FOR_DPB_TYPE {
1195     OMX_U32 nSize;              /** Size of the structure in bytes */
1196     OMX_VERSIONTYPE nVersion;   /** OMX specification version information */
1197     OMX_BOOL bEnable;           /** Enable/disable the setting */
1198 } OMX_QTI_VIDEO_PARAM_FORCE_COMPRESSED_FOR_DPB_TYPE;
1199 
1200 /**
1201  * This structure describes the parameters corresponding
1202  * to OMX_QTIIndexParamForceUnCompressedForOPB extension. Enabling this
1203  * extension will force the OPB to be linear for the current video session.
1204  * If this property is not set, then the OPB will be set to linear or compressed
1205  * based on resolution selected and/or if cpu access is requested on the
1206  * OPB buffer.
1207  */
1208 typedef struct OMX_QTI_VIDEO_PARAM_FORCE_UNCOMPRESSED_FOR_OPB_TYPE {
1209     OMX_U32 nSize;              /** Sizeo f the structure in bytes */
1210     OMX_VERSIONTYPE nVersion;   /** OMX specification version information */
1211     OMX_BOOL bEnable;           /** Enable/disable the setting */
1212 } OMX_QTI_VIDEO_PARAM_FORCE_UNCOMPRESSED_FOR_OPB_TYPE;
1213 
1214 typedef struct OMX_VENDOR_EXTRADATATYPE  {
1215     OMX_U32 nPortIndex;
1216     OMX_U32 nDataSize;
1217     OMX_U8  *pData;     // cdata (codec_data/extradata)
1218 } OMX_VENDOR_EXTRADATATYPE;
1219 
1220 /**
1221  * This structure describes the parameters corresponding to the
1222  * OMX_VENDOR_VIDEOFRAMERATE extension. This parameter can be set
1223  * dynamically during any state except the state invalid. This is
1224  * used for frame rate to be set from the application. This
1225  * is set on the in port.
1226  */
1227 typedef struct OMX_VENDOR_VIDEOFRAMERATE  {
1228    OMX_U32 nSize;           /** Size of the structure in bytes */
1229    OMX_VERSIONTYPE nVersion;/** OMX specification version information */
1230    OMX_U32 nPortIndex;      /** Portindex which is extended by this structure */
1231    OMX_U32 nFps;            /** Frame rate value */
1232    OMX_BOOL bEnabled;       /** Flag to enable or disable client's frame rate value */
1233 } OMX_VENDOR_VIDEOFRAMERATE;
1234 
1235 typedef enum OMX_INDEXVENDORTYPE {
1236     OMX_IndexVendorFileReadInputFilename = 0xFF000001,
1237     OMX_IndexVendorParser3gpInputFilename = 0xFF000002,
1238     OMX_IndexVendorVideoExtraData = 0xFF000003,
1239     OMX_IndexVendorAudioExtraData = 0xFF000004,
1240     OMX_IndexVendorVideoFrameRate = 0xFF000005,
1241 } OMX_INDEXVENDORTYPE;
1242 
1243 typedef enum OMX_QCOM_VC1RESOLUTIONTYPE
1244 {
1245    OMX_QCOM_VC1_PICTURE_RES_1x1,
1246    OMX_QCOM_VC1_PICTURE_RES_2x1,
1247    OMX_QCOM_VC1_PICTURE_RES_1x2,
1248    OMX_QCOM_VC1_PICTURE_RES_2x2
1249 } OMX_QCOM_VC1RESOLUTIONTYPE;
1250 
1251 typedef enum OMX_QCOM_INTERLACETYPE
1252 {
1253     OMX_QCOM_InterlaceFrameProgressive,
1254     OMX_QCOM_InterlaceInterleaveFrameTopFieldFirst,
1255     OMX_QCOM_InterlaceInterleaveFrameBottomFieldFirst,
1256     OMX_QCOM_InterlaceFrameTopFieldFirst,
1257     OMX_QCOM_InterlaceFrameBottomFieldFirst,
1258     OMX_QCOM_InterlaceFieldTop,
1259     OMX_QCOM_InterlaceFieldBottom
1260 }OMX_QCOM_INTERLACETYPE;
1261 
1262 typedef struct OMX_QCOM_PARAM_VIDEO_INTERLACETYPE
1263 {
1264     OMX_U32 nSize;           /** Size of the structure in bytes */
1265     OMX_VERSIONTYPE nVersion;/** OMX specification version information */
1266     OMX_U32 nPortIndex;    /** Portindex which is extended by this structure */
1267     OMX_BOOL bInterlace;  /** Interlace content **/
1268 }OMX_QCOM_PARAM_VIDEO_INTERLACETYPE;
1269 
1270 typedef struct OMX_QCOM_CONFIG_INTERLACETYPE
1271 {
1272     OMX_U32 nSize;
1273     OMX_VERSIONTYPE nVersion;
1274     OMX_U32 nPortIndex;
1275     OMX_U32 nIndex;
1276     OMX_QCOM_INTERLACETYPE eInterlaceType;
1277 }OMX_QCOM_CONFIG_INTERLACETYPE;
1278 
1279 #define MAX_PAN_SCAN_WINDOWS 4
1280 
1281 typedef struct OMX_QCOM_PANSCAN
1282 {
1283    OMX_U32 numWindows;
1284    OMX_QCOMRectangle window[MAX_PAN_SCAN_WINDOWS];
1285 } OMX_QCOM_PANSCAN;
1286 
1287 typedef struct OMX_QCOM_ASPECT_RATIO
1288 {
1289    OMX_U32 aspectRatioX;
1290    OMX_U32 aspectRatioY;
1291 } OMX_QCOM_ASPECT_RATIO;
1292 
1293 typedef struct OMX_QCOM_DISPLAY_ASPECT_RATIO
1294 {
1295    OMX_U32 displayVerticalSize;
1296    OMX_U32 displayHorizontalSize;
1297 } OMX_QCOM_DISPLAY_ASPECT_RATIO;
1298 
1299 typedef struct OMX_QCOM_FRAME_PACK_ARRANGEMENT
1300 {
1301   OMX_U32 nSize;
1302   OMX_VERSIONTYPE nVersion;
1303   OMX_U32 nPortIndex;
1304   OMX_U32 id;
1305   OMX_U32 cancel_flag;
1306   OMX_U32 type;
1307   OMX_U32 quincunx_sampling_flag;
1308   OMX_U32 content_interpretation_type;
1309   OMX_U32 spatial_flipping_flag;
1310   OMX_U32 frame0_flipped_flag;
1311   OMX_U32 field_views_flag;
1312   OMX_U32 current_frame_is_frame0_flag;
1313   OMX_U32 frame0_self_contained_flag;
1314   OMX_U32 frame1_self_contained_flag;
1315   OMX_U32 frame0_grid_position_x;
1316   OMX_U32 frame0_grid_position_y;
1317   OMX_U32 frame1_grid_position_x;
1318   OMX_U32 frame1_grid_position_y;
1319   OMX_U32 reserved_byte;
1320   OMX_U32 repetition_period;
1321   OMX_U32 extension_flag;
1322 } OMX_QCOM_FRAME_PACK_ARRANGEMENT;
1323 
1324 typedef struct OMX_QCOM_EXTRADATA_QP
1325 {
1326    OMX_U32        nQP;
1327 } OMX_QCOM_EXTRADATA_QP;
1328 
1329 typedef struct OMX_QCOM_EXTRADATA_BITS_INFO
1330 {
1331    OMX_U32 header_bits;
1332    OMX_U32 frame_bits;
1333 } OMX_QCOM_EXTRADATA_BITS_INFO;
1334 
1335 typedef struct OMX_QCOM_EXTRADATA_USERDATA {
1336    OMX_U32 type;
1337    OMX_U32 data[1];
1338 } OMX_QCOM_EXTRADATA_USERDATA;
1339 
1340 typedef struct OMX_QCOM_EXTRADATA_FRAMEINFO
1341 {
1342    // common frame meta data. interlace related info removed
1343    OMX_VIDEO_PICTURETYPE  ePicType;
1344    OMX_QCOM_INTERLACETYPE interlaceType;
1345    OMX_QCOM_PANSCAN       panScan;
1346    OMX_QCOM_ASPECT_RATIO  aspectRatio;
1347    OMX_QCOM_DISPLAY_ASPECT_RATIO displayAspectRatio;
1348    OMX_U32                nConcealedMacroblocks;
1349    OMX_U32                nRecoverySeiFlag;
1350    OMX_U32                nFrameRate;
1351    OMX_TICKS              nTimeStamp;
1352 } OMX_QCOM_EXTRADATA_FRAMEINFO;
1353 
1354 typedef struct OMX_QCOM_EXTRADATA_FRAMEDIMENSION
1355 {
1356    /** Frame Dimensions added to each YUV buffer */
1357    OMX_U32   nDecWidth;  /** Width  rounded to multiple of 16 */
1358    OMX_U32   nDecHeight; /** Height rounded to multiple of 16 */
1359    OMX_U32   nActualWidth; /** Actual Frame Width */
1360    OMX_U32   nActualHeight; /** Actual Frame Height */
1361 
1362 } OMX_QCOM_EXTRADATA_FRAMEDIMENSION;
1363 
1364 typedef struct OMX_QCOM_H264EXTRADATA
1365 {
1366    OMX_U64 seiTimeStamp;
1367 } OMX_QCOM_H264EXTRADATA;
1368 
1369 typedef struct OMX_QCOM_VC1EXTRADATA
1370 {
1371    OMX_U32                     nVC1RangeY;
1372    OMX_U32                     nVC1RangeUV;
1373    OMX_QCOM_VC1RESOLUTIONTYPE eVC1PicResolution;
1374 } OMX_QCOM_VC1EXTRADATA;
1375 
1376 typedef union OMX_QCOM_EXTRADATA_CODEC_DATA
1377 {
1378    OMX_QCOM_H264EXTRADATA h264ExtraData;
1379    OMX_QCOM_VC1EXTRADATA vc1ExtraData;
1380 } OMX_QCOM_EXTRADATA_CODEC_DATA;
1381 
1382 typedef struct OMX_QCOM_EXTRADATA_MBINFO
1383 {
1384    OMX_U32 nFormat;
1385    OMX_U32 nDataSize;
1386    OMX_U8  data[0];
1387 } OMX_QCOM_EXTRADATA_MBINFO;
1388 
1389 typedef struct OMX_QCOM_EXTRADATA_VQZIPSEI {
1390     OMX_U32 nSize;
1391     OMX_U8 data[0];
1392 } OMX_QCOM_EXTRADATA_VQZIPSEI;
1393 
1394 typedef struct OMX_QTI_VIDEO_PARAM_ENABLE_ROIINFO {
1395     OMX_U32         nSize;
1396     OMX_VERSIONTYPE nVersion;
1397     OMX_U32         nPortIndex;
1398     OMX_BOOL        bEnableRoiInfo;
1399 } OMX_QTI_VIDEO_PARAM_ENABLE_ROIINFO;
1400 
1401 typedef struct OMX_QTI_VIDEO_CONFIG_ROIINFO {
1402     OMX_U32         nSize;
1403     OMX_VERSIONTYPE nVersion;
1404     OMX_U32         nPortIndex;
1405     OMX_S32         nUpperQpOffset;
1406     OMX_S32         nLowerQpOffset;
1407     OMX_BOOL        bUseRoiInfo;
1408     OMX_S32         nRoiMBInfoSize;
1409     OMX_PTR         pRoiMBInfo;
1410 } OMX_QTI_VIDEO_CONFIG_ROIINFO;
1411 
1412 typedef enum OMX_QTI_VIDEO_BLUR_RESOLUTION {
1413     BLUR_RESOL_DISABLED = 0,
1414     BLUR_RESOL_240      = 1,
1415     BLUR_RESOL_480      = 2,
1416     BLUR_RESOL_720      = 3,
1417     BLUR_RESOL_1080     = 4,
1418 } OMX_QTI_VIDEO_BLUR_RESOLUTION;
1419 
1420 typedef struct OMX_QTI_VIDEO_CONFIG_BLURINFO {
1421     OMX_U32         nSize;
1422     OMX_VERSIONTYPE nVersion;
1423     OMX_U32         nPortIndex;
1424     OMX_QTI_VIDEO_BLUR_RESOLUTION eTargetResol;
1425 } OMX_QTI_VIDEO_CONFIG_BLURINFO;
1426 
1427 typedef enum OMX_QCOM_EXTRADATATYPE
1428 {
1429     OMX_ExtraDataFrameInfo =               0x7F000001,
1430     OMX_ExtraDataH264 =                    0x7F000002,
1431     OMX_ExtraDataVC1 =                     0x7F000003,
1432     OMX_ExtraDataFrameDimension =          0x7F000004,
1433     OMX_ExtraDataVideoEncoderSliceInfo =   0x7F000005,
1434     OMX_ExtraDataConcealMB =               0x7F000006,
1435     OMX_ExtraDataInterlaceFormat =         0x7F000007,
1436     OMX_ExtraDataPortDef =                 0x7F000008,
1437     OMX_ExtraDataMP2ExtnData =             0x7F000009,
1438     OMX_ExtraDataMP2UserData =             0x7F00000a,
1439     OMX_ExtraDataVideoLTRInfo =            0x7F00000b,
1440     OMX_ExtraDataFramePackingArrangement = 0x7F00000c,
1441     OMX_ExtraDataQP =                      0x7F00000d,
1442     OMX_ExtraDataInputBitsInfo =           0x7F00000e,
1443     OMX_ExtraDataVideoEncoderMBInfo =      0x7F00000f,
1444     OMX_ExtraDataVQZipSEI  =               0x7F000010,
1445     OMX_ExtraDataDisplayColourSEI =        0x7F000011,
1446     OMX_ExtraDataLightLevelSEI =           0x7F000012,
1447     OMX_ExtraDataEncoderOverrideQPInfo =   0x7F000013,
1448 } OMX_QCOM_EXTRADATATYPE;
1449 
1450 typedef struct  OMX_STREAMINTERLACEFORMATTYPE {
1451     OMX_U32 nSize;
1452     OMX_VERSIONTYPE nVersion;
1453     OMX_U32 nPortIndex;
1454     OMX_BOOL bInterlaceFormat;
1455     OMX_U32 nInterlaceFormats;
1456 } OMX_STREAMINTERLACEFORMAT;
1457 
1458 typedef enum OMX_INTERLACETYPE
1459 {
1460    OMX_InterlaceFrameProgressive,
1461    OMX_InterlaceInterleaveFrameTopFieldFirst,
1462    OMX_InterlaceInterleaveFrameBottomFieldFirst,
1463    OMX_InterlaceFrameTopFieldFirst,
1464    OMX_InterlaceFrameBottomFieldFirst
1465 } OMX_INTERLACES;
1466 
1467 typedef enum QOMX_VIDEO_RECOVERYSEITYPE {
1468 /*
1469  * 0: Frame reconstruction is incorrect
1470  *   a) Open Gop, frames before recovery point SEI
1471  * 1: Frame reconstruction is correct.
1472  *   a) Closed Gop, When decoding starts from the top of closed GOP at IDR
1473  *   b) Open Gop, Output at and subsequent to recovery point SEI with
1474  *      exact_match_flag = true
1475  * 2: Frame reconstruction is approximately correct:
1476  *   a) Closed Gop, When decoding starts from a P/B/I frames wihtout
1477  *      any recovery point SEI information
1478  *   b) Open Gop, Output at and subsequent to recovery point SEI with
1479  *      exact_match_flag = false
1480  * In case flag is set to 0 or 2, DATACORRUPT shall be enabled
1481  * for buffer (nFlags) in FILL_BUFFER_DONE
1482  */
1483     OMX_FRAME_RECONSTRUCTION_INCORRECT = 0,
1484     OMX_FRAME_RECONSTRUCTION_CORRECT = 1,
1485     OMX_FRAME_RECONSTRUCTION_APPROXIMATELY_CORRECT = 2
1486 } QOMX_VIDEO_RECOVERYSEI;
1487 
1488 #define OMX_EXTRADATA_HEADER_SIZE 20
1489 
1490 /**
1491  * AVC profile types, each profile indicates support for various
1492  * performance bounds and different annexes.
1493  */
1494 typedef enum QOMX_VIDEO_AVCPROFILETYPE {
1495     QOMX_VIDEO_AVCProfileBaseline      = OMX_VIDEO_AVCProfileBaseline,
1496     QOMX_VIDEO_AVCProfileMain          = OMX_VIDEO_AVCProfileMain,
1497     QOMX_VIDEO_AVCProfileExtended      = OMX_VIDEO_AVCProfileExtended,
1498     QOMX_VIDEO_AVCProfileHigh          = OMX_VIDEO_AVCProfileHigh,
1499     QOMX_VIDEO_AVCProfileHigh10        = OMX_VIDEO_AVCProfileHigh10,
1500     QOMX_VIDEO_AVCProfileHigh422       = OMX_VIDEO_AVCProfileHigh422,
1501     QOMX_VIDEO_AVCProfileHigh444       = OMX_VIDEO_AVCProfileHigh444,
1502     /* QCom specific profile indexes */
1503     QOMX_VIDEO_AVCProfileConstrained           = OMX_VIDEO_AVCProfileVendorStartUnused,
1504     QOMX_VIDEO_AVCProfileConstrainedBaseline,
1505     QOMX_VIDEO_AVCProfileConstrainedHigh,
1506 } QOMX_VIDEO_AVCPROFILETYPE;
1507 
1508 
1509 /**
1510  * H.264 MVC Profiles
1511   */
1512 typedef enum QOMX_VIDEO_MVCPROFILETYPE {
1513     QOMX_VIDEO_MVCProfileStereoHigh = 0x1,
1514     QOMX_VIDEO_MVCProfileMultiViewHigh = 0x2,
1515     QOMX_VIDEO_MVCProfileKhronosExtensions = 0x6F000000,
1516     QOMX_VIDEO_MVCProfileVendorStartUnused = 0x7F000000,
1517     QOMX_VIDEO_MVCProfileMax = 0x7FFFFFFF
1518 } QOMX_VIDEO_MVCPROFILETYPE;
1519 
1520 /**
1521  * H.264 MVC Levels
1522   */
1523 typedef enum QOMX_VIDEO_MVCLEVELTYPE {
1524     QOMX_VIDEO_MVCLevel1   = 0x01,     /**< Level 1 */
1525     QOMX_VIDEO_MVCLevel1b  = 0x02,     /**< Level 1b */
1526     QOMX_VIDEO_MVCLevel11  = 0x04,     /**< Level 1.1 */
1527     QOMX_VIDEO_MVCLevel12  = 0x08,     /**< Level 1.2 */
1528     QOMX_VIDEO_MVCLevel13  = 0x10,     /**< Level 1.3 */
1529     QOMX_VIDEO_MVCLevel2   = 0x20,     /**< Level 2 */
1530     QOMX_VIDEO_MVCLevel21  = 0x40,     /**< Level 2.1 */
1531     QOMX_VIDEO_MVCLevel22  = 0x80,     /**< Level 2.2 */
1532     QOMX_VIDEO_MVCLevel3   = 0x100,    /**< Level 3 */
1533     QOMX_VIDEO_MVCLevel31  = 0x200,    /**< Level 3.1 */
1534     QOMX_VIDEO_MVCLevel32  = 0x400,    /**< Level 3.2 */
1535     QOMX_VIDEO_MVCLevel4   = 0x800,    /**< Level 4 */
1536     QOMX_VIDEO_MVCLevel41  = 0x1000,   /**< Level 4.1 */
1537     QOMX_VIDEO_MVCLevel42  = 0x2000,   /**< Level 4.2 */
1538     QOMX_VIDEO_MVCLevel5   = 0x4000,   /**< Level 5 */
1539     QOMX_VIDEO_MVCLevel51  = 0x8000,   /**< Level 5.1 */
1540     QOMX_VIDEO_MVCLevelKhronosExtensions = 0x6F000000,
1541     QOMX_VIDEO_MVCLevelVendorStartUnused = 0x7F000000,
1542     QOMX_VIDEO_MVCLevelMax = 0x7FFFFFFF
1543 } QOMX_VIDEO_MVCLEVELTYPE;
1544 
1545 /**
1546  * DivX Versions
1547  */
1548 typedef enum  QOMX_VIDEO_DIVXFORMATTYPE {
1549     QOMX_VIDEO_DIVXFormatUnused = 0x01, /**< Format unused or unknown */
1550     QOMX_VIDEO_DIVXFormat311    = 0x02, /**< DivX 3.11 */
1551     QOMX_VIDEO_DIVXFormat4      = 0x04, /**< DivX 4 */
1552     QOMX_VIDEO_DIVXFormat5      = 0x08, /**< DivX 5 */
1553     QOMX_VIDEO_DIVXFormat6      = 0x10, /**< DivX 6 */
1554     QOMX_VIDEO_DIVXFormatKhronosExtensions = 0x6F000000,
1555     QOMX_VIDEO_DIVXFormatVendorStartUnused = 0x7F000000,
1556     QOMX_VIDEO_DIVXFormatMax = 0x7FFFFFFF
1557 } QOMX_VIDEO_DIVXFORMATTYPE;
1558 
1559 /**
1560  * DivX profile types, each profile indicates support for
1561  * various performance bounds.
1562  */
1563 typedef enum QOMX_VIDEO_DIVXPROFILETYPE {
1564     QOMX_VIDEO_DivXProfileqMobile = 0x01, /**< qMobile Profile */
1565     QOMX_VIDEO_DivXProfileMobile  = 0x02, /**< Mobile Profile */
1566     QOMX_VIDEO_DivXProfileMT      = 0x04, /**< Mobile Theatre Profile */
1567     QOMX_VIDEO_DivXProfileHT      = 0x08, /**< Home Theatre Profile */
1568     QOMX_VIDEO_DivXProfileHD      = 0x10, /**< High Definition Profile */
1569     QOMX_VIDEO_DIVXProfileKhronosExtensions = 0x6F000000,
1570     QOMX_VIDEO_DIVXProfileVendorStartUnused = 0x7F000000,
1571     QOMX_VIDEO_DIVXProfileMax = 0x7FFFFFFF
1572 } QOMX_VIDEO_DIVXPROFILETYPE;
1573 
1574 /**
1575  * DivX Video Params
1576  *
1577  *  STRUCT MEMBERS:
1578  *  nSize      : Size of the structure in bytes
1579  *  nVersion   : OMX specification version information
1580  *  nPortIndex : Port that this structure applies to
1581  *  eFormat    : Version of DivX stream / data
1582  *  eProfile   : Profile of DivX stream / data
1583  */
1584 typedef struct QOMX_VIDEO_PARAM_DIVXTYPE {
1585     OMX_U32 nSize;
1586     OMX_VERSIONTYPE nVersion;
1587     OMX_U32 nPortIndex;
1588     QOMX_VIDEO_DIVXFORMATTYPE eFormat;
1589     QOMX_VIDEO_DIVXPROFILETYPE eProfile;
1590 } QOMX_VIDEO_PARAM_DIVXTYPE;
1591 
1592 
1593 
1594 /**
1595  *  VP Versions
1596  */
1597 typedef enum QOMX_VIDEO_VPFORMATTYPE {
1598     QOMX_VIDEO_VPFormatUnused = 0x01, /**< Format unused or unknown */
1599     QOMX_VIDEO_VPFormat6      = 0x02, /**< VP6 Video Format */
1600     QOMX_VIDEO_VPFormat7      = 0x04, /**< VP7 Video Format */
1601     QOMX_VIDEO_VPFormat8      = 0x08, /**< VP8 Video Format */
1602     QOMX_VIDEO_VPFormat9      = 0x10, /**< VP9 Video Format */
1603     QOMX_VIDEO_VPFormatKhronosExtensions = 0x6F000000,
1604     QOMX_VIDEO_VPFormatVendorStartUnused = 0x7F000000,
1605     QOMX_VIDEO_VPFormatMax = 0x7FFFFFFF
1606 } QOMX_VIDEO_VPFORMATTYPE;
1607 
1608 /**
1609  * VP profile types, each profile indicates support for various
1610  * encoding tools.
1611  */
1612 typedef enum QOMX_VIDEO_VPPROFILETYPE {
1613     QOMX_VIDEO_VPProfileSimple   = 0x01, /**< Simple Profile, applies to VP6 only */
1614     QOMX_VIDEO_VPProfileAdvanced = 0x02, /**< Advanced Profile, applies to VP6 only */
1615     QOMX_VIDEO_VPProfileVersion0 = 0x04, /**< Version 0, applies to VP7 and VP8 */
1616     QOMX_VIDEO_VPProfileVersion1 = 0x08, /**< Version 1, applies to VP7 and VP8 */
1617     QOMX_VIDEO_VPProfileVersion2 = 0x10, /**< Version 2, applies to VP8 only */
1618     QOMX_VIDEO_VPProfileVersion3 = 0x20, /**< Version 3, applies to VP8 only */
1619     QOMX_VIDEO_VPProfileKhronosExtensions = 0x6F000000,
1620     QOMX_VIDEO_VPProfileVendorStartUnused = 0x7F000000,
1621     QOMX_VIDEO_VPProfileMax = 0x7FFFFFFF
1622 } QOMX_VIDEO_VPPROFILETYPE;
1623 
1624 /**
1625  * VP Video Params
1626  *
1627  *  STRUCT MEMBERS:
1628  *  nSize      : Size of the structure in bytes
1629  *  nVersion   : OMX specification version information
1630  *  nPortIndex : Port that this structure applies to
1631  *  eFormat    : Format of VP stream / data
1632  *  eProfile   : Profile or Version of VP stream / data
1633  */
1634 typedef struct QOMX_VIDEO_PARAM_VPTYPE {
1635     OMX_U32 nSize;
1636     OMX_VERSIONTYPE nVersion;
1637     OMX_U32 nPortIndex;
1638     QOMX_VIDEO_VPFORMATTYPE eFormat;
1639     QOMX_VIDEO_VPPROFILETYPE eProfile;
1640 } QOMX_VIDEO_PARAM_VPTYPE;
1641 
1642 /**
1643  * Spark Versions
1644  */
1645 typedef enum QOMX_VIDEO_SPARKFORMATTYPE {
1646     QOMX_VIDEO_SparkFormatUnused = 0x01, /**< Format unused or unknown */
1647     QOMX_VIDEO_SparkFormat0      = 0x02, /**< Video Format Version 0 */
1648     QOMX_VIDEO_SparkFormat1      = 0x04, /**< Video Format Version 1 */
1649     QOMX_VIDEO_SparkFormatKhronosExtensions = 0x6F000000,
1650     QOMX_VIDEO_SparkFormatVendorStartUnused = 0x7F000000,
1651     QOMX_VIDEO_SparkFormatMax = 0x7FFFFFFF
1652 } QOMX_VIDEO_SPARKFORMATTYPE;
1653 
1654 /**
1655  * Spark Video Params
1656  *
1657  *  STRUCT MEMBERS:
1658  *  nSize      : Size of the structure in bytes
1659  *  nVersion   : OMX specification version information
1660  *  nPortIndex : Port that this structure applies to
1661  *  eFormat    : Version of Spark stream / data
1662  */
1663 typedef struct QOMX_VIDEO_PARAM_SPARKTYPE {
1664     OMX_U32 nSize;
1665     OMX_VERSIONTYPE nVersion;
1666     OMX_U32 nPortIndex;
1667     QOMX_VIDEO_SPARKFORMATTYPE eFormat;
1668 } QOMX_VIDEO_PARAM_SPARKTYPE;
1669 
1670 
1671 typedef struct QOMX_VIDEO_QUERY_DECODER_INSTANCES {
1672     OMX_U32 nSize;
1673     OMX_VERSIONTYPE nVersion;
1674     OMX_U32 nPortIndex;
1675     OMX_U32 nNumOfInstances;
1676 } QOMX_VIDEO_QUERY_DECODER_INSTANCES;
1677 
1678 typedef struct QOMX_ENABLETYPE {
1679     OMX_U32 nSize;
1680     OMX_VERSIONTYPE nVersion;
1681     OMX_BOOL bEnable;
1682 } QOMX_ENABLETYPE;
1683 
1684 typedef struct QOMX_DISABLETYPE {
1685     OMX_U32 nSize;
1686     OMX_VERSIONTYPE nVersion;
1687     OMX_BOOL bDisable;
1688 } QOMX_DISABLETYPE;
1689 
1690 typedef enum QOMX_VIDEO_EVENTS {
1691     OMX_EventIndexsettingChanged = OMX_EventVendorStartUnused
1692 } QOMX_VIDEO_EVENTS;
1693 
1694 typedef enum QOMX_VIDEO_PICTURE_ORDER {
1695     QOMX_VIDEO_DISPLAY_ORDER = 0x1,
1696     QOMX_VIDEO_DECODE_ORDER = 0x2
1697 } QOMX_VIDEO_PICTURE_ORDER;
1698 
1699 typedef struct QOMX_VIDEO_DECODER_PICTURE_ORDER {
1700     OMX_U32 nSize;
1701     OMX_VERSIONTYPE nVersion;
1702     OMX_U32 nPortIndex;
1703     QOMX_VIDEO_PICTURE_ORDER eOutputPictureOrder;
1704 } QOMX_VIDEO_DECODER_PICTURE_ORDER;
1705 
1706 typedef struct QOMX_INDEXEXTRADATATYPE {
1707     OMX_U32 nSize;
1708     OMX_VERSIONTYPE nVersion;
1709     OMX_U32 nPortIndex;
1710     OMX_BOOL bEnabled;
1711     OMX_INDEXTYPE nIndex;
1712 } QOMX_INDEXEXTRADATATYPE;
1713 
1714 typedef struct QOMX_INDEXTIMESTAMPREORDER {
1715     OMX_U32 nSize;
1716     OMX_VERSIONTYPE nVersion;
1717     OMX_U32 nPortIndex;
1718     OMX_BOOL bEnable;
1719 } QOMX_INDEXTIMESTAMPREORDER;
1720 
1721 typedef struct QOMX_INDEXDOWNSCALAR {
1722         OMX_U32 nSize;
1723         OMX_VERSIONTYPE nVersion;
1724         OMX_U32 nPortIndex;
1725         OMX_BOOL bEnable;
1726 } QOMX_INDEXDOWNSCALAR;
1727 
1728 typedef struct QOMX_VIDEO_CUSTOM_BUFFERSIZE {
1729         OMX_U32 nSize;
1730         OMX_VERSIONTYPE nVersion;
1731         OMX_U32 nPortIndex;
1732         OMX_U32 nBufferSize;
1733 } QOMX_VIDEO_CUSTOM_BUFFERSIZE;
1734 
1735 #define OMX_QCOM_INDEX_PARAM_VIDEO_SYNCFRAMEDECODINGMODE "OMX.QCOM.index.param.video.SyncFrameDecodingMode"
1736 #define OMX_QCOM_INDEX_PARAM_INDEXEXTRADATA "OMX.QCOM.index.param.IndexExtraData"
1737 #define OMX_QCOM_INDEX_PARAM_VIDEO_SLICEDELIVERYMODE "OMX.QCOM.index.param.SliceDeliveryMode"
1738 #define OMX_QCOM_INDEX_PARAM_VIDEO_FRAMEPACKING_EXTRADATA "OMX.QCOM.index.param.video.FramePackingExtradata"
1739 #define OMX_QCOM_INDEX_PARAM_VIDEO_QP_EXTRADATA "OMX.QCOM.index.param.video.QPExtradata"
1740 #define OMX_QCOM_INDEX_PARAM_VIDEO_INPUTBITSINFO_EXTRADATA "OMX.QCOM.index.param.video.InputBitsInfoExtradata"
1741 #define OMX_QCOM_INDEX_PARAM_VIDEO_EXTNUSER_EXTRADATA "OMX.QCOM.index.param.video.ExtnUserExtraData"
1742 #define OMX_QCOM_INDEX_CONFIG_VIDEO_FRAMEPACKING_INFO "OMX.QCOM.index.config.video.FramePackingInfo"
1743 #define OMX_QCOM_INDEX_PARAM_VIDEO_MPEG2SEQDISP_EXTRADATA "OMX.QCOM.index.param.video.Mpeg2SeqDispExtraData"
1744 
1745 #define OMX_QCOM_INDEX_PARAM_VIDEO_HIERSTRUCTURE "OMX.QCOM.index.param.video.HierStructure"
1746 #define OMX_QCOM_INDEX_PARAM_VIDEO_LTRCOUNT "OMX.QCOM.index.param.video.LTRCount"
1747 #define OMX_QCOM_INDEX_PARAM_VIDEO_LTRPERIOD "OMX.QCOM.index.param.video.LTRPeriod"
1748 #define OMX_QCOM_INDEX_CONFIG_VIDEO_LTRUSE "OMX.QCOM.index.config.video.LTRUse"
1749 #define OMX_QCOM_INDEX_CONFIG_VIDEO_LTRMARK "OMX.QCOM.index.config.video.LTRMark"
1750 #define OMX_QCOM_INDEX_CONFIG_VIDEO_HIER_P_LAYERS "OMX.QCOM.index.config.video.hierplayers"
1751 #define OMX_QCOM_INDEX_CONFIG_RECTANGLE_TYPE "OMX.QCOM.index.config.video.rectangle"
1752 #define OMX_QCOM_INDEX_PARAM_VIDEO_BASE_LAYER_ID "OMX.QCOM.index.param.video.baselayerid"
1753 #define OMX_QCOM_INDEX_CONFIG_VIDEO_QP "OMX.QCOM.index.config.video.qp"
1754 #define OMX_QCOM_INDEX_PARAM_VIDEO_SAR "OMX.QCOM.index.param.video.sar"
1755 #define OMX_QTI_INDEX_PARAM_VIDEO_LOW_LATENCY "OMX.QTI.index.param.video.LowLatency"
1756 
1757 #define OMX_QCOM_INDEX_PARAM_VIDEO_PASSINPUTBUFFERFD "OMX.QCOM.index.param.video.PassInputBufferFd"
1758 #define OMX_QTI_INDEX_PARAM_VIDEO_PREFER_ADAPTIVE_PLAYBACK "OMX.QTI.index.param.video.PreferAdaptivePlayback"
1759 #define OMX_QTI_INDEX_CONFIG_VIDEO_SETTIMEDATA "OMX.QTI.index.config.video.settimedata"
1760 #define OMX_QTI_INDEX_PARAM_VIDEO_FORCE_COMPRESSED_FOR_DPB "OMX.QTI.index.param.video.ForceCompressedForDPB"
1761 #define OMX_QTI_INDEX_PARAM_VIDEO_ENABLE_ROIINFO "OMX.QTI.index.param.enableRoiInfo"
1762 #define OMX_QTI_INDEX_CONFIG_VIDEO_ROIINFO "OMX.QTI.index.config.RoiInfo"
1763 #define OMX_QTI_INDEX_CONFIG_VIDEO_BLURINFO "OMX.QTI.index.config.BlurInfo"
1764 #define OMX_QTI_INDEX_PARAM_VIDEO_CLIENT_EXTRADATA "OMX.QTI.index.param.client.extradata"
1765 #define OMX_QTI_INDEX_CONFIG_COLOR_ASPECTS "OMX.google.android.index.describeColorAspects"
1766 
1767 typedef enum {
1768     QOMX_VIDEO_FRAME_PACKING_CHECKERBOARD = 0,
1769     QOMX_VIDEO_FRAME_PACKING_COLUMN_INTERLEAVE = 1,
1770     QOMX_VIDEO_FRAME_PACKING_ROW_INTERLEAVE = 2,
1771     QOMX_VIDEO_FRAME_PACKING_SIDE_BY_SIDE = 3,
1772     QOMX_VIDEO_FRAME_PACKING_TOP_BOTTOM = 4,
1773     QOMX_VIDEO_FRAME_PACKING_TEMPORAL = 5,
1774 } QOMX_VIDEO_FRAME_PACKING_ARRANGEMENT;
1775 
1776 typedef enum {
1777     QOMX_VIDEO_CONTENT_UNSPECIFIED = 0,
1778     QOMX_VIDEO_CONTENT_LR_VIEW = 1,
1779     QOMX_VIDEO_CONTENT_RL_VIEW = 2,
1780 } QOMX_VIDEO_CONTENT_INTERPRETATION;
1781 
1782 /**
1783  * Specifies the extended picture types. These values should be
1784  * OR'd along with the types defined in OMX_VIDEO_PICTURETYPE to
1785  * signal all pictures types which are allowed.
1786  *
1787  * ENUMS:
1788  *  H.264 Specific Picture Types:   IDR
1789  */
1790 typedef enum QOMX_VIDEO_PICTURETYPE {
1791     QOMX_VIDEO_PictureTypeIDR = OMX_VIDEO_PictureTypeVendorStartUnused + 0x1000
1792 } QOMX_VIDEO_PICTURETYPE;
1793 
1794 #define OMX_QCOM_INDEX_CONFIG_ACTIVE_REGION_DETECTION           "OMX.QCOM.index.config.activeregiondetection"
1795 #define OMX_QCOM_INDEX_CONFIG_ACTIVE_REGION_DETECTION_STATUS    "OMX.QCOM.index.config.activeregiondetectionstatus"
1796 #define OMX_QCOM_INDEX_CONFIG_SCALING_MODE                      "OMX.QCOM.index.config.scalingmode"
1797 #define OMX_QCOM_INDEX_CONFIG_NOISEREDUCTION                    "OMX.QCOM.index.config.noisereduction"
1798 #define OMX_QCOM_INDEX_CONFIG_IMAGEENHANCEMENT                  "OMX.QCOM.index.config.imageenhancement"
1799 #define OMX_QCOM_INDEX_PARAM_HELDBUFFERCOUNT                    "OMX.QCOM.index.param.HeldBufferCount" /**< reference: QOMX_HELDBUFFERCOUNTTYPE */
1800 
1801 
1802 typedef struct QOMX_RECTTYPE {
1803     OMX_U32 nSize;
1804     OMX_VERSIONTYPE nVersion;
1805     OMX_S32 nLeft;
1806     OMX_S32 nTop;
1807     OMX_U32 nWidth;
1808     OMX_U32 nHeight;
1809 } QOMX_RECTTYPE;
1810 
1811 typedef struct QOMX_ACTIVEREGIONDETECTIONTYPE {
1812     OMX_U32 nSize;
1813     OMX_VERSIONTYPE nVersion;
1814     OMX_U32 nPortIndex;
1815     OMX_BOOL bEnable;
1816     QOMX_RECTTYPE sROI;
1817     OMX_U32 nNumExclusionRegions;
1818     QOMX_RECTTYPE sExclusionRegions[1];
1819 } QOMX_ACTIVEREGIONDETECTIONTYPE;
1820 
1821 typedef struct QOMX_ACTIVEREGIONDETECTION_STATUSTYPE {
1822     OMX_U32 nSize;
1823     OMX_VERSIONTYPE nVersion;
1824     OMX_U32 nPortIndex;
1825     OMX_BOOL bDetected;
1826     QOMX_RECTTYPE sDetectedRegion;
1827 } QOMX_ACTIVEREGIONDETECTION_STATUSTYPE;
1828 
1829 typedef enum QOMX_SCALE_MODETYPE {
1830     QOMX_SCALE_MODE_Normal,
1831     QOMX_SCALE_MODE_Anamorphic,
1832     QOMX_SCALE_MODE_Max = 0x7FFFFFFF
1833 } QOMX_SCALE_MODETYPE;
1834 
1835 typedef struct QOMX_SCALINGMODETYPE {
1836     OMX_U32 nSize;
1837     OMX_VERSIONTYPE nVersion;
1838     QOMX_SCALE_MODETYPE  eScaleMode;
1839 } QOMX_SCALINGMODETYPE;
1840 
1841 typedef struct QOMX_NOISEREDUCTIONTYPE {
1842     OMX_U32 nSize;
1843     OMX_VERSIONTYPE nVersion;
1844     OMX_U32 nPortIndex;
1845     OMX_BOOL bEnable;
1846     OMX_BOOL bAutoMode;
1847     OMX_S32 nNoiseReduction;
1848 } QOMX_NOISEREDUCTIONTYPE;
1849 
1850 typedef struct QOMX_IMAGEENHANCEMENTTYPE {
1851     OMX_U32 nSize;
1852     OMX_VERSIONTYPE nVersion;
1853     OMX_U32 nPortIndex;
1854     OMX_BOOL bEnable;
1855     OMX_BOOL bAutoMode;
1856     OMX_S32 nImageEnhancement;
1857 } QOMX_IMAGEENHANCEMENTTYPE;
1858 
1859 /*
1860  * these are part of OMX1.2 but JB MR2 branch doesn't have them defined
1861  * OMX_IndexParamInterlaceFormat
1862  * OMX_INTERLACEFORMATTYPE
1863  */
1864 #ifndef OMX_IndexParamInterlaceFormat
1865 #define OMX_IndexParamInterlaceFormat (0x7FF00000)
1866 typedef struct OMX_INTERLACEFORMATTYPE {
1867     OMX_U32 nSize;
1868     OMX_VERSIONTYPE nVersion;
1869     OMX_U32 nPortIndex;
1870     OMX_U32 nFormat;
1871     OMX_TICKS nTimeStamp;
1872 } OMX_INTERLACEFORMATTYPE;
1873 #endif
1874 
1875 /**
1876  * This structure is used to indicate the maximum number of buffers
1877  * that a port will hold during data flow.
1878  *
1879  * STRUCT MEMBERS:
1880  *  nSize              : Size of the structure in bytes
1881  *  nVersion           : OMX specification version info
1882  *  nPortIndex         : Port that this structure applies to
1883  *  nHeldBufferCount   : Read-only, maximum number of buffers that will be held
1884  */
1885 typedef struct QOMX_HELDBUFFERCOUNTTYPE {
1886     OMX_U32 nSize;
1887     OMX_VERSIONTYPE nVersion;
1888     OMX_U32 nPortIndex;
1889     OMX_U32 nHeldBufferCount;
1890 } QOMX_HELDBUFFERCOUNTTYPE;
1891 
1892 typedef enum QOMX_VIDEO_HIERARCHICALCODINGTYPE {
1893     QOMX_HIERARCHICALCODING_P = 0x01,
1894     QOMX_HIERARCHICALCODING_B = 0x02,
1895 } QOMX_VIDEO_HIERARCHICALCODINGTYPE;
1896 
1897 typedef struct QOMX_VIDEO_HIERARCHICALLAYERS {
1898     OMX_U32 nSize;
1899     OMX_VERSIONTYPE nVersion;
1900     OMX_U32 nPortIndex;
1901     OMX_U32 nNumLayers;
1902     QOMX_VIDEO_HIERARCHICALCODINGTYPE eHierarchicalCodingType;
1903 } QOMX_VIDEO_HIERARCHICALLAYERS;
1904 
1905 typedef struct QOMX_VIDEO_H264ENTROPYCODINGTYPE {
1906    OMX_U32 nSize;
1907    OMX_VERSIONTYPE nVersion;
1908    OMX_BOOL bCabac;
1909    OMX_U32 nCabacInitIdc;
1910 } QOMX_VIDEO_H264ENTROPYCODINGTYPE;
1911 
1912 typedef enum QOMX_VIDEO_IFRAMESIZE_TYPE {
1913     QOMX_IFRAMESIZE_DEFAULT,
1914     QOMX_IFRAMESIZE_MEDIUM,
1915     QOMX_IFRAMESIZE_HUGE,
1916     QOMX_IFRAMESIZE_UNLIMITED,
1917 } QOMX_VIDEO_IFRAMESIZE_TYPE;
1918 
1919 typedef struct QOMX_VIDEO_IFRAMESIZE {
1920    OMX_U32 nSize;
1921    OMX_VERSIONTYPE nVersion;
1922    QOMX_VIDEO_IFRAMESIZE_TYPE eType;
1923 } QOMX_VIDEO_IFRAMESIZE;
1924 
1925 /* VIDEO POSTPROCESSING CTRLS AND ENUMS */
1926 /* MUST KEEP SAME AS IN vpp.h */
1927 #define QOMX_VPP_HQV_CUSTOMPAYLOAD_SZ 256
1928 #define VPP_HQV_CONTROL_GLOBAL_START (VPP_HQV_CONTROL_CUST + 1)
1929 
1930 typedef enum QOMX_VPP_HQV_MODE {
1931     VPP_HQV_MODE_OFF,
1932     VPP_HQV_MODE_AUTO,
1933     VPP_HQV_MODE_MANUAL,
1934     VPP_HQV_MODE_MAX
1935 } QOMX_VPP_HQV_MODE;
1936 
1937 typedef enum QOMX_VPP_HQVCONTROLTYPE {
1938     VPP_HQV_CONTROL_CADE = 0x1,
1939     VPP_HQV_CONTROL_DI = 0x02,
1940     VPP_HQV_CONTROL_CNR = 0x04,
1941     VPP_HQV_CONTROL_AIE = 0x05,
1942     VPP_HQV_CONTROL_FRC = 0x06,
1943     VPP_HQV_CONTROL_CUST = 0x07,
1944     VPP_HQV_CONTROL_GLOBAL_DEMO = VPP_HQV_CONTROL_GLOBAL_START,
1945     VPP_HQV_CONTROL_MAX,
1946 } QOMX_VPP_HQVCONTROLTYPE;
1947 
1948 typedef enum QOMX_VPP_HQV_DI_MODE {
1949     VPP_HQV_DI_MODE_OFF,
1950     VPP_HQV_DI_MODE_VIDEO_1F,
1951     VPP_HQV_DI_MODE_VIDEO_3F,
1952     VPP_HQV_DI_MODE_AUTO,
1953     VPP_HQV_DI_MODE_MAX,
1954 } QOMX_VPP_HQV_DI_MODE;
1955 
1956 typedef enum QOMX_VPP_HQV_HUE_MODE {
1957     VPP_HQV_HUE_MODE_OFF,
1958     VPP_HQV_HUE_MODE_ON,
1959     VPP_HQV_HUE_MODE_MAX,
1960 } QOMX_VPP_HQV_HUE_MODE;
1961 
1962 typedef enum QOMX_VPP_SPLIT_DIRECTION {
1963     VPP_HQV_SPLIT_LEFT_TO_RIGHT,
1964     VPP_HQV_SPLIT_RIGHT_TO_LEFT,
1965     VPP_HQV_SPLIT_TOP_TO_BOTTOM,
1966     VPP_HQV_SPLIT_BOTTOM_TO_TOP,
1967     VPP_HQV_SPLIT_MAX,
1968 } QOMX_VPP_SPLIT_DIRECTION;
1969 
1970 typedef enum QOMX_VPP_HQV_FRC_MODE {
1971    VPP_HQV_FRC_MODE_OFF,
1972    VPP_HQV_FRC_MODE_LOW,
1973    VPP_HQV_FRC_MODE_MED,
1974    VPP_HQV_FRC_MODE_HIGH,
1975    VPP_HQV_FRC_MODE_MAX,
1976 } QOMX_VPP_HQV_FRC_MODE;
1977 
1978 
1979 typedef struct QOMX_VPP_HQVCTRL_CADE {
1980     QOMX_VPP_HQV_MODE mode;
1981     OMX_U32 level;
1982     OMX_S32 contrast;
1983     OMX_S32 saturation;
1984 } QOMX_VPP_HQVCTRL_CADE;
1985 
1986 typedef struct QOMX_VPP_HQVCTRL_DI {
1987     QOMX_VPP_HQV_DI_MODE mode;
1988 } QOMX_VPP_HQVCTRL_DI;
1989 
1990 typedef struct QOMX_VPP_HQVCTRL_CNR {
1991     QOMX_VPP_HQV_MODE mode;
1992     OMX_U32 level;
1993 } QOMX_VPP_HQVCTRL_CNR;
1994 
1995 typedef struct QOMX_VPP_HQVCTRL_AIE {
1996     QOMX_VPP_HQV_MODE mode;
1997     QOMX_VPP_HQV_HUE_MODE hue_mode;
1998     OMX_U32 cade_level;
1999     OMX_U32 ltm_level;
2000 } QOMX_VPP_HQVCTRL_AIE;
2001 
2002 typedef struct QOMX_VPP_HQVCTRL_CUSTOM {
2003     OMX_U32 id;
2004     OMX_U32 len;
2005     OMX_U8 data[QOMX_VPP_HQV_CUSTOMPAYLOAD_SZ];
2006 } QOMX_VPP_HQVCTRL_CUSTOM;
2007 
2008 typedef struct QOMX_VPP_HQVCTRL_GLOBAL_DEMO {
2009     OMX_U32 process_percent;
2010     QOMX_VPP_SPLIT_DIRECTION process_direction;
2011 } QOMX_VPP_HQVCTRL_GLOBAL_DEMO;
2012 
2013 typedef struct QOMX_VPP_HQVCTRL_FRC {
2014     QOMX_VPP_HQV_FRC_MODE mode;
2015 } QOMX_VPP_HQVCTRL_FRC;
2016 
2017 /* VIDEO POSTPROCESSING OMX CTRLS */
2018 typedef struct QOMX_VPP_HQVCONTROL {
2019     OMX_U32 nSize;
2020     OMX_VERSIONTYPE nVersion;
2021     QOMX_VPP_HQV_MODE mode;
2022     QOMX_VPP_HQVCONTROLTYPE ctrl_type;
2023     union {
2024         QOMX_VPP_HQVCTRL_CADE cade;
2025         QOMX_VPP_HQVCTRL_DI di;
2026         QOMX_VPP_HQVCTRL_CNR cnr;
2027         QOMX_VPP_HQVCTRL_AIE aie;
2028         QOMX_VPP_HQVCTRL_CUSTOM custom;
2029         QOMX_VPP_HQVCTRL_GLOBAL_DEMO global_demo;
2030         QOMX_VPP_HQVCTRL_FRC frc;
2031     };
2032 } QOMX_VPP_HQVCONTROL;
2033 
2034 /* STRUCTURE TO TURN VPP ON */
2035 typedef struct QOMX_VPP_ENABLE {
2036     OMX_U32 nSize;
2037     OMX_VERSIONTYPE nVersion;
2038     OMX_BOOL enable_vpp;
2039 } QOMX_VPP_ENABLE;
2040 
2041 typedef enum OMX_QOMX_VIDEO_MBISTATISTICSTYPE {
2042     QOMX_MBI_STATISTICS_MODE_DEFAULT = 0,
2043     QOMX_MBI_STATISTICS_MODE_1 = 0x01,
2044     QOMX_MBI_STATISTICS_MODE_2 = 0x02,
2045 } OMX_QOMX_VIDEO_MBISTATISTICSTYPE;
2046 
2047 typedef struct OMX_QOMX_VIDEO_MBI_STATISTICS {
2048     OMX_U32 nSize;
2049     OMX_VERSIONTYPE nVersion;
2050     OMX_U32 nPortIndex;
2051     OMX_QOMX_VIDEO_MBISTATISTICSTYPE eMBIStatisticsType;
2052 } OMX_QOMX_VIDEO_MBI_STATISTICS;
2053 
2054 typedef struct QOMX_VIDEO_BATCHSIZETYPE {
2055     OMX_U32 nSize;
2056     OMX_VERSIONTYPE nVersion;
2057     OMX_U32 nPortIndex;
2058     OMX_U32 nBatchSize;
2059 } QOMX_VIDEO_BATCHSIZETYPE;
2060 
2061 typedef struct QOMX_VIDEO_CLIENT_EXTRADATA {
2062     OMX_U32 nSize;
2063     OMX_VERSIONTYPE nVersion;
2064     OMX_U32 nPortIndex;
2065     OMX_U32 nFd;
2066     OMX_U32 nExtradataAllocSize;
2067     OMX_U32 nExtradataSize;
2068 } QOMX_VIDEO_CLIENT_EXTRADATATYPE;
2069 
2070 #if defined(__cplusplus) && defined(USE_CAMERA_METABUFFER_UTILS)
2071 
2072 #define CAM_META_BUFFER_EVENT_PERF 0x01
2073 
2074 /**
2075  * Camera1 meta-buffer payload create/access/modify utility
2076  */
2077 struct MetaBufferUtil {
2078 
2079     enum {
2080         INT_OFFSET      = 1,
2081         INT_SIZE        = 2,
2082         INT_USAGE       = 3,
2083         INT_TIMESTAMP   = 4,
2084         INT_COLORFORMAT = 5,
2085         INT_BUFINDEX    = 6,
2086         INT_BUFEVENT    = 7,
2087         INT_TOTAL       = INT_BUFEVENT,
2088     };
2089 
getNumFdsForBatchMetaBufferUtil2090     static int getNumFdsForBatch(int batchSize) {
2091         return batchSize;
2092     }
getNumIntsForBatchMetaBufferUtil2093     static int getNumIntsForBatch(int batchSize) {
2094         return batchSize * INT_TOTAL;
2095     }
getBatchSizeMetaBufferUtil2096     static int getBatchSize(const native_handle_t *hnd) {
2097         return MetaBufferUtil::isHandleSane(hnd) ? hnd->numFds : -1;
2098     }
2099 
2100     /* getters */
2101     /* return a fd at index or -1 if index is invalid */
getFdAtMetaBufferUtil2102     static int getFdAt(const native_handle_t *hnd, int index) {
2103         return (MetaBufferUtil::isHandleSane(hnd) && (index < hnd->numFds)) ? hnd->data[index] : -1;
2104     }
2105     /* return a int of type at index or -1 if index or type is invalid */
getIntAtMetaBufferUtil2106     static int getIntAt(const native_handle_t *hnd, int index, int type) {
2107         int idx = MetaBufferUtil::getIntIndex(hnd, index, type);
2108         return idx < 0 ? -1 : hnd->data[idx];
2109     }
2110 
2111     /* setters */
2112     /* replace the fd at index and return 0. Return -1 if index is invalid */
setFdAtMetaBufferUtil2113     static int setFdAt(native_handle_t *hnd, int index, int fd) {
2114         return (MetaBufferUtil::isHandleSane(hnd) && (index < hnd->numFds)) ? hnd->data[index] = fd, 0 : -1;
2115     }
2116     /* replace an int of type at index and return 0. Return -1 if index or type is invalid */
setIntAtMetaBufferUtil2117     static int setIntAt(native_handle_t *hnd, int index, int type, int value) {
2118         int idx = MetaBufferUtil::getIntIndex(hnd, index, type);
2119         return idx < 0 ? -1 : hnd->data[idx] = value, 0;
2120     }
2121 
2122 private:
isHandleSaneMetaBufferUtil2123     static bool isHandleSane(const native_handle_t *hnd) {
2124         return hnd && hnd->version == sizeof(native_handle_t);
2125     }
2126 
getIntIndexMetaBufferUtil2127     static int getIntIndex(const native_handle_t *hnd, int index, int type) {
2128         int idx = index + type * MetaBufferUtil::getBatchSize(hnd);
2129         return (MetaBufferUtil::isHandleSane(hnd) && (idx < (hnd->numInts + hnd->numFds))) ? idx : -1;
2130     }
2131 };
2132 
2133 #endif // __cplusplus
2134 
2135 typedef enum QOMX_VIDEO_DITHERTYPE {
2136     QOMX_DITHER_DISABLE = 0,
2137     QOMX_DITHER_COLORSPACE_EXCEPT_BT2020 = 0x01,
2138     QOMX_DITHER_ALL_COLORSPACE = 0x02,
2139 } QOMX_VIDEO_DITHERTYPE;
2140 
2141 typedef struct QOMX_VIDEO_DITHER_CONTROL {
2142     OMX_U32 nSize;
2143     OMX_VERSIONTYPE nVersion;
2144     OMX_U32 nPortIndex;
2145     QOMX_VIDEO_DITHERTYPE eDitherType;
2146 } QOMX_VIDEO_DITHER_CONTROL;
2147 
2148 #ifdef __cplusplus
2149 }
2150 #endif /* __cplusplus */
2151 
2152 #endif /* __OMX_QCOM_EXTENSIONS_H__ */
2153