• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*--------------------------------------------------------------------------
2 Copyright (c) 2009-2012, 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 Code Aurora nor
12       the names of its contributors may be used to endorse or promote
13       products derived from this software without specific prior written
14       permission.
15 
16 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19 NON-INFRINGEMENT ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR
20 CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
21 EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
22 PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
23 OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
24 WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
25 OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
26 ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 --------------------------------------------------------------------------*/
28 #ifndef __OMX_QCOM_EXTENSIONS_H__
29 #define __OMX_QCOM_EXTENSIONS_H__
30 
31 #ifdef __cplusplus
32 extern "C" {
33 #endif /* __cplusplus */
34 
35 /*============================================================================
36 *//** @file OMX_QCOMExtns.h
37   This header contains constants and type definitions that specify the
38   extensions added to the OpenMAX Vendor specific APIs.
39 
40 *//*========================================================================*/
41 
42 
43 ///////////////////////////////////////////////////////////////////////////////
44 //                             Include Files
45 ///////////////////////////////////////////////////////////////////////////////
46 #include "OMX_Core.h"
47 #include "OMX_Video.h"
48 
49 /**
50  * This extension is used to register mapping of a virtual
51  * address to a physical address. This extension is a parameter
52  * which can be set using the OMX_SetParameter macro. The data
53  * pointer corresponding to this extension is
54  * OMX_QCOM_MemMapEntry. This parameter is a 'write only'
55  * parameter (Current value cannot be queried using
56  * OMX_GetParameter macro).
57  */
58 #define OMX_QCOM_EXTN_REGISTER_MMAP     "OMX.QCOM.index.param.register_mmap"
59 
60 /**
61  * This structure describes the data pointer corresponding to
62  * the OMX_QCOM_MMAP_REGISTER_EXTN extension. This parameter
63  * must be set only 'after' populating a port with a buffer
64  * using OMX_UseBuffer, wherein the data pointer of the buffer
65  * corresponds to the virtual address as specified in this
66  * structure.
67  */
68 struct OMX_QCOM_PARAM_MEMMAPENTRYTYPE
69 {
70     OMX_U32 nSize;              /** Size of the structure in bytes */
71     OMX_VERSIONTYPE nVersion;   /**< OMX specification version information */
72     OMX_U32 nPortIndex;         /**< Port number the structure applies to */
73 
74     /**
75      * The virtual address of memory block
76      */
77     OMX_U64 nVirtualAddress;
78 
79     /**
80      * The physical address corresponding to the virtual address. The physical
81      * address is contiguous for the entire valid range of the virtual
82      * address.
83      */
84     OMX_U64 nPhysicalAddress;
85 };
86 
87 #define QOMX_VIDEO_IntraRefreshRandom (OMX_VIDEO_IntraRefreshVendorStartUnused + 0)
88 
89 #define QOMX_VIDEO_BUFFERFLAG_BFRAME 0x00100000
90 
91 #define QOMX_VIDEO_BUFFERFLAG_EOSEQ  0x00200000
92 
93 #define OMX_QCOM_PORTDEFN_EXTN   "OMX.QCOM.index.param.portdefn"
94 /* Allowed APIs on the above Index: OMX_GetParameter() and OMX_SetParameter() */
95 
96 typedef enum OMX_QCOMMemoryRegion
97 {
98     OMX_QCOM_MemRegionInvalid,
99     OMX_QCOM_MemRegionEBI1,
100     OMX_QCOM_MemRegionSMI,
101     OMX_QCOM_MemRegionMax = 0X7FFFFFFF
102 } OMX_QCOMMemoryRegion;
103 
104 typedef enum OMX_QCOMCacheAttr
105 {
106     OMX_QCOM_CacheAttrNone,
107     OMX_QCOM_CacheAttrWriteBack,
108     OMX_QCOM_CacheAttrWriteThrough,
109     OMX_QCOM_CacheAttrMAX = 0X7FFFFFFF
110 } OMX_QCOMCacheAttr;
111 
112 typedef struct OMX_QCOMRectangle
113 {
114    OMX_S32 x;
115    OMX_S32 y;
116    OMX_S32 dx;
117    OMX_S32 dy;
118 } OMX_QCOMRectangle;
119 
120 /** OMX_QCOMFramePackingFormat
121   * Input or output buffer format
122   */
123 typedef enum OMX_QCOMFramePackingFormat
124 {
125   /* 0 - unspecified
126    */
127   OMX_QCOM_FramePacking_Unspecified,
128 
129   /*  1 - Partial frames may be present OMX IL 1.1.1 Figure 2-10:
130    *  Case 1??Each Buffer Filled In Whole or In Part
131    */
132   OMX_QCOM_FramePacking_Arbitrary,
133 
134   /*  2 - Multiple complete frames per buffer (integer number)
135    *  OMX IL 1.1.1 Figure 2-11: Case 2�Each Buffer Filled with
136    *  Only Complete Frames of Data
137    */
138   OMX_QCOM_FramePacking_CompleteFrames,
139 
140   /*  3 - Only one complete frame per buffer, no partial frame
141    *  OMX IL 1.1.1 Figure 2-12: Case 3�Each Buffer Filled with
142    *  Only One Frame of Compressed Data. Usually at least one
143    *  complete unit of data will be delivered in a buffer for
144    *  uncompressed data formats.
145    */
146   OMX_QCOM_FramePacking_OnlyOneCompleteFrame,
147 
148   /*  4 - Only one complete subframe per buffer, no partial subframe
149    *  Example: In H264, one complete NAL per buffer, where one frame
150    *  can contatin multiple NAL
151    */
152   OMX_QCOM_FramePacking_OnlyOneCompleteSubFrame,
153 
154   OMX_QCOM_FramePacking_MAX = 0X7FFFFFFF
155 } OMX_QCOMFramePackingFormat;
156 
157 typedef struct OMX_QCOM_PARAM_PORTDEFINITIONTYPE {
158  OMX_U32 nSize;           /** Size of the structure in bytes */
159  OMX_VERSIONTYPE nVersion;/** OMX specification version information */
160  OMX_U32 nPortIndex;    /** Portindex which is extended by this structure */
161 
162  /** Platform specific memory region EBI1, SMI, etc.,*/
163  OMX_QCOMMemoryRegion nMemRegion;
164 
165  OMX_QCOMCacheAttr nCacheAttr; /** Cache attributes */
166 
167  /** Input or output buffer format */
168  OMX_U32 nFramePackingFormat;
169 
170 } OMX_QCOM_PARAM_PORTDEFINITIONTYPE;
171 
172 #define OMX_QCOM_PLATFORMPVT_EXTN   "OMX.QCOM.index.param.platformprivate"
173 /** Allowed APIs on the above Index: OMX_SetParameter() */
174 
175 typedef enum OMX_QCOM_PLATFORM_PRIVATE_ENTRY_TYPE
176 {
177     /** Enum for PMEM information */
178     OMX_QCOM_PLATFORM_PRIVATE_PMEM = 0x1
179 } OMX_QCOM_PLATFORM_PRIVATE_ENTRY_TYPE;
180 
181 /** IL client will set the following structure. A failure
182  *  code will be returned if component does not support the
183  *  value provided for 'type'.
184  */
185 struct OMX_QCOM_PLATFORMPRIVATE_EXTN
186 {
187     OMX_U32 nSize;        /** Size of the structure in bytes */
188     OMX_VERSIONTYPE nVersion; /** OMX spec version information */
189     OMX_U32 nPortIndex;  /** Port number on which usebuffer extn is applied */
190 
191     /** Type of extensions should match an entry from
192      OMX_QCOM_PLATFORM_PRIVATE_ENTRY_TYPE
193     */
194     OMX_QCOM_PLATFORM_PRIVATE_ENTRY_TYPE type;
195 };
196 
197 typedef struct OMX_QCOM_PLATFORM_PRIVATE_PMEM_INFO
198 {
199     /** pmem file descriptor */
200     OMX_U32 pmem_fd;
201     /** Offset from pmem device base address */
202     OMX_U32 offset;
203 }OMX_QCOM_PLATFORM_PRIVATE_PMEM_INFO;
204 
205 typedef struct OMX_QCOM_PLATFORM_PRIVATE_ENTRY
206 {
207     /** Entry type */
208     OMX_QCOM_PLATFORM_PRIVATE_ENTRY_TYPE type;
209 
210     /** Pointer to platform specific entry */
211     void* entry;
212 }OMX_QCOM_PLATFORM_PRIVATE_ENTRY;
213 
214 typedef struct OMX_QCOM_PLATFORM_PRIVATE_LIST
215 {
216     /** Number of entries */
217     OMX_U32 nEntries;
218 
219     /** Pointer to array of platform specific entries *
220      * Contiguous block of OMX_QCOM_PLATFORM_PRIVATE_ENTRY element
221     */
222     OMX_QCOM_PLATFORM_PRIVATE_ENTRY* entryList;
223 }OMX_QCOM_PLATFORM_PRIVATE_LIST;
224 
225 #define OMX_QCOM_FRAME_PACKING_FORMAT   "OMX.QCOM.index.param.framepackfmt"
226 /* Allowed API call: OMX_GetParameter() */
227 /* IL client can use this index to rerieve the list of frame formats *
228  * supported by the component */
229 
230 typedef struct OMX_QCOM_FRAME_PACKINGFORMAT_TYPE {
231     OMX_U32 nSize;
232     OMX_VERSIONTYPE nVersion;
233     OMX_U32 nPortIndex;
234     OMX_U32 nIndex;
235     OMX_QCOMFramePackingFormat eframePackingFormat;
236 } OMX_QCOM_FRAME_PACKINGFORMAT_TYPE;
237 
238 
239 /**
240  * Following is the enum for color formats supported on Qualcomm
241  * MSMs YVU420SemiPlanar color format is not defined in OpenMAX
242  * 1.1.1 and prior versions of OpenMAX specification.
243  */
244 
245 enum OMX_QCOM_COLOR_FORMATTYPE
246 {
247 
248 /** YVU420SemiPlanar: YVU planar format, organized with a first
249  *  plane containing Y pixels, and a second plane containing
250  *  interleaved V and U pixels. V and U pixels are sub-sampled
251  *  by a factor of two both horizontally and vertically.
252  */
253     OMX_QCOM_COLOR_FormatYVU420SemiPlanar = 0x7FA30C00,
254     QOMX_COLOR_FormatYVU420PackedSemiPlanar32m4ka,
255     QOMX_COLOR_FormatYUV420PackedSemiPlanar16m2ka,
256     QOMX_COLOR_FormatYUV420PackedSemiPlanar64x32Tile2m8ka,
257     QOMX_COLOR_FormatAndroidOpaque = (OMX_COLOR_FORMATTYPE) OMX_COLOR_FormatVendorStartUnused  + 0x789,
258 };
259 
260 enum OMX_QCOM_VIDEO_CODINGTYPE
261 {
262 /** Codecs support by qualcomm which are not listed in OMX 1.1.x
263  *  spec
264  *   */
265     OMX_QCOM_VIDEO_CodingVC1  = 0x7FA30C00 ,
266     OMX_QCOM_VIDEO_CodingWMV9 = 0x7FA30C01,
267     QOMX_VIDEO_CodingDivx = 0x7FA30C02,     /**< Value when coding is Divx */
268     QOMX_VIDEO_CodingSpark = 0x7FA30C03,     /**< Value when coding is Sorenson Spark */
269     QOMX_VIDEO_CodingVp = 0x7FA30C04,
270     QOMX_VIDEO_CodingVp8 = 0x7FA30C05
271 };
272 
273 enum OMX_QCOM_EXTN_INDEXTYPE
274 {
275     /** Qcom proprietary extension index list */
276 
277     /* "OMX.QCOM.index.param.register_mmap" */
278     OMX_QcomIndexRegmmap = 0x7F000000,
279 
280     /* "OMX.QCOM.index.param.platformprivate" */
281     OMX_QcomIndexPlatformPvt = 0x7F000001,
282 
283     /* "OMX.QCOM.index.param.portdefn" */
284     OMX_QcomIndexPortDefn = 0x7F000002,
285 
286     /* "OMX.QCOM.index.param.framepackingformat" */
287     OMX_QcomIndexPortFramePackFmt = 0x7F000003,
288 
289     /*"OMX.QCOM.index.param.Interlaced */
290     OMX_QcomIndexParamInterlaced = 0x7F000004,
291 
292     /*"OMX.QCOM.index.config.interlaceformat */
293     OMX_QcomIndexConfigInterlaced = 0x7F000005,
294 
295     /*"OMX.QCOM.index.param.syntaxhdr" */
296     QOMX_IndexParamVideoSyntaxHdr = 0x7F000006,
297 
298     /*"OMX.QCOM.index.config.intraperiod" */
299     QOMX_IndexConfigVideoIntraperiod = 0x7F000007,
300 
301     /*"OMX.QCOM.index.config.randomIntrarefresh" */
302     QOMX_IndexConfigVideoIntraRefresh = 0x7F000008,
303 
304     /*"OMX.QCOM.index.config.video.TemporalSpatialTradeOff" */
305     QOMX_IndexConfigVideoTemporalSpatialTradeOff = 0x7F000009,
306 
307     /*"OMX.QCOM.index.param.video.EncoderMode" */
308     QOMX_IndexParamVideoEncoderMode = 0x7F00000A,
309 
310     /*"OMX.QCOM.index.param.Divxtype */
311     OMX_QcomIndexParamVideoDivx = 0x7F00000B,
312 
313     /*"OMX.QCOM.index.param.Sparktype */
314     OMX_QcomIndexParamVideoSpark = 0x7F00000C,
315 
316     /*"OMX.QCOM.index.param.Vptype */
317     OMX_QcomIndexParamVideoVp = 0x7F00000D,
318 
319     OMX_QcomIndexQueryNumberOfVideoDecInstance = 0x7F00000E,
320 
321     OMX_QcomIndexParamVideoSyncFrameDecodingMode = 0x7F00000F,
322 
323     OMX_QcomIndexParamVideoDecoderPictureOrder = 0x7F000010,
324 
325     OMX_QcomIndexConfigVideoFramePackingArrangement = 0x7F000011,
326 
327     OMX_QcomIndexParamConcealMBMapExtraData = 0x7F000012,
328 
329     OMX_QcomIndexParamFrameInfoExtraData = 0x7F000013,
330 
331     OMX_QcomIndexParamInterlaceExtraData = 0x7F000014,
332 
333     OMX_QcomIndexParamH264TimeInfo = 0x7F000015,
334 
335     OMX_QcomIndexParamIndexExtraDataType = 0x7F000016,
336 
337     OMX_GoogleAndroidIndexEnableAndroidNativeBuffers = 0x7F000017,
338 
339     OMX_GoogleAndroidIndexUseAndroidNativeBuffer = 0x7F000018,
340 
341     OMX_GoogleAndroidIndexGetAndroidNativeBufferUsage = 0x7F000019,
342 
343     /*"OMX.QCOM.index.config.video.QPRange" */
344     OMX_QcomIndexConfigVideoQPRange = 0x7F00001A,
345 
346     /*"OMX.QCOM.index.param.EnableTimeStampReoder"*/
347     OMX_QcomIndexParamEnableTimeStampReorder = 0x7F00001B,
348 
349     /*"OMX.google.android.index.storeMetaDataInBuffers"*/
350     OMX_QcomIndexParamVideoEncodeMetaBufferMode = 0x7F00001C,
351 
352     /*"OMX.google.android.index.useAndroidNativeBuffer2"*/
353     OMX_GoogleAndroidIndexUseAndroidNativeBuffer2 = 0x7F00001D,
354 
355     /*"OMX.QCOM.index.param.VideoMaxAllowedBitrateCheck"*/
356     OMX_QcomIndexParamVideoMaxAllowedBitrateCheck = 0x7F00001E,
357 
358     OMX_QcomIndexEnableSliceDeliveryMode = 0x7F00001F,
359 
360     OMX_QcomIndexParamSequenceHeaderWithIDR = 0x7F000020,
361 };
362 
363 /**
364  * Extension index parameter.  This structure is used to enable
365  * vendor specific extension on input/output port and
366  * to pass the required flags and data, if any.
367  * The format of flags and data being passed is known to
368  * the client and component apriori.
369  *
370  * STRUCT MEMBERS:
371  *  nSize              : Size of Structure plus pData size
372  *  nVersion           : OMX specification version information
373  *  nPortIndex         : Indicates which port to set
374  *  bEnable            : Extension index enable (1) or disable (0)
375  *  nFlags             : Extension index flags, if any
376  *  nDataSize          : Size of the extension index data to follow
377  *  pData              : Extension index data, if present.
378  */
379 typedef struct QOMX_EXTNINDEX_PARAMTYPE {
380     OMX_U32 nSize;
381     OMX_VERSIONTYPE nVersion;
382     OMX_U32 nPortIndex;
383     OMX_BOOL bEnable;
384     OMX_U32 nFlags;
385     OMX_U32 nDataSize;
386     OMX_PTR pData;
387 } QOMX_EXTNINDEX_PARAMTYPE;
388 
389 /**
390  * Enumeration used to define the video encoder modes
391  *
392  * ENUMS:
393  *  EncoderModeDefault : Default video recording mode.
394  *                       All encoder settings made through
395  *                       OMX_SetParameter/OMX_SetConfig are applied. No
396  *                       parameter is overridden.
397  *  EncoderModeMMS : Video recording mode for MMS (Multimedia Messaging
398  *                   Service). This mode is similar to EncoderModeDefault
399  *                   except that here the Rate control mode is overridden
400  *                   internally and set as a variant of variable bitrate with
401  *                   variable frame rate. After this mode is set if the IL
402  *                   client tries to set OMX_VIDEO_CONTROLRATETYPE via
403  *                   OMX_IndexParamVideoBitrate that would be rejected. For
404  *                   this, client should set mode back to EncoderModeDefault
405  *                   first and then change OMX_VIDEO_CONTROLRATETYPE.
406  */
407 typedef enum QOMX_VIDEO_ENCODERMODETYPE
408 {
409     QOMX_VIDEO_EncoderModeDefault        = 0x00,
410     QOMX_VIDEO_EncoderModeMMS            = 0x01,
411     QOMX_VIDEO_EncoderModeMax            = 0x7FFFFFFF
412 } QOMX_VIDEO_ENCODERMODETYPE;
413 
414 /**
415  * This structure is used to set the video encoder mode.
416  *
417  * STRUCT MEMBERS:
418  *  nSize      : Size of the structure in bytes
419  *  nVersion   : OMX specification version info
420  *  nPortIndex : Port that this structure applies to
421  *  nMode : defines the video encoder mode
422  */
423 typedef struct QOMX_VIDEO_PARAM_ENCODERMODETYPE {
424     OMX_U32 nSize;
425     OMX_VERSIONTYPE nVersion;
426     OMX_U32 nPortIndex;
427     QOMX_VIDEO_ENCODERMODETYPE nMode;
428 } QOMX_VIDEO_PARAM_ENCODERMODETYPE;
429 
430 /**
431  * This structure describes the parameters corresponding to the
432  * QOMX_VIDEO_SYNTAXHDRTYPE extension. This parameter can be queried
433  * during the loaded state.
434  */
435 
436 typedef struct QOMX_VIDEO_SYNTAXHDRTYPE
437 {
438    OMX_U32 nSize;           /** Size of the structure in bytes */
439    OMX_VERSIONTYPE nVersion;/** OMX specification version information */
440    OMX_U32 nPortIndex;      /** Portindex which is extended by this structure */
441    OMX_U32 nBytes;    	    /** The number of bytes filled in to the buffer */
442    OMX_U8 data[1];          /** Buffer to store the header information */
443 } QOMX_VIDEO_SYNTAXHDRTYPE;
444 
445 /**
446  * This structure describes the parameters corresponding to the
447  * QOMX_VIDEO_TEMPORALSPATIALTYPE extension. This parameter can be set
448  * dynamically during any state except the state invalid.  This is primarily
449  * used for setting MaxQP from the application.  This is set on the out port.
450  */
451 
452 typedef struct QOMX_VIDEO_TEMPORALSPATIALTYPE
453 {
454    OMX_U32 nSize;           /** Size of the structure in bytes */
455    OMX_VERSIONTYPE nVersion;/** OMX specification version information */
456    OMX_U32 nPortIndex;      /** Portindex which is extended by this structure */
457    OMX_U32 nTSFactor;       /** Temoral spatial tradeoff factor value in 0-100 */
458 } QOMX_VIDEO_TEMPORALSPATIALTYPE;
459 
460 /**
461  * This structure describes the parameters corresponding to the
462  * OMX_QCOM_VIDEO_CONFIG_INTRAPERIODTYPE extension. This parameter can be set
463  * dynamically during any state except the state invalid.  This is set on the out port.
464  */
465 
466 typedef struct QOMX_VIDEO_INTRAPERIODTYPE
467 {
468    OMX_U32 nSize;           /** Size of the structure in bytes */
469    OMX_VERSIONTYPE nVersion;/** OMX specification version information */
470    OMX_U32 nPortIndex;      /** Portindex which is extended by this structure */
471    OMX_U32 nIDRPeriod;      /** This specifies coding a frame as IDR after every nPFrames
472 			        of intra frames. If this parameter is set to 0, only the
473 				first frame of the encode session is an IDR frame. This
474 				field is ignored for non-AVC codecs and is used only for
475 				codecs that support IDR Period */
476    OMX_U32 nPFrames;         /** The number of "P" frames between two "I" frames */
477    OMX_U32 nBFrames;         /** The number of "B" frames between two "I" frames */
478 } QOMX_VIDEO_INTRAPERIODTYPE;
479 
480 /**
481  * This structure describes the parameters corresponding to the
482  * OMX_QCOM_VIDEO_CONFIG_ULBUFFEROCCUPANCYTYPE extension. This parameter can be set
483  * dynamically during any state except the state invalid. This is used for the buffer negotiation
484  * with other clients.  This is set on the out port.
485  */
486 typedef struct OMX_QCOM_VIDEO_CONFIG_ULBUFFEROCCUPANCYTYPE
487 {
488    OMX_U32 nSize;            /** Size of the structure in bytes */
489    OMX_VERSIONTYPE nVersion; /** OMX specification version information */
490    OMX_U32 nPortIndex;       /** Portindex which is extended by this structure */
491    OMX_U32 nBufferOccupancy; /** The number of bytes to be set for the buffer occupancy */
492 } OMX_QCOM_VIDEO_CONFIG_ULBUFFEROCCUPANCYTYPE;
493 
494 /**
495  * This structure describes the parameters corresponding to the
496  * OMX_QCOM_VIDEO_CONFIG_RANDOMINTRAREFRESHTYPE extension. This parameter can be set
497  * dynamically during any state except the state invalid. This is primarily used for the dynamic/random
498  * intrarefresh.  This is set on the out port.
499  */
500 typedef struct OMX_QCOM_VIDEO_CONFIG_RANDOMINTRAREFRESHTYPE
501 {
502    OMX_U32 nSize;           /** Size of the structure in bytes */
503    OMX_VERSIONTYPE nVersion;/** OMX specification version information */
504    OMX_U32 nPortIndex;      /** Portindex which is extended by this structure */
505    OMX_U32 nRirMBs;         /** The number of MBs to be set for intrarefresh */
506 } OMX_QCOM_VIDEO_CONFIG_RANDOMINTRAREFRESHTYPE;
507 
508 
509 /**
510  * This structure describes the parameters corresponding to the
511  * OMX_QCOM_VIDEO_CONFIG_QPRANGE extension. This parameter can be set
512  * dynamically during any state except the state invalid. This is primarily
513  * used for the min/max QP to be set from the application.  This
514  * is set on the out port.
515  */
516 typedef struct OMX_QCOM_VIDEO_CONFIG_QPRANGE
517 {
518    OMX_U32 nSize;           /** Size of the structure in bytes */
519    OMX_VERSIONTYPE nVersion;/** OMX specification version information */
520    OMX_U32 nPortIndex;      /** Portindex which is extended by this structure */
521    OMX_U32 nMinQP;          /** The number for minimum quantization parameter */
522    OMX_U32 nMaxQP;          /** The number for maximum quantization parameter */
523 } OMX_QCOM_VIDEO_CONFIG_QPRANGE;
524 
525 
526 typedef struct OMX_VENDOR_EXTRADATATYPE  {
527     OMX_U32 nPortIndex;
528     OMX_U32 nDataSize;
529     OMX_U8  *pData;     // cdata (codec_data/extradata)
530 } OMX_VENDOR_EXTRADATATYPE;
531 
532 typedef enum OMX_INDEXVENDORTYPE {
533     OMX_IndexVendorFileReadInputFilename = 0xFF000001,
534     OMX_IndexVendorParser3gpInputFilename = 0xFF000002,
535     OMX_IndexVendorVideoExtraData = 0xFF000003,
536     OMX_IndexVendorAudioExtraData = 0xFF000004
537 } OMX_INDEXVENDORTYPE;
538 
539 typedef enum OMX_QCOM_VC1RESOLUTIONTYPE
540 {
541    OMX_QCOM_VC1_PICTURE_RES_1x1,
542    OMX_QCOM_VC1_PICTURE_RES_2x1,
543    OMX_QCOM_VC1_PICTURE_RES_1x2,
544    OMX_QCOM_VC1_PICTURE_RES_2x2
545 } OMX_QCOM_VC1RESOLUTIONTYPE;
546 
547 typedef enum OMX_QCOM_INTERLACETYPE
548 {
549     OMX_QCOM_InterlaceFrameProgressive,
550     OMX_QCOM_InterlaceInterleaveFrameTopFieldFirst,
551     OMX_QCOM_InterlaceInterleaveFrameBottomFieldFirst,
552     OMX_QCOM_InterlaceFrameTopFieldFirst,
553     OMX_QCOM_InterlaceFrameBottomFieldFirst,
554     OMX_QCOM_InterlaceFieldTop,
555     OMX_QCOM_InterlaceFieldBottom
556 }OMX_QCOM_INTERLACETYPE;
557 
558 typedef struct OMX_QCOM_PARAM_VIDEO_INTERLACETYPE
559 {
560     OMX_U32 nSize;           /** Size of the structure in bytes */
561     OMX_VERSIONTYPE nVersion;/** OMX specification version information */
562     OMX_U32 nPortIndex;    /** Portindex which is extended by this structure */
563     OMX_BOOL bInterlace;  /** Interlace content **/
564 }OMX_QCOM_PARAM_VIDEO_INTERLACETYPE;
565 
566 typedef struct OMX_QCOM_CONFIG_INTERLACETYPE
567 {
568     OMX_U32 nSize;
569     OMX_VERSIONTYPE nVersion;
570     OMX_U32 nPortIndex;
571     OMX_U32 nIndex;
572     OMX_QCOM_INTERLACETYPE eInterlaceType;
573 }OMX_QCOM_CONFIG_INTERLACETYPE;
574 
575 #define MAX_PAN_SCAN_WINDOWS 4
576 
577 typedef struct OMX_QCOM_PANSCAN
578 {
579    OMX_U32 numWindows;
580    OMX_QCOMRectangle window[MAX_PAN_SCAN_WINDOWS];
581 } OMX_QCOM_PANSCAN;
582 
583 typedef struct OMX_QCOM_ASPECT_RATIO
584 {
585    OMX_U32 aspectRatioX;
586    OMX_U32 aspectRatioY;
587 } OMX_QCOM_ASPECT_RATIO;
588 
589 typedef struct OMX_QCOM_FRAME_PACK_ARRANGEMENT
590 {
591   OMX_U32 nSize;
592   OMX_VERSIONTYPE nVersion;
593   OMX_U32 nPortIndex;
594   OMX_U32 id;
595   OMX_U32 cancel_flag;
596   OMX_U32 type;
597   OMX_U32 quincunx_sampling_flag;
598   OMX_U32 content_interpretation_type;
599   OMX_U32 spatial_flipping_flag;
600   OMX_U32 frame0_flipped_flag;
601   OMX_U32 field_views_flag;
602   OMX_U32 current_frame_is_frame0_flag;
603   OMX_U32 frame0_self_contained_flag;
604   OMX_U32 frame1_self_contained_flag;
605   OMX_U32 frame0_grid_position_x;
606   OMX_U32 frame0_grid_position_y;
607   OMX_U32 frame1_grid_position_x;
608   OMX_U32 frame1_grid_position_y;
609   OMX_U32 reserved_byte;
610   OMX_U32 repetition_period;
611   OMX_U32 extension_flag;
612 } OMX_QCOM_FRAME_PACK_ARRANGEMENT;
613 
614 typedef struct OMX_QCOM_EXTRADATA_FRAMEINFO
615 {
616    // common frame meta data. interlace related info removed
617    OMX_VIDEO_PICTURETYPE  ePicType;
618    OMX_QCOM_INTERLACETYPE interlaceType;
619    OMX_QCOM_PANSCAN       panScan;
620    OMX_QCOM_ASPECT_RATIO  aspectRatio;
621    OMX_U32                nConcealedMacroblocks;
622    OMX_U32                nFrameRate;
623 } OMX_QCOM_EXTRADATA_FRAMEINFO;
624 
625 typedef struct OMX_QCOM_EXTRADATA_FRAMEDIMENSION
626 {
627    /** Frame Dimensions added to each YUV buffer */
628    OMX_U32   nDecWidth;  /** Width  rounded to multiple of 16 */
629    OMX_U32   nDecHeight; /** Height rounded to multiple of 16 */
630    OMX_U32   nActualWidth; /** Actual Frame Width */
631    OMX_U32   nActualHeight; /** Actual Frame Height */
632 
633 }OMX_QCOM_EXTRADATA_FRAMEDIMENSION;
634 
635 typedef struct OMX_QCOM_H264EXTRADATA
636 {
637    OMX_U64 seiTimeStamp;
638 } OMX_QCOM_H264EXTRADATA;
639 
640 typedef struct OMX_QCOM_VC1EXTRADATA
641 {
642    OMX_U32                     nVC1RangeY;
643    OMX_U32                     nVC1RangeUV;
644    OMX_QCOM_VC1RESOLUTIONTYPE eVC1PicResolution;
645 } OMX_QCOM_VC1EXTRADATA;
646 
647 typedef union OMX_QCOM_EXTRADATA_CODEC_DATA
648 {
649    OMX_QCOM_H264EXTRADATA h264ExtraData;
650    OMX_QCOM_VC1EXTRADATA vc1ExtraData;
651 } OMX_QCOM_EXTRADATA_CODEC_DATA;
652 
653 typedef enum OMX_QCOM_EXTRADATATYPE
654 {
655    OMX_ExtraDataFrameInfo = 0x7F000001,
656    OMX_ExtraDataH264 = 0x7F000002,
657    OMX_ExtraDataVC1 = 0x7F000003,
658    OMX_ExtraDataFrameDimension = 0x7F000004,
659    OMX_ExtraDataVideoEncoderSliceInfo = 0x7F000005,
660    OMX_ExtraDataConcealMB = 0x7F000006,
661    OMX_ExtraDataInterlaceFormat = 0x7F000007,
662    OMX_ExtraDataPortDef = 0x7F000008
663 } OMX_QCOM_EXTRADATATYPE;
664 
665 typedef struct  OMX_STREAMINTERLACEFORMATTYPE {
666     OMX_U32 nSize;
667     OMX_VERSIONTYPE nVersion;
668     OMX_U32 nPortIndex;
669     OMX_BOOL bInterlaceFormat;
670     OMX_U32 nInterlaceFormats;
671 } OMX_STREAMINTERLACEFORMAT;
672 
673 typedef enum OMX_INTERLACETYPE
674 {
675    OMX_InterlaceFrameProgressive,
676    OMX_InterlaceInterleaveFrameTopFieldFirst,
677    OMX_InterlaceInterleaveFrameBottomFieldFirst,
678    OMX_InterlaceFrameTopFieldFirst,
679    OMX_InterlaceFrameBottomFieldFirst
680 }OMX_INTERLACEs;
681 
682 
683 #define OMX_EXTRADATA_HEADER_SIZE 20
684 
685 /**
686  * DivX Versions
687  */
688 typedef enum  QOMX_VIDEO_DIVXFORMATTYPE {
689     QOMX_VIDEO_DIVXFormatUnused = 0x01, /**< Format unused or unknown */
690     QOMX_VIDEO_DIVXFormat311    = 0x02, /**< DivX 3.11 */
691     QOMX_VIDEO_DIVXFormat4      = 0x04, /**< DivX 4 */
692     QOMX_VIDEO_DIVXFormat5      = 0x08, /**< DivX 5 */
693     QOMX_VIDEO_DIVXFormat6      = 0x10, /**< DivX 6 */
694     QOMX_VIDEO_DIVXFormatKhronosExtensions = 0x6F000000,
695     QOMX_VIDEO_DIVXFormatVendorStartUnused = 0x7F000000,
696     QOMX_VIDEO_DIVXFormatMax = 0x7FFFFFFF
697 } QOMX_VIDEO_DIVXFORMATTYPE;
698 
699 /**
700  * DivX profile types, each profile indicates support for
701  * various performance bounds.
702  */
703 typedef enum QOMX_VIDEO_DIVXPROFILETYPE {
704     QOMX_VIDEO_DivXProfileqMobile = 0x01, /**< qMobile Profile */
705     QOMX_VIDEO_DivXProfileMobile  = 0x02, /**< Mobile Profile */
706     QOMX_VIDEO_DivXProfileMT      = 0x04, /**< Mobile Theatre Profile */
707     QOMX_VIDEO_DivXProfileHT      = 0x08, /**< Home Theatre Profile */
708     QOMX_VIDEO_DivXProfileHD      = 0x10, /**< High Definition Profile */
709     QOMX_VIDEO_DIVXProfileKhronosExtensions = 0x6F000000,
710     QOMX_VIDEO_DIVXProfileVendorStartUnused = 0x7F000000,
711     QOMX_VIDEO_DIVXProfileMax = 0x7FFFFFFF
712 } QOMX_VIDEO_DIVXPROFILETYPE;
713 
714 /**
715  * DivX Video Params
716  *
717  *  STRUCT MEMBERS:
718  *  nSize      : Size of the structure in bytes
719  *  nVersion   : OMX specification version information
720  *  nPortIndex : Port that this structure applies to
721  *  eFormat    : Version of DivX stream / data
722  *  eProfile   : Profile of DivX stream / data
723  */
724 typedef struct QOMX_VIDEO_PARAM_DIVXTYPE {
725     OMX_U32 nSize;
726     OMX_VERSIONTYPE nVersion;
727     OMX_U32 nPortIndex;
728     QOMX_VIDEO_DIVXFORMATTYPE eFormat;
729     QOMX_VIDEO_DIVXPROFILETYPE eProfile;
730 } QOMX_VIDEO_PARAM_DIVXTYPE;
731 
732 
733 
734 /**
735  *  VP Versions
736  */
737 typedef enum QOMX_VIDEO_VPFORMATTYPE {
738     QOMX_VIDEO_VPFormatUnused = 0x01, /**< Format unused or unknown */
739     QOMX_VIDEO_VPFormat6      = 0x02, /**< VP6 Video Format */
740     QOMX_VIDEO_VPFormat7      = 0x04, /**< VP7 Video Format */
741     QOMX_VIDEO_VPFormat8      = 0x08, /**< VP8 Video Format */
742     QOMX_VIDEO_VPFormatKhronosExtensions = 0x6F000000,
743     QOMX_VIDEO_VPFormatVendorStartUnused = 0x7F000000,
744     QOMX_VIDEO_VPFormatMax = 0x7FFFFFFF
745 } QOMX_VIDEO_VPFORMATTYPE;
746 
747 /**
748  * VP profile types, each profile indicates support for various
749  * encoding tools.
750  */
751 typedef enum QOMX_VIDEO_VPPROFILETYPE {
752     QOMX_VIDEO_VPProfileSimple   = 0x01, /**< Simple Profile, applies to VP6 only */
753     QOMX_VIDEO_VPProfileAdvanced = 0x02, /**< Advanced Profile, applies to VP6 only */
754     QOMX_VIDEO_VPProfileVersion0 = 0x04, /**< Version 0, applies to VP7 and VP8 */
755     QOMX_VIDEO_VPProfileVersion1 = 0x08, /**< Version 1, applies to VP7 and VP8 */
756     QOMX_VIDEO_VPProfileVersion2 = 0x10, /**< Version 2, applies to VP8 only */
757     QOMX_VIDEO_VPProfileVersion3 = 0x20, /**< Version 3, applies to VP8 only */
758     QOMX_VIDEO_VPProfileKhronosExtensions = 0x6F000000,
759     QOMX_VIDEO_VPProfileVendorStartUnused = 0x7F000000,
760     QOMX_VIDEO_VPProfileMax = 0x7FFFFFFF
761 } QOMX_VIDEO_VPPROFILETYPE;
762 
763 /**
764  * VP Video Params
765  *
766  *  STRUCT MEMBERS:
767  *  nSize      : Size of the structure in bytes
768  *  nVersion   : OMX specification version information
769  *  nPortIndex : Port that this structure applies to
770  *  eFormat    : Format of VP stream / data
771  *  eProfile   : Profile or Version of VP stream / data
772  */
773 typedef struct QOMX_VIDEO_PARAM_VPTYPE {
774     OMX_U32 nSize;
775     OMX_VERSIONTYPE nVersion;
776     OMX_U32 nPortIndex;
777     QOMX_VIDEO_VPFORMATTYPE eFormat;
778     QOMX_VIDEO_VPPROFILETYPE eProfile;
779 } QOMX_VIDEO_PARAM_VPTYPE;
780 
781 /**
782  * Spark Versions
783  */
784 typedef enum QOMX_VIDEO_SPARKFORMATTYPE {
785     QOMX_VIDEO_SparkFormatUnused = 0x01, /**< Format unused or unknown */
786     QOMX_VIDEO_SparkFormat0      = 0x02, /**< Video Format Version 0 */
787     QOMX_VIDEO_SparkFormat1      = 0x04, /**< Video Format Version 1 */
788     QOMX_VIDEO_SparkFormatKhronosExtensions = 0x6F000000,
789     QOMX_VIDEO_SparkFormatVendorStartUnused = 0x7F000000,
790     QOMX_VIDEO_SparkFormatMax = 0x7FFFFFFF
791 } QOMX_VIDEO_SPARKFORMATTYPE;
792 
793 /**
794  * Spark Video Params
795  *
796  *  STRUCT MEMBERS:
797  *  nSize      : Size of the structure in bytes
798  *  nVersion   : OMX specification version information
799  *  nPortIndex : Port that this structure applies to
800  *  eFormat    : Version of Spark stream / data
801  */
802 typedef struct QOMX_VIDEO_PARAM_SPARKTYPE {
803     OMX_U32 nSize;
804     OMX_VERSIONTYPE nVersion;
805     OMX_U32 nPortIndex;
806     QOMX_VIDEO_SPARKFORMATTYPE eFormat;
807 } QOMX_VIDEO_PARAM_SPARKTYPE;
808 
809 
810 typedef struct QOMX_VIDEO_QUERY_DECODER_INSTANCES {
811     OMX_U32 nSize;
812     OMX_VERSIONTYPE nVersion;
813     OMX_U32 nPortIndex;
814     OMX_U32 nNumOfInstances;
815 } QOMX_VIDEO_QUERY_DECODER_INSTANCES;
816 
817 typedef struct QOMX_ENABLETYPE {
818     OMX_BOOL bEnable;
819 } QOMX_ENABLETYPE;
820 
821 typedef enum QOMX_VIDEO_EVENTS {
822     OMX_EventIndexsettingChanged = OMX_EventVendorStartUnused
823 } QOMX_VIDEO_EVENTS;
824 
825 typedef enum QOMX_VIDEO_PICTURE_ORDER {
826     QOMX_VIDEO_DISPLAY_ORDER = 0x1,
827     QOMX_VIDEO_DECODE_ORDER = 0x2
828 } QOMX_VIDEO_PICTURE_ORDER;
829 
830 typedef struct QOMX_VIDEO_DECODER_PICTURE_ORDER {
831     OMX_U32 nSize;
832     OMX_VERSIONTYPE nVersion;
833     OMX_U32 nPortIndex;
834     QOMX_VIDEO_PICTURE_ORDER eOutputPictureOrder;
835 } QOMX_VIDEO_DECODER_PICTURE_ORDER;
836 
837 typedef struct QOMX_INDEXEXTRADATATYPE {
838     OMX_U32 nSize;
839     OMX_VERSIONTYPE nVersion;
840     OMX_U32 nPortIndex;
841     OMX_BOOL bEnabled;
842     OMX_INDEXTYPE nIndex;
843 } QOMX_INDEXEXTRADATATYPE;
844 
845 typedef struct QOMX_INDEXTIMESTAMPREORDER {
846 	OMX_U32 nSize;
847 	OMX_VERSIONTYPE nVersion;
848 	OMX_U32 nPortIndex;
849 	OMX_BOOL bEnable;
850 } QOMX_INDEXTIMESTAMPREORDER;
851 
852 #define OMX_QCOM_INDEX_PARAM_VIDEO_SYNCFRAMEDECODINGMODE "OMX.QCOM.index.param.video.SyncFrameDecodingMode"
853 #define OMX_QCOM_INDEX_PARAM_INDEXEXTRADATA "OMX.QCOM.index.param.IndexExtraData"
854 #define OMX_QCOM_INDEX_PARAM_VIDEO_SLICEDELIVERYMODE "OMX.QCOM.index.param.SliceDeliveryMode"
855 
856 typedef enum {
857     QOMX_VIDEO_FRAME_PACKING_CHECKERBOARD = 0,
858     QOMX_VIDEO_FRAME_PACKING_COLUMN_INTERLEAVE = 1,
859     QOMX_VIDEO_FRAME_PACKING_ROW_INTERLEAVE = 2,
860     QOMX_VIDEO_FRAME_PACKING_SIDE_BY_SIDE = 3,
861     QOMX_VIDEO_FRAME_PACKING_TOP_BOTTOM = 4,
862     QOMX_VIDEO_FRAME_PACKING_TEMPORAL = 5,
863 } QOMX_VIDEO_FRAME_PACKING_ARRANGEMENT;
864 
865 typedef enum {
866     QOMX_VIDEO_CONTENT_UNSPECIFIED = 0,
867     QOMX_VIDEO_CONTENT_LR_VIEW = 1,
868     QOMX_VIDEO_CONTENT_RL_VIEW = 2,
869 } QOMX_VIDEO_CONTENT_INTERPRETATION;
870 
871 #ifdef __cplusplus
872 }
873 #endif /* __cplusplus */
874 
875 #endif /* __OMX_QCOM_EXTENSIONS_H__ */
876