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