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 61 /** AVC additional profiles */ 62 typedef enum OMX_VIDEO_AVCPROFILEEXTTYPE { 63 OMX_VIDEO_AVCProfileConstrainedBaseline = 0x10000, /**< Constrained baseline profile */ 64 OMX_VIDEO_AVCProfileConstrainedHigh = 0x80000, /**< Constrained high profile */ 65 } OMX_VIDEO_AVCPROFILEEXTTYPE; 66 67 /** VP8 profiles */ 68 typedef enum OMX_VIDEO_VP8PROFILETYPE { 69 OMX_VIDEO_VP8ProfileMain = 0x01, 70 OMX_VIDEO_VP8ProfileUnknown = 0x6EFFFFFF, 71 OMX_VIDEO_VP8ProfileMax = 0x7FFFFFFF 72 } OMX_VIDEO_VP8PROFILETYPE; 73 74 /** VP8 levels */ 75 typedef enum OMX_VIDEO_VP8LEVELTYPE { 76 OMX_VIDEO_VP8Level_Version0 = 0x01, 77 OMX_VIDEO_VP8Level_Version1 = 0x02, 78 OMX_VIDEO_VP8Level_Version2 = 0x04, 79 OMX_VIDEO_VP8Level_Version3 = 0x08, 80 OMX_VIDEO_VP8LevelUnknown = 0x6EFFFFFF, 81 OMX_VIDEO_VP8LevelMax = 0x7FFFFFFF 82 } OMX_VIDEO_VP8LEVELTYPE; 83 84 /** VP8 Param */ 85 typedef struct OMX_VIDEO_PARAM_VP8TYPE { 86 OMX_U32 nSize; 87 OMX_VERSIONTYPE nVersion; 88 OMX_U32 nPortIndex; 89 OMX_VIDEO_VP8PROFILETYPE eProfile; 90 OMX_VIDEO_VP8LEVELTYPE eLevel; 91 OMX_U32 nDCTPartitions; 92 OMX_BOOL bErrorResilientMode; 93 } OMX_VIDEO_PARAM_VP8TYPE; 94 95 /** Structure for configuring VP8 reference frames */ 96 typedef struct OMX_VIDEO_VP8REFERENCEFRAMETYPE { 97 OMX_U32 nSize; 98 OMX_VERSIONTYPE nVersion; 99 OMX_U32 nPortIndex; 100 OMX_BOOL bPreviousFrameRefresh; 101 OMX_BOOL bGoldenFrameRefresh; 102 OMX_BOOL bAlternateFrameRefresh; 103 OMX_BOOL bUsePreviousFrame; 104 OMX_BOOL bUseGoldenFrame; 105 OMX_BOOL bUseAlternateFrame; 106 } OMX_VIDEO_VP8REFERENCEFRAMETYPE; 107 108 /** Structure for querying VP8 reference frame type */ 109 typedef struct OMX_VIDEO_VP8REFERENCEFRAMEINFOTYPE { 110 OMX_U32 nSize; 111 OMX_VERSIONTYPE nVersion; 112 OMX_U32 nPortIndex; 113 OMX_BOOL bIsIntraFrame; 114 OMX_BOOL bIsGoldenOrAlternateFrame; 115 } OMX_VIDEO_VP8REFERENCEFRAMEINFOTYPE; 116 117 /** Maximum number of VP8 temporal layers */ 118 #define OMX_VIDEO_ANDROID_MAXVP8TEMPORALLAYERS 3 119 120 /** VP8 temporal layer patterns */ 121 typedef enum OMX_VIDEO_ANDROID_VPXTEMPORALLAYERPATTERNTYPE { 122 OMX_VIDEO_VPXTemporalLayerPatternNone = 0, 123 OMX_VIDEO_VPXTemporalLayerPatternWebRTC = 1, 124 OMX_VIDEO_VPXTemporalLayerPatternMax = 0x7FFFFFFF 125 } OMX_VIDEO_ANDROID_VPXTEMPORALLAYERPATTERNTYPE; 126 127 /** 128 * Android specific VP8/VP9 encoder params 129 * 130 * STRUCT MEMBERS: 131 * nSize : Size of the structure in bytes 132 * nVersion : OMX specification version information 133 * nPortIndex : Port that this structure applies to 134 * nKeyFrameInterval : Key frame interval in frames 135 * eTemporalPattern : Type of temporal layer pattern 136 * nTemporalLayerCount : Number of temporal coding layers 137 * nTemporalLayerBitrateRatio : Bitrate ratio allocation between temporal 138 * streams in percentage 139 * nMinQuantizer : Minimum (best quality) quantizer 140 * nMaxQuantizer : Maximum (worst quality) quantizer 141 */ 142 typedef struct OMX_VIDEO_PARAM_ANDROID_VP8ENCODERTYPE { 143 OMX_U32 nSize; 144 OMX_VERSIONTYPE nVersion; 145 OMX_U32 nPortIndex; 146 OMX_U32 nKeyFrameInterval; // distance between consecutive key_frames (including one 147 // of the key_frames). 0 means interval is unspecified and 148 // can be freely chosen by the codec. 1 means a stream of 149 // only key_frames. 150 151 OMX_VIDEO_ANDROID_VPXTEMPORALLAYERPATTERNTYPE eTemporalPattern; 152 OMX_U32 nTemporalLayerCount; 153 OMX_U32 nTemporalLayerBitrateRatio[OMX_VIDEO_ANDROID_MAXVP8TEMPORALLAYERS]; 154 OMX_U32 nMinQuantizer; 155 OMX_U32 nMaxQuantizer; 156 } OMX_VIDEO_PARAM_ANDROID_VP8ENCODERTYPE; 157 158 /** VP9 profiles */ 159 typedef enum OMX_VIDEO_VP9PROFILETYPE { 160 OMX_VIDEO_VP9Profile0 = 0x1, 161 OMX_VIDEO_VP9Profile1 = 0x2, 162 OMX_VIDEO_VP9Profile2 = 0x4, 163 OMX_VIDEO_VP9Profile3 = 0x8, 164 // HDR profiles also support passing HDR metadata 165 OMX_VIDEO_VP9Profile2HDR = 0x1000, 166 OMX_VIDEO_VP9Profile3HDR = 0x2000, 167 OMX_VIDEO_VP9Profile2HDR10Plus = 0x4000, 168 OMX_VIDEO_VP9Profile3HDR10Plus = 0x8000, 169 OMX_VIDEO_VP9ProfileUnknown = 0x6EFFFFFF, 170 OMX_VIDEO_VP9ProfileMax = 0x7FFFFFFF 171 } OMX_VIDEO_VP9PROFILETYPE; 172 173 /** VP9 levels */ 174 typedef enum OMX_VIDEO_VP9LEVELTYPE { 175 OMX_VIDEO_VP9Level1 = 0x1, 176 OMX_VIDEO_VP9Level11 = 0x2, 177 OMX_VIDEO_VP9Level2 = 0x4, 178 OMX_VIDEO_VP9Level21 = 0x8, 179 OMX_VIDEO_VP9Level3 = 0x10, 180 OMX_VIDEO_VP9Level31 = 0x20, 181 OMX_VIDEO_VP9Level4 = 0x40, 182 OMX_VIDEO_VP9Level41 = 0x80, 183 OMX_VIDEO_VP9Level5 = 0x100, 184 OMX_VIDEO_VP9Level51 = 0x200, 185 OMX_VIDEO_VP9Level52 = 0x400, 186 OMX_VIDEO_VP9Level6 = 0x800, 187 OMX_VIDEO_VP9Level61 = 0x1000, 188 OMX_VIDEO_VP9Level62 = 0x2000, 189 OMX_VIDEO_VP9LevelUnknown = 0x6EFFFFFF, 190 OMX_VIDEO_VP9LevelMax = 0x7FFFFFFF 191 } OMX_VIDEO_VP9LEVELTYPE; 192 193 /** 194 * VP9 Parameters. 195 * Encoder specific parameters (decoders should ignore these fields): 196 * - bErrorResilientMode 197 * - nTileRows 198 * - nTileColumns 199 * - bEnableFrameParallelDecoding 200 */ 201 typedef struct OMX_VIDEO_PARAM_VP9TYPE { 202 OMX_U32 nSize; 203 OMX_VERSIONTYPE nVersion; 204 OMX_U32 nPortIndex; 205 OMX_VIDEO_VP9PROFILETYPE eProfile; 206 OMX_VIDEO_VP9LEVELTYPE eLevel; 207 OMX_BOOL bErrorResilientMode; 208 OMX_U32 nTileRows; 209 OMX_U32 nTileColumns; 210 OMX_BOOL bEnableFrameParallelDecoding; 211 } OMX_VIDEO_PARAM_VP9TYPE; 212 213 /** HEVC Profile enum type */ 214 typedef enum OMX_VIDEO_HEVCPROFILETYPE { 215 OMX_VIDEO_HEVCProfileUnknown = 0x0, 216 OMX_VIDEO_HEVCProfileMain = 0x1, 217 OMX_VIDEO_HEVCProfileMain10 = 0x2, 218 OMX_VIDEO_HEVCProfileMainStill = 0x4, 219 // Main10 profile with HDR SEI support. 220 OMX_VIDEO_HEVCProfileMain10HDR10 = 0x1000, 221 OMX_VIDEO_HEVCProfileMain10HDR10Plus = 0x2000, 222 OMX_VIDEO_HEVCProfileMax = 0x7FFFFFFF 223 } OMX_VIDEO_HEVCPROFILETYPE; 224 225 /** HEVC Level enum type */ 226 typedef enum OMX_VIDEO_HEVCLEVELTYPE { 227 OMX_VIDEO_HEVCLevelUnknown = 0x0, 228 OMX_VIDEO_HEVCMainTierLevel1 = 0x1, 229 OMX_VIDEO_HEVCHighTierLevel1 = 0x2, 230 OMX_VIDEO_HEVCMainTierLevel2 = 0x4, 231 OMX_VIDEO_HEVCHighTierLevel2 = 0x8, 232 OMX_VIDEO_HEVCMainTierLevel21 = 0x10, 233 OMX_VIDEO_HEVCHighTierLevel21 = 0x20, 234 OMX_VIDEO_HEVCMainTierLevel3 = 0x40, 235 OMX_VIDEO_HEVCHighTierLevel3 = 0x80, 236 OMX_VIDEO_HEVCMainTierLevel31 = 0x100, 237 OMX_VIDEO_HEVCHighTierLevel31 = 0x200, 238 OMX_VIDEO_HEVCMainTierLevel4 = 0x400, 239 OMX_VIDEO_HEVCHighTierLevel4 = 0x800, 240 OMX_VIDEO_HEVCMainTierLevel41 = 0x1000, 241 OMX_VIDEO_HEVCHighTierLevel41 = 0x2000, 242 OMX_VIDEO_HEVCMainTierLevel5 = 0x4000, 243 OMX_VIDEO_HEVCHighTierLevel5 = 0x8000, 244 OMX_VIDEO_HEVCMainTierLevel51 = 0x10000, 245 OMX_VIDEO_HEVCHighTierLevel51 = 0x20000, 246 OMX_VIDEO_HEVCMainTierLevel52 = 0x40000, 247 OMX_VIDEO_HEVCHighTierLevel52 = 0x80000, 248 OMX_VIDEO_HEVCMainTierLevel6 = 0x100000, 249 OMX_VIDEO_HEVCHighTierLevel6 = 0x200000, 250 OMX_VIDEO_HEVCMainTierLevel61 = 0x400000, 251 OMX_VIDEO_HEVCHighTierLevel61 = 0x800000, 252 OMX_VIDEO_HEVCMainTierLevel62 = 0x1000000, 253 OMX_VIDEO_HEVCHighTierLevel62 = 0x2000000, 254 OMX_VIDEO_HEVCHighTiermax = 0x7FFFFFFF 255 } OMX_VIDEO_HEVCLEVELTYPE; 256 257 /** Structure for controlling HEVC video encoding */ 258 typedef struct OMX_VIDEO_PARAM_HEVCTYPE { 259 OMX_U32 nSize; 260 OMX_VERSIONTYPE nVersion; 261 OMX_U32 nPortIndex; 262 OMX_VIDEO_HEVCPROFILETYPE eProfile; 263 OMX_VIDEO_HEVCLEVELTYPE eLevel; 264 OMX_U32 nKeyFrameInterval; // distance between consecutive I-frames (including one 265 // of the I frames). 0 means interval is unspecified and 266 // can be freely chosen by the codec. 1 means a stream of 267 // only I frames. 268 } OMX_VIDEO_PARAM_HEVCTYPE; 269 270 /** Structure to define if dependent slice segments should be used */ 271 typedef struct OMX_VIDEO_SLICESEGMENTSTYPE { 272 OMX_U32 nSize; 273 OMX_VERSIONTYPE nVersion; 274 OMX_U32 nPortIndex; 275 OMX_BOOL bDepedentSegments; 276 OMX_BOOL bEnableLoopFilterAcrossSlices; 277 } OMX_VIDEO_SLICESEGMENTSTYPE; 278 279 /** Structure to return timestamps of rendered output frames as well as EOS 280 * for tunneled components. 281 */ 282 typedef struct OMX_VIDEO_RENDEREVENTTYPE { 283 OMX_S64 nMediaTimeUs; // timestamp of rendered video frame 284 OMX_S64 nSystemTimeNs; // system monotonic time at the time frame was rendered 285 // Use INT64_MAX for nMediaTimeUs to signal that the EOS 286 // has been reached. In this case, nSystemTimeNs MUST be 287 // the system time when the last frame was rendered. 288 // This MUST be done in addition to returning (and 289 // following) the render information for the last frame. 290 } OMX_VIDEO_RENDEREVENTTYPE; 291 292 /** Dolby Vision Profile enum type */ 293 typedef enum OMX_VIDEO_DOLBYVISIONPROFILETYPE { 294 OMX_VIDEO_DolbyVisionProfileUnknown = 0x0, 295 OMX_VIDEO_DolbyVisionProfileDvavPer = 0x1, 296 OMX_VIDEO_DolbyVisionProfileDvavPen = 0x2, 297 OMX_VIDEO_DolbyVisionProfileDvheDer = 0x4, 298 OMX_VIDEO_DolbyVisionProfileDvheDen = 0x8, 299 OMX_VIDEO_DolbyVisionProfileDvheDtr = 0x10, 300 OMX_VIDEO_DolbyVisionProfileDvheStn = 0x20, 301 OMX_VIDEO_DolbyVisionProfileDvheDth = 0x40, 302 OMX_VIDEO_DolbyVisionProfileDvheDtb = 0x80, 303 OMX_VIDEO_DolbyVisionProfileDvheSt = 0x100, 304 OMX_VIDEO_DolbyVisionProfileDvavSe = 0x200, 305 OMX_VIDEO_DolbyVisionProfileDvav110 = 0x400, 306 OMX_VIDEO_DolbyVisionProfileMax = 0x7FFFFFFF 307 } OMX_VIDEO_DOLBYVISIONPROFILETYPE; 308 309 /** Dolby Vision Level enum type */ 310 typedef enum OMX_VIDEO_DOLBYVISIONLEVELTYPE { 311 OMX_VIDEO_DolbyVisionLevelUnknown = 0x0, 312 OMX_VIDEO_DolbyVisionLevelHd24 = 0x1, 313 OMX_VIDEO_DolbyVisionLevelHd30 = 0x2, 314 OMX_VIDEO_DolbyVisionLevelFhd24 = 0x4, 315 OMX_VIDEO_DolbyVisionLevelFhd30 = 0x8, 316 OMX_VIDEO_DolbyVisionLevelFhd60 = 0x10, 317 OMX_VIDEO_DolbyVisionLevelUhd24 = 0x20, 318 OMX_VIDEO_DolbyVisionLevelUhd30 = 0x40, 319 OMX_VIDEO_DolbyVisionLevelUhd48 = 0x80, 320 OMX_VIDEO_DolbyVisionLevelUhd60 = 0x100, 321 OMX_VIDEO_DolbyVisionLevelmax = 0x7FFFFFFF 322 } OMX_VIDEO_DOLBYVISIONLEVELTYPE; 323 324 /** AV1 Profile enum type */ 325 typedef enum OMX_VIDEO_AV1PROFILETYPE { 326 OMX_VIDEO_AV1ProfileMain8 = 0x00000001, 327 OMX_VIDEO_AV1ProfileMain10 = 0x00000002, 328 OMX_VIDEO_AV1ProfileMain10HDR10 = 0x00001000, 329 OMX_VIDEO_AV1ProfileMain10HDR10Plus = 0x00002000, 330 OMX_VIDEO_AV1ProfileUnknown = 0x6EFFFFFF, 331 OMX_VIDEO_AV1ProfileMax = 0x7FFFFFFF 332 } OMX_VIDEO_AV1PROFILETYPE; 333 334 /** AV1 Level enum type */ 335 typedef enum OMX_VIDEO_AV1LEVELTYPE { 336 OMX_VIDEO_AV1Level2 = 0x1, 337 OMX_VIDEO_AV1Level21 = 0x2, 338 OMX_VIDEO_AV1Level22 = 0x4, 339 OMX_VIDEO_AV1Level23 = 0x8, 340 OMX_VIDEO_AV1Level3 = 0x10, 341 OMX_VIDEO_AV1Level31 = 0x20, 342 OMX_VIDEO_AV1Level32 = 0x40, 343 OMX_VIDEO_AV1Level33 = 0x80, 344 OMX_VIDEO_AV1Level4 = 0x100, 345 OMX_VIDEO_AV1Level41 = 0x200, 346 OMX_VIDEO_AV1Level42 = 0x400, 347 OMX_VIDEO_AV1Level43 = 0x800, 348 OMX_VIDEO_AV1Level5 = 0x1000, 349 OMX_VIDEO_AV1Level51 = 0x2000, 350 OMX_VIDEO_AV1Level52 = 0x4000, 351 OMX_VIDEO_AV1Level53 = 0x8000, 352 OMX_VIDEO_AV1Level6 = 0x10000, 353 OMX_VIDEO_AV1Level61 = 0x20000, 354 OMX_VIDEO_AV1Level62 = 0x40000, 355 OMX_VIDEO_AV1Level63 = 0x80000, 356 OMX_VIDEO_AV1Level7 = 0x100000, 357 OMX_VIDEO_AV1Level71 = 0x200000, 358 OMX_VIDEO_AV1Level72 = 0x400000, 359 OMX_VIDEO_AV1Level73 = 0x800000, 360 OMX_VIDEO_AV1LevelUnknown = 0x6EFFFFFF, 361 OMX_VIDEO_AV1LevelMax = 0x7FFFFFFF 362 } OMX_VIDEO_AV1LEVELTYPE; 363 364 /** 365 * Structure for configuring video compression intra refresh period 366 * 367 * STRUCT MEMBERS: 368 * nSize : Size of the structure in bytes 369 * nVersion : OMX specification version information 370 * nPortIndex : Port that this structure applies to 371 * nRefreshPeriod : Intra refreh period in frames. Value 0 means disable intra refresh 372 */ 373 typedef struct OMX_VIDEO_CONFIG_ANDROID_INTRAREFRESHTYPE { 374 OMX_U32 nSize; 375 OMX_VERSIONTYPE nVersion; 376 OMX_U32 nPortIndex; 377 OMX_U32 nRefreshPeriod; 378 } OMX_VIDEO_CONFIG_ANDROID_INTRAREFRESHTYPE; 379 380 /** Maximum number of temporal layers supported by AVC/HEVC */ 381 #define OMX_VIDEO_ANDROID_MAXTEMPORALLAYERS 8 382 383 /** temporal layer patterns */ 384 typedef enum OMX_VIDEO_ANDROID_TEMPORALLAYERINGPATTERNTYPE { 385 OMX_VIDEO_AndroidTemporalLayeringPatternNone = 0, 386 // pattern as defined by WebRTC 387 OMX_VIDEO_AndroidTemporalLayeringPatternWebRTC = 1 << 0, 388 // pattern where frames in any layer other than the base layer only depend on at most the very 389 // last frame from each preceding layer (other than the base layer.) 390 OMX_VIDEO_AndroidTemporalLayeringPatternAndroid = 1 << 1, 391 } OMX_VIDEO_ANDROID_TEMPORALLAYERINGPATTERNTYPE; 392 393 /** 394 * Android specific param for configuration of temporal layering. 395 * Android only supports temporal layering where successive layers each double the 396 * previous layer's framerate. 397 * NOTE: Reading this parameter at run-time SHALL return actual run-time values. 398 * 399 * nSize : Size of the structure in bytes 400 * nVersion : OMX specification version information 401 * nPortIndex : Port that this structure applies to (output port for encoders) 402 * eSupportedPatterns : A bitmask of supported layering patterns 403 * nLayerCountMax : Max number of temporal coding layers supported 404 * by the encoder (must be at least 1, 1 meaning temporal layering 405 * is NOT supported) 406 * nBLayerCountMax : Max number of layers that can contain B frames 407 * (0) to (nLayerCountMax - 1) 408 * ePattern : Layering pattern. 409 * nPLayerCountActual : Number of temporal layers to be coded with non-B frames, 410 * starting from and including the base-layer. 411 * (1 to nLayerCountMax - nBLayerCountActual) 412 * If nPLayerCountActual is 1 and nBLayerCountActual is 0, temporal 413 * layering is disabled. Otherwise, it is enabled. 414 * nBLayerCountActual : Number of temporal layers to be coded with B frames, 415 * starting after non-B layers. 416 * (0 to nBLayerCountMax) 417 * bBitrateRatiosSpecified : Flag to indicate if layer-wise bitrate 418 * distribution is specified. 419 * nBitrateRatios : Bitrate ratio (100 based) per layer (index 0 is base layer). 420 * Honored if bBitrateRatiosSpecified is set. 421 * i.e for 4 layers with desired distribution (25% 25% 25% 25%), 422 * nBitrateRatio = {25, 50, 75, 100, ... } 423 * Values in indices not less than 'the actual number of layers 424 * minus 1' MAY be ignored and assumed to be 100. 425 */ 426 typedef struct OMX_VIDEO_PARAM_ANDROID_TEMPORALLAYERINGTYPE { 427 OMX_U32 nSize; 428 OMX_VERSIONTYPE nVersion; 429 OMX_U32 nPortIndex; 430 OMX_VIDEO_ANDROID_TEMPORALLAYERINGPATTERNTYPE eSupportedPatterns; 431 OMX_U32 nLayerCountMax; 432 OMX_U32 nBLayerCountMax; 433 OMX_VIDEO_ANDROID_TEMPORALLAYERINGPATTERNTYPE ePattern; 434 OMX_U32 nPLayerCountActual; 435 OMX_U32 nBLayerCountActual; 436 OMX_BOOL bBitrateRatiosSpecified; 437 OMX_U32 nBitrateRatios[OMX_VIDEO_ANDROID_MAXTEMPORALLAYERS]; 438 } OMX_VIDEO_PARAM_ANDROID_TEMPORALLAYERINGTYPE; 439 440 /** 441 * Android specific config for changing the temporal-layer count or 442 * bitrate-distribution at run-time. 443 * 444 * nSize : Size of the structure in bytes 445 * nVersion : OMX specification version information 446 * nPortIndex : Port that this structure applies to (output port for encoders) 447 * ePattern : Layering pattern. 448 * nPLayerCountActual : Number of temporal layers to be coded with non-B frames. 449 * (same OMX_VIDEO_PARAM_ANDROID_TEMPORALLAYERINGTYPE limits apply.) 450 * nBLayerCountActual : Number of temporal layers to be coded with B frames. 451 * (same OMX_VIDEO_PARAM_ANDROID_TEMPORALLAYERINGTYPE limits apply.) 452 * bBitrateRatiosSpecified : Flag to indicate if layer-wise bitrate 453 * distribution is specified. 454 * nBitrateRatios : Bitrate ratio (100 based, Q16 values) per layer (0 is base layer). 455 * Honored if bBitrateRatiosSpecified is set. 456 * (same OMX_VIDEO_PARAM_ANDROID_TEMPORALLAYERINGTYPE limits apply.) 457 */ 458 typedef struct OMX_VIDEO_CONFIG_ANDROID_TEMPORALLAYERINGTYPE { 459 OMX_U32 nSize; 460 OMX_VERSIONTYPE nVersion; 461 OMX_U32 nPortIndex; 462 OMX_VIDEO_ANDROID_TEMPORALLAYERINGPATTERNTYPE ePattern; 463 OMX_U32 nPLayerCountActual; 464 OMX_U32 nBLayerCountActual; 465 OMX_BOOL bBitrateRatiosSpecified; 466 OMX_U32 nBitrateRatios[OMX_VIDEO_ANDROID_MAXTEMPORALLAYERS]; 467 } OMX_VIDEO_CONFIG_ANDROID_TEMPORALLAYERINGTYPE; 468 469 /** 470 * Android specific param for specifying image grid layout information for image encoding 471 * use cases, corresponding to index OMX_IndexParamVideoAndroidImageGrid. 472 * 473 * OMX_VIDEO_CodingImageHEIC encoders must handle this param type. When this param is set 474 * on the component with bEnabled set to true, nTileWidth, nTileHeight, nGridRows, 475 * nGridCols indicates the desired grid config by the client. The component can use this 476 * as a heuristic, and is free to choose any suitable grid configs. The client shall 477 * always get the actual from the component after the param is set. Encoder will receive 478 * each input image in full, and shall encode it into tiles in row-major, top-row first, 479 * left-to-right order, and send each encoded tile in a separate output buffer. All output 480 * buffers for the same input buffer shall carry the same timestamp as the input buffer. 481 * If the input buffer is marked EOS, the EOS should only appear on the last output buffer 482 * for that input buffer. 483 * 484 * OMX_VIDEO_CodingHEVC encoders might also receive this param when it's used for image 485 * encoding, although in this case the param only serves as a hint. The encoder will 486 * receive the input image tiles in row-major, top-row first, left-to-right order. 487 * The grid config can be used for quality control, or optimizations. 488 * 489 * If this param is not set, the component shall assume that grid option is disabled. 490 * 491 * nSize : Size of the structure in bytes 492 * nVersion : OMX specification version information 493 * nPortIndex : Port that this structure applies to (output port for encoders) 494 * bEnabled : Whether grid is enabled. If true, the other parameters 495 * specifies the grid config; otherwise they shall be ignored. 496 * nTileWidth : Width of each tile. 497 * nTileHeight : Height of each tile. 498 * nGridRows : Number of rows in the grid. 499 * nGridCols : Number of cols in the grid. 500 */ 501 typedef struct OMX_VIDEO_PARAM_ANDROID_IMAGEGRIDTYPE { 502 OMX_U32 nSize; 503 OMX_VERSIONTYPE nVersion; 504 OMX_U32 nPortIndex; 505 OMX_BOOL bEnabled; 506 OMX_U32 nTileWidth; 507 OMX_U32 nTileHeight; 508 OMX_U32 nGridRows; 509 OMX_U32 nGridCols; 510 } OMX_VIDEO_PARAM_ANDROID_IMAGEGRIDTYPE; 511 512 #ifdef __cplusplus 513 } 514 #endif /* __cplusplus */ 515 516 #endif /* OMX_VideoExt_h */ 517 /* File EOF */ 518