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 Enumerates the mime type of audio raw stream. 360 * 361 * @syscap SystemCapability.Multimedia.Media.CodecBase 362 * @since 18 363 */ 364 extern const char *OH_AVCODEC_MIMETYPE_AUDIO_RAW; 365 /** 366 * @brief Enumerates the MIME type of video mpeg2 codec. 367 * 368 * @syscap SystemCapability.Multimedia.Media.CodecBase 369 * @since 17 370 */ 371 extern const char *OH_AVCODEC_MIMETYPE_VIDEO_MPEG2; 372 /** 373 * @brief Enumerates the MIME type of video mpeg4 part2 codec. 374 * 375 * @syscap SystemCapability.Multimedia.Media.CodecBase 376 * @since 17 377 */ 378 extern const char *OH_AVCODEC_MIMETYPE_VIDEO_MPEG4_PART2; 379 380 /** 381 * @brief Enumerates the MIME type of video h263 codec. 382 * 383 * @syscap SystemCapability.Multimedia.Media.CodecBase 384 * @since 17 385 */ 386 extern const char *OH_AVCODEC_MIMETYPE_VIDEO_H263; 387 388 /** 389 * @brief Key for timeStamp in surface's extraData, value type is int64_t. 390 * 391 * @syscap SystemCapability.Multimedia.Media.CodecBase 392 * @deprecated since 14 393 * @since 9 394 */ 395 extern const char *OH_ED_KEY_TIME_STAMP; 396 /** 397 * @brief Key for endOfStream in surface's extraData, value type is bool. 398 * 399 * @syscap SystemCapability.Multimedia.Media.CodecBase 400 * @deprecated since 14 401 * @since 9 402 */ 403 extern const char *OH_ED_KEY_EOS; 404 405 /** 406 * @brief Key for track type, value type is int32_t, see {@link OH_MediaType}. 407 * 408 * @syscap SystemCapability.Multimedia.Media.CodecBase 409 * @since 9 410 */ 411 extern const char *OH_MD_KEY_TRACK_TYPE; 412 /** 413 * @brief Key for codec mime type, value type is string. 414 * 415 * @syscap SystemCapability.Multimedia.Media.CodecBase 416 * @since 9 417 */ 418 extern const char *OH_MD_KEY_CODEC_MIME; 419 /** 420 * @brief Key for file duration in microseconds, value type is int64_t. 421 * 422 * @syscap SystemCapability.Multimedia.Media.CodecBase 423 * @since 9 424 */ 425 extern const char *OH_MD_KEY_DURATION; 426 /** 427 * @brief Key for bitrate, value type is int64_t. 428 * 429 * @syscap SystemCapability.Multimedia.Media.CodecBase 430 * @since 9 431 */ 432 extern const char *OH_MD_KEY_BITRATE; 433 /** 434 * @brief Key for max input size, value type is int32_t. 435 * 436 * @syscap SystemCapability.Multimedia.Media.CodecBase 437 * @since 9 438 */ 439 extern const char *OH_MD_KEY_MAX_INPUT_SIZE; 440 /** 441 * @brief Key for video width, value type is int32_t. 442 * 443 * @syscap SystemCapability.Multimedia.Media.CodecBase 444 * @since 9 445 */ 446 extern const char *OH_MD_KEY_WIDTH; 447 /** 448 * @brief Key for video height, value type is int32_t. 449 * 450 * @syscap SystemCapability.Multimedia.Media.CodecBase 451 * @since 9 452 */ 453 extern const char *OH_MD_KEY_HEIGHT; 454 /** 455 * @brief Key for video pixel format, value type is int32_t, see {@link OH_AVPixelFormat}. 456 * 457 * @syscap SystemCapability.Multimedia.Media.CodecBase 458 * @since 9 459 */ 460 extern const char *OH_MD_KEY_PIXEL_FORMAT; 461 /** 462 * @brief key for audio raw format, value type is int32_t , see {@link OH_BitsPerSample}. 463 * 464 * @syscap SystemCapability.Multimedia.Media.CodecBase 465 * @since 9 466 */ 467 extern const char *OH_MD_KEY_AUDIO_SAMPLE_FORMAT; 468 /** 469 * @brief Key for video frame rate, value type is double. 470 * 471 * @syscap SystemCapability.Multimedia.Media.CodecBase 472 * @since 9 473 */ 474 extern const char *OH_MD_KEY_FRAME_RATE; 475 /** 476 * @brief video encode bitrate mode, the value type is int32_t, see {@link OH_VideoEncodeBitrateMode}. 477 * 478 * @syscap SystemCapability.Multimedia.Media.CodecBase 479 * @since 9 480 */ 481 extern const char *OH_MD_KEY_VIDEO_ENCODE_BITRATE_MODE; 482 /** 483 * @brief encode profile, the value type is int32_t. see {@link OH_AVCProfile}, {@link OH_HEVCProfile}, 484 * {@link OH_AACProfile}. 485 * 486 * @syscap SystemCapability.Multimedia.Media.CodecBase 487 * @since 9 488 */ 489 extern const char *OH_MD_KEY_PROFILE; 490 /** 491 * @brief Key for audio channel count, value type is int32_t. 492 * 493 * @syscap SystemCapability.Multimedia.Media.CodecBase 494 * @since 9 495 */ 496 extern const char *OH_MD_KEY_AUD_CHANNEL_COUNT; 497 /** 498 * @brief Key for audio sample rate, value type is int32_t. 499 * 500 * @syscap SystemCapability.Multimedia.Media.CodecBase 501 * @since 9 502 */ 503 extern const char *OH_MD_KEY_AUD_SAMPLE_RATE; 504 /** 505 * @brief Key for the interval of key frame. value type is int32_t, the unit is milliseconds. A negative value means no 506 * key frames are requested after the first frame. A zero value means a stream containing all key frames is requested. 507 * 508 * @syscap SystemCapability.Multimedia.Media.CodecBase 509 * @since 9 510 */ 511 extern const char *OH_MD_KEY_I_FRAME_INTERVAL; 512 /** 513 * @brief Key of the surface rotation angle. value type is int32_t: should be {0, 90, 180, 270}, default is 0. 514 * 515 * @syscap SystemCapability.Multimedia.Media.CodecBase 516 * @since 9 517 */ 518 extern const char *OH_MD_KEY_ROTATION; 519 520 /** 521 * @brief Key for video YUV value range flag, value type is bool, true for full range, false for limited range. 522 * 523 * @syscap SystemCapability.Multimedia.Media.CodecBase 524 * @since 10 525 */ 526 extern const char *OH_MD_KEY_RANGE_FLAG; 527 /** 528 * @brief Key for video color primaries, value type is int32_t, see {@link OH_ColorPrimary}. 529 * 530 * @syscap SystemCapability.Multimedia.Media.CodecBase 531 * @since 10 532 */ 533 extern const char *OH_MD_KEY_COLOR_PRIMARIES; 534 /** 535 * @brief Key for video transfer characteristics, value type is int32_t, see {@link OH_TransferCharacteristic}. 536 * 537 * @syscap SystemCapability.Multimedia.Media.CodecBase 538 * @since 10 539 */ 540 extern const char *OH_MD_KEY_TRANSFER_CHARACTERISTICS; 541 /** 542 * @brief Key for video matrix coefficients, value type is int32_t, see {@link OH_MatrixCoefficient}. 543 * 544 * @syscap SystemCapability.Multimedia.Media.CodecBase 545 * @since 10 546 */ 547 extern const char *OH_MD_KEY_MATRIX_COEFFICIENTS; 548 /** 549 * @brief Key for the request an I-Frame immediately, value type is bool. 550 * 551 * @syscap SystemCapability.Multimedia.Media.CodecBase 552 * @since 10 553 */ 554 extern const char *OH_MD_KEY_REQUEST_I_FRAME; 555 /** 556 * @brief Key for the desired encoding quality, value type is int32_t, this key is only. 557 * supported for encoders that are configured in constant quality mode. 558 * 559 * @syscap SystemCapability.Multimedia.Media.CodecBase 560 * @since 10 561 */ 562 extern const char *OH_MD_KEY_QUALITY; 563 /** 564 * @brief Key of the codec specific data. value type is a uint8_t pointer. 565 * 566 * @syscap SystemCapability.Multimedia.Media.CodecBase 567 * @since 10 568 */ 569 extern const char *OH_MD_KEY_CODEC_CONFIG; 570 /** 571 * @brief source format Key for title, value type is string. 572 * 573 * @syscap SystemCapability.Multimedia.Media.CodecBase 574 * @since 10 575 */ 576 extern const char *OH_MD_KEY_TITLE; 577 /** 578 * @brief source format Key for artist, value type is string. 579 * 580 * @syscap SystemCapability.Multimedia.Media.CodecBase 581 * @since 10 582 */ 583 extern const char *OH_MD_KEY_ARTIST; 584 /** 585 * @brief source format Key for album, value type is string. 586 * 587 * @syscap SystemCapability.Multimedia.Media.CodecBase 588 * @since 10 589 */ 590 extern const char *OH_MD_KEY_ALBUM; 591 /** 592 * @brief source format Key for album artist, value type is string. 593 * 594 * @syscap SystemCapability.Multimedia.Media.CodecBase 595 * @since 10 596 */ 597 extern const char *OH_MD_KEY_ALBUM_ARTIST; 598 /** 599 * @brief source format Key for date, value type is string. 600 * 601 * @syscap SystemCapability.Multimedia.Media.CodecBase 602 * @since 10 603 */ 604 extern const char *OH_MD_KEY_DATE; 605 /** 606 * @brief source format Key for comment, value type is string. 607 * 608 * @syscap SystemCapability.Multimedia.Media.CodecBase 609 * @since 10 610 */ 611 extern const char *OH_MD_KEY_COMMENT; 612 /** 613 * @brief source format Key for genre, value type is string. 614 * 615 * @syscap SystemCapability.Multimedia.Media.CodecBase 616 * @since 10 617 */ 618 extern const char *OH_MD_KEY_GENRE; 619 /** 620 * @brief source format Key for copyright, value type is string. 621 * 622 * @syscap SystemCapability.Multimedia.Media.CodecBase 623 * @since 10 624 */ 625 extern const char *OH_MD_KEY_COPYRIGHT; 626 /** 627 * @brief source format Key for language, value type is string. 628 * 629 * @syscap SystemCapability.Multimedia.Media.CodecBase 630 * @since 10 631 */ 632 extern const char *OH_MD_KEY_LANGUAGE; 633 /** 634 * @brief source format Key for description, value type is string. 635 * 636 * @syscap SystemCapability.Multimedia.Media.CodecBase 637 * @since 10 638 */ 639 extern const char *OH_MD_KEY_DESCRIPTION; 640 /** 641 * @brief source format Key for lyrics, value type is string. 642 * 643 * @syscap SystemCapability.Multimedia.Media.CodecBase 644 * @since 10 645 */ 646 extern const char *OH_MD_KEY_LYRICS; 647 /** 648 * @brief source format Key for track count, value type is int32_t. 649 * 650 * @syscap SystemCapability.Multimedia.Media.CodecBase 651 * @since 10 652 */ 653 extern const char *OH_MD_KEY_TRACK_COUNT; 654 /** 655 * @brief Key for the desired encoding channel layout, value type is int64_t, this key is only supported for encoders. 656 * 657 * @syscap SystemCapability.Multimedia.Media.CodecBase 658 * @since 10 659 */ 660 extern const char *OH_MD_KEY_CHANNEL_LAYOUT; 661 /** 662 * @brief Key for bits per coded sample, value type is int32_t, supported for flac encoder, 663 * see {@link OH_BitsPerSample}. 664 * 665 * @syscap SystemCapability.Multimedia.Media.CodecBase 666 * @since 10 667 */ 668 extern const char *OH_MD_KEY_BITS_PER_CODED_SAMPLE; 669 /** 670 * @brief Key for the aac format, value type is int32_t, supported for aac decoder. 671 * 672 * @syscap SystemCapability.Multimedia.Media.CodecBase 673 * @since 10 674 */ 675 extern const char *OH_MD_KEY_AAC_IS_ADTS; 676 /** 677 * @brief Key for aac sbr mode, value type is int32_t, supported for aac encoder. 678 * 679 * @syscap SystemCapability.Multimedia.Media.CodecBase 680 * @since 10 681 */ 682 extern const char *OH_MD_KEY_SBR; 683 /** 684 * @brief Key for flac compliance level, value type is int32_t. 685 * 686 * @syscap SystemCapability.Multimedia.Media.CodecBase 687 * @since 10 688 */ 689 extern const char *OH_MD_KEY_COMPLIANCE_LEVEL; 690 /** 691 * @brief Key for vorbis identification header, value type is a uint8_t pointer, supported only for vorbis decoder. 692 * 693 * @syscap SystemCapability.Multimedia.Media.CodecBase 694 * @since 10 695 */ 696 extern const char *OH_MD_KEY_IDENTIFICATION_HEADER; 697 /** 698 * @brief Key for vorbis setup header, value type is a uint8_t pointer, supported only for vorbis decoder. 699 * 700 * @syscap SystemCapability.Multimedia.Media.CodecBase 701 * @since 10 702 */ 703 extern const char *OH_MD_KEY_SETUP_HEADER; 704 /** 705 * @brief Key for video scale type, value type is int32_t, see {@link OH_ScalingMode}. 706 * 707 * @syscap SystemCapability.Multimedia.Media.CodecBase 708 * @deprecated since 14 709 * @useinstead OH_NativeWindow_NativeWindowSetScalingModeV2 710 * @since 10 711 */ 712 extern const char *OH_MD_KEY_SCALING_MODE; 713 /** 714 * @brief Key for max input buffer count, value type is int32_t. 715 * 716 * @syscap SystemCapability.Multimedia.Media.CodecBase 717 * @since 10 718 */ 719 extern const char *OH_MD_MAX_INPUT_BUFFER_COUNT; 720 /** 721 * @brief Key for max output buffer count, value type is int32_t. 722 * 723 * @syscap SystemCapability.Multimedia.Media.CodecBase 724 * @since 10 725 */ 726 extern const char *OH_MD_MAX_OUTPUT_BUFFER_COUNT; 727 728 /** 729 * @brief Key for audio codec compression level, value type is int32_t. 730 * 731 * @syscap SystemCapability.Multimedia.Media.CodecBase 732 * @since 11 733 */ 734 extern const char *OH_MD_KEY_AUDIO_COMPRESSION_LEVEL; 735 /** 736 * @brief Key of the video is hdr vivid. value type is bool. 737 * 738 * @syscap SystemCapability.Multimedia.Media.CodecBase 739 * @since 11 740 */ 741 extern const char *OH_MD_KEY_VIDEO_IS_HDR_VIVID; 742 /** 743 * @brief Key for number of audio objects. value type is int32_t. 744 * 745 * @syscap SystemCapability.Multimedia.Media.CodecBase 746 * @since 11 747 */ 748 extern const char *OH_MD_KEY_AUDIO_OBJECT_NUMBER; 749 /** 750 * @brief Key for meta data of audio vivid. value type is a uint8_t pointer. 751 * 752 * @syscap SystemCapability.Multimedia.Media.CodecBase 753 * @since 11 754 */ 755 extern const char *OH_MD_KEY_AUDIO_VIVID_METADATA; 756 757 /** 758 * @brief Key for querying the maximum long-term reference count of video encoder, value type is int32_t. 759 * You should query the count through interface {@link OH_AVCapability_GetFeatureProperties} 760 * with enum {@link VIDEO_ENCODER_LONG_TERM_REFERENCE}. 761 * 762 * @syscap SystemCapability.Multimedia.Media.CodecBase 763 * @since 12 764 */ 765 extern const char *OH_FEATURE_PROPERTY_KEY_VIDEO_ENCODER_MAX_LTR_FRAME_COUNT; 766 /** 767 * @brief Key for enable the temporal scalability mode, value type is int32_t (0 or 1): 1 is enabled, 0 otherwise. 768 * The default value is 0. To query supported, you should use the interface {@link OH_AVCapability_IsFeatureSupported} 769 * with enum {@link VIDEO_ENCODER_TEMPORAL_SCALABILITY}. This is an optional key that applies only to video encoder. 770 * It is used in configure. 771 * 772 * @syscap SystemCapability.Multimedia.Media.CodecBase 773 * @since 12 774 */ 775 extern const char *OH_MD_KEY_VIDEO_ENCODER_ENABLE_TEMPORAL_SCALABILITY; 776 /** 777 * @brief Key for describing the temporal group of picture size, value type is int32_t. It takes effect only when 778 * temporal level scale is enable. This is an optional key that applies only to video encoder. It is used in configure. 779 * 780 * @syscap SystemCapability.Multimedia.Media.CodecBase 781 * @since 12 782 */ 783 extern const char *OH_MD_KEY_VIDEO_ENCODER_TEMPORAL_GOP_SIZE; 784 /** 785 * @brief Key for describing the reference mode in temporal group of picture, value type is int32_t, see enum 786 * {@link OH_TemporalGopReferenceMode}. It takes effect only when temporal level sacle is enabled. 787 * This is an optional key that applies only to video encoder. It is used in configure. 788 * 789 * @syscap SystemCapability.Multimedia.Media.CodecBase 790 * @since 12 791 */ 792 extern const char *OH_MD_KEY_VIDEO_ENCODER_TEMPORAL_GOP_REFERENCE_MODE; 793 /** 794 * @brief Key for describing the count of used long-term reference frames, value type is int32_t, must be within the 795 * supported range. To get supported range, you should query wthether the capability is supported through the interface 796 * {@link OH_AVCapability_GetFeatureProperties} with enum {@link VIDEO_ENCODER_LONG_TERM_REFERENCE}, otherwise, not set 797 * the key. This is an optional key that applies only to video encoder. It is used in configure. 798 * 799 * @syscap SystemCapability.Multimedia.Media.CodecBase 800 * @since 12 801 */ 802 extern const char *OH_MD_KEY_VIDEO_ENCODER_LTR_FRAME_COUNT; 803 /** 804 * @brief Key for describing mark this frame as a long term reference frame, value type is int32_t (0 or 1): 1 is mark, 805 * 0 otherwise. It takes effect only when the number of used long term reference frames is configured. This is an 806 * optional key that applies only to video encoder input loop. It takes effect immediately. 807 * 808 * @syscap SystemCapability.Multimedia.Media.CodecBase 809 * @since 12 810 */ 811 extern const char *OH_MD_KEY_VIDEO_ENCODER_PER_FRAME_MARK_LTR; 812 /** 813 * @brief Key for describing the long term reference frame poc referenced by this frame, value type is int32_t. This is 814 * an optional key that applies only to video encoder input loop. It takes effect immediately. 815 * 816 * @syscap SystemCapability.Multimedia.Media.CodecBase 817 * @since 12 818 */ 819 extern const char *OH_MD_KEY_VIDEO_ENCODER_PER_FRAME_USE_LTR; 820 /** 821 * @brief Key for indicating this frame is a long-term reference frame, value type is int32_t (0 or 1): 1 is LTR, 822 * 0 otherwise. This is an optional key that applies only to video encoder output loop. 823 * It indicates the attribute of the frame. 824 * 825 * @syscap SystemCapability.Multimedia.Media.CodecBase 826 * @since 12 827 */ 828 extern const char *OH_MD_KEY_VIDEO_PER_FRAME_IS_LTR; 829 /** 830 * @brief Key for describing the frame poc, value type is int32_t. This is an optional key that applies only to video 831 * encoder output loop. It indicates the attribute of the frame. 832 * 833 * @syscap SystemCapability.Multimedia.Media.CodecBase 834 * @since 12 835 */ 836 extern const char *OH_MD_KEY_VIDEO_PER_FRAME_POC; 837 /** 838 * @brief Key for describing the top-coordinate (y) of the crop rectangle, value type is int32_t. This is the top-most 839 * row included in the crop frame, where row indices start at 0. 840 * 841 * @syscap SystemCapability.Multimedia.Media.CodecBase 842 * @since 12 843 */ 844 extern const char *OH_MD_KEY_VIDEO_CROP_TOP; 845 /** 846 * @brief Key for describing the bottom-coordinate (y) of the crop rectangle, value type is int32_t. This is the 847 * bottom-most row included in the crop frame, where row indices start at 0. 848 * 849 * @syscap SystemCapability.Multimedia.Media.CodecBase 850 * @since 12 851 */ 852 extern const char *OH_MD_KEY_VIDEO_CROP_BOTTOM; 853 /** 854 * @brief Key for describing the left-coordinate (x) of the crop rectangle, value type is int32_t. 855 * This is the left-most column included in the crop frame, where column indices start at 0. 856 * 857 * @syscap SystemCapability.Multimedia.Media.CodecBase 858 * @since 12 859 */ 860 extern const char *OH_MD_KEY_VIDEO_CROP_LEFT; 861 /** 862 * @brief Key for describing the right-coordinate (x) of the crop rectangle, value type is int32_t. This is the 863 * right-most column included in the crop frame, where column indices start at 0. 864 * 865 * @syscap SystemCapability.Multimedia.Media.CodecBase 866 * @since 12 867 */ 868 extern const char *OH_MD_KEY_VIDEO_CROP_RIGHT; 869 /** 870 * @brief Key for describing the stride of the video buffer layout, value type is int32_t. Stride (or row increment) is 871 * the difference between the index of a pixel and that of the pixel directly underneath. For YUV 420 formats, the 872 * stride corresponds to the Y plane; the stride of the U and V planes can be calculated based on the color format, 873 * though it is generally undefined and depends on the device and release. 874 * 875 * @syscap SystemCapability.Multimedia.Media.CodecBase 876 * @since 12 877 */ 878 extern const char *OH_MD_KEY_VIDEO_STRIDE; 879 /** 880 * @brief Key for describing the plane height of a multi-planar (YUV) video buffer layout, value type is int32_t. 881 * Slice height (or plane height/vertical stride) is the number of rows that must be skipped to get from 882 * the top of the Y plane to the top of the U plane in the buffer. In essence the offset of the U plane 883 * is sliceHeight * stride. The height of the U/V planes can be calculated based on the color format, 884 * though it is generally undefined and depends on the device and release. 885 * 886 * @syscap SystemCapability.Multimedia.Media.CodecBase 887 * @since 12 888 */ 889 extern const char *OH_MD_KEY_VIDEO_SLICE_HEIGHT; 890 /** 891 * @brief Key for describing the valid picture width of the video, value type is int32_t. 892 * Get the value from an OH_AVFormat instance, which obtained by calling {@link OH_VideoDecoder_GetOutputDescription} 893 * or {@link OH_AVCodecOnStreamChanged}. 894 * 895 * @syscap SystemCapability.Multimedia.Media.CodecBase 896 * @since 12 897 */ 898 extern const char *OH_MD_KEY_VIDEO_PIC_WIDTH; 899 /** 900 * @brief Key for describing the valid picture height of the video, value type is int32_t. 901 * Get the value from an OH_AVFormat instance, which obtained by calling {@link OH_VideoDecoder_GetOutputDescription} 902 * or {@link OH_AVCodecOnStreamChanged}. 903 * 904 * @syscap SystemCapability.Multimedia.Media.CodecBase 905 * @since 12 906 */ 907 extern const char *OH_MD_KEY_VIDEO_PIC_HEIGHT; 908 /** 909 * @brief Key to enable the low latency mode, value type is int32_t (0 or 1):1 is enabled, 0 otherwise. 910 * If enabled, the video encoder or video decoder doesn't hold input and output data more than required by 911 * the codec standards. This is an optional key that applies only to video encoder or video decoder. 912 * It is used in configure. 913 * 914 * @syscap SystemCapability.Multimedia.Media.CodecBase 915 * @since 12 916 */ 917 extern const char *OH_MD_KEY_VIDEO_ENABLE_LOW_LATENCY; 918 /** 919 * @brief Key for describing the maximum quantization parameter allowed for video encoder, value type is int32_t. 920 * It is used in configure/setparameter or takes effect immediately with the frame. 921 * 922 * @syscap SystemCapability.Multimedia.Media.CodecBase 923 * @since 12 924 */ 925 extern const char *OH_MD_KEY_VIDEO_ENCODER_QP_MAX; 926 /** 927 * @brief Key for describing the minimum quantization parameter allowed for video encoder, value type is int32_t. 928 * It is used in configure/setparameter or takes effect immediately with the frame. 929 * 930 * @syscap SystemCapability.Multimedia.Media.CodecBase 931 * @since 12 932 */ 933 extern const char *OH_MD_KEY_VIDEO_ENCODER_QP_MIN; 934 /** 935 * @brief Key for describing the video frame averge quantization parameter, value type is int32_t. 936 * This is a part of a video encoder statistics export feature. This value is emitted from video encoder for a video 937 * frame. 938 * 939 * @syscap SystemCapability.Multimedia.Media.CodecBase 940 * @since 12 941 */ 942 extern const char *OH_MD_KEY_VIDEO_ENCODER_QP_AVERAGE; 943 /** 944 * @brief Key for describing video frame mean squared error, value type is double. 945 * This is a part of a video encoder statistics export feature. This value is emitted from video encoder for a video 946 * frame. 947 * 948 * @syscap SystemCapability.Multimedia.Media.CodecBase 949 * @since 12 950 */ 951 extern const char *OH_MD_KEY_VIDEO_ENCODER_MSE; 952 /** 953 * @brief Key for decoding timestamp of the buffer in microseconds, value type is int64_t. 954 * 955 * @syscap SystemCapability.Multimedia.Media.CodecBase 956 * @since 12 957 */ 958 extern const char *OH_MD_KEY_DECODING_TIMESTAMP; 959 /** 960 * @brief Key for duration of the buffer in microseconds, value type is int64_t. 961 * 962 * @syscap SystemCapability.Multimedia.Media.CodecBase 963 * @since 12 964 */ 965 extern const char *OH_MD_KEY_BUFFER_DURATION; 966 /** 967 * @brief Key for sample aspect ratio, value type is double. 968 * 969 * @syscap SystemCapability.Multimedia.Media.CodecBase 970 * @since 12 971 */ 972 extern const char *OH_MD_KEY_VIDEO_SAR; 973 /** 974 * @brief Key for start time of the first frame in the media file in microseconds, value type is int64_t. 975 * 976 * @syscap SystemCapability.Multimedia.Media.CodecBase 977 * @since 12 978 */ 979 extern const char *OH_MD_KEY_START_TIME; 980 /** 981 * @brief Key for start time of track in microseconds, value type is int64_t. 982 * 983 * @syscap SystemCapability.Multimedia.Media.CodecBase 984 * @since 12 985 */ 986 extern const char *OH_MD_KEY_TRACK_START_TIME; 987 /** 988 * @brief Key for setting the output color space of video decoder. The value type is int32_t. 989 * The supported value is {@link OH_COLORSPACE_BT709_LIMIT}, see {@link OH_NativeBuffer_ColorSpace}. It is used in 990 * {@link OH_VideoDecoder_Configure}. If the color space conversion capability is supported and this key is configured, 991 * the video decoder will automatically transcode an HDR Vivid video to an SDR video with color space BT709. 992 * If color space conversion capability is not supported, {@link OH_VideoDecoder_Configure} returns 993 * {@link AV_ERR_VIDEO_UNSUPPORTED_COLOR_SPACE_CONVERSION}. 994 * If the input video is not an HDR vivid video, an error {@link AV_ERR_VIDEO_UNSUPPORTED_COLOR_SPACE_CONVERSION} will 995 * be reported by callback function {@link OH_AVCodecOnError}. 996 * 997 * @syscap SystemCapability.Multimedia.Media.CodecBase 998 * @since 12 999 */ 1000 extern const char *OH_MD_KEY_VIDEO_DECODER_OUTPUT_COLOR_SPACE; 1001 /** 1002 * @brief Key for describing if enable VRR or not, value type is int32_t (0 or 1): 1 is enabled, 0 otherwise. 1003 * This is an optional key that applies only to video decoder. It is used in configure. 1004 * 1005 * @syscap SystemCapability.Multimedia.Media.CodecBase 1006 * @since 15 1007 */ 1008 extern const char *OH_MD_KEY_VIDEO_DECODER_OUTPUT_ENABLE_VRR; 1009 /** 1010 * @brief Key for creation timestamp of a media file, value type is string. 1011 * 1012 * @syscap SystemCapability.Multimedia.Media.CodecBase 1013 * @since 14 1014 */ 1015 extern const char *OH_MD_KEY_CREATION_TIME; 1016 /** 1017 * @brief Key applies only when configuring a video encoder in surface mode, value type is int32_t. 1018 * If no new frame became available since the last frame submitted to the encoder, 1019 * it will sumbit the previous frame repeatly in milliseconds. It is used in configure. 1020 * 1021 * @syscap SystemCapability.Multimedia.Media.CodecBase 1022 * @since 18 1023 */ 1024 extern const char *OH_MD_KEY_VIDEO_ENCODER_REPEAT_PREVIOUS_FRAME_AFTER; 1025 /** 1026 * @brief Key for describing the maximum count that the frame previously submitted to the encoder will be 1027 * repeated, in case no new frame has been available since, value type is int32_t. This key takes effect only when 1028 * {@link VIDEO_ENCODER_REPEAT_PREVIOUS_FRAME_AFTER} is vaild. It is used in configure. 1029 * 1030 * @syscap SystemCapability.Multimedia.Media.CodecBase 1031 * @since 18 1032 */ 1033 extern const char *OH_MD_KEY_VIDEO_ENCODER_REPEAT_PREVIOUS_MAX_COUNT; 1034 1035 /** 1036 * @brief Media type. 1037 * 1038 * @syscap SystemCapability.Multimedia.Media.CodecBase 1039 * @since 9 1040 */ 1041 typedef enum OH_MediaType { 1042 /* track is audio. */ 1043 MEDIA_TYPE_AUD = 0, 1044 /* track is video. */ 1045 MEDIA_TYPE_VID = 1, 1046 /** track is subtitle. 1047 * @since 12 1048 */ 1049 MEDIA_TYPE_SUBTITLE = 2, 1050 } OH_MediaType; 1051 1052 /** 1053 * @brief AAC Profile 1054 * 1055 * @syscap SystemCapability.Multimedia.Media.CodecBase 1056 * @since 9 1057 */ 1058 typedef enum OH_AACProfile { 1059 AAC_PROFILE_LC = 0, 1060 /** 1061 * High-Efficiency AAC profile, contain the audio object types: AAC LC, SBR 1062 * @since 14 1063 */ 1064 AAC_PROFILE_HE = 3, 1065 /** 1066 * High-Efficiency AAC v2 profile, contain the audio object types: AAC LC, SBR, PS 1067 * @since 14 1068 */ 1069 AAC_PROFILE_HE_V2 = 4, 1070 } OH_AACProfile; 1071 1072 /** 1073 * @brief AVC Profile 1074 * 1075 * @syscap SystemCapability.Multimedia.Media.CodecBase 1076 * @since 9 1077 */ 1078 typedef enum OH_AVCProfile { 1079 AVC_PROFILE_BASELINE = 0, 1080 AVC_PROFILE_HIGH = 4, 1081 AVC_PROFILE_MAIN = 8, 1082 } OH_AVCProfile; 1083 1084 /** 1085 * @brief HEVC Profile 1086 * 1087 * @syscap SystemCapability.Multimedia.Media.CodecBase 1088 * @since 10 1089 */ 1090 typedef enum OH_HEVCProfile { 1091 HEVC_PROFILE_MAIN = 0, 1092 HEVC_PROFILE_MAIN_10 = 1, 1093 HEVC_PROFILE_MAIN_STILL = 2, 1094 /** 1095 * @deprecated since 14 1096 */ 1097 HEVC_PROFILE_MAIN_10_HDR10 = 3, 1098 /** 1099 * @deprecated since 14 1100 */ 1101 HEVC_PROFILE_MAIN_10_HDR10_PLUS = 4, 1102 } OH_HEVCProfile; 1103 1104 /** 1105 * @brief Profile: A specified subset of the syntax of VVC. 1106 * 1107 * @syscap SystemCapability.Multimedia.Media.CodecBase 1108 * @since 15 1109 */ 1110 typedef enum OH_VVCProfile { 1111 /** Main 10 profile */ 1112 VVC_PROFILE_MAIN_10 = 1, 1113 /** Main 12 profile */ 1114 VVC_PROFILE_MAIN_12 = 2, 1115 /** Main 12 Intra profile */ 1116 VVC_PROFILE_MAIN_12_INTRA = 10, 1117 /** Multilayer Main 10 profile */ 1118 VVC_PROFILE_MULTI_MAIN_10 = 17, 1119 /** Main 10 4:4:4 profile */ 1120 VVC_PROFILE_MAIN_10_444 = 33, 1121 /** Main 12 4:4:4 profile */ 1122 VVC_PROFILE_MAIN_12_444 = 34, 1123 /** Main 16 4:4:4 profile */ 1124 VVC_PROFILE_MAIN_16_444 = 36, 1125 /** Main 12 4:4:4 Intra profile */ 1126 VVC_PROFILE_MAIN_12_444_INTRA = 42, 1127 /** Main 16 4:4:4 Intra profile */ 1128 VVC_PROFILE_MAIN_16_444_INTRA = 44, 1129 /** Multilayer Main 10 4:4:4 profile */ 1130 VVC_PROFILE_MULTI_MAIN_10_444 = 49, 1131 /** Main 10 Still Picture profile */ 1132 VVC_PROFILE_MAIN_10_STILL = 65, 1133 /** Main 12 Still Picture profile */ 1134 VVC_PROFILE_MAIN_12_STILL = 66, 1135 /** Main 10 4:4:4 Still Picture profile */ 1136 VVC_PROFILE_MAIN_10_444_STILL = 97, 1137 /** Main 12 4:4:4 Still Picture profile */ 1138 VVC_PROFILE_MAIN_12_444_STILL = 98, 1139 /** Main 16 4:4:4 Still Picture profile */ 1140 VVC_PROFILE_MAIN_16_444_STILL = 100, 1141 } OH_VVCProfile; 1142 1143 /** 1144 * @brief MPEG2 Profile 1145 * 1146 * @syscap SystemCapability.Multimedia.Media.CodecBase 1147 * @since 17 1148 */ 1149 typedef enum OH_MPEG2Profile { 1150 /** Simple profile */ 1151 MPEG2_PROFILE_SIMPLE = 0, 1152 /** Main profile */ 1153 MPEG2_PROFILE_MAIN = 1, 1154 /** SNR scalable profile */ 1155 MPEG2_PROFILE_SNR_SCALABLE = 2, 1156 /** Spatially scalable profile */ 1157 MPEG2_PROFILE_SPATIALLY_SCALABLE = 3, 1158 /** High profile */ 1159 MPEG2_PROFILE_HIGH = 4, 1160 /** 4:2:2 profile */ 1161 MPEG2_PROFILE_422 = 5, 1162 } OH_MPEG2Profile; 1163 1164 /** 1165 * @brief MPEG4 Profile 1166 * 1167 * @syscap SystemCapability.Multimedia.Media.CodecBase 1168 * @since 17 1169 */ 1170 typedef enum OH_MPEG4Profile { 1171 /** Simple profile */ 1172 MPEG4_PROFILE_SIMPLE = 0, 1173 /** Simple scalable profile */ 1174 MPEG4_PROFILE_SIMPLE_SCALABLE = 1, 1175 /** Core profile */ 1176 MPEG4_PROFILE_CORE = 2, 1177 /** Main profile */ 1178 MPEG4_PROFILE_MAIN = 3, 1179 /** N-Bit profile */ 1180 MPEG4_PROFILE_N_BIT = 4, 1181 /** Hybrid profile */ 1182 MPEG4_PROFILE_HYBRID = 5, 1183 /** Basic animated texture profile */ 1184 MPEG4_PROFILE_BASIC_ANIMATED_TEXTURE = 6, 1185 /** Scalable texture profile */ 1186 MPEG4_PROFILE_SCALABLE_TEXTURE = 7, 1187 /** Simple FA profile */ 1188 MPEG4_PROFILE_SIMPLE_FA = 8, 1189 /** Advanced real time simple profile */ 1190 MPEG4_PROFILE_ADVANCED_REAL_TIME_SIMPLE = 9, 1191 /** Core scalable profile */ 1192 MPEG4_PROFILE_CORE_SCALABLE = 10, 1193 /** Advanced coding efficiency profile */ 1194 MPEG4_PROFILE_ADVANCED_CODING_EFFICIENCY = 11, 1195 /** Advanced core profile */ 1196 MPEG4_PROFILE_ADVANCED_CORE = 12, 1197 /** Advanced scalable texture profile */ 1198 MPEG4_PROFILE_ADVANCED_SCALABLE_TEXTURE = 13, 1199 /** Advanced simple profile */ 1200 MPEG4_PROFILE_ADVANCED_SIMPLE = 17, 1201 } OH_MPEG4Profile; 1202 1203 /** 1204 * @brief H263 Profile 1205 * 1206 * @syscap SystemCapability.Multimedia.Media.CodecBase 1207 * @since 17 1208 */ 1209 typedef enum OH_H263Profile { 1210 /** Baseline profile */ 1211 H263_PROFILE_BASELINE = 0, 1212 /** Version 1 backward compatibility profile */ 1213 H263_PROFILE_VERSION_1_BACKWARD_COMPATIBILITY = 2, 1214 } OH_H263Profile; 1215 1216 /** 1217 * @brief Enumerates the muxer output file format 1218 * 1219 * @syscap SystemCapability.Multimedia.Media.CodecBase 1220 * @since 10 1221 */ 1222 typedef enum OH_AVOutputFormat { 1223 AV_OUTPUT_FORMAT_DEFAULT = 0, 1224 AV_OUTPUT_FORMAT_MPEG_4 = 2, 1225 AV_OUTPUT_FORMAT_M4A = 6, 1226 /** 1227 * The muxer output amr file format. 1228 * @since 12 1229 */ 1230 AV_OUTPUT_FORMAT_AMR = 8, 1231 /** 1232 * The muxer output mp3 file format. 1233 * @since 12 1234 */ 1235 AV_OUTPUT_FORMAT_MP3 = 9, 1236 /** 1237 * The muxer output wav file format. 1238 * @since 12 1239 */ 1240 AV_OUTPUT_FORMAT_WAV = 10, 1241 /** 1242 * The muxer output aac file format. 1243 * @since 18 1244 */ 1245 AV_OUTPUT_FORMAT_AAC = 11, 1246 } OH_AVOutputFormat; 1247 1248 /** 1249 * @brief Seek Mode 1250 * 1251 * @syscap SystemCapability.Multimedia.Media.CodecBase 1252 * @since 10 1253 */ 1254 typedef enum OH_AVSeekMode { 1255 /* seek to sync sample after the time */ 1256 SEEK_MODE_NEXT_SYNC = 0, 1257 /* seek to sync sample before the time */ 1258 SEEK_MODE_PREVIOUS_SYNC, 1259 /* seek to sync sample closest to time */ 1260 SEEK_MODE_CLOSEST_SYNC, 1261 } OH_AVSeekMode; 1262 1263 /** 1264 * @brief Scaling Mode 1265 * 1266 * @syscap SystemCapability.Multimedia.Media.CodecBase 1267 * @deprecated since 14 1268 * @useinstead OHScalingModeV2 1269 * @since 10 1270 */ 1271 typedef enum OH_ScalingMode { 1272 /** 1273 * @deprecated since 14 1274 * @useinstead OH_SCALING_MODE_SCALE_TO_WINDOW_V2 1275 */ 1276 SCALING_MODE_SCALE_TO_WINDOW = 1, 1277 /** 1278 * @deprecated since 14 1279 * @useinstead OH_SCALING_MODE_SCALE_CROP_V2 1280 */ 1281 SCALING_MODE_SCALE_CROP = 2, 1282 } OH_ScalingMode; 1283 1284 /** 1285 * @brief enum Audio Bits Per Coded Sample 1286 * 1287 * @syscap SystemCapability.Multimedia.Media.CodecBase 1288 * @since 10 1289 */ 1290 typedef enum OH_BitsPerSample { 1291 SAMPLE_U8 = 0, 1292 SAMPLE_S16LE = 1, 1293 SAMPLE_S24LE = 2, 1294 SAMPLE_S32LE = 3, 1295 SAMPLE_F32LE = 4, 1296 SAMPLE_U8P = 5, 1297 SAMPLE_S16P = 6, 1298 SAMPLE_S24P = 7, 1299 SAMPLE_S32P = 8, 1300 SAMPLE_F32P = 9, 1301 INVALID_WIDTH = -1 1302 } OH_BitsPerSample; 1303 1304 /** 1305 * @brief Color Primary 1306 * 1307 * @syscap SystemCapability.Multimedia.Media.CodecBase 1308 * @since 10 1309 */ 1310 typedef enum OH_ColorPrimary { 1311 COLOR_PRIMARY_BT709 = 1, 1312 COLOR_PRIMARY_UNSPECIFIED = 2, 1313 COLOR_PRIMARY_BT470_M = 4, 1314 COLOR_PRIMARY_BT601_625 = 5, 1315 COLOR_PRIMARY_BT601_525 = 6, 1316 COLOR_PRIMARY_SMPTE_ST240 = 7, 1317 COLOR_PRIMARY_GENERIC_FILM = 8, 1318 COLOR_PRIMARY_BT2020 = 9, 1319 COLOR_PRIMARY_SMPTE_ST428 = 10, 1320 COLOR_PRIMARY_P3DCI = 11, 1321 COLOR_PRIMARY_P3D65 = 12, 1322 } OH_ColorPrimary; 1323 1324 /** 1325 * @brief Transfer Characteristic 1326 * 1327 * @syscap SystemCapability.Multimedia.Media.CodecBase 1328 * @since 10 1329 */ 1330 typedef enum OH_TransferCharacteristic { 1331 TRANSFER_CHARACTERISTIC_BT709 = 1, 1332 TRANSFER_CHARACTERISTIC_UNSPECIFIED = 2, 1333 TRANSFER_CHARACTERISTIC_GAMMA_2_2 = 4, 1334 TRANSFER_CHARACTERISTIC_GAMMA_2_8 = 5, 1335 TRANSFER_CHARACTERISTIC_BT601 = 6, 1336 TRANSFER_CHARACTERISTIC_SMPTE_ST240 = 7, 1337 TRANSFER_CHARACTERISTIC_LINEAR = 8, 1338 TRANSFER_CHARACTERISTIC_LOG = 9, 1339 TRANSFER_CHARACTERISTIC_LOG_SQRT = 10, 1340 TRANSFER_CHARACTERISTIC_IEC_61966_2_4 = 11, 1341 TRANSFER_CHARACTERISTIC_BT1361 = 12, 1342 TRANSFER_CHARACTERISTIC_IEC_61966_2_1 = 13, 1343 TRANSFER_CHARACTERISTIC_BT2020_10BIT = 14, 1344 TRANSFER_CHARACTERISTIC_BT2020_12BIT = 15, 1345 TRANSFER_CHARACTERISTIC_PQ = 16, 1346 TRANSFER_CHARACTERISTIC_SMPTE_ST428 = 17, 1347 TRANSFER_CHARACTERISTIC_HLG = 18, 1348 } OH_TransferCharacteristic; 1349 1350 /** 1351 * @brief Matrix Coefficient 1352 * 1353 * @syscap SystemCapability.Multimedia.Media.CodecBase 1354 * @since 10 1355 */ 1356 typedef enum OH_MatrixCoefficient { 1357 MATRIX_COEFFICIENT_IDENTITY = 0, 1358 MATRIX_COEFFICIENT_BT709 = 1, 1359 MATRIX_COEFFICIENT_UNSPECIFIED = 2, 1360 MATRIX_COEFFICIENT_FCC = 4, 1361 MATRIX_COEFFICIENT_BT601_625 = 5, 1362 MATRIX_COEFFICIENT_BT601_525 = 6, 1363 MATRIX_COEFFICIENT_SMPTE_ST240 = 7, 1364 MATRIX_COEFFICIENT_YCGCO = 8, 1365 MATRIX_COEFFICIENT_BT2020_NCL = 9, 1366 MATRIX_COEFFICIENT_BT2020_CL = 10, 1367 MATRIX_COEFFICIENT_SMPTE_ST2085 = 11, 1368 MATRIX_COEFFICIENT_CHROMATICITY_NCL = 12, 1369 MATRIX_COEFFICIENT_CHROMATICITY_CL = 13, 1370 MATRIX_COEFFICIENT_ICTCP = 14, 1371 } OH_MatrixCoefficient; 1372 1373 /** 1374 * @brief AVC Level. 1375 * 1376 * @syscap SystemCapability.Multimedia.Media.CodecBase 1377 * @since 12 1378 */ 1379 typedef enum OH_AVCLevel { 1380 AVC_LEVEL_1 = 0, 1381 AVC_LEVEL_1b = 1, 1382 AVC_LEVEL_11 = 2, 1383 AVC_LEVEL_12 = 3, 1384 AVC_LEVEL_13 = 4, 1385 AVC_LEVEL_2 = 5, 1386 AVC_LEVEL_21 = 6, 1387 AVC_LEVEL_22 = 7, 1388 AVC_LEVEL_3 = 8, 1389 AVC_LEVEL_31 = 9, 1390 AVC_LEVEL_32 = 10, 1391 AVC_LEVEL_4 = 11, 1392 AVC_LEVEL_41 = 12, 1393 AVC_LEVEL_42 = 13, 1394 AVC_LEVEL_5 = 14, 1395 AVC_LEVEL_51 = 15, 1396 AVC_LEVEL_52 = 16, 1397 AVC_LEVEL_6 = 17, 1398 AVC_LEVEL_61 = 18, 1399 AVC_LEVEL_62 = 19, 1400 } OH_AVCLevel; 1401 1402 /** 1403 * @brief HEVC Level. 1404 * 1405 * @syscap SystemCapability.Multimedia.Media.CodecBase 1406 * @since 12 1407 */ 1408 typedef enum OH_HEVCLevel { 1409 HEVC_LEVEL_1 = 0, 1410 HEVC_LEVEL_2 = 1, 1411 HEVC_LEVEL_21 = 2, 1412 HEVC_LEVEL_3 = 3, 1413 HEVC_LEVEL_31 = 4, 1414 HEVC_LEVEL_4 = 5, 1415 HEVC_LEVEL_41 = 6, 1416 HEVC_LEVEL_5 = 7, 1417 HEVC_LEVEL_51 = 8, 1418 HEVC_LEVEL_52 = 9, 1419 HEVC_LEVEL_6 = 10, 1420 HEVC_LEVEL_61 = 11, 1421 HEVC_LEVEL_62 = 12, 1422 } OH_HEVCLevel; 1423 1424 /** 1425 * @brief VVC Level: A defined set of constraints on the values that may be taken by the syntax elements and variables 1426 * of VVC, or the value of a transform coefficient prior to scaling. 1427 * 1428 * @syscap SystemCapability.Multimedia.Media.CodecBase 1429 * @since 15 1430 */ 1431 typedef enum OH_VVCLevel { 1432 /** VVC level 1.0 */ 1433 VVC_LEVEL_1 = 16, 1434 /** VVC level 2.0 */ 1435 VVC_LEVEL_2 = 32, 1436 /** VVC level 2.1 */ 1437 VVC_LEVEL_21 = 35, 1438 /** VVC level 3.0 */ 1439 VVC_LEVEL_3 = 48, 1440 /** VVC level 3.1 */ 1441 VVC_LEVEL_31 = 51, 1442 /** VVC level 4.0 */ 1443 VVC_LEVEL_4 = 64, 1444 /** VVC level 4.1 */ 1445 VVC_LEVEL_41 = 67, 1446 /** VVC level 5.0 */ 1447 VVC_LEVEL_5 = 80, 1448 /** VVC level 5.1 */ 1449 VVC_LEVEL_51 = 83, 1450 /** VVC level 5.2 */ 1451 VVC_LEVEL_52 = 86, 1452 /** VVC level 6.0 */ 1453 VVC_LEVEL_6 = 96, 1454 /** VVC level 6.1 */ 1455 VVC_LEVEL_61 = 99, 1456 /** VVC level 6.2 */ 1457 VVC_LEVEL_62 = 102, 1458 /** VVC level 6.3 */ 1459 VVC_LEVEL_63 = 105, 1460 /** VVC level 15.5 */ 1461 VVC_LEVEL_155 = 255, 1462 } OH_VVCLevel; 1463 1464 /** 1465 * @brief MPEG2 Level. 1466 * 1467 * @syscap SystemCapability.Multimedia.Media.CodecBase 1468 * @since 17 1469 */ 1470 typedef enum OH_MPEG2Level { 1471 /** Low level */ 1472 MPEG2_LEVEL_LOW = 0, 1473 /** Main level */ 1474 MPEG2_LEVEL_MAIN = 1, 1475 /** High 1440 level */ 1476 MPEG2_LEVEL_HIGH_1440 = 2, 1477 /** High level */ 1478 MPEG2_LEVEL_HIGH = 3, 1479 } OH_MPEG2Level; 1480 1481 /** 1482 * @brief MPEG4 Level. 1483 * 1484 * @syscap SystemCapability.Multimedia.Media.CodecBase 1485 * @since 17 1486 */ 1487 typedef enum OH_MPEG4Level { 1488 /** 0 level */ 1489 MPEG4_LEVEL_0 = 0, 1490 /** 0B level */ 1491 MPEG4_LEVEL_0B = 1, 1492 /** 1 level */ 1493 MPEG4_LEVEL_1 = 2, 1494 /** 2 level */ 1495 MPEG4_LEVEL_2 = 3, 1496 /** 3 level */ 1497 MPEG4_LEVEL_3 = 4, 1498 /** 3B level */ 1499 MPEG4_LEVEL_3B = 5, 1500 /** 4 level */ 1501 MPEG4_LEVEL_4 = 6, 1502 /** 4A level */ 1503 MPEG4_LEVEL_4A = 7, 1504 /** 5 level */ 1505 MPEG4_LEVEL_5 = 8, 1506 /** 6 level */ 1507 MPEG4_LEVEL_6 = 9, 1508 } OH_MPEG4Level; 1509 1510 /** 1511 * @brief H263 Level. 1512 * 1513 * @syscap SystemCapability.Multimedia.Media.CodecBase 1514 * @since 17 1515 */ 1516 typedef enum OH_H263Level { 1517 /** 10 level */ 1518 H263_LEVEL_10 = 0, 1519 /** 20 level */ 1520 H263_LEVEL_20 = 1, 1521 /** 30 level */ 1522 H263_LEVEL_30 = 2, 1523 /** 40 level */ 1524 H263_LEVEL_40 = 3, 1525 /** 45 level */ 1526 H263_LEVEL_45 = 4, 1527 /** 50 level */ 1528 H263_LEVEL_50 = 5, 1529 /** 60 level */ 1530 H263_LEVEL_60 = 6, 1531 /** 70 level */ 1532 H263_LEVEL_70 = 7, 1533 } OH_H263Level; 1534 1535 /** 1536 * @brief The reference mode in temporal group of picture. 1537 * 1538 * @syscap SystemCapability.Multimedia.Media.CodecBase 1539 * @since 12 1540 */ 1541 typedef enum OH_TemporalGopReferenceMode { 1542 /** Refer to latest short-term reference frame. */ 1543 ADJACENT_REFERENCE = 0, 1544 /** Refer to latest long-term reference frame. */ 1545 JUMP_REFERENCE = 1, 1546 /** Uniformly scaled reference structure, which has even distribution of video frames after drop the highest 1547 * enhance layer. The temporal group of pictures must be power of 2. */ 1548 UNIFORMLY_SCALED_REFERENCE = 2, 1549 } OH_TemporalGopReferenceMode; 1550 1551 /** 1552 * @brief The bitrate mode of encoder. 1553 * 1554 * Change the location of the header file, since 14. 1555 * 1556 * @syscap SystemCapability.Multimedia.Media.CodecBase 1557 * @since 10 1558 */ 1559 typedef enum OH_BitrateMode { 1560 /** Constant Bit rate mode. */ 1561 BITRATE_MODE_CBR = 0, 1562 /** Variable Bit rate mode. */ 1563 BITRATE_MODE_VBR = 1, 1564 /** Constant Quality mode. */ 1565 BITRATE_MODE_CQ = 2 1566 } OH_BitrateMode; 1567 1568 #ifdef __cplusplus 1569 } 1570 #endif 1571 1572 #endif // NATIVE_AVCODEC_BASE_H 1573 /** @} */ 1574