OMX_IntelVideoExt.h revision 553a23247aa6a416f89a51e9d20b1789a63c3d41
1/* 2 * Copyright (c) 2010 The Khronos Group Inc. 3 * 4 * Permission is hereby granted, free of charge, to any person obtaining 5 * a copy of this software and associated documentation files (the 6 * "Software"), to deal in the Software without restriction, including 7 * without limitation the rights to use, copy, modify, merge, publish, 8 * distribute, sublicense, and/or sell copies of the Software, and to 9 * permit persons to whom the Software is furnished to do so, subject 10 * to the following conditions: 11 * The above copyright notice and this permission notice shall be included 12 * in all copies or substantial portions of the Software. 13 * 14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 15 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 17 * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 18 * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 19 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 20 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 * 22 */ 23 24/** OMX_VideoExt.h - OpenMax IL version 1.1.2 25 * The OMX_VideoExt header file contains extensions to the 26 * definitions used by both the application and the component to 27 * access video items. 28 */ 29 30#ifndef OMX_IntelVideoExt_h 31#define OMX_IntelVideoExt_h 32 33#ifdef __cplusplus 34extern "C" { 35#endif /* __cplusplus */ 36 37/* Each OMX header shall include all required header files to allow the 38 * header to compile without errors. The includes below are required 39 * for this header file to compile successfully 40 */ 41#include <OMX_Core.h> 42/** NALU Formats */ 43typedef enum OMX_INTEL_NALUFORMATSTYPE { 44 OMX_NaluFormatZeroByteInterleaveLength = 32, 45 OMX_NaluFormatStartCodesSeparateFirstHeader = 64, 46 OMX_NaluFormatLengthPrefixedSeparateFirstHeader = 128, 47} OMX_INTEL_NALUFORMATSTYPE; 48 49 50typedef struct OMX_VIDEO_PARAM_BYTESTREAMTYPE { 51 OMX_U32 nSize; // Size of the structure 52 OMX_VERSIONTYPE nVersion; // OMX specification version 53 OMX_U32 nPortIndex; // Port that this structure applies to 54 OMX_BOOL bBytestream; // Enable/disable bytestream support 55} OMX_VIDEO_PARAM_BYTESTREAMTYPE; 56 57typedef struct OMX_VIDEO_CONFIG_INTEL_BITRATETYPE { 58 OMX_U32 nSize; 59 OMX_VERSIONTYPE nVersion; 60 OMX_U32 nPortIndex; 61 OMX_U32 nMaxEncodeBitrate; // Maximum bitrate 62 OMX_U32 nTargetPercentage; // Target bitrate as percentage of maximum bitrate; e.g. 95 is 95% 63 OMX_U32 nWindowSize; // Window size in milliseconds allowed for bitrate to reach target 64 OMX_U32 nInitialQP; // Initial QP for I frames 65 OMX_U32 nMinQP; 66} OMX_VIDEO_CONFIG_INTEL_BITRATETYPE; 67 68typedef enum OMX_VIDEO_INTEL_CONTROLRATETYPE { 69 OMX_Video_Intel_ControlRateDisable, 70 OMX_Video_Intel_ControlRateVariable, 71 OMX_Video_Intel_ControlRateConstant, 72 OMX_Video_Intel_ControlRateVideoConferencingMode, 73 OMX_Video_Intel_ControlRateMax = 0x7FFFFFFF 74} OMX_VIDEO_INTEL_CONTROLRATETYPE; 75 76typedef struct OMX_VIDEO_PARAM_INTEL_BITRATETYPE { 77 OMX_U32 nSize; 78 OMX_VERSIONTYPE nVersion; 79 OMX_U32 nPortIndex; 80 OMX_VIDEO_INTEL_CONTROLRATETYPE eControlRate; 81 OMX_U32 nTargetBitrate; 82} OMX_VIDEO_PARAM_INTEL_BITRATETYPE; 83 84typedef struct OMX_VIDEO_PARAM_INTEL_AVC_DECODE_SETTINGS { 85 OMX_U32 nSize; // Size of the structure 86 OMX_VERSIONTYPE nVersion; // OMX specification version 87 OMX_U32 nPortIndex; // Port that this structure applies to 88 OMX_U32 nMaxNumberOfReferenceFrame; // Maximum number of reference frames 89 OMX_U32 nMaxWidth; // Maximum width of video 90 OMX_U32 nMaxHeight; // Maximum height of video 91} OMX_VIDEO_PARAM_INTEL_AVC_DECODE_SETTINGS; 92 93 94typedef struct OMX_VIDEO_CONFIG_INTEL_SLICE_NUMBERS { 95 OMX_U32 nSize; // Size of the structure 96 OMX_VERSIONTYPE nVersion; // OMX specification version 97 OMX_U32 nPortIndex; // Port that this structure applies to 98 OMX_U32 nISliceNumber; // I frame slice number 99 OMX_U32 nPSliceNumber; // P frame slice number 100} OMX_VIDEO_CONFIG_INTEL_SLICE_NUMBERS; 101 102 103typedef struct OMX_VIDEO_CONFIG_INTEL_AIR { 104 OMX_U32 nSize; // Size of the structure 105 OMX_VERSIONTYPE nVersion; // OMX specification version 106 OMX_U32 nPortIndex; // Port that this structure applies to 107 OMX_BOOL bAirEnable; // Enable AIR 108 OMX_BOOL bAirAuto; // AIR auto 109 OMX_U32 nAirMBs; // Number of AIR MBs 110 OMX_U32 nAirThreshold; // AIR Threshold 111 112} OMX_VIDEO_CONFIG_INTEL_AIR; 113 114typedef struct OMX_VIDEO_PARAM_INTEL_AVCVUI { 115 OMX_U32 nSize; // Size of the structure 116 OMX_VERSIONTYPE nVersion; // OMX specification version 117 OMX_U32 nPortIndex; // Port that this structure applies to 118 OMX_BOOL bVuiGeneration; // Enable/disable VUI generation 119 120} OMX_VIDEO_PARAM_INTEL_AVCVUI; 121 122typedef struct OMX_VIDEO_PARAM_INTEL_ADAPTIVE_SLICE_CONTROL { 123 OMX_U32 nSize; // Size of the structure 124 OMX_VERSIONTYPE nVersion; // OMX specification version 125 OMX_U32 nPortIndex; // Port that this structure applies to 126 OMX_BOOL bEnable; // enable adaptive slice control 127 OMX_U32 nMinPSliceNumber; // minimum number of P slices 128 OMX_U32 nNumPFramesToSkip; // number of P frames after an I frame to skip before kicking in adaptive slice control 129 OMX_U32 nSliceSizeThreshold; // Slice size threshold for adaptive slice control to start a new slice 130 OMX_U32 nSliceSizeSkipThreshold; // Slice size skip threshold for adaptive slice control to start a new slice 131} OMX_VIDEO_PARAM_INTEL_ADAPTIVE_SLICE_CONTROL; 132 133/** 134 * Vendor Private Configs 135 * 136 * STRUCT MEMBERS: 137 * nSize : Size of the structure in bytes 138 * nVersion : OMX specification version information 139 * nPortIndex : Port that this structure applies to 140 * nCapacity : Specifies the private unit size 141 * nHolder : Pointer to private unit address 142 */ 143typedef struct OMX_VIDEO_CONFIG_PRI_INFOTYPE { 144 OMX_U32 nSize; 145 OMX_VERSIONTYPE nVersion; 146 OMX_U32 nPortIndex; 147 OMX_U32 nCapacity; 148 OMX_PTR nHolder; 149} OMX_VIDEO_CONFIG_PRI_INFOTYPE; 150 151// Error reporting data structure 152typedef struct OMX_VIDEO_CONFIG_INTEL_ERROR_REPORT { 153 OMX_U32 nSize; 154 OMX_VERSIONTYPE nVersion; 155 OMX_U32 nPortIndex; 156 OMX_BOOL bEnable; 157} OMX_VIDEO_CONFIG_INTEL_ERROR_REPORT; 158 159#define MAX_ERR_NUM 10 160 161typedef enum 162{ 163 OMX_Decode_SliceMissing = 0, 164 OMX_Decode_MBError = 1, 165 OMX_Decode_RefMissing = 2, 166} OMX_VIDEO_DECODE_ERRORTYPE; 167 168typedef struct OMX_VIDEO_ERROR_INFO { 169 OMX_VIDEO_DECODE_ERRORTYPE type; 170 union { 171 struct {OMX_U32 start_mb; OMX_U32 end_mb;} mb_pos; 172 } error_data; 173}; 174 175typedef struct OMX_VIDEO_ERROR_BUFFER { 176 OMX_U32 errorNumber; // Error number should be no more than MAX_ERR_NUM 177 OMX_S64 timeStamp; // presentation time stamp 178 OMX_VIDEO_ERROR_INFO errorArray[MAX_ERR_NUM]; 179}; 180 181// Force K frame for VP8 encode 182typedef struct OMX_VIDEO_CONFIG_INTEL_VP8_FORCE_KFRAME { 183 OMX_U32 nSize; 184 OMX_VERSIONTYPE nVersion; 185 OMX_U32 nPortIndex; 186 OMX_BOOL bForceKFrame; 187} OMX_VIDEO_CONFIG_INTEL_VP8_FORCE_KFRAME; 188 189// max frame size for VP8 encode during WebRTC feature 190typedef struct OMX_VIDEO_CONFIG_INTEL_VP8_MAX_FRAME_SIZE_RATIO { 191 OMX_U32 nSize; 192 OMX_VERSIONTYPE nVersion; 193 OMX_U32 nPortIndex; 194 OMX_U32 nMaxFrameSizeRatio; 195} OMX_VIDEO_CONFIG_INTEL_VP8_MAX_FRAME_SIZE_RATIO; 196 197 198#ifdef __cplusplus 199} 200#endif /* __cplusplus */ 201 202#endif /* OMX_VideoExt_h */ 203/* File EOF */ 204