1 /* 2 * Copyright (C) 2023 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 /** 17 * @addtogroup CodecBase 18 * @{ 19 * 20 * @brief The CodecBase module provides variables, properties, and functions 21 * for audio and video muxer, demuxer, and basic encoding and decoding functions. 22 * 23 * @syscap SystemCapability.Multimedia.Media.CodecBase 24 * @since 9 25 */ 26 27 /** 28 * @file native_avcodec_base.h 29 * 30 * @brief Declare the Native API used for audio and video muxer, 31 * demuxer and basic encoding and decoding functions. 32 * @kit AVCodecKit 33 * @library libnative_media_codecbase.so 34 * @syscap SystemCapability.Multimedia.Media.CodecBase 35 * @since 9 36 */ 37 38 #ifndef NATIVE_AVCODEC_BASE_H 39 #define NATIVE_AVCODEC_BASE_H 40 41 #include <stdint.h> 42 #include <stdio.h> 43 #include "native_avbuffer.h" 44 #include "native_avmemory.h" 45 46 #ifdef __cplusplus 47 extern "C" { 48 #endif 49 50 /** 51 * @brief Forward declaration of OHNativeWindow. 52 * 53 * @since 9 54 */ 55 typedef struct NativeWindow OHNativeWindow; 56 /** 57 * @brief Forward declaration of OH_AVCodec. 58 * 59 * @since 9 60 */ 61 typedef struct OH_AVCodec OH_AVCodec; 62 63 /** 64 * @brief When an error occurs in the running of the OH_AVCodec instance, the function pointer will be called 65 * to report specific error information. 66 * 67 * @syscap SystemCapability.Multimedia.Media.CodecBase 68 * @param codec OH_AVCodec instance 69 * @param errorCode specific error code 70 * @param userData User specific data 71 * @since 9 72 */ 73 typedef void (*OH_AVCodecOnError)(OH_AVCodec *codec, int32_t errorCode, void *userData); 74 75 /** 76 * @brief When the output stream changes, the function pointer will be called to report the new stream description 77 * information. It should be noted that the life cycle of the OH_AVFormat pointer 78 * is only valid when the function pointer is called, and it is forbidden to continue to access after the call ends. 79 * 80 * @syscap SystemCapability.Multimedia.Media.CodecBase 81 * @param codec OH_AVCodec instance 82 * @param format New output stream description information 83 * @param userData User specific data 84 * @since 9 85 */ 86 typedef void (*OH_AVCodecOnStreamChanged)(OH_AVCodec *codec, OH_AVFormat *format, void *userData); 87 88 /** 89 * @brief When OH_AVCodec needs new input data during the running process, 90 * the function pointer will be called and carry an available Buffer to fill in the new input data. 91 * 92 * @syscap SystemCapability.Multimedia.Media.CodecBase 93 * @param codec OH_AVCodec instance 94 * @param index The index corresponding to the newly available input buffer. 95 * @param data New available input buffer. 96 * @param userData User specific data 97 * @deprecated since 11 98 * @useinstead OH_AVCodecOnNeedInputBuffer 99 * @since 9 100 */ 101 typedef void (*OH_AVCodecOnNeedInputData)(OH_AVCodec *codec, uint32_t index, OH_AVMemory *data, void *userData); 102 103 /** 104 * @brief When new output data is generated during the operation of OH_AVCodec, the function pointer will be 105 * called and carry a Buffer containing the new output data. It should be noted that the life cycle of the 106 * OH_AVCodecBufferAttr pointer is only valid when the function pointer is called. , which prohibits continued 107 * access after the call ends. 108 * 109 * @syscap SystemCapability.Multimedia.Media.CodecBase 110 * @param codec OH_AVCodec instance 111 * @param index The index corresponding to the new output Buffer. 112 * @param data Buffer containing the new output data 113 * @param attr The description of the new output Buffer, please refer to {@link OH_AVCodecBufferAttr} 114 * @param userData specified data 115 * @deprecated since 11 116 * @useinstead OH_AVCodecOnNewOutputBuffer 117 * @since 9 118 */ 119 typedef void (*OH_AVCodecOnNewOutputData)(OH_AVCodec *codec, uint32_t index, OH_AVMemory *data, 120 OH_AVCodecBufferAttr *attr, void *userData); 121 122 /** 123 * @brief When OH_AVCodec needs new input data during the running process, 124 * the function pointer will be called and carry an available Buffer to fill in the new input data. 125 * 126 * @syscap SystemCapability.Multimedia.Media.CodecBase 127 * @param codec OH_AVCodec instance 128 * @param index The index corresponding to the newly available input buffer. 129 * @param buffer New available input buffer. 130 * @param userData User specific data 131 * @since 11 132 */ 133 typedef void (*OH_AVCodecOnNeedInputBuffer)(OH_AVCodec *codec, uint32_t index, OH_AVBuffer *buffer, void *userData); 134 135 /** 136 * @brief When new output data is generated during the operation of OH_AVCodec, the function pointer will be 137 * called and carry a Buffer containing the new output data. 138 * 139 * @syscap SystemCapability.Multimedia.Media.CodecBase 140 * @param codec OH_AVCodec instance 141 * @param index The index corresponding to the new output Buffer. 142 * @param buffer Buffer containing the new output buffer. 143 * @param userData specified data 144 * @since 11 145 */ 146 typedef void (*OH_AVCodecOnNewOutputBuffer)(OH_AVCodec *codec, uint32_t index, OH_AVBuffer *buffer, void *userData); 147 148 /** 149 * @brief A collection of all asynchronous callback function pointers in OH_AVCodec. Register an instance of this 150 * structure to the OH_AVCodec instance, and process the information reported through the callback to ensure the 151 * normal operation of OH_AVCodec. 152 * 153 * @syscap SystemCapability.Multimedia.Media.CodecBase 154 * @param onError Monitor OH_AVCodec operation errors, refer to {@link OH_AVCodecOnError} 155 * @param onStreamChanged Monitor codec stream information, refer to {@link OH_AVCodecOnStreamChanged} 156 * @param onNeedInputData Monitoring codec requires input data, refer to {@link OH_AVCodecOnNeedInputData} 157 * @param onNeedOutputData Monitor codec to generate output data, refer to {@link OH_AVCodecOnNewOutputData} 158 * @deprecated since 11 159 * @useinstead OH_AVCodecCallback 160 * @since 9 161 */ 162 typedef struct OH_AVCodecAsyncCallback { 163 OH_AVCodecOnError onError; 164 OH_AVCodecOnStreamChanged onStreamChanged; 165 OH_AVCodecOnNeedInputData onNeedInputData; 166 OH_AVCodecOnNewOutputData onNeedOutputData; 167 } OH_AVCodecAsyncCallback; 168 169 /** 170 * @brief A collection of all asynchronous callback function pointers in OH_AVCodec. Register an instance of this 171 * structure to the OH_AVCodec instance, and process the information reported through the callback to ensure the 172 * normal operation of OH_AVCodec. 173 * 174 * @syscap SystemCapability.Multimedia.Media.CodecBase 175 * @param onError Monitor OH_AVCodec operation errors, refer to {@link OH_AVCodecOnError} 176 * @param onStreamChanged Monitor codec stream information, refer to {@link OH_AVCodecOnStreamChanged} 177 * @param onNeedInputBuffer Monitoring codec requires input buffer, refer to {@link OH_AVCodecOnNeedInputBuffer} 178 * @param onNewOutputBuffer Monitor codec to generate output buffer, refer to {@link OH_AVCodecOnNewOutputBuffer} 179 * @since 11 180 */ 181 typedef struct OH_AVCodecCallback { 182 OH_AVCodecOnError onError; 183 OH_AVCodecOnStreamChanged onStreamChanged; 184 OH_AVCodecOnNeedInputBuffer onNeedInputBuffer; 185 OH_AVCodecOnNewOutputBuffer onNewOutputBuffer; 186 } OH_AVCodecCallback; 187 188 /** 189 * @brief the function pointer will be called to get sequence media data. 190 * @syscap SystemCapability.Multimedia.Media.CodecBase 191 * @param data OH_AVBuffer buffer to fill 192 * @param length expected to read size; 193 * @param pos current read offset 194 * @return Actual size of data read to the buffer. 195 * @since 12 196 */ 197 typedef int32_t (*OH_AVDataSourceReadAt)(OH_AVBuffer *data, int32_t length, int64_t pos); 198 199 /** 200 * @brief User customized data source. 201 * @syscap SystemCapability.Multimedia.Media.CodecBase 202 * @since 12 203 */ 204 typedef struct OH_AVDataSource { 205 /** 206 * Total size of the data source. 207 */ 208 int64_t size; 209 /** 210 * Callback interface for reading data from datasource. 211 */ 212 OH_AVDataSourceReadAt readAt; 213 } OH_AVDataSource; 214 215 /** 216 * @brief the function pointer will be called to get sequence media data. 217 * @syscap SystemCapability.Multimedia.Media.CodecBase 218 * @param data OH_AVBuffer buffer to fill 219 * @param length expected to read size; 220 * @param pos current read offset 221 * @param userData user-defined data 222 * @return Actual size of data read to the buffer. 223 * @since 20 224 */ 225 typedef int32_t (*OH_AVDataSourceReadAtExt)(OH_AVBuffer *data, int32_t length, int64_t pos, void *userData); 226 227 /** 228 * @brief User customized data source. 229 * @syscap SystemCapability.Multimedia.Media.CodecBase 230 * @since 20 231 */ 232 typedef struct OH_AVDataSourceExt { 233 /** 234 * Total size of the data source. 235 */ 236 int64_t size; 237 /** 238 * Callback interface for reading data from datasource. 239 */ 240 OH_AVDataSourceReadAtExt readAt; 241 } OH_AVDataSourceExt; 242 243 /** 244 * @brief Enumerates the mime types of video avc codec. 245 * 246 * @syscap SystemCapability.Multimedia.Media.CodecBase 247 * @since 9 248 */ 249 extern const char *OH_AVCODEC_MIMETYPE_VIDEO_AVC; 250 /** 251 * @brief Enumerates the mime types of audio aac codec. 252 * 253 * @syscap SystemCapability.Multimedia.Media.CodecBase 254 * @since 9 255 */ 256 extern const char *OH_AVCODEC_MIMETYPE_AUDIO_AAC; 257 258 /** 259 * @brief Enumerates the mime types of audio flac codec. 260 * 261 * @syscap SystemCapability.Multimedia.Media.CodecBase 262 * @since 10 263 */ 264 extern const char *OH_AVCODEC_MIMETYPE_AUDIO_FLAC; 265 /** 266 * @brief Enumerates the mime types of audio vorbis codec. 267 * 268 * @syscap SystemCapability.Multimedia.Media.CodecBase 269 * @since 10 270 */ 271 extern const char *OH_AVCODEC_MIMETYPE_AUDIO_VORBIS; 272 /** 273 * @brief Enumerates the mime types of audio mp3 codec. 274 * 275 * @syscap SystemCapability.Multimedia.Media.CodecBase 276 * @since 10 277 */ 278 extern const char *OH_AVCODEC_MIMETYPE_AUDIO_MPEG; 279 /** 280 * @brief Enumerates the mime types of video hevc codec. 281 * 282 * @syscap SystemCapability.Multimedia.Media.CodecBase 283 * @since 10 284 */ 285 extern const char *OH_AVCODEC_MIMETYPE_VIDEO_HEVC; 286 287 /** 288 * @brief Enumerates the mime types of video mpeg4 muxer. 289 * 290 * @syscap SystemCapability.Multimedia.Media.CodecBase 291 * @deprecated since 11 292 * @since 10 293 */ 294 extern const char *OH_AVCODEC_MIMETYPE_VIDEO_MPEG4; 295 296 /** 297 * @brief Enumerates the mime types of cover jpg muxer. 298 * 299 * @syscap SystemCapability.Multimedia.Media.CodecBase 300 * @since 10 301 */ 302 extern const char *OH_AVCODEC_MIMETYPE_IMAGE_JPG; 303 /** 304 * @brief Enumerates the mime types of cover png muxer. 305 * 306 * @syscap SystemCapability.Multimedia.Media.CodecBase 307 * @since 10 308 */ 309 extern const char *OH_AVCODEC_MIMETYPE_IMAGE_PNG; 310 /** 311 * @brief Enumerates the mime types of cover bmp muxer. 312 * 313 * @syscap SystemCapability.Multimedia.Media.CodecBase 314 * @since 10 315 */ 316 extern const char *OH_AVCODEC_MIMETYPE_IMAGE_BMP; 317 318 /** 319 * @brief Enumerates the mime types of audio vivid codec. 320 * 321 * @syscap SystemCapability.Multimedia.Media.CodecBase 322 * @since 11 323 */ 324 extern const char *OH_AVCODEC_MIMETYPE_AUDIO_VIVID; 325 /** 326 * @brief Enumerates the mime types of audio amrnb codec. 327 * 328 * @syscap SystemCapability.Multimedia.Media.CodecBase 329 * @since 11 330 */ 331 extern const char *OH_AVCODEC_MIMETYPE_AUDIO_AMR_NB; 332 /** 333 * @brief Enumerates the mime types of audio amrwb codec. 334 * 335 * @syscap SystemCapability.Multimedia.Media.CodecBase 336 * @since 11 337 */ 338 extern const char *OH_AVCODEC_MIMETYPE_AUDIO_AMR_WB; 339 /** 340 * @brief Enumerates the mime types of audio opus codec. 341 * 342 * @syscap SystemCapability.Multimedia.Media.CodecBase 343 * @since 11 344 */ 345 extern const char *OH_AVCODEC_MIMETYPE_AUDIO_OPUS; 346 /** 347 * @brief Enumerates the mime types of audio g711mu codec. 348 * 349 * @syscap SystemCapability.Multimedia.Media.CodecBase 350 * @since 11 351 */ 352 extern const char *OH_AVCODEC_MIMETYPE_AUDIO_G711MU; 353 354 /** 355 * @brief Enumerates the mime type of audio ape codec. 356 * 357 * @syscap SystemCapability.Multimedia.Media.CodecBase 358 * @since 12 359 */ 360 extern const char *OH_AVCODEC_MIMETYPE_AUDIO_APE; 361 362 /** 363 * @brief Enumerates the MIME type of versatile video coding. 364 * 365 * @syscap SystemCapability.Multimedia.Media.CodecBase 366 * @since 12 367 */ 368 extern const char *OH_AVCODEC_MIMETYPE_VIDEO_VVC; 369 370 /** 371 * @brief Enumerates the mime type of subtitle srt. 372 * 373 * @syscap SystemCapability.Multimedia.Media.CodecBase 374 * @since 12 375 */ 376 extern const char *OH_AVCODEC_MIMETYPE_SUBTITLE_SRT; 377 378 /** 379 * @brief Enumerates the mime type of subtitle webvtt. 380 * 381 * @syscap SystemCapability.Multimedia.Media.CodecBase 382 * @since 12 383 */ 384 extern const char *OH_AVCODEC_MIMETYPE_SUBTITLE_WEBVTT; 385 386 /** 387 * @brief Enumerates the mime type of audio raw stream. 388 * 389 * @syscap SystemCapability.Multimedia.Media.CodecBase 390 * @since 18 391 */ 392 extern const char *OH_AVCODEC_MIMETYPE_AUDIO_RAW; 393 394 /** 395 * @brief Enumerates the mime types of audio G711 A-law codec. 396 * 397 * @syscap SystemCapability.Multimedia.Media.CodecBase 398 * @since 20 399 */ 400 extern const char *OH_AVCODEC_MIMETYPE_AUDIO_G711A; 401 402 /** 403 * @brief Enumerates the MIME type of video mpeg2 codec. 404 * 405 * @syscap SystemCapability.Multimedia.Media.CodecBase 406 * @since 17 407 */ 408 extern const char *OH_AVCODEC_MIMETYPE_VIDEO_MPEG2; 409 /** 410 * @brief Enumerates the MIME type of video mpeg4 part2 codec. 411 * 412 * @syscap SystemCapability.Multimedia.Media.CodecBase 413 * @since 17 414 */ 415 extern const char *OH_AVCODEC_MIMETYPE_VIDEO_MPEG4_PART2; 416 417 /** 418 * @brief Enumerates the MIME type of video h263 codec. 419 * 420 * @syscap SystemCapability.Multimedia.Media.CodecBase 421 * @since 17 422 */ 423 extern const char *OH_AVCODEC_MIMETYPE_VIDEO_H263; 424 425 /** 426 * @brief Key for timeStamp in surface's extraData, value type is int64_t. 427 * 428 * @syscap SystemCapability.Multimedia.Media.CodecBase 429 * @deprecated since 14 430 * @since 9 431 */ 432 extern const char *OH_ED_KEY_TIME_STAMP; 433 /** 434 * @brief Key for endOfStream in surface's extraData, value type is bool. 435 * 436 * @syscap SystemCapability.Multimedia.Media.CodecBase 437 * @deprecated since 14 438 * @since 9 439 */ 440 extern const char *OH_ED_KEY_EOS; 441 442 /** 443 * @brief Key for track type, value type is int32_t, see {@link OH_MediaType}. 444 * 445 * @syscap SystemCapability.Multimedia.Media.CodecBase 446 * @since 9 447 */ 448 extern const char *OH_MD_KEY_TRACK_TYPE; 449 /** 450 * @brief Key for codec mime type, value type is string. 451 * 452 * @syscap SystemCapability.Multimedia.Media.CodecBase 453 * @since 9 454 */ 455 extern const char *OH_MD_KEY_CODEC_MIME; 456 /** 457 * @brief Key for file duration in microseconds, value type is int64_t. 458 * 459 * @syscap SystemCapability.Multimedia.Media.CodecBase 460 * @since 9 461 */ 462 extern const char *OH_MD_KEY_DURATION; 463 /** 464 * @brief Key for bitrate, value type is int64_t. 465 * 466 * @syscap SystemCapability.Multimedia.Media.CodecBase 467 * @since 9 468 */ 469 extern const char *OH_MD_KEY_BITRATE; 470 /** 471 * @brief Key for max input size, value type is int32_t. 472 * 473 * @syscap SystemCapability.Multimedia.Media.CodecBase 474 * @since 9 475 */ 476 extern const char *OH_MD_KEY_MAX_INPUT_SIZE; 477 /** 478 * @brief Key for video width, value type is int32_t. 479 * 480 * @syscap SystemCapability.Multimedia.Media.CodecBase 481 * @since 9 482 */ 483 extern const char *OH_MD_KEY_WIDTH; 484 /** 485 * @brief Key for video height, value type is int32_t. 486 * 487 * @syscap SystemCapability.Multimedia.Media.CodecBase 488 * @since 9 489 */ 490 extern const char *OH_MD_KEY_HEIGHT; 491 /** 492 * @brief Key for video pixel format, value type is int32_t, see {@link OH_AVPixelFormat}. 493 * 494 * @syscap SystemCapability.Multimedia.Media.CodecBase 495 * @since 9 496 */ 497 extern const char *OH_MD_KEY_PIXEL_FORMAT; 498 /** 499 * @brief key for audio raw format, value type is int32_t , see {@link OH_BitsPerSample}. 500 * 501 * @syscap SystemCapability.Multimedia.Media.CodecBase 502 * @since 9 503 */ 504 extern const char *OH_MD_KEY_AUDIO_SAMPLE_FORMAT; 505 /** 506 * @brief Key for video frame rate, value type is double. 507 * 508 * @syscap SystemCapability.Multimedia.Media.CodecBase 509 * @since 9 510 */ 511 extern const char *OH_MD_KEY_FRAME_RATE; 512 /** 513 * @brief video encode bitrate mode, the value type is int32_t, see {@link OH_VideoEncodeBitrateMode}. 514 * 515 * @syscap SystemCapability.Multimedia.Media.CodecBase 516 * @since 9 517 */ 518 extern const char *OH_MD_KEY_VIDEO_ENCODE_BITRATE_MODE; 519 /** 520 * @brief encode profile, the value type is int32_t. see {@link OH_AVCProfile}, {@link OH_HEVCProfile}, 521 * {@link OH_AACProfile}. 522 * 523 * @syscap SystemCapability.Multimedia.Media.CodecBase 524 * @since 9 525 */ 526 extern const char *OH_MD_KEY_PROFILE; 527 /** 528 * @brief Key for audio channel count, value type is int32_t. 529 * 530 * @syscap SystemCapability.Multimedia.Media.CodecBase 531 * @since 9 532 */ 533 extern const char *OH_MD_KEY_AUD_CHANNEL_COUNT; 534 /** 535 * @brief Key for audio sample rate, value type is int32_t. 536 * 537 * @syscap SystemCapability.Multimedia.Media.CodecBase 538 * @since 9 539 */ 540 extern const char *OH_MD_KEY_AUD_SAMPLE_RATE; 541 /** 542 * @brief Key for the interval of key frame. value type is int32_t, the unit is milliseconds. A negative value means no 543 * key frames are requested after the first frame. A zero value means a stream containing all key frames is requested. 544 * 545 * @syscap SystemCapability.Multimedia.Media.CodecBase 546 * @since 9 547 */ 548 extern const char *OH_MD_KEY_I_FRAME_INTERVAL; 549 /** 550 * @brief Key of the surface rotation angle. value type is int32_t: should be {0, 90, 180, 270}, default is 0. 551 * 552 * @syscap SystemCapability.Multimedia.Media.CodecBase 553 * @since 9 554 */ 555 extern const char *OH_MD_KEY_ROTATION; 556 557 /** 558 * @brief Key for video YUV value range flag, value type is bool, true for full range, false for limited range. 559 * 560 * @syscap SystemCapability.Multimedia.Media.CodecBase 561 * @since 10 562 */ 563 extern const char *OH_MD_KEY_RANGE_FLAG; 564 /** 565 * @brief Key for video color primaries, value type is int32_t, see {@link OH_ColorPrimary}. 566 * 567 * @syscap SystemCapability.Multimedia.Media.CodecBase 568 * @since 10 569 */ 570 extern const char *OH_MD_KEY_COLOR_PRIMARIES; 571 /** 572 * @brief Key for video transfer characteristics, value type is int32_t, see {@link OH_TransferCharacteristic}. 573 * 574 * @syscap SystemCapability.Multimedia.Media.CodecBase 575 * @since 10 576 */ 577 extern const char *OH_MD_KEY_TRANSFER_CHARACTERISTICS; 578 /** 579 * @brief Key for video matrix coefficients, value type is int32_t, see {@link OH_MatrixCoefficient}. 580 * 581 * @syscap SystemCapability.Multimedia.Media.CodecBase 582 * @since 10 583 */ 584 extern const char *OH_MD_KEY_MATRIX_COEFFICIENTS; 585 /** 586 * @brief Key for the request an I-Frame immediately, value type is bool. 587 * 588 * @syscap SystemCapability.Multimedia.Media.CodecBase 589 * @since 10 590 */ 591 extern const char *OH_MD_KEY_REQUEST_I_FRAME; 592 /** 593 * @brief Key for the desired encoding quality, value type is int32_t, this key is only. 594 * supported for encoders that are configured in constant quality mode. 595 * 596 * @syscap SystemCapability.Multimedia.Media.CodecBase 597 * @since 10 598 */ 599 extern const char *OH_MD_KEY_QUALITY; 600 /** 601 * @brief Key of the codec specific data. value type is a uint8_t pointer. 602 * 603 * @syscap SystemCapability.Multimedia.Media.CodecBase 604 * @since 10 605 */ 606 extern const char *OH_MD_KEY_CODEC_CONFIG; 607 /** 608 * @brief source format Key for title, value type is string. 609 * 610 * @syscap SystemCapability.Multimedia.Media.CodecBase 611 * @since 10 612 */ 613 extern const char *OH_MD_KEY_TITLE; 614 /** 615 * @brief source format Key for artist, value type is string. 616 * 617 * @syscap SystemCapability.Multimedia.Media.CodecBase 618 * @since 10 619 */ 620 extern const char *OH_MD_KEY_ARTIST; 621 /** 622 * @brief source format Key for album, value type is string. 623 * 624 * @syscap SystemCapability.Multimedia.Media.CodecBase 625 * @since 10 626 */ 627 extern const char *OH_MD_KEY_ALBUM; 628 /** 629 * @brief source format Key for album artist, value type is string. 630 * 631 * @syscap SystemCapability.Multimedia.Media.CodecBase 632 * @since 10 633 */ 634 extern const char *OH_MD_KEY_ALBUM_ARTIST; 635 /** 636 * @brief source format Key for date, value type is string. 637 * 638 * @syscap SystemCapability.Multimedia.Media.CodecBase 639 * @since 10 640 */ 641 extern const char *OH_MD_KEY_DATE; 642 /** 643 * @brief source format Key for comment, value type is string. 644 * 645 * @syscap SystemCapability.Multimedia.Media.CodecBase 646 * @since 10 647 */ 648 extern const char *OH_MD_KEY_COMMENT; 649 /** 650 * @brief source format Key for genre, value type is string. 651 * 652 * @syscap SystemCapability.Multimedia.Media.CodecBase 653 * @since 10 654 */ 655 extern const char *OH_MD_KEY_GENRE; 656 /** 657 * @brief source format Key for copyright, value type is string. 658 * 659 * @syscap SystemCapability.Multimedia.Media.CodecBase 660 * @since 10 661 */ 662 extern const char *OH_MD_KEY_COPYRIGHT; 663 /** 664 * @brief source format Key for language, value type is string. 665 * 666 * @syscap SystemCapability.Multimedia.Media.CodecBase 667 * @since 10 668 */ 669 extern const char *OH_MD_KEY_LANGUAGE; 670 /** 671 * @brief source format Key for description, value type is string. 672 * 673 * @syscap SystemCapability.Multimedia.Media.CodecBase 674 * @since 10 675 */ 676 extern const char *OH_MD_KEY_DESCRIPTION; 677 /** 678 * @brief source format Key for lyrics, value type is string. 679 * 680 * @syscap SystemCapability.Multimedia.Media.CodecBase 681 * @since 10 682 */ 683 extern const char *OH_MD_KEY_LYRICS; 684 /** 685 * @brief source format Key for track count, value type is int32_t. 686 * 687 * @syscap SystemCapability.Multimedia.Media.CodecBase 688 * @since 10 689 */ 690 extern const char *OH_MD_KEY_TRACK_COUNT; 691 /** 692 * @brief Key for the desired encoding channel layout, value type is int64_t, this key is only supported for encoders. 693 * 694 * @syscap SystemCapability.Multimedia.Media.CodecBase 695 * @since 10 696 */ 697 extern const char *OH_MD_KEY_CHANNEL_LAYOUT; 698 /** 699 * @brief Key for bits per coded sample, value type is int32_t, supported for flac encoder, 700 * see {@link OH_BitsPerSample}. 701 * 702 * @syscap SystemCapability.Multimedia.Media.CodecBase 703 * @since 10 704 */ 705 extern const char *OH_MD_KEY_BITS_PER_CODED_SAMPLE; 706 /** 707 * @brief Key for the aac format, value type is int32_t, supported for aac decoder. 708 * 709 * @syscap SystemCapability.Multimedia.Media.CodecBase 710 * @since 10 711 */ 712 extern const char *OH_MD_KEY_AAC_IS_ADTS; 713 /** 714 * @brief Key for aac sbr mode, value type is int32_t, supported for aac encoder. 715 * 716 * @syscap SystemCapability.Multimedia.Media.CodecBase 717 * @since 10 718 */ 719 extern const char *OH_MD_KEY_SBR; 720 /** 721 * @brief Key for flac compliance level, value type is int32_t. 722 * 723 * @syscap SystemCapability.Multimedia.Media.CodecBase 724 * @since 10 725 */ 726 extern const char *OH_MD_KEY_COMPLIANCE_LEVEL; 727 /** 728 * @brief Key for vorbis identification header, value type is a uint8_t pointer, supported only for vorbis decoder. 729 * 730 * @syscap SystemCapability.Multimedia.Media.CodecBase 731 * @since 10 732 */ 733 extern const char *OH_MD_KEY_IDENTIFICATION_HEADER; 734 /** 735 * @brief Key for vorbis setup header, value type is a uint8_t pointer, supported only for vorbis decoder. 736 * 737 * @syscap SystemCapability.Multimedia.Media.CodecBase 738 * @since 10 739 */ 740 extern const char *OH_MD_KEY_SETUP_HEADER; 741 /** 742 * @brief Key for video scale type, value type is int32_t, see {@link OH_ScalingMode}. 743 * 744 * @syscap SystemCapability.Multimedia.Media.CodecBase 745 * @deprecated since 14 746 * @useinstead OH_NativeWindow_NativeWindowSetScalingModeV2 747 * @since 10 748 */ 749 extern const char *OH_MD_KEY_SCALING_MODE; 750 /** 751 * @brief Key for max input buffer count, value type is int32_t. 752 * 753 * @syscap SystemCapability.Multimedia.Media.CodecBase 754 * @since 10 755 */ 756 extern const char *OH_MD_MAX_INPUT_BUFFER_COUNT; 757 /** 758 * @brief Key for max output buffer count, value type is int32_t. 759 * 760 * @syscap SystemCapability.Multimedia.Media.CodecBase 761 * @since 10 762 */ 763 extern const char *OH_MD_MAX_OUTPUT_BUFFER_COUNT; 764 765 /** 766 * @brief Key for audio codec compression level, value type is int32_t. 767 * 768 * @syscap SystemCapability.Multimedia.Media.CodecBase 769 * @since 11 770 */ 771 extern const char *OH_MD_KEY_AUDIO_COMPRESSION_LEVEL; 772 /** 773 * @brief Key of the video is hdr vivid. value type is bool. 774 * 775 * @syscap SystemCapability.Multimedia.Media.CodecBase 776 * @since 11 777 */ 778 extern const char *OH_MD_KEY_VIDEO_IS_HDR_VIVID; 779 /** 780 * @brief Key for number of audio objects. value type is int32_t. 781 * 782 * @syscap SystemCapability.Multimedia.Media.CodecBase 783 * @since 11 784 */ 785 extern const char *OH_MD_KEY_AUDIO_OBJECT_NUMBER; 786 /** 787 * @brief Key for meta data of audio vivid. value type is a uint8_t pointer. 788 * 789 * @syscap SystemCapability.Multimedia.Media.CodecBase 790 * @since 11 791 */ 792 extern const char *OH_MD_KEY_AUDIO_VIVID_METADATA; 793 794 /** 795 * @brief Key for querying the maximum long-term reference count of video encoder, value type is int32_t. 796 * You should query the count through interface {@link OH_AVCapability_GetFeatureProperties} 797 * with enum {@link VIDEO_ENCODER_LONG_TERM_REFERENCE}. 798 * 799 * @syscap SystemCapability.Multimedia.Media.CodecBase 800 * @since 12 801 */ 802 extern const char *OH_FEATURE_PROPERTY_KEY_VIDEO_ENCODER_MAX_LTR_FRAME_COUNT; 803 /** 804 * @brief Key for enable the temporal scalability mode, value type is int32_t (0 or 1): 1 is enabled, 0 otherwise. 805 * The default value is 0. To query supported, you should use the interface {@link OH_AVCapability_IsFeatureSupported} 806 * with enum {@link VIDEO_ENCODER_TEMPORAL_SCALABILITY}. This is an optional key that applies only to video encoder. 807 * It is used in configure. 808 * 809 * @syscap SystemCapability.Multimedia.Media.CodecBase 810 * @since 12 811 */ 812 extern const char *OH_MD_KEY_VIDEO_ENCODER_ENABLE_TEMPORAL_SCALABILITY; 813 /** 814 * @brief Key for describing the temporal group of picture size, value type is int32_t. It takes effect only when 815 * temporal level scale is enable. This is an optional key that applies only to video encoder. It is used in configure. 816 * 817 * @syscap SystemCapability.Multimedia.Media.CodecBase 818 * @since 12 819 */ 820 extern const char *OH_MD_KEY_VIDEO_ENCODER_TEMPORAL_GOP_SIZE; 821 /** 822 * @brief Key for describing the reference mode in temporal group of picture, value type is int32_t, see enum 823 * {@link OH_TemporalGopReferenceMode}. It takes effect only when temporal level sacle is enabled. 824 * This is an optional key that applies only to video encoder. It is used in configure. 825 * 826 * @syscap SystemCapability.Multimedia.Media.CodecBase 827 * @since 12 828 */ 829 extern const char *OH_MD_KEY_VIDEO_ENCODER_TEMPORAL_GOP_REFERENCE_MODE; 830 /** 831 * @brief Key for describing the count of used long-term reference frames, value type is int32_t, must be within the 832 * supported range. To get supported range, you should query wthether the capability is supported through the interface 833 * {@link OH_AVCapability_GetFeatureProperties} with enum {@link VIDEO_ENCODER_LONG_TERM_REFERENCE}, otherwise, not set 834 * the key. This is an optional key that applies only to video encoder. It is used in configure. 835 * 836 * @syscap SystemCapability.Multimedia.Media.CodecBase 837 * @since 12 838 */ 839 extern const char *OH_MD_KEY_VIDEO_ENCODER_LTR_FRAME_COUNT; 840 /** 841 * @brief Key for describing mark this frame as a long term reference frame, value type is int32_t (0 or 1): 1 is mark, 842 * 0 otherwise. It takes effect only when the number of used long term reference frames is configured. This is an 843 * optional key that applies only to video encoder input loop. It takes effect immediately. 844 * 845 * @syscap SystemCapability.Multimedia.Media.CodecBase 846 * @since 12 847 */ 848 extern const char *OH_MD_KEY_VIDEO_ENCODER_PER_FRAME_MARK_LTR; 849 /** 850 * @brief Key for describing the long term reference frame poc referenced by this frame, value type is int32_t. This is 851 * an optional key that applies only to video encoder input loop. It takes effect immediately. 852 * 853 * @syscap SystemCapability.Multimedia.Media.CodecBase 854 * @since 12 855 */ 856 extern const char *OH_MD_KEY_VIDEO_ENCODER_PER_FRAME_USE_LTR; 857 /** 858 * @brief Key for indicating this frame is a long-term reference frame, value type is int32_t (0 or 1): 1 is LTR, 859 * 0 otherwise. This is an optional key that applies only to video encoder output loop. 860 * It indicates the attribute of the frame. 861 * 862 * @syscap SystemCapability.Multimedia.Media.CodecBase 863 * @since 12 864 */ 865 extern const char *OH_MD_KEY_VIDEO_PER_FRAME_IS_LTR; 866 /** 867 * @brief Key for describing the frame poc, value type is int32_t. This is an optional key that applies only to video 868 * encoder output loop. It indicates the attribute of the frame. 869 * 870 * @syscap SystemCapability.Multimedia.Media.CodecBase 871 * @since 12 872 */ 873 extern const char *OH_MD_KEY_VIDEO_PER_FRAME_POC; 874 /** 875 * @brief Key for describing the top-coordinate (y) of the crop rectangle, value type is int32_t. This is the top-most 876 * row included in the crop frame, where row indices start at 0. 877 * 878 * @syscap SystemCapability.Multimedia.Media.CodecBase 879 * @since 12 880 */ 881 extern const char *OH_MD_KEY_VIDEO_CROP_TOP; 882 /** 883 * @brief Key for describing the bottom-coordinate (y) of the crop rectangle, value type is int32_t. This is the 884 * bottom-most row included in the crop frame, where row indices start at 0. 885 * 886 * @syscap SystemCapability.Multimedia.Media.CodecBase 887 * @since 12 888 */ 889 extern const char *OH_MD_KEY_VIDEO_CROP_BOTTOM; 890 /** 891 * @brief Key for describing the left-coordinate (x) of the crop rectangle, value type is int32_t. 892 * This is the left-most column included in the crop frame, where column indices start at 0. 893 * 894 * @syscap SystemCapability.Multimedia.Media.CodecBase 895 * @since 12 896 */ 897 extern const char *OH_MD_KEY_VIDEO_CROP_LEFT; 898 /** 899 * @brief Key for describing the right-coordinate (x) of the crop rectangle, value type is int32_t. This is the 900 * right-most column included in the crop frame, where column indices start at 0. 901 * 902 * @syscap SystemCapability.Multimedia.Media.CodecBase 903 * @since 12 904 */ 905 extern const char *OH_MD_KEY_VIDEO_CROP_RIGHT; 906 /** 907 * @brief Key for describing the stride of the video buffer layout, value type is int32_t. Stride (or row increment) is 908 * the difference between the index of a pixel and that of the pixel directly underneath. For YUV 420 formats, the 909 * stride corresponds to the Y plane; the stride of the U and V planes can be calculated based on the color format, 910 * though it is generally undefined and depends on the device and release. 911 * 912 * @syscap SystemCapability.Multimedia.Media.CodecBase 913 * @since 12 914 */ 915 extern const char *OH_MD_KEY_VIDEO_STRIDE; 916 /** 917 * @brief Key for describing the plane height of a multi-planar (YUV) video buffer layout, value type is int32_t. 918 * Slice height (or plane height/vertical stride) is the number of rows that must be skipped to get from 919 * the top of the Y plane to the top of the U plane in the buffer. In essence the offset of the U plane 920 * is sliceHeight * stride. The height of the U/V planes can be calculated based on the color format, 921 * though it is generally undefined and depends on the device and release. 922 * 923 * @syscap SystemCapability.Multimedia.Media.CodecBase 924 * @since 12 925 */ 926 extern const char *OH_MD_KEY_VIDEO_SLICE_HEIGHT; 927 /** 928 * @brief Key for describing the valid picture width of the video, value type is int32_t. 929 * Get the value from an OH_AVFormat instance, which obtained by calling {@link OH_VideoDecoder_GetOutputDescription} 930 * or {@link OH_AVCodecOnStreamChanged}. 931 * 932 * @syscap SystemCapability.Multimedia.Media.CodecBase 933 * @since 12 934 */ 935 extern const char *OH_MD_KEY_VIDEO_PIC_WIDTH; 936 /** 937 * @brief Key for describing the valid picture height of the video, value type is int32_t. 938 * Get the value from an OH_AVFormat instance, which obtained by calling {@link OH_VideoDecoder_GetOutputDescription} 939 * or {@link OH_AVCodecOnStreamChanged}. 940 * 941 * @syscap SystemCapability.Multimedia.Media.CodecBase 942 * @since 12 943 */ 944 extern const char *OH_MD_KEY_VIDEO_PIC_HEIGHT; 945 /** 946 * @brief Key to enable the low latency mode, value type is int32_t (0 or 1):1 is enabled, 0 otherwise. 947 * If enabled, the video decoder doesn't hold input and output data more than required by 948 * the codec standards. This is an optional key that applies only to video decoder. 949 * It is used in configure. 950 * 951 * @syscap SystemCapability.Multimedia.Media.CodecBase 952 * @since 12 953 */ 954 extern const char *OH_MD_KEY_VIDEO_ENABLE_LOW_LATENCY; 955 /** 956 * @brief Key for describing the maximum quantization parameter allowed for video encoder, value type is int32_t. 957 * It is used in configure/setparameter or takes effect immediately with the frame. 958 * 959 * @syscap SystemCapability.Multimedia.Media.CodecBase 960 * @since 12 961 */ 962 extern const char *OH_MD_KEY_VIDEO_ENCODER_QP_MAX; 963 /** 964 * @brief Key for describing the minimum quantization parameter allowed for video encoder, value type is int32_t. 965 * It is used in configure/setparameter or takes effect immediately with the frame. 966 * 967 * @syscap SystemCapability.Multimedia.Media.CodecBase 968 * @since 12 969 */ 970 extern const char *OH_MD_KEY_VIDEO_ENCODER_QP_MIN; 971 /** 972 * @brief Key for describing the video frame averge quantization parameter, value type is int32_t. 973 * This is a part of a video encoder statistics export feature. This value is emitted from video encoder for a video 974 * frame. 975 * 976 * @syscap SystemCapability.Multimedia.Media.CodecBase 977 * @since 12 978 */ 979 extern const char *OH_MD_KEY_VIDEO_ENCODER_QP_AVERAGE; 980 /** 981 * @brief Key for describing video frame mean squared error, value type is double. 982 * This is a part of a video encoder statistics export feature. This value is emitted from video encoder for a video 983 * frame. 984 * 985 * @syscap SystemCapability.Multimedia.Media.CodecBase 986 * @since 12 987 */ 988 extern const char *OH_MD_KEY_VIDEO_ENCODER_MSE; 989 /** 990 * @brief Key for decoding timestamp of the buffer in microseconds, value type is int64_t. 991 * 992 * @syscap SystemCapability.Multimedia.Media.CodecBase 993 * @since 12 994 */ 995 extern const char *OH_MD_KEY_DECODING_TIMESTAMP; 996 /** 997 * @brief Key for duration of the buffer in microseconds, value type is int64_t. 998 * 999 * @syscap SystemCapability.Multimedia.Media.CodecBase 1000 * @since 12 1001 */ 1002 extern const char *OH_MD_KEY_BUFFER_DURATION; 1003 /** 1004 * @brief Key for sample aspect ratio, value type is double. 1005 * 1006 * @syscap SystemCapability.Multimedia.Media.CodecBase 1007 * @since 12 1008 */ 1009 extern const char *OH_MD_KEY_VIDEO_SAR; 1010 /** 1011 * @brief Key for start time of the first frame in the media file in microseconds, value type is int64_t. 1012 * 1013 * @syscap SystemCapability.Multimedia.Media.CodecBase 1014 * @since 12 1015 */ 1016 extern const char *OH_MD_KEY_START_TIME; 1017 /** 1018 * @brief Key for start time of track in microseconds, value type is int64_t. 1019 * 1020 * @syscap SystemCapability.Multimedia.Media.CodecBase 1021 * @since 12 1022 */ 1023 extern const char *OH_MD_KEY_TRACK_START_TIME; 1024 /** 1025 * @brief Key for setting the output color space of video decoder. The value type is int32_t. 1026 * The supported value is {@link OH_COLORSPACE_BT709_LIMIT}, see {@link OH_NativeBuffer_ColorSpace}. It is used in 1027 * {@link OH_VideoDecoder_Configure}. If the color space conversion capability is supported and this key is configured, 1028 * the video decoder will automatically transcode an HDR Vivid video to an SDR video with color space BT709. 1029 * If color space conversion capability is not supported, {@link OH_VideoDecoder_Configure} returns 1030 * {@link AV_ERR_VIDEO_UNSUPPORTED_COLOR_SPACE_CONVERSION}. 1031 * If the input video is not an HDR vivid video, an error {@link AV_ERR_VIDEO_UNSUPPORTED_COLOR_SPACE_CONVERSION} will 1032 * be reported by callback function {@link OH_AVCodecOnError}. 1033 * 1034 * @syscap SystemCapability.Multimedia.Media.CodecBase 1035 * @since 12 1036 */ 1037 extern const char *OH_MD_KEY_VIDEO_DECODER_OUTPUT_COLOR_SPACE; 1038 /** 1039 * @brief Key for describing if enable VRR or not, value type is int32_t (0 or 1): 1 is enabled, 0 otherwise. 1040 * This is an optional key that applies only to video decoder. It is used in configure. 1041 * 1042 * @syscap SystemCapability.Multimedia.Media.CodecBase 1043 * @since 15 1044 */ 1045 extern const char *OH_MD_KEY_VIDEO_DECODER_OUTPUT_ENABLE_VRR; 1046 /** 1047 * @brief Key for creation timestamp of a media file, value type is string. 1048 * 1049 * @syscap SystemCapability.Multimedia.Media.CodecBase 1050 * @since 14 1051 */ 1052 extern const char *OH_MD_KEY_CREATION_TIME; 1053 /** 1054 * @brief Key applies only when configuring a video encoder in surface mode, value type is int32_t. 1055 * If no new frame became available since the last frame submitted to the encoder, 1056 * it will sumbit the previous frame repeatly in milliseconds. It is used in configure. 1057 * 1058 * @syscap SystemCapability.Multimedia.Media.CodecBase 1059 * @since 18 1060 */ 1061 extern const char *OH_MD_KEY_VIDEO_ENCODER_REPEAT_PREVIOUS_FRAME_AFTER; 1062 /** 1063 * @brief Key for describing the maximum count that the frame previously submitted to the encoder will be 1064 * repeated, in case no new frame has been available since, value type is int32_t. This key takes effect only when 1065 * {@link VIDEO_ENCODER_REPEAT_PREVIOUS_FRAME_AFTER} is vaild. It is used in configure. 1066 * 1067 * @syscap SystemCapability.Multimedia.Media.CodecBase 1068 * @since 18 1069 */ 1070 extern const char *OH_MD_KEY_VIDEO_ENCODER_REPEAT_PREVIOUS_MAX_COUNT; 1071 /** 1072 * @brief Key to enable B-frame encoding, value type is int32_t (0 or 1): 1 is enabled, 0 otherwise. 1073 * 1074 * This is an optional key that applies only to video encoder, default is 0.\n 1075 * If enabled, the video encoder will use B-frame, the decode order will be different from the display order.\n 1076 * For unsupported platforms, Configuring this key will have no effect.\n 1077 * Platform capability can be checked via {@link OH_AVCapability_IsFeatureSupported} with 1078 * {@link OH_AVCapabilityFeature::VIDEO_ENCODER_B_FRAME}.\n 1079 * It's only used in configuration phase.\n 1080 * 1081 * @syscap SystemCapability.Multimedia.Media.CodecBase 1082 * @since 20 1083 */ 1084 extern const char *OH_MD_KEY_VIDEO_ENCODER_ENABLE_B_FRAME; 1085 1086 /** 1087 * @brief Key for describing the maximum B-frame count of video encoder, value type is int32_t. 1088 * 1089 * Note: This key is only for querying the capability of the codec currently. 1090 * Usage specifications: 1091 * 1. Check feature support via {@link OH_AVCapability_IsFeatureSupported} with 1092 * {@link OH_AVCapabilityFeature::VIDEO_ENCODER_B_FRAME}.\n 1093 * 2. Obtain OH_AVFormat handle via {@link OH_AVCapability_GetFeatureProperties} with 1094 * {@link OH_AVCapabilityFeature::VIDEO_ENCODER_B_FRAME}.\n 1095 * 3. Get maximum B-frame count via {@link OH_AVFormat_GetIntValue} with this key.\n 1096 * 1097 * @syscap SystemCapability.Multimedia.Media.CodecBase 1098 * @since 20 1099 */ 1100 extern const char *OH_MD_KEY_VIDEO_ENCODER_MAX_B_FRAMES; 1101 /** 1102 * @brief Key to set the region of interest(ROI) as QpOffset-Rects, value type is string in the format 1103 * "Top1,Left1-Bottom1,Right1=Offset1;Top2,Left2-Bottom2,Right2=Offset2;". Each "Top,Left-Bottom,Right=Offset" 1104 * represents the coordinate information and quantization parameter of one ROI. Each "=Offset" in the string 1105 * can be omitted, like "Top1,Left1-Bottom1,Right1;Top2,Left2-Bottom2,Right2=Offset2;", the encoder 1106 * will use the default quantization parameter to perform the ROI encoding on the first ROI and 1107 * use Offset2 on the second ROI. 1108 * 1109 * This is an optional key that applies only to video encoder. 1110 * It is used in running process and is set with each frame. 1111 * In surface mode, it is used in {@link OH_VideoEncoder_OnNeedInputParameter}. 1112 * In buffer mode, it is configured via {@link OH_AVBuffer_SetParameter}. 1113 * @syscap SystemCapability.Multimedia.Media.CodecBase 1114 * @since 20 1115 */ 1116 extern const char *OH_MD_KEY_VIDEO_ENCODER_ROI_PARAMS; 1117 /** 1118 * 1119 * @brief Key for front moov of the mp4 and m4a media file, value type is int32_t (0 or 1):1 is enabled, 0 otherwise. 1120 * This key may affect the performance of the stop function of the mp4 and m4a muxer. 1121 * @syscap SystemCapability.Multimedia.Media.CodecBase 1122 * @since 20 1123 */ 1124 extern const char *OH_MD_KEY_ENABLE_MOOV_FRONT; 1125 /** 1126 * @brief Key for the desired encoding quality, value type is int32_t, this key is only 1127 * supported for encoders that are configured in Stable Quality RateControl, the higher 1128 * values generally result in more efficient(smaller-sized) encoding. 1129 * 1130 * @syscap SystemCapability.Multimedia.Media.CodecBase 1131 * @since 20 1132 */ 1133 extern const char *OH_MD_KEY_SQR_FACTOR; 1134 /** 1135 * @brief Key for maximum bitrate, value type is int64_t. 1136 * 1137 * @syscap SystemCapability.Multimedia.Media.CodecBase 1138 * @since 20 1139 */ 1140 extern const char *OH_MD_KEY_MAX_BITRATE; 1141 /** 1142 * @brief Key for describing the reference relationship between tracks, value type is int32_t*. 1143 * 1144 * @syscap SystemCapability.Multimedia.Media.CodecBase 1145 * @since 20 1146 */ 1147 extern const char *OH_MD_KEY_REFERENCE_TRACK_IDS; 1148 /** 1149 * @brief Key for describing the track reference type, value type is string. 1150 * 1151 * @syscap SystemCapability.Multimedia.Media.CodecBase 1152 * @since 20 1153 */ 1154 extern const char *OH_MD_KEY_TRACK_REFERENCE_TYPE; 1155 /** 1156 * @brief Key for describing the track description, value type is string. 1157 * 1158 * @syscap SystemCapability.Multimedia.Media.CodecBase 1159 * @since 20 1160 */ 1161 extern const char *OH_MD_KEY_TRACK_DESCRIPTION; 1162 1163 /** 1164 * @brief Key to enable Bitrate Control Based on Presentation Time Stamp(PTS), 1165 * value type is int32_t (0 or 1):1 is enabled, 0 otherwise. 1166 * 1167 * This is an optional key that applies only to video encoder, default is 0. 1168 * If enabled, the PTS information must be carried in each video frame and sent to the encoder. 1169 * It is used in configure. 1170 * @syscap SystemCapability.Multimedia.Media.CodecBase 1171 * @since 20 1172 */ 1173 extern const char *OH_MD_KEY_VIDEO_ENCODER_ENABLE_PTS_BASED_RATECONTROL; 1174 1175 /** 1176 * @brief Key to enable synchronous mode, value type is (0 or 1): 1 is enabled, 0 otherwise. 1177 * 1178 * This is an optional key, default is 0.\n 1179 * When enabled: 1180 * - Callbacks should NOT be set for codecs 1181 * - Buffer query APIs must be used instead 1182 * - Only used in configuration phase 1183 * 1184 * @syscap SystemCapability.Multimedia.Media.CodecBase 1185 * @since 20 1186 */ 1187 extern const char *OH_MD_KEY_ENABLE_SYNC_MODE; 1188 1189 /** 1190 * @brief Key for specifying whether to output a blank frame during video decoder shutdown, 1191 * value type is int32_t (0 or 1): 1 is enabled, 0 otherwise. 1192 * 1193 * This is an optional key, only used when configuring a video decoder in surface mode.\n 1194 * By default, this feature is disabled (0).\n 1195 * When enabled, the video decoder will output a blank frame (typically black) 1196 * when stop or release to ensure a smooth transition to no-signal state on display devices.\n 1197 * This prevents display retention or flickering caused by abrupt termination.\n 1198 * 1199 * @since 20 1200 */ 1201 extern const char *OH_MD_KEY_VIDEO_DECODER_BLANK_FRAME_ON_SHUTDOWN; 1202 1203 /** 1204 * @brief Media type. 1205 * 1206 * @syscap SystemCapability.Multimedia.Media.CodecBase 1207 * @since 9 1208 */ 1209 typedef enum OH_MediaType { 1210 /* track is audio. */ 1211 MEDIA_TYPE_AUD = 0, 1212 /* track is video. */ 1213 MEDIA_TYPE_VID = 1, 1214 /** track is subtitle. 1215 * @since 12 1216 */ 1217 MEDIA_TYPE_SUBTITLE = 2, 1218 /** track is timed meta. 1219 * @since 20 1220 */ 1221 MEDIA_TYPE_TIMED_METADATA = 5, 1222 /** track is auxiliary. 1223 * @since 20 1224 */ 1225 MEDIA_TYPE_AUXILIARY = 6, 1226 } OH_MediaType; 1227 1228 /** 1229 * @brief AAC Profile 1230 * 1231 * @syscap SystemCapability.Multimedia.Media.CodecBase 1232 * @since 9 1233 */ 1234 typedef enum OH_AACProfile { 1235 AAC_PROFILE_LC = 0, 1236 /** 1237 * High-Efficiency AAC profile, contain the audio object types: AAC LC, SBR 1238 * @since 14 1239 */ 1240 AAC_PROFILE_HE = 3, 1241 /** 1242 * High-Efficiency AAC v2 profile, contain the audio object types: AAC LC, SBR, PS 1243 * @since 14 1244 */ 1245 AAC_PROFILE_HE_V2 = 4, 1246 } OH_AACProfile; 1247 1248 /** 1249 * @brief AVC Profile 1250 * 1251 * @syscap SystemCapability.Multimedia.Media.CodecBase 1252 * @since 9 1253 */ 1254 typedef enum OH_AVCProfile { 1255 AVC_PROFILE_BASELINE = 0, 1256 AVC_PROFILE_HIGH = 4, 1257 AVC_PROFILE_MAIN = 8, 1258 } OH_AVCProfile; 1259 1260 /** 1261 * @brief HEVC Profile 1262 * 1263 * @syscap SystemCapability.Multimedia.Media.CodecBase 1264 * @since 10 1265 */ 1266 typedef enum OH_HEVCProfile { 1267 HEVC_PROFILE_MAIN = 0, 1268 HEVC_PROFILE_MAIN_10 = 1, 1269 HEVC_PROFILE_MAIN_STILL = 2, 1270 /** 1271 * @deprecated since 14 1272 */ 1273 HEVC_PROFILE_MAIN_10_HDR10 = 3, 1274 /** 1275 * @deprecated since 14 1276 */ 1277 HEVC_PROFILE_MAIN_10_HDR10_PLUS = 4, 1278 } OH_HEVCProfile; 1279 1280 /** 1281 * @brief Profile: A specified subset of the syntax of VVC. 1282 * 1283 * @syscap SystemCapability.Multimedia.Media.CodecBase 1284 * @since 15 1285 */ 1286 typedef enum OH_VVCProfile { 1287 /** Main 10 profile */ 1288 VVC_PROFILE_MAIN_10 = 1, 1289 /** Main 12 profile */ 1290 VVC_PROFILE_MAIN_12 = 2, 1291 /** Main 12 Intra profile */ 1292 VVC_PROFILE_MAIN_12_INTRA = 10, 1293 /** Multilayer Main 10 profile */ 1294 VVC_PROFILE_MULTI_MAIN_10 = 17, 1295 /** Main 10 4:4:4 profile */ 1296 VVC_PROFILE_MAIN_10_444 = 33, 1297 /** Main 12 4:4:4 profile */ 1298 VVC_PROFILE_MAIN_12_444 = 34, 1299 /** Main 16 4:4:4 profile */ 1300 VVC_PROFILE_MAIN_16_444 = 36, 1301 /** Main 12 4:4:4 Intra profile */ 1302 VVC_PROFILE_MAIN_12_444_INTRA = 42, 1303 /** Main 16 4:4:4 Intra profile */ 1304 VVC_PROFILE_MAIN_16_444_INTRA = 44, 1305 /** Multilayer Main 10 4:4:4 profile */ 1306 VVC_PROFILE_MULTI_MAIN_10_444 = 49, 1307 /** Main 10 Still Picture profile */ 1308 VVC_PROFILE_MAIN_10_STILL = 65, 1309 /** Main 12 Still Picture profile */ 1310 VVC_PROFILE_MAIN_12_STILL = 66, 1311 /** Main 10 4:4:4 Still Picture profile */ 1312 VVC_PROFILE_MAIN_10_444_STILL = 97, 1313 /** Main 12 4:4:4 Still Picture profile */ 1314 VVC_PROFILE_MAIN_12_444_STILL = 98, 1315 /** Main 16 4:4:4 Still Picture profile */ 1316 VVC_PROFILE_MAIN_16_444_STILL = 100, 1317 } OH_VVCProfile; 1318 1319 /** 1320 * @brief MPEG2 Profile 1321 * 1322 * @syscap SystemCapability.Multimedia.Media.CodecBase 1323 * @since 17 1324 */ 1325 typedef enum OH_MPEG2Profile { 1326 /** Simple profile */ 1327 MPEG2_PROFILE_SIMPLE = 0, 1328 /** Main profile */ 1329 MPEG2_PROFILE_MAIN = 1, 1330 /** SNR scalable profile */ 1331 MPEG2_PROFILE_SNR_SCALABLE = 2, 1332 /** Spatially scalable profile */ 1333 MPEG2_PROFILE_SPATIALLY_SCALABLE = 3, 1334 /** High profile */ 1335 MPEG2_PROFILE_HIGH = 4, 1336 /** 4:2:2 profile */ 1337 MPEG2_PROFILE_422 = 5, 1338 } OH_MPEG2Profile; 1339 1340 /** 1341 * @brief MPEG4 Profile 1342 * 1343 * @syscap SystemCapability.Multimedia.Media.CodecBase 1344 * @since 17 1345 */ 1346 typedef enum OH_MPEG4Profile { 1347 /** Simple profile */ 1348 MPEG4_PROFILE_SIMPLE = 0, 1349 /** Simple scalable profile */ 1350 MPEG4_PROFILE_SIMPLE_SCALABLE = 1, 1351 /** Core profile */ 1352 MPEG4_PROFILE_CORE = 2, 1353 /** Main profile */ 1354 MPEG4_PROFILE_MAIN = 3, 1355 /** N-Bit profile */ 1356 MPEG4_PROFILE_N_BIT = 4, 1357 /** Hybrid profile */ 1358 MPEG4_PROFILE_HYBRID = 5, 1359 /** Basic animated texture profile */ 1360 MPEG4_PROFILE_BASIC_ANIMATED_TEXTURE = 6, 1361 /** Scalable texture profile */ 1362 MPEG4_PROFILE_SCALABLE_TEXTURE = 7, 1363 /** Simple FA profile */ 1364 MPEG4_PROFILE_SIMPLE_FA = 8, 1365 /** Advanced real time simple profile */ 1366 MPEG4_PROFILE_ADVANCED_REAL_TIME_SIMPLE = 9, 1367 /** Core scalable profile */ 1368 MPEG4_PROFILE_CORE_SCALABLE = 10, 1369 /** Advanced coding efficiency profile */ 1370 MPEG4_PROFILE_ADVANCED_CODING_EFFICIENCY = 11, 1371 /** Advanced core profile */ 1372 MPEG4_PROFILE_ADVANCED_CORE = 12, 1373 /** Advanced scalable texture profile */ 1374 MPEG4_PROFILE_ADVANCED_SCALABLE_TEXTURE = 13, 1375 /** Advanced simple profile */ 1376 MPEG4_PROFILE_ADVANCED_SIMPLE = 17, 1377 } OH_MPEG4Profile; 1378 1379 /** 1380 * @brief H263 Profile 1381 * 1382 * @syscap SystemCapability.Multimedia.Media.CodecBase 1383 * @since 17 1384 */ 1385 typedef enum OH_H263Profile { 1386 /** Baseline profile */ 1387 H263_PROFILE_BASELINE = 0, 1388 /** Version 1 backward compatibility profile */ 1389 H263_PROFILE_VERSION_1_BACKWARD_COMPATIBILITY = 2, 1390 } OH_H263Profile; 1391 1392 /** 1393 * @brief Enumerates the muxer output file format 1394 * 1395 * @syscap SystemCapability.Multimedia.Media.CodecBase 1396 * @since 10 1397 */ 1398 typedef enum OH_AVOutputFormat { 1399 AV_OUTPUT_FORMAT_DEFAULT = 0, 1400 AV_OUTPUT_FORMAT_MPEG_4 = 2, 1401 AV_OUTPUT_FORMAT_M4A = 6, 1402 /** 1403 * The muxer output amr file format. 1404 * @since 12 1405 */ 1406 AV_OUTPUT_FORMAT_AMR = 8, 1407 /** 1408 * The muxer output mp3 file format. 1409 * @since 12 1410 */ 1411 AV_OUTPUT_FORMAT_MP3 = 9, 1412 /** 1413 * The muxer output wav file format. 1414 * @since 12 1415 */ 1416 AV_OUTPUT_FORMAT_WAV = 10, 1417 /** 1418 * The muxer output aac file format. 1419 * @since 18 1420 */ 1421 AV_OUTPUT_FORMAT_AAC = 11, 1422 /** 1423 * The muxer output flac file format. 1424 * @since 20 1425 */ 1426 AV_OUTPUT_FORMAT_FLAC = 12, 1427 } OH_AVOutputFormat; 1428 1429 /** 1430 * @brief Seek Mode 1431 * 1432 * @syscap SystemCapability.Multimedia.Media.CodecBase 1433 * @since 10 1434 */ 1435 typedef enum OH_AVSeekMode { 1436 /* seek to sync sample after the time */ 1437 SEEK_MODE_NEXT_SYNC = 0, 1438 /* seek to sync sample before the time */ 1439 SEEK_MODE_PREVIOUS_SYNC, 1440 /* seek to sync sample closest to time */ 1441 SEEK_MODE_CLOSEST_SYNC, 1442 } OH_AVSeekMode; 1443 1444 /** 1445 * @brief Scaling Mode 1446 * 1447 * @syscap SystemCapability.Multimedia.Media.CodecBase 1448 * @deprecated since 14 1449 * @useinstead OHScalingModeV2 1450 * @since 10 1451 */ 1452 typedef enum OH_ScalingMode { 1453 /** 1454 * @deprecated since 14 1455 * @useinstead OH_SCALING_MODE_SCALE_TO_WINDOW_V2 1456 */ 1457 SCALING_MODE_SCALE_TO_WINDOW = 1, 1458 /** 1459 * @deprecated since 14 1460 * @useinstead OH_SCALING_MODE_SCALE_CROP_V2 1461 */ 1462 SCALING_MODE_SCALE_CROP = 2, 1463 } OH_ScalingMode; 1464 1465 /** 1466 * @brief enum Audio Bits Per Coded Sample 1467 * 1468 * @syscap SystemCapability.Multimedia.Media.CodecBase 1469 * @since 10 1470 */ 1471 typedef enum OH_BitsPerSample { 1472 SAMPLE_U8 = 0, 1473 SAMPLE_S16LE = 1, 1474 SAMPLE_S24LE = 2, 1475 SAMPLE_S32LE = 3, 1476 SAMPLE_F32LE = 4, 1477 SAMPLE_U8P = 5, 1478 SAMPLE_S16P = 6, 1479 SAMPLE_S24P = 7, 1480 SAMPLE_S32P = 8, 1481 SAMPLE_F32P = 9, 1482 INVALID_WIDTH = -1 1483 } OH_BitsPerSample; 1484 1485 /** 1486 * @brief Color Primary 1487 * 1488 * @syscap SystemCapability.Multimedia.Media.CodecBase 1489 * @since 10 1490 */ 1491 typedef enum OH_ColorPrimary { 1492 COLOR_PRIMARY_BT709 = 1, 1493 COLOR_PRIMARY_UNSPECIFIED = 2, 1494 COLOR_PRIMARY_BT470_M = 4, 1495 COLOR_PRIMARY_BT601_625 = 5, 1496 COLOR_PRIMARY_BT601_525 = 6, 1497 COLOR_PRIMARY_SMPTE_ST240 = 7, 1498 COLOR_PRIMARY_GENERIC_FILM = 8, 1499 COLOR_PRIMARY_BT2020 = 9, 1500 COLOR_PRIMARY_SMPTE_ST428 = 10, 1501 COLOR_PRIMARY_P3DCI = 11, 1502 COLOR_PRIMARY_P3D65 = 12, 1503 } OH_ColorPrimary; 1504 1505 /** 1506 * @brief Transfer Characteristic 1507 * 1508 * @syscap SystemCapability.Multimedia.Media.CodecBase 1509 * @since 10 1510 */ 1511 typedef enum OH_TransferCharacteristic { 1512 TRANSFER_CHARACTERISTIC_BT709 = 1, 1513 TRANSFER_CHARACTERISTIC_UNSPECIFIED = 2, 1514 TRANSFER_CHARACTERISTIC_GAMMA_2_2 = 4, 1515 TRANSFER_CHARACTERISTIC_GAMMA_2_8 = 5, 1516 TRANSFER_CHARACTERISTIC_BT601 = 6, 1517 TRANSFER_CHARACTERISTIC_SMPTE_ST240 = 7, 1518 TRANSFER_CHARACTERISTIC_LINEAR = 8, 1519 TRANSFER_CHARACTERISTIC_LOG = 9, 1520 TRANSFER_CHARACTERISTIC_LOG_SQRT = 10, 1521 TRANSFER_CHARACTERISTIC_IEC_61966_2_4 = 11, 1522 TRANSFER_CHARACTERISTIC_BT1361 = 12, 1523 TRANSFER_CHARACTERISTIC_IEC_61966_2_1 = 13, 1524 TRANSFER_CHARACTERISTIC_BT2020_10BIT = 14, 1525 TRANSFER_CHARACTERISTIC_BT2020_12BIT = 15, 1526 TRANSFER_CHARACTERISTIC_PQ = 16, 1527 TRANSFER_CHARACTERISTIC_SMPTE_ST428 = 17, 1528 TRANSFER_CHARACTERISTIC_HLG = 18, 1529 } OH_TransferCharacteristic; 1530 1531 /** 1532 * @brief Matrix Coefficient 1533 * 1534 * @syscap SystemCapability.Multimedia.Media.CodecBase 1535 * @since 10 1536 */ 1537 typedef enum OH_MatrixCoefficient { 1538 MATRIX_COEFFICIENT_IDENTITY = 0, 1539 MATRIX_COEFFICIENT_BT709 = 1, 1540 MATRIX_COEFFICIENT_UNSPECIFIED = 2, 1541 MATRIX_COEFFICIENT_FCC = 4, 1542 MATRIX_COEFFICIENT_BT601_625 = 5, 1543 MATRIX_COEFFICIENT_BT601_525 = 6, 1544 MATRIX_COEFFICIENT_SMPTE_ST240 = 7, 1545 MATRIX_COEFFICIENT_YCGCO = 8, 1546 MATRIX_COEFFICIENT_BT2020_NCL = 9, 1547 MATRIX_COEFFICIENT_BT2020_CL = 10, 1548 MATRIX_COEFFICIENT_SMPTE_ST2085 = 11, 1549 MATRIX_COEFFICIENT_CHROMATICITY_NCL = 12, 1550 MATRIX_COEFFICIENT_CHROMATICITY_CL = 13, 1551 MATRIX_COEFFICIENT_ICTCP = 14, 1552 } OH_MatrixCoefficient; 1553 1554 /** 1555 * @brief AVC Level. 1556 * 1557 * @syscap SystemCapability.Multimedia.Media.CodecBase 1558 * @since 12 1559 */ 1560 typedef enum OH_AVCLevel { 1561 AVC_LEVEL_1 = 0, 1562 AVC_LEVEL_1b = 1, 1563 AVC_LEVEL_11 = 2, 1564 AVC_LEVEL_12 = 3, 1565 AVC_LEVEL_13 = 4, 1566 AVC_LEVEL_2 = 5, 1567 AVC_LEVEL_21 = 6, 1568 AVC_LEVEL_22 = 7, 1569 AVC_LEVEL_3 = 8, 1570 AVC_LEVEL_31 = 9, 1571 AVC_LEVEL_32 = 10, 1572 AVC_LEVEL_4 = 11, 1573 AVC_LEVEL_41 = 12, 1574 AVC_LEVEL_42 = 13, 1575 AVC_LEVEL_5 = 14, 1576 AVC_LEVEL_51 = 15, 1577 AVC_LEVEL_52 = 16, 1578 AVC_LEVEL_6 = 17, 1579 AVC_LEVEL_61 = 18, 1580 AVC_LEVEL_62 = 19, 1581 } OH_AVCLevel; 1582 1583 /** 1584 * @brief HEVC Level. 1585 * 1586 * @syscap SystemCapability.Multimedia.Media.CodecBase 1587 * @since 12 1588 */ 1589 typedef enum OH_HEVCLevel { 1590 HEVC_LEVEL_1 = 0, 1591 HEVC_LEVEL_2 = 1, 1592 HEVC_LEVEL_21 = 2, 1593 HEVC_LEVEL_3 = 3, 1594 HEVC_LEVEL_31 = 4, 1595 HEVC_LEVEL_4 = 5, 1596 HEVC_LEVEL_41 = 6, 1597 HEVC_LEVEL_5 = 7, 1598 HEVC_LEVEL_51 = 8, 1599 HEVC_LEVEL_52 = 9, 1600 HEVC_LEVEL_6 = 10, 1601 HEVC_LEVEL_61 = 11, 1602 HEVC_LEVEL_62 = 12, 1603 } OH_HEVCLevel; 1604 1605 /** 1606 * @brief VVC Level: A defined set of constraints on the values that may be taken by the syntax elements and variables 1607 * of VVC, or the value of a transform coefficient prior to scaling. 1608 * 1609 * @syscap SystemCapability.Multimedia.Media.CodecBase 1610 * @since 15 1611 */ 1612 typedef enum OH_VVCLevel { 1613 /** VVC level 1.0 */ 1614 VVC_LEVEL_1 = 16, 1615 /** VVC level 2.0 */ 1616 VVC_LEVEL_2 = 32, 1617 /** VVC level 2.1 */ 1618 VVC_LEVEL_21 = 35, 1619 /** VVC level 3.0 */ 1620 VVC_LEVEL_3 = 48, 1621 /** VVC level 3.1 */ 1622 VVC_LEVEL_31 = 51, 1623 /** VVC level 4.0 */ 1624 VVC_LEVEL_4 = 64, 1625 /** VVC level 4.1 */ 1626 VVC_LEVEL_41 = 67, 1627 /** VVC level 5.0 */ 1628 VVC_LEVEL_5 = 80, 1629 /** VVC level 5.1 */ 1630 VVC_LEVEL_51 = 83, 1631 /** VVC level 5.2 */ 1632 VVC_LEVEL_52 = 86, 1633 /** VVC level 6.0 */ 1634 VVC_LEVEL_6 = 96, 1635 /** VVC level 6.1 */ 1636 VVC_LEVEL_61 = 99, 1637 /** VVC level 6.2 */ 1638 VVC_LEVEL_62 = 102, 1639 /** VVC level 6.3 */ 1640 VVC_LEVEL_63 = 105, 1641 /** VVC level 15.5 */ 1642 VVC_LEVEL_155 = 255, 1643 } OH_VVCLevel; 1644 1645 /** 1646 * @brief MPEG2 Level. 1647 * 1648 * @syscap SystemCapability.Multimedia.Media.CodecBase 1649 * @since 17 1650 */ 1651 typedef enum OH_MPEG2Level { 1652 /** Low level */ 1653 MPEG2_LEVEL_LOW = 0, 1654 /** Main level */ 1655 MPEG2_LEVEL_MAIN = 1, 1656 /** High 1440 level */ 1657 MPEG2_LEVEL_HIGH_1440 = 2, 1658 /** High level */ 1659 MPEG2_LEVEL_HIGH = 3, 1660 } OH_MPEG2Level; 1661 1662 /** 1663 * @brief MPEG4 Level. 1664 * 1665 * @syscap SystemCapability.Multimedia.Media.CodecBase 1666 * @since 17 1667 */ 1668 typedef enum OH_MPEG4Level { 1669 /** 0 level */ 1670 MPEG4_LEVEL_0 = 0, 1671 /** 0B level */ 1672 MPEG4_LEVEL_0B = 1, 1673 /** 1 level */ 1674 MPEG4_LEVEL_1 = 2, 1675 /** 2 level */ 1676 MPEG4_LEVEL_2 = 3, 1677 /** 3 level */ 1678 MPEG4_LEVEL_3 = 4, 1679 /** 3B level */ 1680 MPEG4_LEVEL_3B = 5, 1681 /** 4 level */ 1682 MPEG4_LEVEL_4 = 6, 1683 /** 4A level */ 1684 MPEG4_LEVEL_4A = 7, 1685 /** 5 level */ 1686 MPEG4_LEVEL_5 = 8, 1687 /** 6 level */ 1688 MPEG4_LEVEL_6 = 9, 1689 } OH_MPEG4Level; 1690 1691 /** 1692 * @brief H263 Level. 1693 * 1694 * @syscap SystemCapability.Multimedia.Media.CodecBase 1695 * @since 17 1696 */ 1697 typedef enum OH_H263Level { 1698 /** 10 level */ 1699 H263_LEVEL_10 = 0, 1700 /** 20 level */ 1701 H263_LEVEL_20 = 1, 1702 /** 30 level */ 1703 H263_LEVEL_30 = 2, 1704 /** 40 level */ 1705 H263_LEVEL_40 = 3, 1706 /** 45 level */ 1707 H263_LEVEL_45 = 4, 1708 /** 50 level */ 1709 H263_LEVEL_50 = 5, 1710 /** 60 level */ 1711 H263_LEVEL_60 = 6, 1712 /** 70 level */ 1713 H263_LEVEL_70 = 7, 1714 } OH_H263Level; 1715 1716 /** 1717 * @brief The reference mode in temporal group of picture. 1718 * 1719 * @syscap SystemCapability.Multimedia.Media.CodecBase 1720 * @since 12 1721 */ 1722 typedef enum OH_TemporalGopReferenceMode { 1723 /** Refer to latest short-term reference frame. */ 1724 ADJACENT_REFERENCE = 0, 1725 /** Refer to latest long-term reference frame. */ 1726 JUMP_REFERENCE = 1, 1727 /** Uniformly scaled reference structure, which has even distribution of video frames after drop the highest 1728 * enhance layer. The temporal group of pictures must be power of 2. */ 1729 UNIFORMLY_SCALED_REFERENCE = 2, 1730 } OH_TemporalGopReferenceMode; 1731 1732 /** 1733 * @brief The bitrate mode of encoder. 1734 * 1735 * Change the location of the header file, since 14. 1736 * 1737 * @syscap SystemCapability.Multimedia.Media.CodecBase 1738 * @since 10 1739 */ 1740 typedef enum OH_BitrateMode { 1741 /** Constant Bit rate mode. */ 1742 BITRATE_MODE_CBR = 0, 1743 /** Variable Bit rate mode. */ 1744 BITRATE_MODE_VBR = 1, 1745 /** Constant Quality mode. */ 1746 BITRATE_MODE_CQ = 2, 1747 /** Stable Quality RateControl. 1748 * @since 20 1749 */ 1750 BITRATE_MODE_SQR = 3 1751 } OH_BitrateMode; 1752 1753 #ifdef __cplusplus 1754 } 1755 #endif 1756 1757 #endif // NATIVE_AVCODEC_BASE_H 1758 /** @} */ 1759