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