1/*--------------------------------------------------------------------------
2Copyright (c) 2009, The Linux Foundation. All rights reserved.
3
4Redistribution and use in source and binary forms, with or without
5modification, 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
16THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19NON-INFRINGEMENT ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR
20CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
21EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
22PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
23OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
24WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
25OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
26ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27--------------------------------------------------------------------------*/
28#ifndef __OMX_QCOM_EXTENSIONS_H__
29#define __OMX_QCOM_EXTENSIONS_H__
30
31/*============================================================================
32*//** @file OMX_QCOMExtns.h
33  This header contains constants and type definitions that specify the
34  extensions added to the OpenMAX Vendor specific APIs.
35
36*//*========================================================================*/
37
38
39//////////////////////////////////////////////////////////////////////////////
40//                             Include Files
41//////////////////////////////////////////////////////////////////////////////
42#include "OMX_Core.h"
43#include "OMX_Video.h"
44
45/**
46 * This extension is used to register mapping of a virtual
47 * address to a physical address. This extension is a parameter
48 * which can be set using the OMX_SetParameter macro. The data
49 * pointer corresponding to this extension is
50 * OMX_QCOM_MemMapEntry. This parameter is a 'write only'
51 * parameter (Current value cannot be queried using
52 * OMX_GetParameter macro).
53 */
54#define OMX_QCOM_EXTN_REGISTER_MMAP     "OMX.QCOM.index.param.register_mmap"
55
56/**
57 * This structure describes the data pointer corresponding to
58 * the OMX_QCOM_MMAP_REGISTER_EXTN extension. This parameter
59 * must be set only 'after' populating a port with a buffer
60 * using OMX_UseBuffer, wherein the data pointer of the buffer
61 * corresponds to the virtual address as specified in this
62 * structure.
63 */
64struct OMX_QCOM_PARAM_MEMMAPENTRYTYPE
65{
66    OMX_U32 nSize;              /** Size of the structure in bytes */
67    OMX_VERSIONTYPE nVersion;   /**< OMX specification version information */
68    OMX_U32 nPortIndex;         /**< Port number the structure applies to */
69
70    /**
71     * The virtual address of memory block
72     */
73    OMX_U64 nVirtualAddress;
74
75    /**
76     * The physical address corresponding to the virtual address. The physical
77     * address is contiguous for the entire valid range of the virtual
78     * address.
79     */
80    OMX_U64 nPhysicalAddress;
81};
82
83#define QOMX_VIDEO_IntraRefreshRandom (OMX_VIDEO_IntraRefreshVendorStartUnused + 0)
84
85#define OMX_QCOM_PORTDEFN_EXTN   "OMX.QCOM.index.param.portdefn"
86/* Allowed APIs on the above Index: OMX_GetParameter() and OMX_SetParameter() */
87
88typedef enum OMX_QCOMMemoryRegion
89{
90    OMX_QCOM_MemRegionInvalid,
91    OMX_QCOM_MemRegionEBI1,
92    OMX_QCOM_MemRegionSMI,
93    OMX_QCOM_MemRegionMax = 0X7FFFFFFF
94} OMX_QCOMMemoryRegion;
95
96typedef enum OMX_QCOMCacheAttr
97{
98    OMX_QCOM_CacheAttrNone,
99    OMX_QCOM_CacheAttrWriteBack,
100    OMX_QCOM_CacheAttrWriteThrough,
101    OMX_QCOM_CacheAttrMAX = 0X7FFFFFFF
102} OMX_QCOMCacheAttr;
103
104typedef struct OMX_QCOMRectangle
105{
106   OMX_S32 x;
107   OMX_S32 y;
108   OMX_S32 dx;
109   OMX_S32 dy;
110} OMX_QCOMRectangle;
111
112/** OMX_QCOMFramePackingFormat
113  * Input or output buffer format
114  */
115typedef enum OMX_QCOMFramePackingFormat
116{
117  /* 0 - unspecified
118   */
119  OMX_QCOM_FramePacking_Unspecified,
120
121  /*  1 - Partial frames may be present OMX IL 1.1.1 Figure 2-10:
122   *  Case 1??Each Buffer Filled In Whole or In Part
123   */
124  OMX_QCOM_FramePacking_Arbitrary,
125
126  /*  2 - Multiple complete frames per buffer (integer number)
127   *  OMX IL 1.1.1 Figure 2-11: Case 2�Each Buffer Filled with
128   *  Only Complete Frames of Data
129   */
130  OMX_QCOM_FramePacking_CompleteFrames,
131
132  /*  3 - Only one complete frame per buffer, no partial frame
133   *  OMX IL 1.1.1 Figure 2-12: Case 3�Each Buffer Filled with
134   *  Only One Frame of Compressed Data. Usually at least one
135   *  complete unit of data will be delivered in a buffer for
136   *  uncompressed data formats.
137   */
138  OMX_QCOM_FramePacking_OnlyOneCompleteFrame,
139
140  /*  4 - Only one complete subframe per buffer, no partial subframe
141   *  Example: In H264, one complete NAL per buffer, where one frame
142   *  can contatin multiple NAL
143   */
144  OMX_QCOM_FramePacking_OnlyOneCompleteSubFrame,
145
146  OMX_QCOM_FramePacking_MAX = 0X7FFFFFFF
147} OMX_QCOMFramePackingFormat;
148
149typedef struct OMX_QCOM_PARAM_PORTDEFINITIONTYPE {
150 OMX_U32 nSize;           /** Size of the structure in bytes */
151 OMX_VERSIONTYPE nVersion;/** OMX specification version information */
152 OMX_U32 nPortIndex;    /** Portindex which is extended by this structure */
153
154 /** Platform specific memory region EBI1, SMI, etc.,*/
155 OMX_QCOMMemoryRegion nMemRegion;
156
157 OMX_QCOMCacheAttr nCacheAttr; /** Cache attributes */
158
159 /** Input or output buffer format */
160 OMX_U32 nFramePackingFormat;
161
162} OMX_QCOM_PARAM_PORTDEFINITIONTYPE;
163
164#define OMX_QCOM_PLATFORMPVT_EXTN   "OMX.QCOM.index.param.platformprivate"
165/** Allowed APIs on the above Index: OMX_SetParameter() */
166
167typedef enum OMX_QCOM_PLATFORM_PRIVATE_ENTRY_TYPE
168{
169    /** Enum for PMEM information */
170    OMX_QCOM_PLATFORM_PRIVATE_PMEM = 0x1
171} OMX_QCOM_PLATFORM_PRIVATE_ENTRY_TYPE;
172
173/** IL client will set the following structure. A failure
174 *  code will be returned if component does not support the
175 *  value provided for 'type'.
176 */
177struct OMX_QCOM_PLATFORMPRIVATE_EXTN
178{
179    OMX_U32 nSize;        /** Size of the structure in bytes */
180    OMX_VERSIONTYPE nVersion; /** OMX spec version information */
181    OMX_U32 nPortIndex;  /** Port number on which usebuffer extn is applied */
182
183    /** Type of extensions should match an entry from
184     OMX_QCOM_PLATFORM_PRIVATE_ENTRY_TYPE
185    */
186    OMX_QCOM_PLATFORM_PRIVATE_ENTRY_TYPE type;
187};
188
189typedef struct OMX_QCOM_PLATFORM_PRIVATE_PMEM_INFO
190{
191    /** pmem file descriptor */
192    OMX_U32 pmem_fd;
193    /** Offset from pmem device base address */
194    OMX_U32 offset;
195}OMX_QCOM_PLATFORM_PRIVATE_PMEM_INFO;
196
197typedef struct OMX_QCOM_PLATFORM_PRIVATE_ENTRY
198{
199    /** Entry type */
200    OMX_QCOM_PLATFORM_PRIVATE_ENTRY_TYPE type;
201
202    /** Pointer to platform specific entry */
203    void* entry;
204}OMX_QCOM_PLATFORM_PRIVATE_ENTRY;
205
206typedef struct OMX_QCOM_PLATFORM_PRIVATE_LIST
207{
208    /** Number of entries */
209    OMX_U32 nEntries;
210
211    /** Pointer to array of platform specific entries *
212     * Contiguous block of OMX_QCOM_PLATFORM_PRIVATE_ENTRY element
213    */
214    OMX_QCOM_PLATFORM_PRIVATE_ENTRY* entryList;
215}OMX_QCOM_PLATFORM_PRIVATE_LIST;
216
217#define OMX_QCOM_FRAME_PACKING_FORMAT   "OMX.QCOM.index.param.framepackfmt"
218/* Allowed API call: OMX_GetParameter() */
219/* IL client can use this index to rerieve the list of frame formats *
220 * supported by the component */
221
222typedef struct OMX_QCOM_FRAME_PACKINGFORMAT_TYPE {
223    OMX_U32 nSize;
224    OMX_VERSIONTYPE nVersion;
225    OMX_U32 nPortIndex;
226    OMX_U32 nIndex;
227    OMX_QCOMFramePackingFormat eframePackingFormat;
228} OMX_QCOM_FRAME_PACKINGFORMAT_TYPE;
229
230
231/**
232 * Following is the enum for color formats supported on Qualcomm
233 * MSMs YVU420SemiPlanar color format is not defined in OpenMAX
234 * 1.1.1 and prior versions of OpenMAX specification.
235 */
236
237enum OMX_QCOM_COLOR_FORMATTYPE
238{
239
240/** YVU420SemiPlanar: YVU planar format, organized with a first
241 *  plane containing Y pixels, and a second plane containing
242 *  interleaved V and U pixels. V and U pixels are sub-sampled
243 *  by a factor of two both horizontally and vertically.
244 */
245    OMX_QCOM_COLOR_FormatYVU420SemiPlanar = 0x7FA30C00,
246    QOMX_COLOR_FormatYVU420PackedSemiPlanar32m4ka,
247    QOMX_COLOR_FormatYUV420PackedSemiPlanar16m2ka,
248    QOMX_COLOR_FormatYUV420PackedSemiPlanar64x32Tile2m8ka
249};
250
251enum OMX_QCOM_VIDEO_CODINGTYPE
252{
253/** Codecs support by qualcomm which are not listed in OMX 1.1.x
254 *  spec
255 *   */
256    OMX_QCOM_VIDEO_CodingVC1  = 0x7FA30C00 ,
257    OMX_QCOM_VIDEO_CodingWMV9 = 0x7FA30C01,
258    QOMX_VIDEO_CodingDivx = 0x7FA30C02,     /**< Value when coding is Divx */
259    QOMX_VIDEO_CodingSpark = 0x7FA30C03,     /**< Value when coding is Sorenson Spark */
260    QOMX_VIDEO_CodingVp = 0x7FA30C04
261};
262
263enum OMX_QCOM_EXTN_INDEXTYPE
264{
265    /** Qcom proprietary extension index list */
266
267    /* "OMX.QCOM.index.param.register_mmap" */
268    OMX_QcomIndexRegmmap = 0x7F000000,
269
270    /* "OMX.QCOM.index.param.platformprivate" */
271    OMX_QcomIndexPlatformPvt = 0x7F000001,
272
273    /* "OMX.QCOM.index.param.portdefn" */
274    OMX_QcomIndexPortDefn = 0x7F000002,
275
276    /* "OMX.QCOM.index.param.framepackingformat" */
277    OMX_QcomIndexPortFramePackFmt = 0x7F000003,
278
279    /*"OMX.QCOM.index.param.Interlaced */
280    OMX_QcomIndexParamInterlaced = 0x7F000004,
281
282    /*"OMX.QCOM.index.config.interlaceformat */
283    OMX_QcomIndexConfigInterlaced = 0x7F000005,
284
285    /*"OMX.QCOM.index.param.syntaxhdr" */
286    QOMX_IndexParamVideoSyntaxHdr = 0x7F000006,
287
288    /*"OMX.QCOM.index.config.intraperiod" */
289    QOMX_IndexConfigVideoIntraperiod = 0x7F000007,
290
291    /*"OMX.QCOM.index.config.randomIntrarefresh" */
292    QOMX_IndexConfigVideoIntraRefresh = 0x7F000008,
293
294    /*"OMX.QCOM.index.config.video.TemporalSpatialTradeOff" */
295    QOMX_IndexConfigVideoTemporalSpatialTradeOff = 0x7F000009,
296
297    /*"OMX.QCOM.index.param.video.EncoderMode" */
298    QOMX_IndexParamVideoEncoderMode = 0x7F00000A,
299
300    /*"OMX.QCOM.index.param.Divxtype */
301    OMX_QcomIndexParamVideoDivx = 0x7F00000B,
302
303    /*"OMX.QCOM.index.param.Sparktype */
304    OMX_QcomIndexParamVideoSpark = 0x7F00000C,
305
306    /*"OMX.QCOM.index.param.Vptype */
307    OMX_QcomIndexParamVideoVp = 0x7F00000D,
308
309    OMX_QcomIndexQueryNumberOfVideoDecInstance = 0x7F00000E
310};
311
312/**
313 * Enumeration used to define the video encoder modes
314 *
315 * ENUMS:
316 *  EncoderModeDefault : Default video recording mode.
317 *                       All encoder settings made through
318 *                       OMX_SetParameter/OMX_SetConfig are applied. No
319 *                       parameter is overridden.
320 *  EncoderModeMMS : Video recording mode for MMS (Multimedia Messaging
321 *                   Service). This mode is similar to EncoderModeDefault
322 *                   except that here the Rate control mode is overridden
323 *                   internally and set as a variant of variable bitrate with
324 *                   variable frame rate. After this mode is set if the IL
325 *                   client tries to set OMX_VIDEO_CONTROLRATETYPE via
326 *                   OMX_IndexParamVideoBitrate that would be rejected. For
327 *                   this, client should set mode back to EncoderModeDefault
328 *                   first and then change OMX_VIDEO_CONTROLRATETYPE.
329 */
330typedef enum QOMX_VIDEO_ENCODERMODETYPE
331{
332    QOMX_VIDEO_EncoderModeDefault        = 0x00,
333    QOMX_VIDEO_EncoderModeMMS            = 0x01,
334    QOMX_VIDEO_EncoderModeMax            = 0x7FFFFFFF
335} QOMX_VIDEO_ENCODERMODETYPE;
336
337/**
338 * This structure is used to set the video encoder mode.
339 *
340 * STRUCT MEMBERS:
341 *  nSize      : Size of the structure in bytes
342 *  nVersion   : OMX specification version info
343 *  nPortIndex : Port that this structure applies to
344 *  nMode : defines the video encoder mode
345 */
346typedef struct QOMX_VIDEO_PARAM_ENCODERMODETYPE {
347    OMX_U32 nSize;
348    OMX_VERSIONTYPE nVersion;
349    OMX_U32 nPortIndex;
350    QOMX_VIDEO_ENCODERMODETYPE nMode;
351} QOMX_VIDEO_PARAM_ENCODERMODETYPE;
352
353/**
354 * This structure describes the parameters corresponding to the
355 * QOMX_VIDEO_SYNTAXHDRTYPE extension. This parameter can be queried
356 * during the loaded state.
357 */
358
359typedef struct QOMX_VIDEO_SYNTAXHDRTYPE
360{
361   OMX_U32 nSize;           /** Size of the structure in bytes */
362   OMX_VERSIONTYPE nVersion;/** OMX specification version information */
363   OMX_U32 nPortIndex;      /** Portindex which is extended by this structure */
364   OMX_U32 nBytes;    	    /** The number of bytes filled in to the buffer */
365   OMX_U8 data[1];          /** Buffer to store the header information */
366} QOMX_VIDEO_SYNTAXHDRTYPE;
367
368/**
369 * This structure describes the parameters corresponding to the
370 * QOMX_VIDEO_TEMPORALSPATIALTYPE extension. This parameter can be set
371 * dynamically during any state except the state invalid.  This is primarily
372 * used for setting MaxQP from the application.  This is set on the out port.
373 */
374
375typedef struct QOMX_VIDEO_TEMPORALSPATIALTYPE
376{
377   OMX_U32 nSize;           /** Size of the structure in bytes */
378   OMX_VERSIONTYPE nVersion;/** OMX specification version information */
379   OMX_U32 nPortIndex;      /** Portindex which is extended by this structure */
380   OMX_U32 nTSFactor;       /** Temoral spatial tradeoff factor value in 0-100 */
381} QOMX_VIDEO_TEMPORALSPATIALTYPE;
382
383/**
384 * This structure describes the parameters corresponding to the
385 * OMX_QCOM_VIDEO_CONFIG_INTRAPERIODTYPE extension. This parameter can be set
386 * dynamically during any state except the state invalid.  This is set on the out port.
387 */
388
389typedef struct QOMX_VIDEO_INTRAPERIODTYPE
390{
391   OMX_U32 nSize;           /** Size of the structure in bytes */
392   OMX_VERSIONTYPE nVersion;/** OMX specification version information */
393   OMX_U32 nPortIndex;      /** Portindex which is extended by this structure */
394   OMX_U32 nIDRPeriod;      /** This specifies coding a frame as IDR after every nPFrames
395			        of intra frames. If this parameter is set to 0, only the
396				first frame of the encode session is an IDR frame. This
397				field is ignored for non-AVC codecs and is used only for
398				codecs that support IDR Period */
399   OMX_U32 nPFrames;         /** The number of "P" frames between two "I" frames */
400   OMX_U32 nBFrames;         /** The number of "B" frames between two "I" frames */
401} QOMX_VIDEO_INTRAPERIODTYPE;
402
403/**
404 * This structure describes the parameters corresponding to the
405 * OMX_QCOM_VIDEO_CONFIG_ULBUFFEROCCUPANCYTYPE extension. This parameter can be set
406 * dynamically during any state except the state invalid. This is used for the buffer negotiation
407 * with other clients.  This is set on the out port.
408 */
409typedef struct OMX_QCOM_VIDEO_CONFIG_ULBUFFEROCCUPANCYTYPE
410{
411   OMX_U32 nSize;            /** Size of the structure in bytes */
412   OMX_VERSIONTYPE nVersion; /** OMX specification version information */
413   OMX_U32 nPortIndex;       /** Portindex which is extended by this structure */
414   OMX_U32 nBufferOccupancy; /** The number of bytes to be set for the buffer occupancy */
415} OMX_QCOM_VIDEO_CONFIG_ULBUFFEROCCUPANCYTYPE;
416
417/**
418 * This structure describes the parameters corresponding to the
419 * OMX_QCOM_VIDEO_CONFIG_RANDOMINTRAREFRESHTYPE extension. This parameter can be set
420 * dynamically during any state except the state invalid. This is primarily used for the dynamic/random
421 * intrarefresh.  This is set on the out port.
422 */
423typedef struct OMX_QCOM_VIDEO_CONFIG_RANDOMINTRAREFRESHTYPE
424{
425   OMX_U32 nSize;           /** Size of the structure in bytes */
426   OMX_VERSIONTYPE nVersion;/** OMX specification version information */
427   OMX_U32 nPortIndex;      /** Portindex which is extended by this structure */
428   OMX_U32 nRirMBs;         /** The number of MBs to be set for intrarefresh */
429} OMX_QCOM_VIDEO_CONFIG_RANDOMINTRAREFRESHTYPE;
430
431
432/**
433 * This structure describes the parameters corresponding to the
434 * OMX_QCOM_VIDEO_CONFIG_QPRANGE extension. This parameter can be set
435 * dynamically during any state except the state invalid. This is primarily
436 * used for the min/max QP to be set from the application.  This
437 * is set on the out port.
438 */
439typedef struct OMX_QCOM_VIDEO_CONFIG_QPRANGE
440{
441   OMX_U32 nSize;           /** Size of the structure in bytes */
442   OMX_VERSIONTYPE nVersion;/** OMX specification version information */
443   OMX_U32 nPortIndex;      /** Portindex which is extended by this structure */
444   OMX_U32 nMinQP;          /** The number for minimum quantization parameter */
445   OMX_U32 nMaxQP;          /** The number for maximum quantization parameter */
446} OMX_QCOM_VIDEO_CONFIG_QPRANGE;
447
448
449typedef struct OMX_VENDOR_EXTRADATATYPE  {
450    OMX_U32 nPortIndex;
451    OMX_U32 nDataSize;
452    OMX_U8  *pData;     // cdata (codec_data/extradata)
453} OMX_VENDOR_EXTRADATATYPE;
454
455typedef enum OMX_INDEXVENDORTYPE {
456    OMX_IndexVendorFileReadInputFilename = 0xFF000001,
457    OMX_IndexVendorParser3gpInputFilename = 0xFF000002,
458    OMX_IndexVendorVideoExtraData = 0xFF000003,
459    OMX_IndexVendorAudioExtraData = 0xFF000004
460} OMX_INDEXVENDORTYPE;
461
462typedef enum OMX_QCOM_VC1RESOLUTIONTYPE
463{
464   OMX_QCOM_VC1_PICTURE_RES_1x1,
465   OMX_QCOM_VC1_PICTURE_RES_2x1,
466   OMX_QCOM_VC1_PICTURE_RES_1x2,
467   OMX_QCOM_VC1_PICTURE_RES_2x2
468} OMX_QCOM_VC1RESOLUTIONTYPE;
469
470typedef enum OMX_QCOM_INTERLACETYPE
471{
472    OMX_QCOM_InterlaceFrameProgressive,
473    OMX_QCOM_InterlaceInterleaveFrameTopFieldFirst,
474    OMX_QCOM_InterlaceInterleaveFrameBottomFieldFirst,
475    OMX_QCOM_InterlaceFrameTopFieldFirst,
476    OMX_QCOM_InterlaceFrameBottomFieldFirst,
477    OMX_QCOM_InterlaceFieldTop,
478    OMX_QCOM_InterlaceFieldBottom
479}OMX_QCOM_INTERLACETYPE;
480
481typedef struct OMX_QCOM_PARAM_VIDEO_INTERLACETYPE
482{
483    OMX_U32 nSize;           /** Size of the structure in bytes */
484    OMX_VERSIONTYPE nVersion;/** OMX specification version information */
485    OMX_U32 nPortIndex;    /** Portindex which is extended by this structure */
486    OMX_BOOL bInterlace;  /** Interlace content **/
487}OMX_QCOM_PARAM_VIDEO_INTERLACETYPE;
488
489typedef struct OMX_QCOM_CONFIG_INTERLACETYPE
490{
491    OMX_U32 nSize;
492    OMX_VERSIONTYPE nVersion;
493    OMX_U32 nPortIndex;
494    OMX_U32 nIndex;
495    OMX_QCOM_INTERLACETYPE eInterlaceType;
496}OMX_QCOM_CONFIG_INTERLACETYPE;
497
498#define MAX_PAN_SCAN_WINDOWS 4
499
500typedef struct OMX_QCOM_PANSCAN
501{
502   OMX_U32 numWindows;
503   OMX_QCOMRectangle window[MAX_PAN_SCAN_WINDOWS];
504} OMX_QCOM_PANSCAN;
505
506typedef struct OMX_QCOM_EXTRADATA_FRAMEINFO
507{
508   // common frame meta data. interlace related info removed
509   OMX_VIDEO_PICTURETYPE  ePicType;
510   OMX_QCOM_INTERLACETYPE interlaceType;
511   OMX_QCOM_PANSCAN       panScan;
512   OMX_U32                nConcealedMacroblocks;
513} OMX_QCOM_EXTRADATA_FRAMEINFO;
514
515typedef struct OMX_QCOM_EXTRADATA_FRAMEDIMENSION
516{
517   /** Frame Dimensions added to each YUV buffer */
518   OMX_U32   nDecWidth;  /** Width  rounded to multiple of 16 */
519   OMX_U32   nDecHeight; /** Height rounded to multiple of 16 */
520   OMX_U32   nActualWidth; /** Actual Frame Width */
521   OMX_U32   nActualHeight; /** Actual Frame Height */
522
523}OMX_QCOM_EXTRADATA_FRAMEDIMENSION;
524
525typedef struct OMX_QCOM_H264EXTRADATA
526{
527   OMX_U64 seiTimeStamp;
528} OMX_QCOM_H264EXTRADATA;
529
530typedef struct OMX_QCOM_VC1EXTRADATA
531{
532   OMX_U32                     nVC1RangeY;
533   OMX_U32                     nVC1RangeUV;
534   OMX_QCOM_VC1RESOLUTIONTYPE eVC1PicResolution;
535} OMX_QCOM_VC1EXTRADATA;
536
537typedef union OMX_QCOM_EXTRADATA_CODEC_DATA
538{
539   OMX_QCOM_H264EXTRADATA h264ExtraData;
540   OMX_QCOM_VC1EXTRADATA vc1ExtraData;
541} OMX_QCOM_EXTRADATA_CODEC_DATA;
542
543typedef enum OMX_QCOM_EXTRADATATYPE
544{
545   OMX_ExtraDataFrameInfo = 0x7F000001,
546   OMX_ExtraDataH264 = 0x7F000002,
547   OMX_ExtraDataVC1 = 0x7F000003,
548   OMX_ExtraDataFrameDimension = 0x7F000004,
549   OMX_ExtraDataVideoEncoderSliceInfo = 0x7F000005
550} OMX_QCOM_EXTRADATATYPE;
551
552
553#define OMX_EXTRADATA_HEADER_SIZE 20
554
555/**
556 * DivX Versions
557 */
558typedef enum  QOMX_VIDEO_DIVXFORMATTYPE {
559    QOMX_VIDEO_DIVXFormatUnused = 0x01, /**< Format unused or unknown */
560    QOMX_VIDEO_DIVXFormat311    = 0x02, /**< DivX 3.11 */
561    QOMX_VIDEO_DIVXFormat4      = 0x04, /**< DivX 4 */
562    QOMX_VIDEO_DIVXFormat5      = 0x08, /**< DivX 5 */
563    QOMX_VIDEO_DIVXFormat6      = 0x10, /**< DivX 6 */
564    QOMX_VIDEO_DIVXFormatKhronosExtensions = 0x6F000000,
565    QOMX_VIDEO_DIVXFormatVendorStartUnused = 0x7F000000,
566    QOMX_VIDEO_DIVXFormatMax = 0x7FFFFFFF
567} QOMX_VIDEO_DIVXFORMATTYPE;
568
569/**
570 * DivX profile types, each profile indicates support for
571 * various performance bounds.
572 */
573typedef enum QOMX_VIDEO_DIVXPROFILETYPE {
574    QOMX_VIDEO_DivXProfileqMobile = 0x01, /**< qMobile Profile */
575    QOMX_VIDEO_DivXProfileMobile  = 0x02, /**< Mobile Profile */
576    QOMX_VIDEO_DivXProfileMT      = 0x04, /**< Mobile Theatre Profile */
577    QOMX_VIDEO_DivXProfileHT      = 0x08, /**< Home Theatre Profile */
578    QOMX_VIDEO_DivXProfileHD      = 0x10, /**< High Definition Profile */
579    QOMX_VIDEO_DIVXProfileKhronosExtensions = 0x6F000000,
580    QOMX_VIDEO_DIVXProfileVendorStartUnused = 0x7F000000,
581    QOMX_VIDEO_DIVXProfileMax = 0x7FFFFFFF
582} QOMX_VIDEO_DIVXPROFILETYPE;
583
584/**
585 * DivX Video Params
586 *
587 *  STRUCT MEMBERS:
588 *  nSize      : Size of the structure in bytes
589 *  nVersion   : OMX specification version information
590 *  nPortIndex : Port that this structure applies to
591 *  eFormat    : Version of DivX stream / data
592 *  eProfile   : Profile of DivX stream / data
593 */
594typedef struct QOMX_VIDEO_PARAM_DIVXTYPE {
595    OMX_U32 nSize;
596    OMX_VERSIONTYPE nVersion;
597    OMX_U32 nPortIndex;
598    QOMX_VIDEO_DIVXFORMATTYPE eFormat;
599    QOMX_VIDEO_DIVXPROFILETYPE eProfile;
600} QOMX_VIDEO_PARAM_DIVXTYPE;
601
602
603
604/**
605 * VP Versions
606 */
607typedef enum QOMX_VIDEO_VPFORMATTYPE {
608    QOMX_VIDEO_VPFormatUnused = 0x01, /**< Format unused or unknown */
609    QOMX_VIDEO_VPFormat6      = 0x02, /**< VP6 Video Format */
610    QOMX_VIDEO_VPFormat7      = 0x04, /**< VP7 Video Format */
611    QOMX_VIDEO_VPFormat8      = 0x08, /**< VP8 Video Format */
612    QOMX_VIDEO_VPFormatKhronosExtensions = 0x6F000000,
613    QOMX_VIDEO_VPFormatVendorStartUnused = 0x7F000000,
614    QOMX_VIDEO_VPFormatMax = 0x7FFFFFFF
615} QOMX_VIDEO_VPFORMATTYPE;
616
617/**
618 * VP profile types, each profile indicates support for various
619 * encoding tools.
620 */
621typedef enum QOMX_VIDEO_VPPROFILETYPE {
622    QOMX_VIDEO_VPProfileSimple   = 0x01, /**< Simple Profile, applies to VP6 only */
623    QOMX_VIDEO_VPProfileAdvanced = 0x02, /**< Advanced Profile, applies to VP6 only */
624    QOMX_VIDEO_VPProfileVersion0 = 0x04, /**< Version 0, applies to VP7 and VP8 */
625    QOMX_VIDEO_VPProfileVersion1 = 0x08, /**< Version 1, applies to VP7 and VP8 */
626    QOMX_VIDEO_VPProfileVersion2 = 0x10, /**< Version 2, applies to VP8 only */
627    QOMX_VIDEO_VPProfileVersion3 = 0x20, /**< Version 3, applies to VP8 only */
628    QOMX_VIDEO_VPProfileKhronosExtensions = 0x6F000000,
629    QOMX_VIDEO_VPProfileVendorStartUnused = 0x7F000000,
630    QOMX_VIDEO_VPProfileMax = 0x7FFFFFFF
631} QOMX_VIDEO_VPPROFILETYPE;
632
633/**
634 * VP Video Params
635 *
636 *  STRUCT MEMBERS:
637 *  nSize      : Size of the structure in bytes
638 *  nVersion   : OMX specification version information
639 *  nPortIndex : Port that this structure applies to
640 *  eFormat    : Format of VP stream / data
641 *  eProfile   : Profile or Version of VP stream / data
642 */
643typedef struct QOMX_VIDEO_PARAM_VPTYPE {
644    OMX_U32 nSize;
645    OMX_VERSIONTYPE nVersion;
646    OMX_U32 nPortIndex;
647    QOMX_VIDEO_VPFORMATTYPE eFormat;
648    QOMX_VIDEO_VPPROFILETYPE eProfile;
649} QOMX_VIDEO_PARAM_VPTYPE;
650
651/**
652 * Spark Versions
653 */
654typedef enum QOMX_VIDEO_SPARKFORMATTYPE {
655    QOMX_VIDEO_SparkFormatUnused = 0x01, /**< Format unused or unknown */
656    QOMX_VIDEO_SparkFormat0      = 0x02, /**< Video Format Version 0 */
657    QOMX_VIDEO_SparkFormat1      = 0x04, /**< Video Format Version 1 */
658    QOMX_VIDEO_SparkFormatKhronosExtensions = 0x6F000000,
659    QOMX_VIDEO_SparkFormatVendorStartUnused = 0x7F000000,
660    QOMX_VIDEO_SparkFormatMax = 0x7FFFFFFF
661} QOMX_VIDEO_SPARKFORMATTYPE;
662
663/**
664 * Spark Video Params
665 *
666 *  STRUCT MEMBERS:
667 *  nSize      : Size of the structure in bytes
668 *  nVersion   : OMX specification version information
669 *  nPortIndex : Port that this structure applies to
670 *  eFormat    : Version of Spark stream / data
671 */
672typedef struct QOMX_VIDEO_PARAM_SPARKTYPE {
673    OMX_U32 nSize;
674    OMX_VERSIONTYPE nVersion;
675    OMX_U32 nPortIndex;
676    QOMX_VIDEO_SPARKFORMATTYPE eFormat;
677} QOMX_VIDEO_PARAM_SPARKTYPE;
678
679
680typedef struct QOMX_VIDEO_QUERY_DECODER_INSTANCES {
681    OMX_U32 nSize;
682    OMX_VERSIONTYPE nVersion;
683    OMX_U32 nPortIndex;
684    OMX_U32 nNumOfInstances;
685} QOMX_VIDEO_QUERY_DECODER_INSTANCES;
686
687
688
689#endif /* __OMX_QCOM_EXTENSIONS_H__ */
690