1 /* 2 * Copyright (c) 2025 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 #ifndef CODEC_OMX_EXT_H 17 #define CODEC_OMX_EXT_H 18 #include <OMX_IVCommon.h> 19 #include <OMX_Video.h> 20 #include <OMX_Core.h> 21 #include <stdbool.h> 22 #ifdef __cplusplus 23 #if __cplusplus 24 extern "C" { 25 #endif 26 #endif /* __cplusplus */ 27 28 #define PROCESS_NAME_LEN 50 29 #define ROI_QUANTITY 6 30 #define MAX_HARDWARE_ADDR_LEN 6 31 32 /** 33 * @brief Enumerates the extended AVC profile. 34 */ 35 enum CodecAVCProfileExt { 36 OMX_VIDEO_AVC_LEVEL52 = 0x10000, /**< Level 5.2 */ 37 OMX_VIDEO_AVC_LEVEL6 = 0x20000, /**< Level 6 */ 38 OMX_VIDEO_AVC_LEVEL61 = 0x40000, /**< Level 6.1 */ 39 OMX_VIDEO_AVC_LEVEL62 = 0x80000, /**< Level 6.2 */ 40 }; 41 42 /** 43 * @brief Enumerates the extended codec codingtyps. 44 */ 45 enum CodecVideoExType { 46 CODEC_OMX_VIDEO_CodingVP9 = 10, /** VP9 Index in Codec HDI */ 47 CODEC_OMX_VIDEO_CodingHEVC = 11, /** HEVC Index in Codec HDI */ 48 CODEC_OMX_VIDEO_CodingVVC = 0x7F000007, /** VVC Index in Codec HDI */ 49 }; 50 51 /** 52 * @brief Enumerates the extended HEVC profile. 53 */ 54 enum CodecHevcProfile { 55 CODEC_HEVC_PROFILE_INVALID = 0x0, 56 CODEC_HEVC_PROFILE_MAIN = 0x1, 57 CODEC_HEVC_PROFILE_MAIN10 = 0x2, 58 CODEC_HEVC_PROFILE_MAIN_STILL = 0x3, 59 // main_10 profile with HDR SEI support. 60 CODEC_HEVC_PROFILE_MAIN10_HDR10 = 0x1000, 61 CODEC_HEVC_PROFILE_MAIN10_HDR10_PLUS = 0x2000, 62 CODEC_HEVC_PROFILE_MAX = 0x7FFFFFFF 63 }; 64 65 /** 66 * @brief Enumerates the extended HEVC level. 67 */ 68 enum CodecHevcLevel { 69 CODEC_HEVC_LEVEL_INVALID = 0x0, 70 CODEC_HEVC_MAIN_TIER_LEVEL1 = 0x1, 71 CODEC_HEVC_HIGH_TIER_LEVEL1 = 0x2, 72 CODEC_HEVC_MAIN_TIER_LEVEL2 = 0x4, 73 CODEC_HEVC_HIGH_TIER_LEVEL2 = 0x8, 74 CODEC_HEVC_MAIN_TIER_LEVEL21 = 0x10, 75 CODEC_HEVC_HIGH_TIER_LEVEL21 = 0x20, 76 CODEC_HEVC_MAIN_TIER_LEVEL3 = 0x40, 77 CODEC_HEVC_HIGH_TIER_LEVEL3 = 0x80, 78 CODEC_HEVC_MAIN_TIER_LEVEL31 = 0x100, 79 CODEC_HEVC_HIGH_TIER_LEVEL31 = 0x200, 80 CODEC_HEVC_MAIN_TIER_LEVEL4 = 0x400, 81 CODEC_HEVC_HIGH_TIER_LEVEL4 = 0x800, 82 CODEC_HEVC_MAIN_TIER_LEVEL41 = 0x1000, 83 CODEC_HEVC_HIGH_TIER_LEVEL41 = 0x2000, 84 CODEC_HEVC_MAIN_TIER_LEVEL5 = 0x4000, 85 CODEC_HEVC_HIGH_TIER_LEVEL5 = 0x8000, 86 CODEC_HEVC_MAIN_TIER_LEVEL51 = 0x10000, 87 CODEC_HEVC_HIGH_TIER_LEVEL51 = 0x20000, 88 CODEC_HEVC_MAIN_TIER_LEVEL52 = 0x40000, 89 CODEC_HEVC_HIGH_TIER_LEVEL52 = 0x80000, 90 CODEC_HEVC_MAIN_TIER_LEVEL6 = 0x100000, 91 CODEC_HEVC_HIGH_TIER_LEVEL6 = 0x200000, 92 CODEC_HEVC_MAIN_TIER_LEVEL61 = 0x400000, 93 CODEC_HEVC_HIGH_TIER_LEVEL61 = 0x800000, 94 CODEC_HEVC_MAIN_TIER_LEVEL62 = 0x1000000, 95 CODEC_HEVC_HIGH_TIER_LEVEL62 = 0x2000000, 96 CODEC_HEVC_HIGH_TIER_MAX = 0x7FFFFFFF 97 }; 98 99 /** 100 * @brief Enumerates the extended VVC profile. 101 */ 102 enum CodecVvcProfile { 103 CODEC_VVC_PROFILE_INVALID = 0x0, 104 CODEC_VVC_PROFILE_MAIN10 = 0x1, 105 CODEC_VVC_PROFILE_MAIN10_STILL = 0x2, 106 CODEC_VVC_PROFILE_MAIN10_444 = 0x3, 107 CODEC_VVC_PROFILE_MAIN10_444_STILL = 0x4, 108 CODEC_VVC_PROFILE_MULTI_MAIN10 = 0x5, 109 CODEC_VVC_PROFILE_MULTI_MAIN10_444 = 0x6, 110 // Operation range extensions profiles 111 CODEC_VVC_PROFILE_MAIN12 = 0x7, 112 CODEC_VVC_PROFILE_MAIN12_INTRA = 0x8, 113 CODEC_VVC_PROFILE_MAIN12_STILL = 0x9, 114 CODEC_VVC_PROFILE_MAIN12_444 = 0xA, 115 CODEC_VVC_PROFILE_MAIN12_444_INTRA = 0xB, 116 CODEC_VVC_PROFILE_MAIN12_444_STILL = 0xC, 117 CODEC_VVC_PROFILE_MAIN16_444 = 0xD, 118 CODEC_VVC_PROFILE_MAIN16_444_INTRA = 0xE, 119 CODEC_VVC_PROFILE_MAIN16_444_STILL = 0xF, 120 CODEC_VVC_PROFILE_MAX = 0x7FFFFFFF 121 }; 122 123 /** 124 * @brief Enumerates the extended VVC level. 125 */ 126 enum CodecVvcLevel { 127 CODEC_VVC_LEVEL_INVALID = 0x0, 128 CODEC_VVC_MAIN_TIER_LEVEL1 = 0x1, 129 CODEC_VVC_HIGH_TIER_LEVEL1 = 0x2, 130 CODEC_VVC_MAIN_TIER_LEVEL2 = 0x4, 131 CODEC_VVC_HIGH_TIER_LEVEL2 = 0x8, 132 CODEC_VVC_MAIN_TIER_LEVEL21 = 0x10, 133 CODEC_VVC_HIGH_TIER_LEVEL21 = 0x20, 134 CODEC_VVC_MAIN_TIER_LEVEL3 = 0x40, 135 CODEC_VVC_HIGH_TIER_LEVEL3 = 0x80, 136 CODEC_VVC_MAIN_TIER_LEVEL31 = 0x100, 137 CODEC_VVC_HIGH_TIER_LEVEL31 = 0x200, 138 CODEC_VVC_MAIN_TIER_LEVEL4 = 0x400, 139 CODEC_VVC_HIGH_TIER_LEVEL4 = 0x800, 140 CODEC_VVC_MAIN_TIER_LEVEL41 = 0x1000, 141 CODEC_VVC_HIGH_TIER_LEVEL41 = 0x2000, 142 CODEC_VVC_MAIN_TIER_LEVEL5 = 0x4000, 143 CODEC_VVC_HIGH_TIER_LEVEL5 = 0x8000, 144 CODEC_VVC_MAIN_TIER_LEVEL51 = 0x10000, 145 CODEC_VVC_HIGH_TIER_LEVEL51 = 0x20000, 146 CODEC_VVC_MAIN_TIER_LEVEL52 = 0x40000, 147 CODEC_VVC_HIGH_TIER_LEVEL52 = 0x80000, 148 CODEC_VVC_MAIN_TIER_LEVEL6 = 0x100000, 149 CODEC_VVC_HIGH_TIER_LEVEL6 = 0x200000, 150 CODEC_VVC_MAIN_TIER_LEVEL61 = 0x400000, 151 CODEC_VVC_HIGH_TIER_LEVEL61 = 0x800000, 152 CODEC_VVC_MAIN_TIER_LEVEL62 = 0x1000000, 153 CODEC_VVC_HIGH_TIER_LEVEL62 = 0x2000000, 154 CODEC_VVC_MAIN_TIER_LEVEL63 = 0x4000000, 155 CODEC_VVC_HIGH_TIER_LEVEL63 = 0x8000000, 156 CODEC_VVC_MAIN_TIER_LEVEL155 = 0x10000000, 157 CODEC_VVC_HIGH_TIER_LEVEL155 = 0x20000000, 158 CODEC_VVC_HIGH_TIER_MAX = 0x7FFFFFFF 159 }; 160 161 /** 162 * @brief Enumerates the extended codec color format. 163 */ 164 enum CodecColorFormatExt { 165 CODEC_COLOR_FORMAT_RGBA8888 = OMX_COLOR_FormatVendorStartUnused + 100, 166 }; 167 168 /** 169 * @brief Enumerates the buffer types. 170 */ 171 enum CodecBufferType { 172 /** Invalid buffer type. */ 173 CODEC_BUFFER_TYPE_INVALID = 0, 174 /** Virtual address type. */ 175 CODEC_BUFFER_TYPE_VIRTUAL_ADDR = 0x1, 176 /** Shared memory. */ 177 CODEC_BUFFER_TYPE_AVSHARE_MEM_FD = 0x2, 178 /** Handle. */ 179 CODEC_BUFFER_TYPE_HANDLE = 0x4, 180 /** Dynamic handle. */ 181 CODEC_BUFFER_TYPE_DYNAMIC_HANDLE = 0x8, 182 /** DMA memory. */ 183 CODEC_BUFFER_TYPE_DMA_MEM_FD = 0x10, 184 }; 185 186 /** 187 * @brief Defines the <b>SupportBuffer</b>. 188 */ 189 struct SupportBufferType { 190 uint32_t size; /** Size of the structure */ 191 union OMX_VERSIONTYPE version; /** Component version */ 192 uint32_t portIndex; /** Port index */ 193 uint32_t bufferTypes; /** Supported buffer types */ 194 }; 195 196 /** 197 * @brief Define the <b>UseBuffer</b>. 198 */ 199 struct UseBufferType { 200 uint32_t size; /** Size of the structure */ 201 union OMX_VERSIONTYPE version; /** Component version */ 202 uint32_t portIndex; /** Port index */ 203 uint32_t bufferType; /** Buffer type */ 204 }; 205 206 /** 207 * @brief Defines the <b>BufferHandleUsage</b>. 208 */ 209 struct GetBufferHandleUsageParams { 210 uint32_t size; /** Size of the structure */ 211 union OMX_VERSIONTYPE version; /** Component version */ 212 uint32_t portIndex; /** Port index */ 213 uint64_t usage; /** Usage */ 214 }; 215 216 struct GetChannelIdParam { 217 uint32_t size; /** Size of the structure */ 218 union OMX_VERSIONTYPE version; /** Component version */ 219 int32_t channelId; /**< channel id */ 220 }; 221 222 struct GetLppModeParam { 223 uint32_t size; /** Size of the structure */ 224 union OMX_VERSIONTYPE version; /** Component version */ 225 bool enable; /**< lpp enable */ 226 }; 227 228 /** 229 * @brief Defines the <b>CodecVideoPortFormatParam</b>. 230 */ 231 struct CodecVideoPortFormatParam { 232 uint32_t size; /** Size of the structure */ 233 union OMX_VERSIONTYPE version; /** Component version */ 234 uint32_t portIndex; /** Port index */ 235 uint32_t codecColorIndex; /** Color format index */ 236 uint32_t codecColorFormat; /** Color format defined in Display */ 237 uint32_t codecCompressFormat; /** See */ 238 uint32_t framerate; /** Q16 format */ 239 }; 240 241 /** 242 * @brief Defines the <b>ControlRateConstantQuality</b>. 243 */ 244 struct ControlRateConstantQuality { 245 uint32_t size; /** Size of the structure */ 246 union OMX_VERSIONTYPE version; /** Component version */ 247 uint32_t portIndex; /** Port index */ 248 uint32_t qualityValue; /** Control rate constant quality */ 249 }; 250 251 /** 252 * @brief Defines the <b>ControlRateConstantQuality</b>. 253 */ 254 struct ControlQualityTargetQp { 255 uint32_t size; /** Size of the structure */ 256 union OMX_VERSIONTYPE version; /** Component version */ 257 uint32_t portIndex; /** Port index */ 258 uint32_t targetQp; /** Control rate constant quality */ 259 }; 260 261 /** 262 * @brief Defines the <b>StableControlRate</b>. 263 */ 264 struct StableControlRate { 265 uint32_t size; /** Size of the structure */ 266 union OMX_VERSIONTYPE version; /** Component version */ 267 uint32_t portIndex; /** Port index */ 268 uint32_t sqrFactor; /** sqr Factor */ 269 uint32_t sMaxBitrate; /** Control max bitrate */ 270 uint32_t sTargetBitrate; /** Control bitrate */ 271 bool bitrateEnabled; /** Control whether bitrate takes effect **/ 272 }; 273 274 /** 275 * @brief Defines the <b>PassthroughParam</b>. 276 */ 277 struct PassthroughParam { 278 int32_t key; /**< Parameter type index */ 279 void *val; /**< Pointer to the parameter value */ 280 int size; /**< Parameter value size */ 281 }; 282 283 /** 284 * @brief Defines the <b>WorkingFrequencyParam</b>. 285 */ 286 struct WorkingFrequencyParam { 287 uint32_t size; /** Size of the structure */ 288 union OMX_VERSIONTYPE version; /** Component version */ 289 uint32_t level; /** Working Frequency level */ 290 }; 291 292 /** 293 * @brief Defines the <b>ProcessNameParam</b>. 294 */ 295 struct ProcessNameParam { 296 uint32_t size; /** Size of the structure */ 297 union OMX_VERSIONTYPE version; /** Component version */ 298 char processName[PROCESS_NAME_LEN]; /** Process name array */ 299 }; 300 301 /** 302 * @brief Defines the <b>AudioCodecParam</b>. 303 */ 304 struct AudioCodecParam { 305 uint32_t size; /** Size of the structure */ 306 union OMX_VERSIONTYPE version; /** Component version */ 307 uint32_t sampleRate; /** Sample Rate */ 308 uint32_t sampleFormat; /** Sample Format */ 309 uint32_t channels; /** Channels */ 310 uint32_t bitRate; /** Bit Rate */ 311 uint32_t reserved; /** reserved word */ 312 }; 313 314 /** 315 * @brief Defines the <b>LppTargetPtsParam</b>. 316 */ 317 struct LppTargetPtsParam { 318 uint32_t size; /** Size of the structure */ 319 union OMX_VERSIONTYPE version; /** Component version */ 320 int64_t targetPts; /** lpp target pts */ 321 }; 322 323 /** 324 * @brief Enumerates the extended codec indexes. 325 */ 326 enum OmxIndexCodecExType { 327 /** Extended BufferType index */ 328 OMX_IndexExtBufferTypeStartUnused = OMX_IndexKhronosExtensions + 0x00a00000, 329 /** SupportBuffer */ 330 OMX_IndexParamSupportBufferType, 331 /** UseBuffer */ 332 OMX_IndexParamUseBufferType, 333 /** GetBufferHandleUsage */ 334 OMX_IndexParamGetBufferHandleUsage, 335 /** CodecVideoPortFormatParam */ 336 OMX_IndexCodecVideoPortFormat, 337 /** ControlRateConstantQuality */ 338 OMX_IndexParamControlRateConstantQuality, 339 /** PassthroughParam */ 340 OMX_IndexParamPassthrough, 341 /** OMX_IndexParamVideoHevc */ 342 OMX_IndexParamVideoHevc, 343 /** range/primary/transfer/matrix */ 344 OMX_IndexColorAspects, 345 /** WorkingFrequencyParam */ 346 OMX_IndexParamWorkingFrequency, 347 /** ProcessNameParam */ 348 OMX_IndexParamProcessName, 349 /** AudioCodecParam */ 350 OMX_IndexParamAudioCodec, 351 /** CodecParamOverlayBuffer */ 352 OMX_IndexParamOverlayBuffer, 353 /** CodecLTRParam/CodecLTRPerFrameParam */ 354 OMX_IndexParamLTR, 355 /** CodecQPRangeParam */ 356 OMX_IndexParamQPRange, 357 /** CodecRoiParam */ 358 OMX_IndexParamRoi, 359 /** OMX_CONFIG_BOOLEANTYPE */ 360 OMX_IndexParamLowLatency, 361 /** WirelessLowDelay */ 362 OMX_IndexParamWirelessLowDelay, 363 /** OMX_S32 */ 364 OMX_IndexParamEncOutQp, 365 /** double */ 366 OMX_IndexParamEncOutMse, 367 /** CodecEncOutLTRParam */ 368 OMX_IndexParamEncOutLTR, 369 /** OMX_CONFIG_BOOLEANTYPE */ 370 OMX_IndexParamEncParamsFeedback, 371 /** OMX_S32 */ 372 OMX_IndexParamEncOutFrameLayer, 373 /** OMX_S32 */ 374 OMX_IndexParamQPStsart, 375 /** OMX_BOOL */ 376 OMX_IndexParamSkipFrame, 377 /** CodecTemperalLayerParam */ 378 OMX_IndexParamTemperalLayer, 379 /** OMX_S32 */ 380 OMX_IndexParamEncOutRealBitrate, 381 /** CodecEncOutMadParam */ 382 OMX_IndexParamEncOutMad, 383 /** OMX_S32 */ 384 OMX_IndexParamEncOutIRatio, 385 /** OMX_S32 */ 386 OMX_IndexParamEncOutFrameQp, 387 /** OMX_CONFIG_BOOLEANTYPE */ 388 OMX_IndexParamSupportPackInput, 389 /** OMX_CONFIG_BOOLEANTYPE */ 390 OMX_IndexParamIsMvUpload, 391 /** OMX_CONFIG_BOOLEANTYPE */ 392 OMX_IndexParamEnablePackInput, 393 /** OMX_CONFIG_BOOLEANTYPE */ 394 OMX_IndexParamSwitchGround, 395 /** OMX_CONFIG_BOOLEANTYPE */ 396 OMX_IndexParamBufferRecycle, 397 /** OMX_CONFIG_BOOLEANTYPE */ 398 OMX_IndexParamFreqUpdate, 399 /** ControlRateSQR */ 400 OMX_IndexParamControlRateSQR, 401 /** OMX_CONFIG_BOOLEANTYPE */ 402 OMX_IndexParamEnableQPMap, 403 /** CodecBlockQpParam */ 404 OMX_IndexParamBlockQP, 405 /** ControlRateCRF */ 406 OMX_IndexParamControlRateCRF, 407 /** CodecEncGopMode */ 408 OMX_IndexParamEncBFrameMode, 409 /** OperatingRate */ 410 OMX_IndexParamOperatingRate, 411 /** OMX_CONFIG_CHANNELID */ 412 OMX_IndexParamChannelId, 413 /** OMX_CONFIG_LPPMODE */ 414 OMX_IndexParamLppMode, 415 /** InputStreamError */ 416 OMX_IndexInputStreamError, 417 /** OMX_CONFIG_LPP_TARGETPTS */ 418 OMX_IndexParamLppTargetPts, 419 /** RCDynamicParam */ 420 OMX_IndexWirelessLowdelayRcDynamicParams, 421 /** RC Capped CRF Param */ 422 OMX_IndexWirelessLowdelayRcCRFParams, 423 }; 424 425 struct OmxVideoParamsWirelessLowdelay { 426 uint32_t nSize; 427 bool bSetMac; 428 bool bEnablePack; 429 bool bEnableOmxTest; 430 uint32_t sliceNum; 431 uint32_t layerNum; 432 uint8_t smac[MAX_HARDWARE_ADDR_LEN]; 433 uint8_t dmac[MAX_HARDWARE_ADDR_LEN]; 434 }; 435 436 struct OmxVideoParamsWltDynamicParam { 437 uint32_t nSize; 438 uint32_t nPortIndex; 439 uint32_t maxQP; 440 uint32_t minQP; 441 uint32_t maxBitRate; 442 uint32_t minBitRate; 443 uint32_t rcFps; 444 }; 445 446 struct OmxVideoParamsWltCrfParam { 447 uint32_t nSize; 448 uint32_t nPortIndex; 449 uint32_t complex; 450 bool isSceneCut; 451 }; 452 453 typedef enum OmxEventTypeExt { 454 /** WirelessLowdelayDual420*/ 455 OMX_MotionStatusChanged = OMX_EventVendorStartUnused + 4, 456 }OmxEventTypeExt; 457 458 /** 459 * @brief Enumerates the Other Control Rate Type. 460 */ 461 typedef enum OmxVideoControlRateVendorExtType { 462 /** constant bit rate mode with Rlambda */ 463 OMX_Video_ControlRateConstantWithRlambda = OMX_Video_ControlRateVendorStartUnused + 0x1, 464 /** constant bit rate mode with CQ */ 465 OMX_Video_ControlRateConstantWithCQ, 466 /** stable bit rate mode with SQR */ 467 OMX_Video_ControlRateConstantWithSQR, 468 /** constant bit rate mode with CRF */ 469 OMX_Video_ControlRateConstantWithCRF, 470 } OmxVideoControlRateVendorExtType; 471 472 /** 473 * @brief Enumerates the Other extended codec indexes. 474 */ 475 enum OmxIndexCodecOtherExtType { 476 /** Extended Config AutoFramerate Conversion */ 477 OMX_IndexCodecExtConfigAutoFramerateConversion = OMX_IndexOtherStartUnused + 0x1, 478 /** Extended Config Priority */ 479 OMX_IndexCodecExtConfigPriority, 480 /** Extended Config OperatingRate index */ 481 OMX_IndexCodecExtConfigOperatingRate, 482 }; 483 484 enum OmxIndexCodecVendorExtType { 485 /** Extended Channel Attributes index */ 486 OMX_IndexCodecExtChannelAttributes = OMX_IndexVendorStartUnused + 0x1, 487 /** CodecEnableNativeBufferParams */ 488 OMX_IndexCodecExtEnableNativeBuffer, 489 }; 490 491 /** 492 * @brief Structure for controlling HEVC video encoding 493 */ 494 struct CodecVideoParamHevc { 495 uint32_t size; /** Size of the structure */ 496 union OMX_VERSIONTYPE version; /** Component version */ 497 uint32_t portIndex; /** Port index */ 498 enum CodecHevcProfile profile; /** Hevc profile. For details, see {@link CodecHevcProfile}. */ 499 enum CodecHevcLevel level; /** Hevc level. For details, see {@link CodecHevcLevel}. */ 500 uint32_t keyFrameInterval; /** Distance between consecutive I-frames (including one of the I frams). 501 0 means interval is unspecified and can be freely chosen by the codec. 502 1 means a stream of only I frams. other means the real value. */ 503 }; 504 505 /** 506 * @brief Defines the <b>CodecEnableNativeBufferParams</b>. 507 */ 508 struct CodecEnableNativeBufferParams { 509 uint32_t size; /** Size of the structure */ 510 union OMX_VERSIONTYPE version; /** Component version */ 511 uint32_t portIndex; /** Port index */ 512 bool enable; /** Enable NativeBuffer */ 513 }; 514 515 struct ColorAspects { 516 bool range; 517 uint8_t primaries; 518 uint8_t transfer; 519 uint8_t matrixCoeffs; 520 }; 521 522 /** 523 * @brief Structure for controlling color space 524 */ 525 struct CodecVideoColorspace { 526 uint32_t size; /** Size of the structure */ 527 union OMX_VERSIONTYPE version; /** Component version */ 528 uint32_t portIndex; /** Port index */ 529 uint32_t requestingDataSpace; 530 uint32_t dataSpaceChanged; 531 uint32_t pixeFormat; 532 uint32_t dataSpace; 533 struct ColorAspects aspects; 534 }; 535 536 /** 537 * @brief Structure for pAppPrivate data of OMX_BUFFERHEADERTYPE 538 */ 539 struct OMXBufferAppPrivateData { 540 int32_t fd; /** dma fd or secure dma fd allocated by vender */ 541 uint32_t sizeOfParam; 542 void *param; 543 }; 544 545 struct CodecLTRParam { 546 uint32_t size; /** Size of the structure */ 547 union OMX_VERSIONTYPE version; /** Component version */ 548 uint32_t ltrFrameListLen; 549 }; 550 551 struct CodecLTRPerFrameParam { 552 bool markAsLTR; 553 bool useLTR; 554 uint32_t useLTRPoc; 555 }; 556 557 struct CodecEncOutLTRParam { 558 bool isLTR; 559 uint32_t poc; 560 }; 561 562 struct CodecQPRangeParam { 563 uint32_t size; /** Size of the structure */ 564 union OMX_VERSIONTYPE version; /** Component version */ 565 uint32_t minQp; 566 uint32_t maxQp; 567 }; 568 569 struct CodecTemperalLayerParam { 570 uint32_t size; /** Size of the structure */ 571 union OMX_VERSIONTYPE version; /** Component version */ 572 uint32_t layerCnt; 573 }; 574 575 struct RoiSize { 576 bool regionEnable; 577 bool absQp; 578 int32_t roiQp; 579 uint32_t roiStartX; 580 uint32_t roiStartY; 581 int32_t roiWidth; 582 int32_t roiHeight; 583 }; 584 struct CodecRoiParam { 585 union OMX_VERSIONTYPE version; 586 uint32_t size; 587 struct RoiSize roiInfo[ROI_QUANTITY]; 588 }; 589 590 struct CodecParamOverlayBuffer { 591 uint32_t size; /** Size of the structure */ 592 union OMX_VERSIONTYPE version; /** Component version */ 593 bool enable; 594 uint32_t dstX; 595 uint32_t dstY; 596 uint32_t dstW; 597 uint32_t dstH; 598 void* bufferHandle; 599 }; 600 601 struct CodecEncOutMadParam { 602 int32_t frameMadi; 603 int32_t frameMadp; 604 int32_t sumMadi; 605 }; 606 607 struct CodecBlockQpParam { 608 uint32_t size; /** Size of the structure */ 609 union OMX_VERSIONTYPE version; /** Component version */ 610 void *blockQpAddr; /** qpmap data address */ 611 uint32_t blockQpSize; /** qpmap data size */ 612 bool blockQpSetByUser; /** qpmap set by user */ 613 bool absQp; /** qpmap use abs qp */ 614 uint8_t reserve[2]; /** struct reserve */ 615 uint8_t qpMapData[0]; /** qpmap data */ 616 }; 617 618 typedef enum OMX_VIDEO_GOP_MODE: uint32_t { 619 OMX_ENCODE_GOP_DEFAULT_P_MODE = 0, 620 OMX_ENCODE_GOP_ADAPTIVE_B_MODE, 621 OMX_ENCODE_GOP_H3B_MODE, 622 } OMX_VIDEO_GOP_MODE; 623 624 struct CodecEncGopMode { 625 uint32_t size; /** Size of the structure */ 626 union OMX_VERSIONTYPE version; /** Component version */ 627 OMX_VIDEO_GOP_MODE gopMode; /** encode gop mode */ 628 }; 629 630 #ifdef __cplusplus 631 #if __cplusplus 632 } 633 #endif 634 #endif /* __cplusplus */ 635 636 #endif // CODEC_OMX_EXT_H