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 Enumerates the mime types of video avc codec. 217 * 218 * @syscap SystemCapability.Multimedia.Media.CodecBase 219 * @since 9 220 */ 221 extern const char *OH_AVCODEC_MIMETYPE_VIDEO_AVC; 222 /** 223 * @brief Enumerates the mime types of audio aac codec. 224 * 225 * @syscap SystemCapability.Multimedia.Media.CodecBase 226 * @since 9 227 */ 228 extern const char *OH_AVCODEC_MIMETYPE_AUDIO_AAC; 229 230 /** 231 * @brief Enumerates the mime types of audio flac codec. 232 * 233 * @syscap SystemCapability.Multimedia.Media.CodecBase 234 * @since 10 235 */ 236 extern const char *OH_AVCODEC_MIMETYPE_AUDIO_FLAC; 237 /** 238 * @brief Enumerates the mime types of audio vorbis codec. 239 * 240 * @syscap SystemCapability.Multimedia.Media.CodecBase 241 * @since 10 242 */ 243 extern const char *OH_AVCODEC_MIMETYPE_AUDIO_VORBIS; 244 /** 245 * @brief Enumerates the mime types of audio mp3 codec. 246 * 247 * @syscap SystemCapability.Multimedia.Media.CodecBase 248 * @since 10 249 */ 250 extern const char *OH_AVCODEC_MIMETYPE_AUDIO_MPEG; 251 /** 252 * @brief Enumerates the mime types of video hevc codec. 253 * 254 * @syscap SystemCapability.Multimedia.Media.CodecBase 255 * @since 10 256 */ 257 extern const char *OH_AVCODEC_MIMETYPE_VIDEO_HEVC; 258 259 /** 260 * @brief Enumerates the mime types of video mpeg4 muxer. 261 * 262 * @syscap SystemCapability.Multimedia.Media.CodecBase 263 * @deprecated since 11 264 * @since 10 265 */ 266 extern const char *OH_AVCODEC_MIMETYPE_VIDEO_MPEG4; 267 268 /** 269 * @brief Enumerates the mime types of cover jpg muxer. 270 * 271 * @syscap SystemCapability.Multimedia.Media.CodecBase 272 * @since 10 273 */ 274 extern const char *OH_AVCODEC_MIMETYPE_IMAGE_JPG; 275 /** 276 * @brief Enumerates the mime types of cover png muxer. 277 * 278 * @syscap SystemCapability.Multimedia.Media.CodecBase 279 * @since 10 280 */ 281 extern const char *OH_AVCODEC_MIMETYPE_IMAGE_PNG; 282 /** 283 * @brief Enumerates the mime types of cover bmp muxer. 284 * 285 * @syscap SystemCapability.Multimedia.Media.CodecBase 286 * @since 10 287 */ 288 extern const char *OH_AVCODEC_MIMETYPE_IMAGE_BMP; 289 290 /** 291 * @brief Enumerates the mime types of audio vivid codec. 292 * 293 * @syscap SystemCapability.Multimedia.Media.CodecBase 294 * @since 11 295 */ 296 extern const char *OH_AVCODEC_MIMETYPE_AUDIO_VIVID; 297 /** 298 * @brief Enumerates the mime types of audio amrnb codec. 299 * 300 * @syscap SystemCapability.Multimedia.Media.CodecBase 301 * @since 11 302 */ 303 extern const char *OH_AVCODEC_MIMETYPE_AUDIO_AMR_NB; 304 /** 305 * @brief Enumerates the mime types of audio amrwb codec. 306 * 307 * @syscap SystemCapability.Multimedia.Media.CodecBase 308 * @since 11 309 */ 310 extern const char *OH_AVCODEC_MIMETYPE_AUDIO_AMR_WB; 311 /** 312 * @brief Enumerates the mime types of audio opus codec. 313 * 314 * @syscap SystemCapability.Multimedia.Media.CodecBase 315 * @since 11 316 */ 317 extern const char *OH_AVCODEC_MIMETYPE_AUDIO_OPUS; 318 /** 319 * @brief Enumerates the mime types of audio g711mu codec. 320 * 321 * @syscap SystemCapability.Multimedia.Media.CodecBase 322 * @since 11 323 */ 324 extern const char *OH_AVCODEC_MIMETYPE_AUDIO_G711MU; 325 326 /** 327 * @brief Enumerates the mime type of audio ape codec. 328 * 329 * @syscap SystemCapability.Multimedia.Media.CodecBase 330 * @since 12 331 */ 332 extern const char *OH_AVCODEC_MIMETYPE_AUDIO_APE; 333 334 /** 335 * @brief Enumerates the MIME type of versatile video coding. 336 * 337 * @syscap SystemCapability.Multimedia.Media.CodecBase 338 * @since 12 339 */ 340 extern const char *OH_AVCODEC_MIMETYPE_VIDEO_VVC; 341 342 /** 343 * @brief Enumerates the mime type of subtitle srt. 344 * 345 * @syscap SystemCapability.Multimedia.Media.CodecBase 346 * @since 12 347 */ 348 extern const char *OH_AVCODEC_MIMETYPE_SUBTITLE_SRT; 349 350 /** 351 * @brief Enumerates the mime type of subtitle webvtt. 352 * 353 * @syscap SystemCapability.Multimedia.Media.CodecBase 354 * @since 12 355 */ 356 extern const char *OH_AVCODEC_MIMETYPE_SUBTITLE_WEBVTT; 357 358 /** 359 * @brief Key for timeStamp in surface's extraData, value type is int64_t. 360 * 361 * @syscap SystemCapability.Multimedia.Media.CodecBase 362 * @deprecated since 14 363 * @since 9 364 */ 365 extern const char *OH_ED_KEY_TIME_STAMP; 366 /** 367 * @brief Key for endOfStream in surface's extraData, value type is bool. 368 * 369 * @syscap SystemCapability.Multimedia.Media.CodecBase 370 * @deprecated since 14 371 * @since 9 372 */ 373 extern const char *OH_ED_KEY_EOS; 374 375 /** 376 * @brief Key for track type, value type is int32_t, see {@link OH_MediaType}. 377 * 378 * @syscap SystemCapability.Multimedia.Media.CodecBase 379 * @since 9 380 */ 381 extern const char *OH_MD_KEY_TRACK_TYPE; 382 /** 383 * @brief Key for codec mime type, value type is string. 384 * 385 * @syscap SystemCapability.Multimedia.Media.CodecBase 386 * @since 9 387 */ 388 extern const char *OH_MD_KEY_CODEC_MIME; 389 /** 390 * @brief Key for file duration in microseconds, value type is int64_t. 391 * 392 * @syscap SystemCapability.Multimedia.Media.CodecBase 393 * @since 9 394 */ 395 extern const char *OH_MD_KEY_DURATION; 396 /** 397 * @brief Key for bitrate, value type is int64_t. 398 * 399 * @syscap SystemCapability.Multimedia.Media.CodecBase 400 * @since 9 401 */ 402 extern const char *OH_MD_KEY_BITRATE; 403 /** 404 * @brief Key for max input size, value type is int32_t. 405 * 406 * @syscap SystemCapability.Multimedia.Media.CodecBase 407 * @since 9 408 */ 409 extern const char *OH_MD_KEY_MAX_INPUT_SIZE; 410 /** 411 * @brief Key for video width, value type is int32_t. 412 * 413 * @syscap SystemCapability.Multimedia.Media.CodecBase 414 * @since 9 415 */ 416 extern const char *OH_MD_KEY_WIDTH; 417 /** 418 * @brief Key for video height, value type is int32_t. 419 * 420 * @syscap SystemCapability.Multimedia.Media.CodecBase 421 * @since 9 422 */ 423 extern const char *OH_MD_KEY_HEIGHT; 424 /** 425 * @brief Key for video pixel format, value type is int32_t, see {@link OH_AVPixelFormat}. 426 * 427 * @syscap SystemCapability.Multimedia.Media.CodecBase 428 * @since 9 429 */ 430 extern const char *OH_MD_KEY_PIXEL_FORMAT; 431 /** 432 * @brief key for audio raw format, value type is int32_t , see {@link OH_BitsPerSample}. 433 * 434 * @syscap SystemCapability.Multimedia.Media.CodecBase 435 * @since 9 436 */ 437 extern const char *OH_MD_KEY_AUDIO_SAMPLE_FORMAT; 438 /** 439 * @brief Key for video frame rate, value type is double. 440 * 441 * @syscap SystemCapability.Multimedia.Media.CodecBase 442 * @since 9 443 */ 444 extern const char *OH_MD_KEY_FRAME_RATE; 445 /** 446 * @brief video encode bitrate mode, the value type is int32_t, see {@link OH_VideoEncodeBitrateMode}. 447 * 448 * @syscap SystemCapability.Multimedia.Media.CodecBase 449 * @since 9 450 */ 451 extern const char *OH_MD_KEY_VIDEO_ENCODE_BITRATE_MODE; 452 /** 453 * @brief encode profile, the value type is int32_t. see {@link OH_AVCProfile}, {@link OH_HEVCProfile}, 454 * {@link OH_AACProfile}. 455 * 456 * @syscap SystemCapability.Multimedia.Media.CodecBase 457 * @since 9 458 */ 459 extern const char *OH_MD_KEY_PROFILE; 460 /** 461 * @brief Key for audio channel count, value type is int32_t. 462 * 463 * @syscap SystemCapability.Multimedia.Media.CodecBase 464 * @since 9 465 */ 466 extern const char *OH_MD_KEY_AUD_CHANNEL_COUNT; 467 /** 468 * @brief Key for audio sample rate, value type is int32_t. 469 * 470 * @syscap SystemCapability.Multimedia.Media.CodecBase 471 * @since 9 472 */ 473 extern const char *OH_MD_KEY_AUD_SAMPLE_RATE; 474 /** 475 * @brief Key for the interval of key frame. value type is int32_t, the unit is milliseconds. A negative value means no 476 * key frames are requested after the first frame. A zero value means a stream containing all key frames is requested. 477 * 478 * @syscap SystemCapability.Multimedia.Media.CodecBase 479 * @since 9 480 */ 481 extern const char *OH_MD_KEY_I_FRAME_INTERVAL; 482 /** 483 * @brief Key of the surface rotation angle. value type is int32_t: should be {0, 90, 180, 270}, default is 0. 484 * 485 * @syscap SystemCapability.Multimedia.Media.CodecBase 486 * @since 9 487 */ 488 extern const char *OH_MD_KEY_ROTATION; 489 490 /** 491 * @brief Key for video YUV value range flag, value type is bool, true for full range, false for limited range. 492 * 493 * @syscap SystemCapability.Multimedia.Media.CodecBase 494 * @since 10 495 */ 496 extern const char *OH_MD_KEY_RANGE_FLAG; 497 /** 498 * @brief Key for video color primaries, value type is int32_t, see {@link OH_ColorPrimary}. 499 * 500 * @syscap SystemCapability.Multimedia.Media.CodecBase 501 * @since 10 502 */ 503 extern const char *OH_MD_KEY_COLOR_PRIMARIES; 504 /** 505 * @brief Key for video transfer characteristics, value type is int32_t, see {@link OH_TransferCharacteristic}. 506 * 507 * @syscap SystemCapability.Multimedia.Media.CodecBase 508 * @since 10 509 */ 510 extern const char *OH_MD_KEY_TRANSFER_CHARACTERISTICS; 511 /** 512 * @brief Key for video matrix coefficients, value type is int32_t, see {@link OH_MatrixCoefficient}. 513 * 514 * @syscap SystemCapability.Multimedia.Media.CodecBase 515 * @since 10 516 */ 517 extern const char *OH_MD_KEY_MATRIX_COEFFICIENTS; 518 /** 519 * @brief Key for the request an I-Frame immediately, value type is bool. 520 * 521 * @syscap SystemCapability.Multimedia.Media.CodecBase 522 * @since 10 523 */ 524 extern const char *OH_MD_KEY_REQUEST_I_FRAME; 525 /** 526 * @brief Key for the desired encoding quality, value type is int32_t, this key is only. 527 * supported for encoders that are configured in constant quality mode. 528 * 529 * @syscap SystemCapability.Multimedia.Media.CodecBase 530 * @since 10 531 */ 532 extern const char *OH_MD_KEY_QUALITY; 533 /** 534 * @brief Key of the codec specific data. value type is a uint8_t pointer. 535 * 536 * @syscap SystemCapability.Multimedia.Media.CodecBase 537 * @since 10 538 */ 539 extern const char *OH_MD_KEY_CODEC_CONFIG; 540 /** 541 * @brief source format Key for title, value type is string. 542 * 543 * @syscap SystemCapability.Multimedia.Media.CodecBase 544 * @since 10 545 */ 546 extern const char *OH_MD_KEY_TITLE; 547 /** 548 * @brief source format Key for artist, value type is string. 549 * 550 * @syscap SystemCapability.Multimedia.Media.CodecBase 551 * @since 10 552 */ 553 extern const char *OH_MD_KEY_ARTIST; 554 /** 555 * @brief source format Key for album, value type is string. 556 * 557 * @syscap SystemCapability.Multimedia.Media.CodecBase 558 * @since 10 559 */ 560 extern const char *OH_MD_KEY_ALBUM; 561 /** 562 * @brief source format Key for album artist, value type is string. 563 * 564 * @syscap SystemCapability.Multimedia.Media.CodecBase 565 * @since 10 566 */ 567 extern const char *OH_MD_KEY_ALBUM_ARTIST; 568 /** 569 * @brief source format Key for date, value type is string. 570 * 571 * @syscap SystemCapability.Multimedia.Media.CodecBase 572 * @since 10 573 */ 574 extern const char *OH_MD_KEY_DATE; 575 /** 576 * @brief source format Key for comment, value type is string. 577 * 578 * @syscap SystemCapability.Multimedia.Media.CodecBase 579 * @since 10 580 */ 581 extern const char *OH_MD_KEY_COMMENT; 582 /** 583 * @brief source format Key for genre, value type is string. 584 * 585 * @syscap SystemCapability.Multimedia.Media.CodecBase 586 * @since 10 587 */ 588 extern const char *OH_MD_KEY_GENRE; 589 /** 590 * @brief source format Key for copyright, value type is string. 591 * 592 * @syscap SystemCapability.Multimedia.Media.CodecBase 593 * @since 10 594 */ 595 extern const char *OH_MD_KEY_COPYRIGHT; 596 /** 597 * @brief source format Key for language, value type is string. 598 * 599 * @syscap SystemCapability.Multimedia.Media.CodecBase 600 * @since 10 601 */ 602 extern const char *OH_MD_KEY_LANGUAGE; 603 /** 604 * @brief source format Key for description, value type is string. 605 * 606 * @syscap SystemCapability.Multimedia.Media.CodecBase 607 * @since 10 608 */ 609 extern const char *OH_MD_KEY_DESCRIPTION; 610 /** 611 * @brief source format Key for lyrics, value type is string. 612 * 613 * @syscap SystemCapability.Multimedia.Media.CodecBase 614 * @since 10 615 */ 616 extern const char *OH_MD_KEY_LYRICS; 617 /** 618 * @brief source format Key for track count, value type is int32_t. 619 * 620 * @syscap SystemCapability.Multimedia.Media.CodecBase 621 * @since 10 622 */ 623 extern const char *OH_MD_KEY_TRACK_COUNT; 624 /** 625 * @brief Key for the desired encoding channel layout, value type is int64_t, this key is only supported for encoders. 626 * 627 * @syscap SystemCapability.Multimedia.Media.CodecBase 628 * @since 10 629 */ 630 extern const char *OH_MD_KEY_CHANNEL_LAYOUT; 631 /** 632 * @brief Key for bits per coded sample, value type is int32_t, supported for flac encoder, 633 * see {@link OH_BitsPerSample}. 634 * 635 * @syscap SystemCapability.Multimedia.Media.CodecBase 636 * @since 10 637 */ 638 extern const char *OH_MD_KEY_BITS_PER_CODED_SAMPLE; 639 /** 640 * @brief Key for the aac format, value type is int32_t, supported for aac decoder. 641 * 642 * @syscap SystemCapability.Multimedia.Media.CodecBase 643 * @since 10 644 */ 645 extern const char *OH_MD_KEY_AAC_IS_ADTS; 646 /** 647 * @brief Key for aac sbr mode, value type is int32_t, supported for aac encoder. 648 * 649 * @syscap SystemCapability.Multimedia.Media.CodecBase 650 * @since 10 651 */ 652 extern const char *OH_MD_KEY_SBR; 653 /** 654 * @brief Key for flac compliance level, value type is int32_t. 655 * 656 * @syscap SystemCapability.Multimedia.Media.CodecBase 657 * @since 10 658 */ 659 extern const char *OH_MD_KEY_COMPLIANCE_LEVEL; 660 /** 661 * @brief Key for vorbis identification header, value type is a uint8_t pointer, supported only for vorbis decoder. 662 * 663 * @syscap SystemCapability.Multimedia.Media.CodecBase 664 * @since 10 665 */ 666 extern const char *OH_MD_KEY_IDENTIFICATION_HEADER; 667 /** 668 * @brief Key for vorbis setup header, value type is a uint8_t pointer, supported only for vorbis decoder. 669 * 670 * @syscap SystemCapability.Multimedia.Media.CodecBase 671 * @since 10 672 */ 673 extern const char *OH_MD_KEY_SETUP_HEADER; 674 /** 675 * @brief Key for video scale type, value type is int32_t, see {@link OH_ScalingMode}. 676 * 677 * @syscap SystemCapability.Multimedia.Media.CodecBase 678 * @deprecated since 14 679 * @useinstead OH_NativeWindow_NativeWindowSetScalingModeV2 680 * @since 10 681 */ 682 extern const char *OH_MD_KEY_SCALING_MODE; 683 /** 684 * @brief Key for max input buffer count, value type is int32_t. 685 * 686 * @syscap SystemCapability.Multimedia.Media.CodecBase 687 * @since 10 688 */ 689 extern const char *OH_MD_MAX_INPUT_BUFFER_COUNT; 690 /** 691 * @brief Key for max output buffer count, value type is int32_t. 692 * 693 * @syscap SystemCapability.Multimedia.Media.CodecBase 694 * @since 10 695 */ 696 extern const char *OH_MD_MAX_OUTPUT_BUFFER_COUNT; 697 698 /** 699 * @brief Key for audio codec compression level, value type is int32_t. 700 * 701 * @syscap SystemCapability.Multimedia.Media.CodecBase 702 * @since 11 703 */ 704 extern const char *OH_MD_KEY_AUDIO_COMPRESSION_LEVEL; 705 /** 706 * @brief Key of the video is hdr vivid. value type is bool. 707 * 708 * @syscap SystemCapability.Multimedia.Media.CodecBase 709 * @since 11 710 */ 711 extern const char *OH_MD_KEY_VIDEO_IS_HDR_VIVID; 712 /** 713 * @brief Key for number of audio objects. value type is int32_t. 714 * 715 * @syscap SystemCapability.Multimedia.Media.CodecBase 716 * @since 11 717 */ 718 extern const char *OH_MD_KEY_AUDIO_OBJECT_NUMBER; 719 /** 720 * @brief Key for meta data of audio vivid. value type is a uint8_t pointer. 721 * 722 * @syscap SystemCapability.Multimedia.Media.CodecBase 723 * @since 11 724 */ 725 extern const char *OH_MD_KEY_AUDIO_VIVID_METADATA; 726 727 /** 728 * @brief Key for querying the maximum long-term reference count of video encoder, value type is int32_t. 729 * You should query the count through interface {@link OH_AVCapability_GetFeatureProperties} 730 * with enum {@link VIDEO_ENCODER_LONG_TERM_REFERENCE}. 731 * 732 * @syscap SystemCapability.Multimedia.Media.CodecBase 733 * @since 12 734 */ 735 extern const char *OH_FEATURE_PROPERTY_KEY_VIDEO_ENCODER_MAX_LTR_FRAME_COUNT; 736 /** 737 * @brief Key for enable the temporal scalability mode, value type is int32_t (0 or 1): 1 is enabled, 0 otherwise. 738 * The default value is 0. To query supported, you should use the interface {@link OH_AVCapability_IsFeatureSupported} 739 * with enum {@link VIDEO_ENCODER_TEMPORAL_SCALABILITY}. This is an optional key that applies only to video encoder. 740 * It is used in configure. 741 * 742 * @syscap SystemCapability.Multimedia.Media.CodecBase 743 * @since 12 744 */ 745 extern const char *OH_MD_KEY_VIDEO_ENCODER_ENABLE_TEMPORAL_SCALABILITY; 746 /** 747 * @brief Key for describing the temporal group of picture size, value type is int32_t. It takes effect only when 748 * temporal level scale is enable. This is an optional key that applies only to video encoder. It is used in configure. 749 * 750 * @syscap SystemCapability.Multimedia.Media.CodecBase 751 * @since 12 752 */ 753 extern const char *OH_MD_KEY_VIDEO_ENCODER_TEMPORAL_GOP_SIZE; 754 /** 755 * @brief Key for describing the reference mode in temporal group of picture, value type is int32_t, see enum 756 * {@link OH_TemporalGopReferenceMode}. It takes effect only when temporal level sacle is enabled. 757 * This is an optional key that applies only to video encoder. It is used in configure. 758 * 759 * @syscap SystemCapability.Multimedia.Media.CodecBase 760 * @since 12 761 */ 762 extern const char *OH_MD_KEY_VIDEO_ENCODER_TEMPORAL_GOP_REFERENCE_MODE; 763 /** 764 * @brief Key for describing the count of used long-term reference frames, value type is int32_t, must be within the 765 * supported range. To get supported range, you should query wthether the capability is supported through the interface 766 * {@link OH_AVCapability_GetFeatureProperties} with enum {@link VIDEO_ENCODER_LONG_TERM_REFERENCE}, otherwise, not set 767 * the key. This is an optional key that applies only to video encoder. It is used in configure. 768 * 769 * @syscap SystemCapability.Multimedia.Media.CodecBase 770 * @since 12 771 */ 772 extern const char *OH_MD_KEY_VIDEO_ENCODER_LTR_FRAME_COUNT; 773 /** 774 * @brief Key for describing mark this frame as a long term reference frame, value type is int32_t (0 or 1): 1 is mark, 775 * 0 otherwise. It takes effect only when the number of used long term reference frames is configured. This is an 776 * optional key that applies only to video encoder input loop. It takes effect immediately. 777 * 778 * @syscap SystemCapability.Multimedia.Media.CodecBase 779 * @since 12 780 */ 781 extern const char *OH_MD_KEY_VIDEO_ENCODER_PER_FRAME_MARK_LTR; 782 /** 783 * @brief Key for describing the long term reference frame poc referenced by this frame, value type is int32_t. This is 784 * an optional key that applies only to video encoder input loop. It takes effect immediately. 785 * 786 * @syscap SystemCapability.Multimedia.Media.CodecBase 787 * @since 12 788 */ 789 extern const char *OH_MD_KEY_VIDEO_ENCODER_PER_FRAME_USE_LTR; 790 /** 791 * @brief Key for indicating this frame is a long-term reference frame, value type is int32_t (0 or 1): 1 is LTR, 792 * 0 otherwise. This is an optional key that applies only to video encoder output loop. 793 * It indicates the attribute of the frame. 794 * 795 * @syscap SystemCapability.Multimedia.Media.CodecBase 796 * @since 12 797 */ 798 extern const char *OH_MD_KEY_VIDEO_PER_FRAME_IS_LTR; 799 /** 800 * @brief Key for describing the frame poc, value type is int32_t. This is an optional key that applies only to video 801 * encoder output loop. It indicates the attribute of the frame. 802 * 803 * @syscap SystemCapability.Multimedia.Media.CodecBase 804 * @since 12 805 */ 806 extern const char *OH_MD_KEY_VIDEO_PER_FRAME_POC; 807 /** 808 * @brief Key for describing the top-coordinate (y) of the crop rectangle, value type is int32_t. This is the top-most 809 * row included in the crop frame, where row indices start at 0. 810 * 811 * @syscap SystemCapability.Multimedia.Media.CodecBase 812 * @since 12 813 */ 814 extern const char *OH_MD_KEY_VIDEO_CROP_TOP; 815 /** 816 * @brief Key for describing the bottom-coordinate (y) of the crop rectangle, value type is int32_t. This is the 817 * bottom-most row included in the crop frame, where row indices start at 0. 818 * 819 * @syscap SystemCapability.Multimedia.Media.CodecBase 820 * @since 12 821 */ 822 extern const char *OH_MD_KEY_VIDEO_CROP_BOTTOM; 823 /** 824 * @brief Key for describing the left-coordinate (x) of the crop rectangle, value type is int32_t. 825 * This is the left-most column included in the crop frame, where column indices start at 0. 826 * 827 * @syscap SystemCapability.Multimedia.Media.CodecBase 828 * @since 12 829 */ 830 extern const char *OH_MD_KEY_VIDEO_CROP_LEFT; 831 /** 832 * @brief Key for describing the right-coordinate (x) of the crop rectangle, value type is int32_t. This is the 833 * right-most column included in the crop frame, where column indices start at 0. 834 * 835 * @syscap SystemCapability.Multimedia.Media.CodecBase 836 * @since 12 837 */ 838 extern const char *OH_MD_KEY_VIDEO_CROP_RIGHT; 839 /** 840 * @brief Key for describing the stride of the video buffer layout, value type is int32_t. Stride (or row increment) is 841 * the difference between the index of a pixel and that of the pixel directly underneath. For YUV 420 formats, the 842 * stride corresponds to the Y plane; the stride of the U and V planes can be calculated based on the color format, 843 * though it is generally undefined and depends on the device and release. 844 * 845 * @syscap SystemCapability.Multimedia.Media.CodecBase 846 * @since 12 847 */ 848 extern const char *OH_MD_KEY_VIDEO_STRIDE; 849 /** 850 * @brief Key for describing the plane height of a multi-planar (YUV) video buffer layout, value type is int32_t. 851 * Slice height (or plane height/vertical stride) is the number of rows that must be skipped to get from 852 * the top of the Y plane to the top of the U plane in the buffer. In essence the offset of the U plane 853 * is sliceHeight * stride. The height of the U/V planes can be calculated based on the color format, 854 * though it is generally undefined and depends on the device and release. 855 * 856 * @syscap SystemCapability.Multimedia.Media.CodecBase 857 * @since 12 858 */ 859 extern const char *OH_MD_KEY_VIDEO_SLICE_HEIGHT; 860 /** 861 * @brief Key for describing the valid picture width of the video, value type is int32_t. 862 * Get the value from an OH_AVFormat instance, which obtained by calling {@link OH_VideoDecoder_GetOutputDescription} 863 * or {@link OH_AVCodecOnStreamChanged}. 864 * 865 * @syscap SystemCapability.Multimedia.Media.CodecBase 866 * @since 12 867 */ 868 extern const char *OH_MD_KEY_VIDEO_PIC_WIDTH; 869 /** 870 * @brief Key for describing the valid picture height of the video, value type is int32_t. 871 * Get the value from an OH_AVFormat instance, which obtained by calling {@link OH_VideoDecoder_GetOutputDescription} 872 * or {@link OH_AVCodecOnStreamChanged}. 873 * 874 * @syscap SystemCapability.Multimedia.Media.CodecBase 875 * @since 12 876 */ 877 extern const char *OH_MD_KEY_VIDEO_PIC_HEIGHT; 878 /** 879 * @brief Key to enable the low latency mode, value type is int32_t (0 or 1):1 is enabled, 0 otherwise. 880 * If enabled, the video encoder or video decoder doesn't hold input and output data more than required by 881 * the codec standards. This is an optional key that applies only to video encoder or video decoder. 882 * It is used in configure. 883 * 884 * @syscap SystemCapability.Multimedia.Media.CodecBase 885 * @since 12 886 */ 887 extern const char *OH_MD_KEY_VIDEO_ENABLE_LOW_LATENCY; 888 /** 889 * @brief Key for describing the maximum quantization parameter allowed for video encoder, value type is int32_t. 890 * It is used in configure/setparameter or takes effect immediately with the frame. 891 * 892 * @syscap SystemCapability.Multimedia.Media.CodecBase 893 * @since 12 894 */ 895 extern const char *OH_MD_KEY_VIDEO_ENCODER_QP_MAX; 896 /** 897 * @brief Key for describing the minimum quantization parameter allowed for video encoder, value type is int32_t. 898 * It is used in configure/setparameter or takes effect immediately with the frame. 899 * 900 * @syscap SystemCapability.Multimedia.Media.CodecBase 901 * @since 12 902 */ 903 extern const char *OH_MD_KEY_VIDEO_ENCODER_QP_MIN; 904 /** 905 * @brief Key for describing the video frame averge quantization parameter, value type is int32_t. 906 * This is a part of a video encoder statistics export feature. This value is emitted from video encoder for a video 907 * frame. 908 * 909 * @syscap SystemCapability.Multimedia.Media.CodecBase 910 * @since 12 911 */ 912 extern const char *OH_MD_KEY_VIDEO_ENCODER_QP_AVERAGE; 913 /** 914 * @brief Key for describing video frame mean squared error, value type is double. 915 * This is a part of a video encoder statistics export feature. This value is emitted from video encoder for a video 916 * frame. 917 * 918 * @syscap SystemCapability.Multimedia.Media.CodecBase 919 * @since 12 920 */ 921 extern const char *OH_MD_KEY_VIDEO_ENCODER_MSE; 922 /** 923 * @brief Key for decoding timestamp of the buffer in microseconds, value type is int64_t. 924 * 925 * @syscap SystemCapability.Multimedia.Media.CodecBase 926 * @since 12 927 */ 928 extern const char *OH_MD_KEY_DECODING_TIMESTAMP; 929 /** 930 * @brief Key for duration of the buffer in microseconds, value type is int64_t. 931 * 932 * @syscap SystemCapability.Multimedia.Media.CodecBase 933 * @since 12 934 */ 935 extern const char *OH_MD_KEY_BUFFER_DURATION; 936 /** 937 * @brief Key for sample aspect ratio, value type is double. 938 * 939 * @syscap SystemCapability.Multimedia.Media.CodecBase 940 * @since 12 941 */ 942 extern const char *OH_MD_KEY_VIDEO_SAR; 943 /** 944 * @brief Key for start time of file, value type is int64_t. 945 * 946 * @syscap SystemCapability.Multimedia.Media.CodecBase 947 * @since 12 948 */ 949 extern const char *OH_MD_KEY_START_TIME; 950 /** 951 * @brief Key for start time of track, value type is int64_t. 952 * 953 * @syscap SystemCapability.Multimedia.Media.CodecBase 954 * @since 12 955 */ 956 extern const char *OH_MD_KEY_TRACK_START_TIME; 957 /** 958 * @brief Key for setting the output color space of video decoder. The value type is int32_t. 959 * The supported value is {@link OH_COLORSPACE_BT709_LIMIT}, see {@link OH_NativeBuffer_ColorSpace}. It is used in 960 * {@link OH_VideoDecoder_Configure}. If the color space conversion capability is supported and this key is configured, 961 * the video decoder will automatically transcode an HDR Vivid video to an SDR video with color space BT709. 962 * If color space conversion capability is not supported, {@link OH_VideoDecoder_Configure} returns 963 * {@link AV_ERR_VIDEO_UNSUPPORTED_COLOR_SPACE_CONVERSION}. 964 * If the input video is not an HDR vivid video, an error {@link AV_ERR_VIDEO_UNSUPPORTED_COLOR_SPACE_CONVERSION} will 965 * be reported by callback function {@link OH_AVCodecOnError}. 966 * 967 * @syscap SystemCapability.Multimedia.Media.CodecBase 968 * @since 12 969 */ 970 extern const char *OH_MD_KEY_VIDEO_DECODER_OUTPUT_COLOR_SPACE; 971 972 /** 973 * @brief Key for creation timestamp of a media file, value type is string. 974 * 975 * @syscap SystemCapability.Multimedia.Media.CodecBase 976 * @since 14 977 */ 978 extern const char *OH_MD_KEY_CREATION_TIME; 979 980 /** 981 * @brief Media type. 982 * 983 * @syscap SystemCapability.Multimedia.Media.CodecBase 984 * @since 9 985 */ 986 typedef enum OH_MediaType { 987 /* track is audio. */ 988 MEDIA_TYPE_AUD = 0, 989 /* track is video. */ 990 MEDIA_TYPE_VID = 1, 991 /** track is subtitle. 992 * @since 12 993 */ 994 MEDIA_TYPE_SUBTITLE = 2, 995 } OH_MediaType; 996 997 /** 998 * @brief AAC Profile 999 * 1000 * @syscap SystemCapability.Multimedia.Media.CodecBase 1001 * @since 9 1002 */ 1003 typedef enum OH_AACProfile { 1004 AAC_PROFILE_LC = 0, 1005 /** 1006 * High-Efficiency AAC profile, contain the audio object types: AAC LC, SBR 1007 * @since 14 1008 */ 1009 AAC_PROFILE_HE = 3, 1010 /** 1011 * High-Efficiency AAC v2 profile, contain the audio object types: AAC LC, SBR, PS 1012 * @since 14 1013 */ 1014 AAC_PROFILE_HE_V2 = 4, 1015 } OH_AACProfile; 1016 1017 /** 1018 * @brief AVC Profile 1019 * 1020 * @syscap SystemCapability.Multimedia.Media.CodecBase 1021 * @since 9 1022 */ 1023 typedef enum OH_AVCProfile { 1024 AVC_PROFILE_BASELINE = 0, 1025 AVC_PROFILE_HIGH = 4, 1026 AVC_PROFILE_MAIN = 8, 1027 } OH_AVCProfile; 1028 1029 /** 1030 * @brief HEVC Profile 1031 * 1032 * @syscap SystemCapability.Multimedia.Media.CodecBase 1033 * @since 10 1034 */ 1035 typedef enum OH_HEVCProfile { 1036 HEVC_PROFILE_MAIN = 0, 1037 HEVC_PROFILE_MAIN_10 = 1, 1038 HEVC_PROFILE_MAIN_STILL = 2, 1039 /** 1040 * @deprecated since 14 1041 */ 1042 HEVC_PROFILE_MAIN_10_HDR10 = 3, 1043 /** 1044 * @deprecated since 14 1045 */ 1046 HEVC_PROFILE_MAIN_10_HDR10_PLUS = 4, 1047 } OH_HEVCProfile; 1048 1049 /** 1050 * @brief Enumerates the muxer output file format 1051 * 1052 * @syscap SystemCapability.Multimedia.Media.CodecBase 1053 * @since 10 1054 */ 1055 typedef enum OH_AVOutputFormat { 1056 AV_OUTPUT_FORMAT_DEFAULT = 0, 1057 AV_OUTPUT_FORMAT_MPEG_4 = 2, 1058 AV_OUTPUT_FORMAT_M4A = 6, 1059 /** 1060 * The muxer output amr file format. 1061 * @since 12 1062 */ 1063 AV_OUTPUT_FORMAT_AMR = 8, 1064 /** 1065 * The muxer output mp3 file format. 1066 * @since 12 1067 */ 1068 AV_OUTPUT_FORMAT_MP3 = 9, 1069 /** 1070 * The muxer output wav file format. 1071 * @since 12 1072 */ 1073 AV_OUTPUT_FORMAT_WAV = 10, 1074 } OH_AVOutputFormat; 1075 1076 /** 1077 * @brief Seek Mode 1078 * 1079 * @syscap SystemCapability.Multimedia.Media.CodecBase 1080 * @since 10 1081 */ 1082 typedef enum OH_AVSeekMode { 1083 /* seek to sync sample after the time */ 1084 SEEK_MODE_NEXT_SYNC = 0, 1085 /* seek to sync sample before the time */ 1086 SEEK_MODE_PREVIOUS_SYNC, 1087 /* seek to sync sample closest to time */ 1088 SEEK_MODE_CLOSEST_SYNC, 1089 } OH_AVSeekMode; 1090 1091 /** 1092 * @brief Scaling Mode 1093 * 1094 * @syscap SystemCapability.Multimedia.Media.CodecBase 1095 * @deprecated since 14 1096 * @useinstead OHScalingModeV2 1097 * @since 10 1098 */ 1099 typedef enum OH_ScalingMode { 1100 /** 1101 * @deprecated since 14 1102 * @useinstead OH_SCALING_MODE_SCALE_TO_WINDOW_V2 1103 */ 1104 SCALING_MODE_SCALE_TO_WINDOW = 1, 1105 /** 1106 * @deprecated since 14 1107 * @useinstead OH_SCALING_MODE_SCALE_CROP_V2 1108 */ 1109 SCALING_MODE_SCALE_CROP = 2, 1110 } OH_ScalingMode; 1111 1112 /** 1113 * @brief enum Audio Bits Per Coded Sample 1114 * 1115 * @syscap SystemCapability.Multimedia.Media.CodecBase 1116 * @since 10 1117 */ 1118 typedef enum OH_BitsPerSample { 1119 SAMPLE_U8 = 0, 1120 SAMPLE_S16LE = 1, 1121 SAMPLE_S24LE = 2, 1122 SAMPLE_S32LE = 3, 1123 SAMPLE_F32LE = 4, 1124 SAMPLE_U8P = 5, 1125 SAMPLE_S16P = 6, 1126 SAMPLE_S24P = 7, 1127 SAMPLE_S32P = 8, 1128 SAMPLE_F32P = 9, 1129 INVALID_WIDTH = -1 1130 } OH_BitsPerSample; 1131 1132 /** 1133 * @brief Color Primary 1134 * 1135 * @syscap SystemCapability.Multimedia.Media.CodecBase 1136 * @since 10 1137 */ 1138 typedef enum OH_ColorPrimary { 1139 COLOR_PRIMARY_BT709 = 1, 1140 COLOR_PRIMARY_UNSPECIFIED = 2, 1141 COLOR_PRIMARY_BT470_M = 4, 1142 COLOR_PRIMARY_BT601_625 = 5, 1143 COLOR_PRIMARY_BT601_525 = 6, 1144 COLOR_PRIMARY_SMPTE_ST240 = 7, 1145 COLOR_PRIMARY_GENERIC_FILM = 8, 1146 COLOR_PRIMARY_BT2020 = 9, 1147 COLOR_PRIMARY_SMPTE_ST428 = 10, 1148 COLOR_PRIMARY_P3DCI = 11, 1149 COLOR_PRIMARY_P3D65 = 12, 1150 } OH_ColorPrimary; 1151 1152 /** 1153 * @brief Transfer Characteristic 1154 * 1155 * @syscap SystemCapability.Multimedia.Media.CodecBase 1156 * @since 10 1157 */ 1158 typedef enum OH_TransferCharacteristic { 1159 TRANSFER_CHARACTERISTIC_BT709 = 1, 1160 TRANSFER_CHARACTERISTIC_UNSPECIFIED = 2, 1161 TRANSFER_CHARACTERISTIC_GAMMA_2_2 = 4, 1162 TRANSFER_CHARACTERISTIC_GAMMA_2_8 = 5, 1163 TRANSFER_CHARACTERISTIC_BT601 = 6, 1164 TRANSFER_CHARACTERISTIC_SMPTE_ST240 = 7, 1165 TRANSFER_CHARACTERISTIC_LINEAR = 8, 1166 TRANSFER_CHARACTERISTIC_LOG = 9, 1167 TRANSFER_CHARACTERISTIC_LOG_SQRT = 10, 1168 TRANSFER_CHARACTERISTIC_IEC_61966_2_4 = 11, 1169 TRANSFER_CHARACTERISTIC_BT1361 = 12, 1170 TRANSFER_CHARACTERISTIC_IEC_61966_2_1 = 13, 1171 TRANSFER_CHARACTERISTIC_BT2020_10BIT = 14, 1172 TRANSFER_CHARACTERISTIC_BT2020_12BIT = 15, 1173 TRANSFER_CHARACTERISTIC_PQ = 16, 1174 TRANSFER_CHARACTERISTIC_SMPTE_ST428 = 17, 1175 TRANSFER_CHARACTERISTIC_HLG = 18, 1176 } OH_TransferCharacteristic; 1177 1178 /** 1179 * @brief Matrix Coefficient 1180 * 1181 * @syscap SystemCapability.Multimedia.Media.CodecBase 1182 * @since 10 1183 */ 1184 typedef enum OH_MatrixCoefficient { 1185 MATRIX_COEFFICIENT_IDENTITY = 0, 1186 MATRIX_COEFFICIENT_BT709 = 1, 1187 MATRIX_COEFFICIENT_UNSPECIFIED = 2, 1188 MATRIX_COEFFICIENT_FCC = 4, 1189 MATRIX_COEFFICIENT_BT601_625 = 5, 1190 MATRIX_COEFFICIENT_BT601_525 = 6, 1191 MATRIX_COEFFICIENT_SMPTE_ST240 = 7, 1192 MATRIX_COEFFICIENT_YCGCO = 8, 1193 MATRIX_COEFFICIENT_BT2020_NCL = 9, 1194 MATRIX_COEFFICIENT_BT2020_CL = 10, 1195 MATRIX_COEFFICIENT_SMPTE_ST2085 = 11, 1196 MATRIX_COEFFICIENT_CHROMATICITY_NCL = 12, 1197 MATRIX_COEFFICIENT_CHROMATICITY_CL = 13, 1198 MATRIX_COEFFICIENT_ICTCP = 14, 1199 } OH_MatrixCoefficient; 1200 1201 /** 1202 * @brief AVC Level. 1203 * 1204 * @syscap SystemCapability.Multimedia.Media.CodecBase 1205 * @since 12 1206 */ 1207 typedef enum OH_AVCLevel { 1208 AVC_LEVEL_1 = 0, 1209 AVC_LEVEL_1b = 1, 1210 AVC_LEVEL_11 = 2, 1211 AVC_LEVEL_12 = 3, 1212 AVC_LEVEL_13 = 4, 1213 AVC_LEVEL_2 = 5, 1214 AVC_LEVEL_21 = 6, 1215 AVC_LEVEL_22 = 7, 1216 AVC_LEVEL_3 = 8, 1217 AVC_LEVEL_31 = 9, 1218 AVC_LEVEL_32 = 10, 1219 AVC_LEVEL_4 = 11, 1220 AVC_LEVEL_41 = 12, 1221 AVC_LEVEL_42 = 13, 1222 AVC_LEVEL_5 = 14, 1223 AVC_LEVEL_51 = 15, 1224 AVC_LEVEL_52 = 16, 1225 AVC_LEVEL_6 = 17, 1226 AVC_LEVEL_61 = 18, 1227 AVC_LEVEL_62 = 19, 1228 } OH_AVCLevel; 1229 1230 /** 1231 * @brief HEVC Level. 1232 * 1233 * @syscap SystemCapability.Multimedia.Media.CodecBase 1234 * @since 12 1235 */ 1236 typedef enum OH_HEVCLevel { 1237 HEVC_LEVEL_1 = 0, 1238 HEVC_LEVEL_2 = 1, 1239 HEVC_LEVEL_21 = 2, 1240 HEVC_LEVEL_3 = 3, 1241 HEVC_LEVEL_31 = 4, 1242 HEVC_LEVEL_4 = 5, 1243 HEVC_LEVEL_41 = 6, 1244 HEVC_LEVEL_5 = 7, 1245 HEVC_LEVEL_51 = 8, 1246 HEVC_LEVEL_52 = 9, 1247 HEVC_LEVEL_6 = 10, 1248 HEVC_LEVEL_61 = 11, 1249 HEVC_LEVEL_62 = 12, 1250 } OH_HEVCLevel; 1251 1252 /** 1253 * @brief The reference mode in temporal group of picture. 1254 * 1255 * @syscap SystemCapability.Multimedia.Media.CodecBase 1256 * @since 12 1257 */ 1258 typedef enum OH_TemporalGopReferenceMode { 1259 /** Refer to latest short-term reference frame. */ 1260 ADJACENT_REFERENCE = 0, 1261 /** Refer to latest long-term reference frame. */ 1262 JUMP_REFERENCE = 1, 1263 /** Uniformly scaled reference structure, which has even distribution of video frames after drop the highest 1264 * enhance layer. The temporal group of pictures must be power of 2. */ 1265 UNIFORMLY_SCALED_REFERENCE = 2, 1266 } OH_TemporalGopReferenceMode; 1267 1268 /** 1269 * @brief The bitrate mode of encoder. 1270 * 1271 * Change the location of the header file, since 14. 1272 * 1273 * @syscap SystemCapability.Multimedia.Media.CodecBase 1274 * @since 10 1275 */ 1276 typedef enum OH_BitrateMode { 1277 /** Constant Bit rate mode. */ 1278 BITRATE_MODE_CBR = 0, 1279 /** Variable Bit rate mode. */ 1280 BITRATE_MODE_VBR = 1, 1281 /** Constant Quality mode. */ 1282 BITRATE_MODE_CQ = 2 1283 } OH_BitrateMode; 1284 1285 #ifdef __cplusplus 1286 } 1287 #endif 1288 1289 #endif // NATIVE_AVCODEC_BASE_H 1290 /** @} */