Home | History | Annotate | Download | only in inc
      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 2Each 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 3Each 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     OMX_QcomIndexParamEnableVUIStreamRestrictFlag = 0x7F000021,
    363 };
    364 
    365 /**
    366  * Extension index parameter.  This structure is used to enable
    367  * vendor specific extension on input/output port and
    368  * to pass the required flags and data, if any.
    369  * The format of flags and data being passed is known to
    370  * the client and component apriori.
    371  *
    372  * STRUCT MEMBERS:
    373  *  nSize              : Size of Structure plus pData size
    374  *  nVersion           : OMX specification version information
    375  *  nPortIndex         : Indicates which port to set
    376  *  bEnable            : Extension index enable (1) or disable (0)
    377  *  nFlags             : Extension index flags, if any
    378  *  nDataSize          : Size of the extension index data to follow
    379  *  pData              : Extension index data, if present.
    380  */
    381 typedef struct QOMX_EXTNINDEX_PARAMTYPE {
    382     OMX_U32 nSize;
    383     OMX_VERSIONTYPE nVersion;
    384     OMX_U32 nPortIndex;
    385     OMX_BOOL bEnable;
    386     OMX_U32 nFlags;
    387     OMX_U32 nDataSize;
    388     OMX_PTR pData;
    389 } QOMX_EXTNINDEX_PARAMTYPE;
    390 
    391 /**
    392  * Enumeration used to define the video encoder modes
    393  *
    394  * ENUMS:
    395  *  EncoderModeDefault : Default video recording mode.
    396  *                       All encoder settings made through
    397  *                       OMX_SetParameter/OMX_SetConfig are applied. No
    398  *                       parameter is overridden.
    399  *  EncoderModeMMS : Video recording mode for MMS (Multimedia Messaging
    400  *                   Service). This mode is similar to EncoderModeDefault
    401  *                   except that here the Rate control mode is overridden
    402  *                   internally and set as a variant of variable bitrate with
    403  *                   variable frame rate. After this mode is set if the IL
    404  *                   client tries to set OMX_VIDEO_CONTROLRATETYPE via
    405  *                   OMX_IndexParamVideoBitrate that would be rejected. For
    406  *                   this, client should set mode back to EncoderModeDefault
    407  *                   first and then change OMX_VIDEO_CONTROLRATETYPE.
    408  */
    409 typedef enum QOMX_VIDEO_ENCODERMODETYPE
    410 {
    411     QOMX_VIDEO_EncoderModeDefault        = 0x00,
    412     QOMX_VIDEO_EncoderModeMMS            = 0x01,
    413     QOMX_VIDEO_EncoderModeMax            = 0x7FFFFFFF
    414 } QOMX_VIDEO_ENCODERMODETYPE;
    415 
    416 /**
    417  * This structure is used to set the video encoder mode.
    418  *
    419  * STRUCT MEMBERS:
    420  *  nSize      : Size of the structure in bytes
    421  *  nVersion   : OMX specification version info
    422  *  nPortIndex : Port that this structure applies to
    423  *  nMode : defines the video encoder mode
    424  */
    425 typedef struct QOMX_VIDEO_PARAM_ENCODERMODETYPE {
    426     OMX_U32 nSize;
    427     OMX_VERSIONTYPE nVersion;
    428     OMX_U32 nPortIndex;
    429     QOMX_VIDEO_ENCODERMODETYPE nMode;
    430 } QOMX_VIDEO_PARAM_ENCODERMODETYPE;
    431 
    432 /**
    433  * This structure describes the parameters corresponding to the
    434  * QOMX_VIDEO_SYNTAXHDRTYPE extension. This parameter can be queried
    435  * during the loaded state.
    436  */
    437 
    438 typedef struct QOMX_VIDEO_SYNTAXHDRTYPE
    439 {
    440    OMX_U32 nSize;           /** Size of the structure in bytes */
    441    OMX_VERSIONTYPE nVersion;/** OMX specification version information */
    442    OMX_U32 nPortIndex;      /** Portindex which is extended by this structure */
    443    OMX_U32 nBytes;    	    /** The number of bytes filled in to the buffer */
    444    OMX_U8 data[1];          /** Buffer to store the header information */
    445 } QOMX_VIDEO_SYNTAXHDRTYPE;
    446 
    447 /**
    448  * This structure describes the parameters corresponding to the
    449  * QOMX_VIDEO_TEMPORALSPATIALTYPE extension. This parameter can be set
    450  * dynamically during any state except the state invalid.  This is primarily
    451  * used for setting MaxQP from the application.  This is set on the out port.
    452  */
    453 
    454 typedef struct QOMX_VIDEO_TEMPORALSPATIALTYPE
    455 {
    456    OMX_U32 nSize;           /** Size of the structure in bytes */
    457    OMX_VERSIONTYPE nVersion;/** OMX specification version information */
    458    OMX_U32 nPortIndex;      /** Portindex which is extended by this structure */
    459    OMX_U32 nTSFactor;       /** Temoral spatial tradeoff factor value in 0-100 */
    460 } QOMX_VIDEO_TEMPORALSPATIALTYPE;
    461 
    462 /**
    463  * This structure describes the parameters corresponding to the
    464  * OMX_QCOM_VIDEO_CONFIG_INTRAPERIODTYPE extension. This parameter can be set
    465  * dynamically during any state except the state invalid.  This is set on the out port.
    466  */
    467 
    468 typedef struct QOMX_VIDEO_INTRAPERIODTYPE
    469 {
    470    OMX_U32 nSize;           /** Size of the structure in bytes */
    471    OMX_VERSIONTYPE nVersion;/** OMX specification version information */
    472    OMX_U32 nPortIndex;      /** Portindex which is extended by this structure */
    473    OMX_U32 nIDRPeriod;      /** This specifies coding a frame as IDR after every nPFrames
    474 			        of intra frames. If this parameter is set to 0, only the
    475 				first frame of the encode session is an IDR frame. This
    476 				field is ignored for non-AVC codecs and is used only for
    477 				codecs that support IDR Period */
    478    OMX_U32 nPFrames;         /** The number of "P" frames between two "I" frames */
    479    OMX_U32 nBFrames;         /** The number of "B" frames between two "I" frames */
    480 } QOMX_VIDEO_INTRAPERIODTYPE;
    481 
    482 /**
    483  * This structure describes the parameters corresponding to the
    484  * OMX_QCOM_VIDEO_CONFIG_ULBUFFEROCCUPANCYTYPE extension. This parameter can be set
    485  * dynamically during any state except the state invalid. This is used for the buffer negotiation
    486  * with other clients.  This is set on the out port.
    487  */
    488 typedef struct OMX_QCOM_VIDEO_CONFIG_ULBUFFEROCCUPANCYTYPE
    489 {
    490    OMX_U32 nSize;            /** Size of the structure in bytes */
    491    OMX_VERSIONTYPE nVersion; /** OMX specification version information */
    492    OMX_U32 nPortIndex;       /** Portindex which is extended by this structure */
    493    OMX_U32 nBufferOccupancy; /** The number of bytes to be set for the buffer occupancy */
    494 } OMX_QCOM_VIDEO_CONFIG_ULBUFFEROCCUPANCYTYPE;
    495 
    496 /**
    497  * This structure describes the parameters corresponding to the
    498  * OMX_QCOM_VIDEO_CONFIG_RANDOMINTRAREFRESHTYPE extension. This parameter can be set
    499  * dynamically during any state except the state invalid. This is primarily used for the dynamic/random
    500  * intrarefresh.  This is set on the out port.
    501  */
    502 typedef struct OMX_QCOM_VIDEO_CONFIG_RANDOMINTRAREFRESHTYPE
    503 {
    504    OMX_U32 nSize;           /** Size of the structure in bytes */
    505    OMX_VERSIONTYPE nVersion;/** OMX specification version information */
    506    OMX_U32 nPortIndex;      /** Portindex which is extended by this structure */
    507    OMX_U32 nRirMBs;         /** The number of MBs to be set for intrarefresh */
    508 } OMX_QCOM_VIDEO_CONFIG_RANDOMINTRAREFRESHTYPE;
    509 
    510 
    511 /**
    512  * This structure describes the parameters corresponding to the
    513  * OMX_QCOM_VIDEO_CONFIG_QPRANGE extension. This parameter can be set
    514  * dynamically during any state except the state invalid. This is primarily
    515  * used for the min/max QP to be set from the application.  This
    516  * is set on the out port.
    517  */
    518 typedef struct OMX_QCOM_VIDEO_CONFIG_QPRANGE
    519 {
    520    OMX_U32 nSize;           /** Size of the structure in bytes */
    521    OMX_VERSIONTYPE nVersion;/** OMX specification version information */
    522    OMX_U32 nPortIndex;      /** Portindex which is extended by this structure */
    523    OMX_U32 nMinQP;          /** The number for minimum quantization parameter */
    524    OMX_U32 nMaxQP;          /** The number for maximum quantization parameter */
    525 } OMX_QCOM_VIDEO_CONFIG_QPRANGE;
    526 
    527 
    528 typedef struct OMX_VENDOR_EXTRADATATYPE  {
    529     OMX_U32 nPortIndex;
    530     OMX_U32 nDataSize;
    531     OMX_U8  *pData;     // cdata (codec_data/extradata)
    532 } OMX_VENDOR_EXTRADATATYPE;
    533 
    534 typedef enum OMX_INDEXVENDORTYPE {
    535     OMX_IndexVendorFileReadInputFilename = 0xFF000001,
    536     OMX_IndexVendorParser3gpInputFilename = 0xFF000002,
    537     OMX_IndexVendorVideoExtraData = 0xFF000003,
    538     OMX_IndexVendorAudioExtraData = 0xFF000004
    539 } OMX_INDEXVENDORTYPE;
    540 
    541 typedef enum OMX_QCOM_VC1RESOLUTIONTYPE
    542 {
    543    OMX_QCOM_VC1_PICTURE_RES_1x1,
    544    OMX_QCOM_VC1_PICTURE_RES_2x1,
    545    OMX_QCOM_VC1_PICTURE_RES_1x2,
    546    OMX_QCOM_VC1_PICTURE_RES_2x2
    547 } OMX_QCOM_VC1RESOLUTIONTYPE;
    548 
    549 typedef enum OMX_QCOM_INTERLACETYPE
    550 {
    551     OMX_QCOM_InterlaceFrameProgressive,
    552     OMX_QCOM_InterlaceInterleaveFrameTopFieldFirst,
    553     OMX_QCOM_InterlaceInterleaveFrameBottomFieldFirst,
    554     OMX_QCOM_InterlaceFrameTopFieldFirst,
    555     OMX_QCOM_InterlaceFrameBottomFieldFirst,
    556     OMX_QCOM_InterlaceFieldTop,
    557     OMX_QCOM_InterlaceFieldBottom
    558 }OMX_QCOM_INTERLACETYPE;
    559 
    560 typedef struct OMX_QCOM_PARAM_VIDEO_INTERLACETYPE
    561 {
    562     OMX_U32 nSize;           /** Size of the structure in bytes */
    563     OMX_VERSIONTYPE nVersion;/** OMX specification version information */
    564     OMX_U32 nPortIndex;    /** Portindex which is extended by this structure */
    565     OMX_BOOL bInterlace;  /** Interlace content **/
    566 }OMX_QCOM_PARAM_VIDEO_INTERLACETYPE;
    567 
    568 typedef struct OMX_QCOM_CONFIG_INTERLACETYPE
    569 {
    570     OMX_U32 nSize;
    571     OMX_VERSIONTYPE nVersion;
    572     OMX_U32 nPortIndex;
    573     OMX_U32 nIndex;
    574     OMX_QCOM_INTERLACETYPE eInterlaceType;
    575 }OMX_QCOM_CONFIG_INTERLACETYPE;
    576 
    577 #define MAX_PAN_SCAN_WINDOWS 4
    578 
    579 typedef struct OMX_QCOM_PANSCAN
    580 {
    581    OMX_U32 numWindows;
    582    OMX_QCOMRectangle window[MAX_PAN_SCAN_WINDOWS];
    583 } OMX_QCOM_PANSCAN;
    584 
    585 typedef struct OMX_QCOM_ASPECT_RATIO
    586 {
    587    OMX_U32 aspectRatioX;
    588    OMX_U32 aspectRatioY;
    589 } OMX_QCOM_ASPECT_RATIO;
    590 
    591 typedef struct OMX_QCOM_FRAME_PACK_ARRANGEMENT
    592 {
    593   OMX_U32 nSize;
    594   OMX_VERSIONTYPE nVersion;
    595   OMX_U32 nPortIndex;
    596   OMX_U32 id;
    597   OMX_U32 cancel_flag;
    598   OMX_U32 type;
    599   OMX_U32 quincunx_sampling_flag;
    600   OMX_U32 content_interpretation_type;
    601   OMX_U32 spatial_flipping_flag;
    602   OMX_U32 frame0_flipped_flag;
    603   OMX_U32 field_views_flag;
    604   OMX_U32 current_frame_is_frame0_flag;
    605   OMX_U32 frame0_self_contained_flag;
    606   OMX_U32 frame1_self_contained_flag;
    607   OMX_U32 frame0_grid_position_x;
    608   OMX_U32 frame0_grid_position_y;
    609   OMX_U32 frame1_grid_position_x;
    610   OMX_U32 frame1_grid_position_y;
    611   OMX_U32 reserved_byte;
    612   OMX_U32 repetition_period;
    613   OMX_U32 extension_flag;
    614 } OMX_QCOM_FRAME_PACK_ARRANGEMENT;
    615 
    616 typedef struct OMX_QCOM_EXTRADATA_FRAMEINFO
    617 {
    618    // common frame meta data. interlace related info removed
    619    OMX_VIDEO_PICTURETYPE  ePicType;
    620    OMX_QCOM_INTERLACETYPE interlaceType;
    621    OMX_QCOM_PANSCAN       panScan;
    622    OMX_QCOM_ASPECT_RATIO  aspectRatio;
    623    OMX_U32                nConcealedMacroblocks;
    624    OMX_U32                nFrameRate;
    625 } OMX_QCOM_EXTRADATA_FRAMEINFO;
    626 
    627 typedef struct OMX_QCOM_EXTRADATA_FRAMEDIMENSION
    628 {
    629    /** Frame Dimensions added to each YUV buffer */
    630    OMX_U32   nDecWidth;  /** Width  rounded to multiple of 16 */
    631    OMX_U32   nDecHeight; /** Height rounded to multiple of 16 */
    632    OMX_U32   nActualWidth; /** Actual Frame Width */
    633    OMX_U32   nActualHeight; /** Actual Frame Height */
    634 
    635 }OMX_QCOM_EXTRADATA_FRAMEDIMENSION;
    636 
    637 typedef struct OMX_QCOM_H264EXTRADATA
    638 {
    639    OMX_U64 seiTimeStamp;
    640 } OMX_QCOM_H264EXTRADATA;
    641 
    642 typedef struct OMX_QCOM_VC1EXTRADATA
    643 {
    644    OMX_U32                     nVC1RangeY;
    645    OMX_U32                     nVC1RangeUV;
    646    OMX_QCOM_VC1RESOLUTIONTYPE eVC1PicResolution;
    647 } OMX_QCOM_VC1EXTRADATA;
    648 
    649 typedef union OMX_QCOM_EXTRADATA_CODEC_DATA
    650 {
    651    OMX_QCOM_H264EXTRADATA h264ExtraData;
    652    OMX_QCOM_VC1EXTRADATA vc1ExtraData;
    653 } OMX_QCOM_EXTRADATA_CODEC_DATA;
    654 
    655 typedef enum OMX_QCOM_EXTRADATATYPE
    656 {
    657    OMX_ExtraDataFrameInfo = 0x7F000001,
    658    OMX_ExtraDataH264 = 0x7F000002,
    659    OMX_ExtraDataVC1 = 0x7F000003,
    660    OMX_ExtraDataFrameDimension = 0x7F000004,
    661    OMX_ExtraDataVideoEncoderSliceInfo = 0x7F000005,
    662    OMX_ExtraDataConcealMB = 0x7F000006,
    663    OMX_ExtraDataInterlaceFormat = 0x7F000007,
    664    OMX_ExtraDataPortDef = 0x7F000008
    665 } OMX_QCOM_EXTRADATATYPE;
    666 
    667 typedef struct  OMX_STREAMINTERLACEFORMATTYPE {
    668     OMX_U32 nSize;
    669     OMX_VERSIONTYPE nVersion;
    670     OMX_U32 nPortIndex;
    671     OMX_BOOL bInterlaceFormat;
    672     OMX_U32 nInterlaceFormats;
    673 } OMX_STREAMINTERLACEFORMAT;
    674 
    675 typedef enum OMX_INTERLACETYPE
    676 {
    677    OMX_InterlaceFrameProgressive,
    678    OMX_InterlaceInterleaveFrameTopFieldFirst,
    679    OMX_InterlaceInterleaveFrameBottomFieldFirst,
    680    OMX_InterlaceFrameTopFieldFirst,
    681    OMX_InterlaceFrameBottomFieldFirst
    682 }OMX_INTERLACEs;
    683 
    684 
    685 #define OMX_EXTRADATA_HEADER_SIZE 20
    686 
    687 /**
    688  * DivX Versions
    689  */
    690 typedef enum  QOMX_VIDEO_DIVXFORMATTYPE {
    691     QOMX_VIDEO_DIVXFormatUnused = 0x01, /**< Format unused or unknown */
    692     QOMX_VIDEO_DIVXFormat311    = 0x02, /**< DivX 3.11 */
    693     QOMX_VIDEO_DIVXFormat4      = 0x04, /**< DivX 4 */
    694     QOMX_VIDEO_DIVXFormat5      = 0x08, /**< DivX 5 */
    695     QOMX_VIDEO_DIVXFormat6      = 0x10, /**< DivX 6 */
    696     QOMX_VIDEO_DIVXFormatKhronosExtensions = 0x6F000000,
    697     QOMX_VIDEO_DIVXFormatVendorStartUnused = 0x7F000000,
    698     QOMX_VIDEO_DIVXFormatMax = 0x7FFFFFFF
    699 } QOMX_VIDEO_DIVXFORMATTYPE;
    700 
    701 /**
    702  * DivX profile types, each profile indicates support for
    703  * various performance bounds.
    704  */
    705 typedef enum QOMX_VIDEO_DIVXPROFILETYPE {
    706     QOMX_VIDEO_DivXProfileqMobile = 0x01, /**< qMobile Profile */
    707     QOMX_VIDEO_DivXProfileMobile  = 0x02, /**< Mobile Profile */
    708     QOMX_VIDEO_DivXProfileMT      = 0x04, /**< Mobile Theatre Profile */
    709     QOMX_VIDEO_DivXProfileHT      = 0x08, /**< Home Theatre Profile */
    710     QOMX_VIDEO_DivXProfileHD      = 0x10, /**< High Definition Profile */
    711     QOMX_VIDEO_DIVXProfileKhronosExtensions = 0x6F000000,
    712     QOMX_VIDEO_DIVXProfileVendorStartUnused = 0x7F000000,
    713     QOMX_VIDEO_DIVXProfileMax = 0x7FFFFFFF
    714 } QOMX_VIDEO_DIVXPROFILETYPE;
    715 
    716 /**
    717  * DivX Video Params
    718  *
    719  *  STRUCT MEMBERS:
    720  *  nSize      : Size of the structure in bytes
    721  *  nVersion   : OMX specification version information
    722  *  nPortIndex : Port that this structure applies to
    723  *  eFormat    : Version of DivX stream / data
    724  *  eProfile   : Profile of DivX stream / data
    725  */
    726 typedef struct QOMX_VIDEO_PARAM_DIVXTYPE {
    727     OMX_U32 nSize;
    728     OMX_VERSIONTYPE nVersion;
    729     OMX_U32 nPortIndex;
    730     QOMX_VIDEO_DIVXFORMATTYPE eFormat;
    731     QOMX_VIDEO_DIVXPROFILETYPE eProfile;
    732 } QOMX_VIDEO_PARAM_DIVXTYPE;
    733 
    734 
    735 
    736 /**
    737  *  VP Versions
    738  */
    739 typedef enum QOMX_VIDEO_VPFORMATTYPE {
    740     QOMX_VIDEO_VPFormatUnused = 0x01, /**< Format unused or unknown */
    741     QOMX_VIDEO_VPFormat6      = 0x02, /**< VP6 Video Format */
    742     QOMX_VIDEO_VPFormat7      = 0x04, /**< VP7 Video Format */
    743     QOMX_VIDEO_VPFormat8      = 0x08, /**< VP8 Video Format */
    744     QOMX_VIDEO_VPFormatKhronosExtensions = 0x6F000000,
    745     QOMX_VIDEO_VPFormatVendorStartUnused = 0x7F000000,
    746     QOMX_VIDEO_VPFormatMax = 0x7FFFFFFF
    747 } QOMX_VIDEO_VPFORMATTYPE;
    748 
    749 /**
    750  * VP profile types, each profile indicates support for various
    751  * encoding tools.
    752  */
    753 typedef enum QOMX_VIDEO_VPPROFILETYPE {
    754     QOMX_VIDEO_VPProfileSimple   = 0x01, /**< Simple Profile, applies to VP6 only */
    755     QOMX_VIDEO_VPProfileAdvanced = 0x02, /**< Advanced Profile, applies to VP6 only */
    756     QOMX_VIDEO_VPProfileVersion0 = 0x04, /**< Version 0, applies to VP7 and VP8 */
    757     QOMX_VIDEO_VPProfileVersion1 = 0x08, /**< Version 1, applies to VP7 and VP8 */
    758     QOMX_VIDEO_VPProfileVersion2 = 0x10, /**< Version 2, applies to VP8 only */
    759     QOMX_VIDEO_VPProfileVersion3 = 0x20, /**< Version 3, applies to VP8 only */
    760     QOMX_VIDEO_VPProfileKhronosExtensions = 0x6F000000,
    761     QOMX_VIDEO_VPProfileVendorStartUnused = 0x7F000000,
    762     QOMX_VIDEO_VPProfileMax = 0x7FFFFFFF
    763 } QOMX_VIDEO_VPPROFILETYPE;
    764 
    765 /**
    766  * VP Video Params
    767  *
    768  *  STRUCT MEMBERS:
    769  *  nSize      : Size of the structure in bytes
    770  *  nVersion   : OMX specification version information
    771  *  nPortIndex : Port that this structure applies to
    772  *  eFormat    : Format of VP stream / data
    773  *  eProfile   : Profile or Version of VP stream / data
    774  */
    775 typedef struct QOMX_VIDEO_PARAM_VPTYPE {
    776     OMX_U32 nSize;
    777     OMX_VERSIONTYPE nVersion;
    778     OMX_U32 nPortIndex;
    779     QOMX_VIDEO_VPFORMATTYPE eFormat;
    780     QOMX_VIDEO_VPPROFILETYPE eProfile;
    781 } QOMX_VIDEO_PARAM_VPTYPE;
    782 
    783 /**
    784  * Spark Versions
    785  */
    786 typedef enum QOMX_VIDEO_SPARKFORMATTYPE {
    787     QOMX_VIDEO_SparkFormatUnused = 0x01, /**< Format unused or unknown */
    788     QOMX_VIDEO_SparkFormat0      = 0x02, /**< Video Format Version 0 */
    789     QOMX_VIDEO_SparkFormat1      = 0x04, /**< Video Format Version 1 */
    790     QOMX_VIDEO_SparkFormatKhronosExtensions = 0x6F000000,
    791     QOMX_VIDEO_SparkFormatVendorStartUnused = 0x7F000000,
    792     QOMX_VIDEO_SparkFormatMax = 0x7FFFFFFF
    793 } QOMX_VIDEO_SPARKFORMATTYPE;
    794 
    795 /**
    796  * Spark Video Params
    797  *
    798  *  STRUCT MEMBERS:
    799  *  nSize      : Size of the structure in bytes
    800  *  nVersion   : OMX specification version information
    801  *  nPortIndex : Port that this structure applies to
    802  *  eFormat    : Version of Spark stream / data
    803  */
    804 typedef struct QOMX_VIDEO_PARAM_SPARKTYPE {
    805     OMX_U32 nSize;
    806     OMX_VERSIONTYPE nVersion;
    807     OMX_U32 nPortIndex;
    808     QOMX_VIDEO_SPARKFORMATTYPE eFormat;
    809 } QOMX_VIDEO_PARAM_SPARKTYPE;
    810 
    811 
    812 typedef struct QOMX_VIDEO_QUERY_DECODER_INSTANCES {
    813     OMX_U32 nSize;
    814     OMX_VERSIONTYPE nVersion;
    815     OMX_U32 nPortIndex;
    816     OMX_U32 nNumOfInstances;
    817 } QOMX_VIDEO_QUERY_DECODER_INSTANCES;
    818 
    819 typedef struct QOMX_ENABLETYPE {
    820     OMX_BOOL bEnable;
    821 } QOMX_ENABLETYPE;
    822 
    823 typedef enum QOMX_VIDEO_EVENTS {
    824     OMX_EventIndexsettingChanged = OMX_EventVendorStartUnused
    825 } QOMX_VIDEO_EVENTS;
    826 
    827 typedef enum QOMX_VIDEO_PICTURE_ORDER {
    828     QOMX_VIDEO_DISPLAY_ORDER = 0x1,
    829     QOMX_VIDEO_DECODE_ORDER = 0x2
    830 } QOMX_VIDEO_PICTURE_ORDER;
    831 
    832 typedef struct QOMX_VIDEO_DECODER_PICTURE_ORDER {
    833     OMX_U32 nSize;
    834     OMX_VERSIONTYPE nVersion;
    835     OMX_U32 nPortIndex;
    836     QOMX_VIDEO_PICTURE_ORDER eOutputPictureOrder;
    837 } QOMX_VIDEO_DECODER_PICTURE_ORDER;
    838 
    839 typedef struct QOMX_INDEXEXTRADATATYPE {
    840     OMX_U32 nSize;
    841     OMX_VERSIONTYPE nVersion;
    842     OMX_U32 nPortIndex;
    843     OMX_BOOL bEnabled;
    844     OMX_INDEXTYPE nIndex;
    845 } QOMX_INDEXEXTRADATATYPE;
    846 
    847 typedef struct QOMX_INDEXTIMESTAMPREORDER {
    848 	OMX_U32 nSize;
    849 	OMX_VERSIONTYPE nVersion;
    850 	OMX_U32 nPortIndex;
    851 	OMX_BOOL bEnable;
    852 } QOMX_INDEXTIMESTAMPREORDER;
    853 
    854 #define OMX_QCOM_INDEX_PARAM_VIDEO_SYNCFRAMEDECODINGMODE "OMX.QCOM.index.param.video.SyncFrameDecodingMode"
    855 #define OMX_QCOM_INDEX_PARAM_INDEXEXTRADATA "OMX.QCOM.index.param.IndexExtraData"
    856 #define OMX_QCOM_INDEX_PARAM_VIDEO_SLICEDELIVERYMODE "OMX.QCOM.index.param.SliceDeliveryMode"
    857 
    858 typedef enum {
    859     QOMX_VIDEO_FRAME_PACKING_CHECKERBOARD = 0,
    860     QOMX_VIDEO_FRAME_PACKING_COLUMN_INTERLEAVE = 1,
    861     QOMX_VIDEO_FRAME_PACKING_ROW_INTERLEAVE = 2,
    862     QOMX_VIDEO_FRAME_PACKING_SIDE_BY_SIDE = 3,
    863     QOMX_VIDEO_FRAME_PACKING_TOP_BOTTOM = 4,
    864     QOMX_VIDEO_FRAME_PACKING_TEMPORAL = 5,
    865 } QOMX_VIDEO_FRAME_PACKING_ARRANGEMENT;
    866 
    867 typedef enum {
    868     QOMX_VIDEO_CONTENT_UNSPECIFIED = 0,
    869     QOMX_VIDEO_CONTENT_LR_VIEW = 1,
    870     QOMX_VIDEO_CONTENT_RL_VIEW = 2,
    871 } QOMX_VIDEO_CONTENT_INTERPRETATION;
    872 
    873 // A pointer to this struct is passed to OMX_SetParameter when the extension
    874 // index for the 'OMX.google.android.index.setVUIStreamRestrictFlag' extension
    875 // is given.
    876 typedef struct QOMX_VUI_BITSTREAM_RESTRICT {
    877     OMX_U32 nSize;
    878     OMX_VERSIONTYPE nVersion;
    879     OMX_BOOL bEnable;
    880 } QOMX_VUI_BITSTREAM_RESTRICT;
    881 
    882 #ifdef __cplusplus
    883 }
    884 #endif /* __cplusplus */
    885 
    886 #endif /* __OMX_QCOM_EXTENSIONS_H__ */
    887