Kunter Gultekin | 203f89a | 2013-02-06 18:03:47 +0200 | [diff] [blame] | 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_VideoExt_h |
| 31 | #define OMX_VideoExt_h |
| 32 | |
| 33 | #ifdef __cplusplus |
| 34 | extern "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 | |
| 43 | /** NALU Formats */ |
| 44 | typedef enum OMX_NALUFORMATSTYPE { |
| 45 | OMX_NaluFormatStartCodes = 1, |
| 46 | OMX_NaluFormatOneNaluPerBuffer = 2, |
| 47 | OMX_NaluFormatOneByteInterleaveLength = 4, |
| 48 | OMX_NaluFormatTwoByteInterleaveLength = 8, |
| 49 | OMX_NaluFormatFourByteInterleaveLength = 16, |
| 50 | OMX_NaluFormatCodingMax = 0x7FFFFFFF |
| 51 | } OMX_NALUFORMATSTYPE; |
| 52 | |
| 53 | /** NAL Stream Format */ |
| 54 | typedef struct OMX_NALSTREAMFORMATTYPE{ |
| 55 | OMX_U32 nSize; |
| 56 | OMX_VERSIONTYPE nVersion; |
| 57 | OMX_U32 nPortIndex; |
| 58 | OMX_NALUFORMATSTYPE eNaluFormat; |
| 59 | } OMX_NALSTREAMFORMATTYPE; |
| 60 | |
Kunter Gultekin | 203f89a | 2013-02-06 18:03:47 +0200 | [diff] [blame] | 61 | /** VP8 profiles */ |
| 62 | typedef enum OMX_VIDEO_VP8PROFILETYPE { |
| 63 | OMX_VIDEO_VP8ProfileMain = 0x01, |
| 64 | OMX_VIDEO_VP8ProfileUnknown = 0x6EFFFFFF, |
| 65 | OMX_VIDEO_VP8ProfileMax = 0x7FFFFFFF |
| 66 | } OMX_VIDEO_VP8PROFILETYPE; |
| 67 | |
| 68 | /** VP8 levels */ |
| 69 | typedef enum OMX_VIDEO_VP8LEVELTYPE { |
| 70 | OMX_VIDEO_VP8Level_Version0 = 0x01, |
| 71 | OMX_VIDEO_VP8Level_Version1 = 0x02, |
| 72 | OMX_VIDEO_VP8Level_Version2 = 0x04, |
| 73 | OMX_VIDEO_VP8Level_Version3 = 0x08, |
| 74 | OMX_VIDEO_VP8LevelUnknown = 0x6EFFFFFF, |
| 75 | OMX_VIDEO_VP8LevelMax = 0x7FFFFFFF |
| 76 | } OMX_VIDEO_VP8LEVELTYPE; |
| 77 | |
Ronghua Wu | cc50538 | 2016-01-15 16:30:57 -0800 | [diff] [blame] | 78 | /** VP9 profiles */ |
| 79 | typedef enum OMX_VIDEO_VP9PROFILETYPE { |
Hangyu Kuang | d15a35b | 2016-04-26 17:01:29 -0700 | [diff] [blame] | 80 | OMX_VIDEO_VP9Profile0 = 0x1, |
| 81 | OMX_VIDEO_VP9Profile1 = 0x2, |
| 82 | OMX_VIDEO_VP9Profile2 = 0x4, |
| 83 | OMX_VIDEO_VP9Profile3 = 0x8, |
Hangyu Kuang | 19c6a83 | 2016-04-07 15:55:41 -0700 | [diff] [blame] | 84 | // HDR profiles also support passing HDR metadata |
Hangyu Kuang | d15a35b | 2016-04-26 17:01:29 -0700 | [diff] [blame] | 85 | OMX_VIDEO_VP9Profile2HDR = 0x1000, |
| 86 | OMX_VIDEO_VP9Profile3HDR = 0x2000, |
Ronghua Wu | cc50538 | 2016-01-15 16:30:57 -0800 | [diff] [blame] | 87 | OMX_VIDEO_VP9ProfileUnknown = 0x6EFFFFFF, |
Hangyu Kuang | d15a35b | 2016-04-26 17:01:29 -0700 | [diff] [blame] | 88 | OMX_VIDEO_VP9ProfileMax = 0x7FFFFFFF |
Ronghua Wu | cc50538 | 2016-01-15 16:30:57 -0800 | [diff] [blame] | 89 | } OMX_VIDEO_VP9PROFILETYPE; |
| 90 | |
| 91 | /** VP9 levels */ |
| 92 | typedef enum OMX_VIDEO_VP9LEVELTYPE { |
Hangyu Kuang | d15a35b | 2016-04-26 17:01:29 -0700 | [diff] [blame] | 93 | OMX_VIDEO_VP9Level1 = 0x1, |
| 94 | OMX_VIDEO_VP9Level11 = 0x2, |
| 95 | OMX_VIDEO_VP9Level2 = 0x4, |
| 96 | OMX_VIDEO_VP9Level21 = 0x8, |
| 97 | OMX_VIDEO_VP9Level3 = 0x10, |
| 98 | OMX_VIDEO_VP9Level31 = 0x20, |
| 99 | OMX_VIDEO_VP9Level4 = 0x40, |
| 100 | OMX_VIDEO_VP9Level41 = 0x80, |
| 101 | OMX_VIDEO_VP9Level5 = 0x100, |
| 102 | OMX_VIDEO_VP9Level51 = 0x200, |
| 103 | OMX_VIDEO_VP9Level52 = 0x400, |
| 104 | OMX_VIDEO_VP9Level6 = 0x800, |
| 105 | OMX_VIDEO_VP9Level61 = 0x1000, |
| 106 | OMX_VIDEO_VP9Level62 = 0x2000, |
Ronghua Wu | cc50538 | 2016-01-15 16:30:57 -0800 | [diff] [blame] | 107 | OMX_VIDEO_VP9LevelUnknown = 0x6EFFFFFF, |
Hangyu Kuang | d15a35b | 2016-04-26 17:01:29 -0700 | [diff] [blame] | 108 | OMX_VIDEO_VP9LevelMax = 0x7FFFFFFF |
Ronghua Wu | cc50538 | 2016-01-15 16:30:57 -0800 | [diff] [blame] | 109 | } OMX_VIDEO_VP9LEVELTYPE; |
| 110 | |
Kunter Gultekin | 203f89a | 2013-02-06 18:03:47 +0200 | [diff] [blame] | 111 | /** VP8 Param */ |
| 112 | typedef struct OMX_VIDEO_PARAM_VP8TYPE { |
| 113 | OMX_U32 nSize; |
| 114 | OMX_VERSIONTYPE nVersion; |
| 115 | OMX_U32 nPortIndex; |
| 116 | OMX_VIDEO_VP8PROFILETYPE eProfile; |
| 117 | OMX_VIDEO_VP8LEVELTYPE eLevel; |
| 118 | OMX_U32 nDCTPartitions; |
| 119 | OMX_BOOL bErrorResilientMode; |
| 120 | } OMX_VIDEO_PARAM_VP8TYPE; |
| 121 | |
| 122 | /** Structure for configuring VP8 reference frames */ |
| 123 | typedef struct OMX_VIDEO_VP8REFERENCEFRAMETYPE { |
| 124 | OMX_U32 nSize; |
| 125 | OMX_VERSIONTYPE nVersion; |
| 126 | OMX_U32 nPortIndex; |
| 127 | OMX_BOOL bPreviousFrameRefresh; |
| 128 | OMX_BOOL bGoldenFrameRefresh; |
| 129 | OMX_BOOL bAlternateFrameRefresh; |
| 130 | OMX_BOOL bUsePreviousFrame; |
| 131 | OMX_BOOL bUseGoldenFrame; |
| 132 | OMX_BOOL bUseAlternateFrame; |
| 133 | } OMX_VIDEO_VP8REFERENCEFRAMETYPE; |
| 134 | |
| 135 | /** Structure for querying VP8 reference frame type */ |
| 136 | typedef struct OMX_VIDEO_VP8REFERENCEFRAMEINFOTYPE { |
| 137 | OMX_U32 nSize; |
| 138 | OMX_VERSIONTYPE nVersion; |
| 139 | OMX_U32 nPortIndex; |
| 140 | OMX_BOOL bIsIntraFrame; |
| 141 | OMX_BOOL bIsGoldenOrAlternateFrame; |
| 142 | } OMX_VIDEO_VP8REFERENCEFRAMEINFOTYPE; |
| 143 | |
Alex Glaznev | 5b155b8 | 2014-04-07 11:09:56 -0700 | [diff] [blame] | 144 | /** Maximum number of VP8 temporal layers */ |
| 145 | #define OMX_VIDEO_ANDROID_MAXVP8TEMPORALLAYERS 3 |
| 146 | |
| 147 | /** VP8 temporal layer patterns */ |
| 148 | typedef enum OMX_VIDEO_ANDROID_VPXTEMPORALLAYERPATTERNTYPE { |
| 149 | OMX_VIDEO_VPXTemporalLayerPatternNone = 0, |
| 150 | OMX_VIDEO_VPXTemporalLayerPatternWebRTC = 1, |
| 151 | OMX_VIDEO_VPXTemporalLayerPatternMax = 0x7FFFFFFF |
| 152 | } OMX_VIDEO_ANDROID_VPXTEMPORALLAYERPATTERNTYPE; |
| 153 | |
| 154 | /** |
| 155 | * Android specific VP8 encoder params |
| 156 | * |
| 157 | * STRUCT MEMBERS: |
| 158 | * nSize : Size of the structure in bytes |
| 159 | * nVersion : OMX specification version information |
| 160 | * nPortIndex : Port that this structure applies to |
| 161 | * nKeyFrameInterval : Key frame interval in frames |
| 162 | * eTemporalPattern : Type of temporal layer pattern |
| 163 | * nTemporalLayerCount : Number of temporal coding layers |
| 164 | * nTemporalLayerBitrateRatio : Bitrate ratio allocation between temporal |
| 165 | * streams in percentage |
| 166 | * nMinQuantizer : Minimum (best quality) quantizer |
| 167 | * nMaxQuantizer : Maximum (worst quality) quantizer |
| 168 | */ |
| 169 | typedef struct OMX_VIDEO_PARAM_ANDROID_VP8ENCODERTYPE { |
| 170 | OMX_U32 nSize; |
| 171 | OMX_VERSIONTYPE nVersion; |
| 172 | OMX_U32 nPortIndex; |
| 173 | OMX_U32 nKeyFrameInterval; |
| 174 | OMX_VIDEO_ANDROID_VPXTEMPORALLAYERPATTERNTYPE eTemporalPattern; |
| 175 | OMX_U32 nTemporalLayerCount; |
| 176 | OMX_U32 nTemporalLayerBitrateRatio[OMX_VIDEO_ANDROID_MAXVP8TEMPORALLAYERS]; |
| 177 | OMX_U32 nMinQuantizer; |
| 178 | OMX_U32 nMaxQuantizer; |
Lajos Molnar | 64f5ec5 | 2014-06-05 22:33:17 -0700 | [diff] [blame] | 179 | } OMX_VIDEO_PARAM_ANDROID_VP8ENCODERTYPE; |
Alex Glaznev | 5b155b8 | 2014-04-07 11:09:56 -0700 | [diff] [blame] | 180 | |
Rachad | 184077d | 2014-05-01 18:42:43 -0700 | [diff] [blame] | 181 | /** HEVC Profile enum type */ |
| 182 | typedef enum OMX_VIDEO_HEVCPROFILETYPE { |
Ronghua Wu | 0471d0a | 2016-02-24 16:28:13 -0800 | [diff] [blame] | 183 | OMX_VIDEO_HEVCProfileUnknown = 0x0, |
| 184 | OMX_VIDEO_HEVCProfileMain = 0x1, |
| 185 | OMX_VIDEO_HEVCProfileMain10 = 0x2, |
| 186 | // Main10 profile with HDR SEI support. |
| 187 | OMX_VIDEO_HEVCProfileMain10HDR10 = 0x1000, |
| 188 | OMX_VIDEO_HEVCProfileMax = 0x7FFFFFFF |
Rachad | 184077d | 2014-05-01 18:42:43 -0700 | [diff] [blame] | 189 | } OMX_VIDEO_HEVCPROFILETYPE; |
| 190 | |
| 191 | /** HEVC Level enum type */ |
| 192 | typedef enum OMX_VIDEO_HEVCLEVELTYPE { |
| 193 | OMX_VIDEO_HEVCLevelUnknown = 0x0, |
| 194 | OMX_VIDEO_HEVCMainTierLevel1 = 0x1, |
| 195 | OMX_VIDEO_HEVCHighTierLevel1 = 0x2, |
| 196 | OMX_VIDEO_HEVCMainTierLevel2 = 0x4, |
| 197 | OMX_VIDEO_HEVCHighTierLevel2 = 0x8, |
| 198 | OMX_VIDEO_HEVCMainTierLevel21 = 0x10, |
| 199 | OMX_VIDEO_HEVCHighTierLevel21 = 0x20, |
| 200 | OMX_VIDEO_HEVCMainTierLevel3 = 0x40, |
| 201 | OMX_VIDEO_HEVCHighTierLevel3 = 0x80, |
| 202 | OMX_VIDEO_HEVCMainTierLevel31 = 0x100, |
| 203 | OMX_VIDEO_HEVCHighTierLevel31 = 0x200, |
| 204 | OMX_VIDEO_HEVCMainTierLevel4 = 0x400, |
| 205 | OMX_VIDEO_HEVCHighTierLevel4 = 0x800, |
| 206 | OMX_VIDEO_HEVCMainTierLevel41 = 0x1000, |
| 207 | OMX_VIDEO_HEVCHighTierLevel41 = 0x2000, |
| 208 | OMX_VIDEO_HEVCMainTierLevel5 = 0x4000, |
| 209 | OMX_VIDEO_HEVCHighTierLevel5 = 0x8000, |
| 210 | OMX_VIDEO_HEVCMainTierLevel51 = 0x10000, |
| 211 | OMX_VIDEO_HEVCHighTierLevel51 = 0x20000, |
| 212 | OMX_VIDEO_HEVCMainTierLevel52 = 0x40000, |
| 213 | OMX_VIDEO_HEVCHighTierLevel52 = 0x80000, |
| 214 | OMX_VIDEO_HEVCMainTierLevel6 = 0x100000, |
| 215 | OMX_VIDEO_HEVCHighTierLevel6 = 0x200000, |
| 216 | OMX_VIDEO_HEVCMainTierLevel61 = 0x400000, |
| 217 | OMX_VIDEO_HEVCHighTierLevel61 = 0x800000, |
| 218 | OMX_VIDEO_HEVCMainTierLevel62 = 0x1000000, |
| 219 | OMX_VIDEO_HEVCHighTierLevel62 = 0x2000000, |
| 220 | OMX_VIDEO_HEVCHighTiermax = 0x7FFFFFFF |
| 221 | } OMX_VIDEO_HEVCLEVELTYPE; |
| 222 | |
Wonsik Kim | 639f71f | 2015-12-08 23:21:36 +0900 | [diff] [blame] | 223 | /** Structure for controlling HEVC video encoding */ |
Rachad | 184077d | 2014-05-01 18:42:43 -0700 | [diff] [blame] | 224 | typedef struct OMX_VIDEO_PARAM_HEVCTYPE { |
| 225 | OMX_U32 nSize; |
| 226 | OMX_VERSIONTYPE nVersion; |
| 227 | OMX_U32 nPortIndex; |
| 228 | OMX_VIDEO_HEVCPROFILETYPE eProfile; |
| 229 | OMX_VIDEO_HEVCLEVELTYPE eLevel; |
Wonsik Kim | 639f71f | 2015-12-08 23:21:36 +0900 | [diff] [blame] | 230 | OMX_U32 nKeyFrameInterval; |
Rachad | 184077d | 2014-05-01 18:42:43 -0700 | [diff] [blame] | 231 | } OMX_VIDEO_PARAM_HEVCTYPE; |
| 232 | |
| 233 | /** Structure to define if dependent slice segments should be used */ |
| 234 | typedef struct OMX_VIDEO_SLICESEGMENTSTYPE { |
| 235 | OMX_U32 nSize; |
| 236 | OMX_VERSIONTYPE nVersion; |
| 237 | OMX_U32 nPortIndex; |
| 238 | OMX_BOOL bDepedentSegments; |
| 239 | OMX_BOOL bEnableLoopFilterAcrossSlices; |
| 240 | } OMX_VIDEO_SLICESEGMENTSTYPE; |
Kunter Gultekin | 203f89a | 2013-02-06 18:03:47 +0200 | [diff] [blame] | 241 | |
Lajos Molnar | bcaa8d5 | 2015-08-07 10:07:07 -0700 | [diff] [blame] | 242 | /** Structure to return timestamps of rendered output frames as well as EOS |
| 243 | * for tunneled components. |
| 244 | */ |
Lajos Molnar | e21d7f5 | 2015-06-05 17:49:25 -0700 | [diff] [blame] | 245 | typedef struct OMX_VIDEO_RENDEREVENTTYPE { |
| 246 | OMX_S64 nMediaTimeUs; // timestamp of rendered video frame |
| 247 | OMX_S64 nSystemTimeNs; // system monotonic time at the time frame was rendered |
Lajos Molnar | bcaa8d5 | 2015-08-07 10:07:07 -0700 | [diff] [blame] | 248 | // Use INT64_MAX for nMediaTimeUs to signal that the EOS |
| 249 | // has been reached. In this case, nSystemTimeNs MUST be |
| 250 | // the system time when the last frame was rendered. |
| 251 | // This MUST be done in addition to returning (and |
| 252 | // following) the render information for the last frame. |
Lajos Molnar | e21d7f5 | 2015-06-05 17:49:25 -0700 | [diff] [blame] | 253 | } OMX_VIDEO_RENDEREVENTTYPE; |
| 254 | |
Ronghua Wu | c92c19e | 2016-01-26 16:47:09 -0800 | [diff] [blame] | 255 | /** Dolby Vision Profile enum type */ |
| 256 | typedef enum OMX_VIDEO_DOLBYVISIONPROFILETYPE { |
| 257 | OMX_VIDEO_DolbyVisionProfileUnknown = 0x0, |
Ronghua Wu | 9917903 | 2016-03-29 14:34:56 -0700 | [diff] [blame] | 258 | OMX_VIDEO_DolbyVisionProfileDvavPer = 0x1, |
| 259 | OMX_VIDEO_DolbyVisionProfileDvavPen = 0x2, |
| 260 | OMX_VIDEO_DolbyVisionProfileDvheDer = 0x4, |
| 261 | OMX_VIDEO_DolbyVisionProfileDvheDen = 0x8, |
| 262 | OMX_VIDEO_DolbyVisionProfileDvheDtr = 0x10, |
| 263 | OMX_VIDEO_DolbyVisionProfileDvheStn = 0x20, |
| 264 | OMX_VIDEO_DolbyVisionProfileDvheDth = 0x40, |
Hangyu Kuang | 6c02314 | 2016-04-28 10:54:04 -0700 | [diff] [blame] | 265 | OMX_VIDEO_DolbyVisionProfileDvheDtb = 0x80, |
Ronghua Wu | c92c19e | 2016-01-26 16:47:09 -0800 | [diff] [blame] | 266 | OMX_VIDEO_DolbyVisionProfileMax = 0x7FFFFFFF |
| 267 | } OMX_VIDEO_DOLBYVISIONPROFILETYPE; |
| 268 | |
| 269 | /** Dolby Vision Level enum type */ |
| 270 | typedef enum OMX_VIDEO_DOLBYVISIONLEVELTYPE { |
| 271 | OMX_VIDEO_DolbyVisionLevelUnknown = 0x0, |
| 272 | OMX_VIDEO_DolbyVisionLevelHd24 = 0x1, |
| 273 | OMX_VIDEO_DolbyVisionLevelHd30 = 0x2, |
| 274 | OMX_VIDEO_DolbyVisionLevelFhd24 = 0x4, |
| 275 | OMX_VIDEO_DolbyVisionLevelFhd30 = 0x8, |
| 276 | OMX_VIDEO_DolbyVisionLevelFhd60 = 0x10, |
| 277 | OMX_VIDEO_DolbyVisionLevelUhd24 = 0x20, |
| 278 | OMX_VIDEO_DolbyVisionLevelUhd30 = 0x40, |
| 279 | OMX_VIDEO_DolbyVisionLevelUhd48 = 0x80, |
| 280 | OMX_VIDEO_DolbyVisionLevelUhd60 = 0x100, |
| 281 | OMX_VIDEO_DolbyVisionLevelmax = 0x7FFFFFFF |
| 282 | } OMX_VIDEO_DOLBYVISIONLEVELTYPE; |
| 283 | |
Hangyu Kuang | dbadc84 | 2016-01-28 09:51:14 -0800 | [diff] [blame] | 284 | /** |
| 285 | * Structure for configuring video compression intra refresh period |
| 286 | * |
| 287 | * STRUCT MEMBERS: |
| 288 | * nSize : Size of the structure in bytes |
| 289 | * nVersion : OMX specification version information |
| 290 | * nPortIndex : Port that this structure applies to |
| 291 | * nRefreshPeriod : Intra refreh period in frames. Value 0 means disable intra refresh |
Praveen Chavan | 3717b16 | 2016-03-25 01:17:32 -0700 | [diff] [blame^] | 292 | */ |
Hangyu Kuang | dbadc84 | 2016-01-28 09:51:14 -0800 | [diff] [blame] | 293 | typedef struct OMX_VIDEO_CONFIG_ANDROID_INTRAREFRESHTYPE { |
| 294 | OMX_U32 nSize; |
| 295 | OMX_VERSIONTYPE nVersion; |
| 296 | OMX_U32 nPortIndex; |
Hangyu Kuang | 70f744b | 2016-02-05 14:14:15 -0800 | [diff] [blame] | 297 | OMX_U32 nRefreshPeriod; |
Hangyu Kuang | dbadc84 | 2016-01-28 09:51:14 -0800 | [diff] [blame] | 298 | } OMX_VIDEO_CONFIG_ANDROID_INTRAREFRESHTYPE; |
| 299 | |
Praveen Chavan | 3717b16 | 2016-03-25 01:17:32 -0700 | [diff] [blame^] | 300 | /** Maximum number of temporal layers supported by AVC/HEVC */ |
| 301 | #define OMX_VIDEO_ANDROID_MAXTEMPORALLAYERS 8 |
| 302 | |
| 303 | /** temporal layer patterns */ |
| 304 | typedef enum OMX_VIDEO_ANDROID_TEMPORALLAYERINGPATTERNTYPE { |
| 305 | OMX_VIDEO_AndroidTemporalLayeringPatternNone = 0, |
| 306 | // pattern as defined by WebRTC |
| 307 | OMX_VIDEO_AndroidTemporalLayeringPatternWebRTC = 1 << 0, |
| 308 | // pattern where frames in any layer other than the base layer only depend on at most the very |
| 309 | // last frame from each preceding layer (other than the base layer.) |
| 310 | OMX_VIDEO_AndroidTemporalLayeringPatternAndroid = 1 << 1, |
| 311 | } OMX_VIDEO_ANDROID_TEMPORALLAYERINGPATTERNTYPE; |
| 312 | |
| 313 | /** |
| 314 | * Android specific param for configuration of temporal layering. |
| 315 | * Android only supports temporal layering where successive layers each double the |
| 316 | * previous layer's framerate. |
| 317 | * NOTE: Reading this parameter at run-time SHALL return actual run-time values. |
| 318 | * |
| 319 | * nSize : Size of the structure in bytes |
| 320 | * nVersion : OMX specification version information |
| 321 | * nPortIndex : Port that this structure applies to (output port for encoders) |
| 322 | * eSupportedPatterns : A bitmask of supported layering patterns |
| 323 | * nLayerCountMax : Max number of temporal coding layers supported |
| 324 | * by the encoder (must be at least 1, 1 meaning temporal layering |
| 325 | * is NOT supported) |
| 326 | * nBLayerCountMax : Max number of layers that can contain B frames |
| 327 | * (0) to (nLayerCountMax - 1) |
| 328 | * ePattern : Layering pattern. |
| 329 | * nPLayerCountActual : Number of temporal layers to be coded with non-B frames, |
| 330 | * starting from and including the base-layer. |
| 331 | * (1 to nLayerCountMax - nBLayerCountActual) |
| 332 | * If nPLayerCountActual is 1 and nBLayerCountActual is 0, temporal |
| 333 | * layering is disabled. Otherwise, it is enabled. |
| 334 | * nBLayerCountActual : Number of temporal layers to be coded with B frames, |
| 335 | * starting after non-B layers. |
| 336 | * (0 to nBLayerCountMax) |
| 337 | * bBitrateRatiosSpecified : Flag to indicate if layer-wise bitrate |
| 338 | * distribution is specified. |
| 339 | * nBitrateRatios : Bitrate ratio (100 based) per layer (index 0 is base layer). |
| 340 | * Honored if bBitrateRatiosSpecified is set. |
| 341 | * i.e for 4 layers with desired distribution (25% 25% 25% 25%), |
| 342 | * nBitrateRatio = {25, 50, 75, 100, ... } |
| 343 | * Values in indices not less than 'the actual number of layers |
| 344 | * minus 1' MAY be ignored and assumed to be 100. |
| 345 | */ |
| 346 | typedef struct OMX_VIDEO_PARAM_ANDROID_TEMPORALLAYERINGTYPE { |
| 347 | OMX_U32 nSize; |
| 348 | OMX_VERSIONTYPE nVersion; |
| 349 | OMX_U32 nPortIndex; |
| 350 | OMX_VIDEO_ANDROID_TEMPORALLAYERINGPATTERNTYPE eSupportedPatterns; |
| 351 | OMX_U32 nLayerCountMax; |
| 352 | OMX_U32 nBLayerCountMax; |
| 353 | OMX_VIDEO_ANDROID_TEMPORALLAYERINGPATTERNTYPE ePattern; |
| 354 | OMX_U32 nPLayerCountActual; |
| 355 | OMX_U32 nBLayerCountActual; |
| 356 | OMX_BOOL bBitrateRatiosSpecified; |
| 357 | OMX_U32 nBitrateRatios[OMX_VIDEO_ANDROID_MAXTEMPORALLAYERS]; |
| 358 | } OMX_VIDEO_PARAM_ANDROID_TEMPORALLAYERINGTYPE; |
| 359 | |
| 360 | /** |
| 361 | * Android specific config for changing the temporal-layer count or |
| 362 | * bitrate-distribution at run-time. |
| 363 | * |
| 364 | * nSize : Size of the structure in bytes |
| 365 | * nVersion : OMX specification version information |
| 366 | * nPortIndex : Port that this structure applies to (output port for encoders) |
| 367 | * ePattern : Layering pattern. |
| 368 | * nPLayerCountActual : Number of temporal layers to be coded with non-B frames. |
| 369 | * (same OMX_VIDEO_PARAM_ANDROID_TEMPORALLAYERINGTYPE limits apply.) |
| 370 | * nBLayerCountActual : Number of temporal layers to be coded with B frames. |
| 371 | * (same OMX_VIDEO_PARAM_ANDROID_TEMPORALLAYERINGTYPE limits apply.) |
| 372 | * bBitrateRatiosSpecified : Flag to indicate if layer-wise bitrate |
| 373 | * distribution is specified. |
| 374 | * nBitrateRatios : Bitrate ratio (100 based, Q16 values) per layer (0 is base layer). |
| 375 | * Honored if bBitrateRatiosSpecified is set. |
| 376 | * (same OMX_VIDEO_PARAM_ANDROID_TEMPORALLAYERINGTYPE limits apply.) |
| 377 | */ |
| 378 | typedef struct OMX_VIDEO_CONFIG_ANDROID_TEMPORALLAYERINGTYPE { |
| 379 | OMX_U32 nSize; |
| 380 | OMX_VERSIONTYPE nVersion; |
| 381 | OMX_U32 nPortIndex; |
| 382 | OMX_VIDEO_ANDROID_TEMPORALLAYERINGPATTERNTYPE ePattern; |
| 383 | OMX_U32 nPLayerCountActual; |
| 384 | OMX_U32 nBLayerCountActual; |
| 385 | OMX_BOOL bBitrateRatiosSpecified; |
| 386 | OMX_U32 nBitrateRatios[OMX_VIDEO_ANDROID_MAXTEMPORALLAYERS]; |
| 387 | } OMX_VIDEO_CONFIG_ANDROID_TEMPORALLAYERINGTYPE; |
| 388 | |
Kunter Gultekin | 203f89a | 2013-02-06 18:03:47 +0200 | [diff] [blame] | 389 | #ifdef __cplusplus |
| 390 | } |
| 391 | #endif /* __cplusplus */ |
| 392 | |
| 393 | #endif /* OMX_VideoExt_h */ |
| 394 | /* File EOF */ |