• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# CodecBase
2
3
4## Overview
5
6The **CodecBase** module provides the variables, attributes, and functions for basic audio and video muxing, demuxing, encoding, and decoding.
7
8**System capability**: SystemCapability.Multimedia.Media.CodecBase
9
10**Since**: 9
11
12
13## Summary
14
15
16### Files
17
18| Name| Description|
19| -------- | -------- |
20| [avcodec_audio_channel_layout.h](avcodec__audio__channel__layout_8h.md) | Declares the enums used for audio codec.|
21| [native_avcodec_base.h](native__avcodec__base_8h.md) | Declare the native APIs used for basic audio and video muxing, demuxing, encoding, and decoding.|
22
23
24### Structs
25
26| Name| Description|
27| -------- | -------- |
28| struct  [OH_AVCodecAsyncCallback](_o_h___a_v_codec_async_callback.md) | Defines all the asynchronous callback function pointers of an **OH_AVCodec** instance.|
29| struct  [OH_AVCodecCallback](_o_h___a_v_codec_callback.md) | Defines all the asynchronous callback function pointers of an **OH_AVCodec** instance.|
30
31
32### Types
33
34| Name| Description|
35| -------- | -------- |
36| typedef void(\* [OH_AVCodecOnError](#oh_avcodeconerror)) (OH_AVCodec \*codec, int32_t errorCode, void \*userData) | Defines the pointer to the function that is called to report error information when an error occurs during the running of an **OH_AVCodec** instance.|
37| typedef void(\* [OH_AVCodecOnStreamChanged](#oh_avcodeconstreamchanged)) (OH_AVCodec \*codec, OH_AVFormat \*format, void \*userData) | Defines the pointer to the function that is called to report the new stream description when the output stream changes.|
38| typedef void(\* [OH_AVCodecOnNeedInputData](#oh_avcodeconneedinputdata)) (OH_AVCodec \*codec, uint32_t index, OH_AVMemory \*data, void \*userData) | Defines the pointer to the function that is called when new input data is required during the running of an **OH_AVCodec** instance. The function carries a buffer to fill in new input data.|
39| typedef void(\* [OH_AVCodecOnNewOutputData](#oh_avcodeconnewoutputdata)) (OH_AVCodec \*codec, uint32_t index, OH_AVMemory \*data, [OH_AVCodecBufferAttr](_o_h___a_v_codec_buffer_attr.md) \*attr, void \*userData) | Defines the pointer to the function that is called when new output data is generated during the running of an **OH_AVCodec** instance. The function carries a buffer filled with new output data.|
40| typedef void(\* [OH_AVCodecOnNeedInputBuffer](#oh_avcodeconneedinputbuffer)) (OH_AVCodec \*codec, uint32_t index, OH_AVBuffer \*buffer, void \*userData) | Defines the pointer to the function that is called when new input data is required during the running of an **OH_AVCodec** instance. The function carries a buffer to fill in new input data.|
41| typedef void(\* [OH_AVCodecOnNewOutputBuffer](#oh_avcodeconnewoutputbuffer)) (OH_AVCodec \*codec, uint32_t index, OH_AVBuffer \*buffer, void \*userData) | Defines the pointer to the function that is called when new output data is generated during the running of an **OH_AVCodec** instance. The function carries a buffer filled with new output data.|
42| typedef struct [OH_AVCodecAsyncCallback](_o_h___a_v_codec_async_callback.md)[OH_AVCodecAsyncCallback](#oh_avcodecasynccallback) | Defines all the asynchronous callback function pointers of an **OH_AVCodec** instance.|
43| typedef struct [OH_AVCodecCallback](_o_h___a_v_codec_callback.md)[OH_AVCodecCallback](#oh_avcodeccallback) | Defines all the asynchronous callback function pointers of an **OH_AVCodec** instance.|
44| typedef enum [OH_MediaType](#oh_mediatype)[OH_MediaType](#oh_mediatype) | Defines an enum that enumerates the media types.|
45| typedef enum [OH_AACProfile](#oh_aacprofile)[OH_AACProfile](#oh_aacprofile) | Defines an enum that enumerates the Advanced Audio Coding (AAC) profiles.|
46| typedef enum [OH_AVCProfile](#oh_avcprofile)[OH_AVCProfile](#oh_avcprofile) | Defines an enum that enumerates the Advanced Video Coding (AVC) profiles.|
47| typedef enum [OH_HEVCProfile](#oh_hevcprofile)[OH_HEVCProfile](#oh_hevcprofile) | Defines an enum that enumerates the High Efficiency Video Coding (HEVC) profiles.|
48| typedef enum [OH_AVOutputFormat](#oh_avoutputformat)[OH_AVOutputFormat](#oh_avoutputformat) | Defines an enum that enumerates the output file formats of a muxer.|
49| typedef enum [OH_AVSeekMode](#oh_avseekmode)[OH_AVSeekMode](#oh_avseekmode) | Defines an enum that enumerates the seek modes.|
50| typedef enum [OH_ScalingMode](#oh_scalingmode)[OH_ScalingMode](#oh_scalingmode) | Defines an enum that enumerates the scaling modes.|
51| typedef enum [OH_BitsPerSample](#oh_bitspersample)[OH_BitsPerSample](#oh_bitspersample) | Defines an enum that enumerates the number of audio bits for each coded sample.|
52| typedef enum [OH_ColorPrimary](#oh_colorprimary)[OH_ColorPrimary](#oh_colorprimary) | Defines an enum that enumerates the primary colors.|
53| typedef enum [OH_TransferCharacteristic](#oh_transfercharacteristic)[OH_TransferCharacteristic](#oh_transfercharacteristic) | Defines an enum that enumerates the transfer characteristics.|
54| typedef enum [OH_MatrixCoefficient](#oh_matrixcoefficient)[OH_MatrixCoefficient](#oh_matrixcoefficient) | Defines an enum that enumerates the matrix coefficients.|
55
56
57### Enums
58
59| Name| Description|
60| -------- | -------- |
61| [AudioChannelSet](#audiochannelset) : uint64_t {<br>FRONT_LEFT = 1ULL &lt;&lt; 0U,<br>FRONT_RIGHT = 1ULL &lt;&lt; 1U,<br>FRONT_CENTER = 1ULL &lt;&lt; 2U,<br>LOW_FREQUENCY = 1ULL &lt;&lt; 3U,<br>BACK_LEFT = 1ULL &lt;&lt; 4U,<br>BACK_RIGHT = 1ULL &lt;&lt; 5U,<br>FRONT_LEFT_OF_CENTER = 1ULL &lt;&lt; 6U,<br>FRONT_RIGHT_OF_CENTER = 1ULL &lt;&lt; 7U,<br>BACK_CENTER = 1ULL &lt;&lt; 8U,<br>SIDE_LEFT = 1ULL &lt;&lt; 9U,<br>SIDE_RIGHT = 1ULL &lt;&lt; 10U,<br>TOP_CENTER = 1ULL &lt;&lt; 11U,<br>TOP_FRONT_LEFT = 1ULL &lt;&lt; 12U,<br>TOP_FRONT_CENTER = 1ULL &lt;&lt; 13U,<br>TOP_FRONT_RIGHT = 1ULL &lt;&lt; 14U,<br>TOP_BACK_LEFT = 1ULL &lt;&lt; 15U,<br>TOP_BACK_CENTER = 1ULL &lt;&lt; 16U,<br>TOP_BACK_RIGHT = 1ULL &lt;&lt; 17U,<br>STEREO_LEFT = 1ULL &lt;&lt; 29U,<br>STEREO_RIGHT = 1ULL &lt;&lt; 30U,<br>WIDE_LEFT = 1ULL &lt;&lt; 31U,<br>WIDE_RIGHT = 1ULL &lt;&lt; 32U,<br>SURROUND_DIRECT_LEFT = 1ULL &lt;&lt; 33U,<br>SURROUND_DIRECT_RIGHT = 1ULL &lt;&lt; 34U,<br>LOW_FREQUENCY_2 = 1ULL &lt;&lt; 35U,<br>TOP_SIDE_LEFT = 1ULL &lt;&lt; 36U,<br>TOP_SIDE_RIGHT = 1ULL &lt;&lt; 37U,<br>BOTTOM_FRONT_CENTER = 1ULL &lt;&lt; 38U,<br>BOTTOM_FRONT_LEFT = 1ULL &lt;&lt; 39U,<br>BOTTOM_FRONT_RIGHT = 1ULL &lt;&lt; 40U,<br>AMBISONICS_ACN0 = 1ULL &lt;&lt; 41U,<br>AMBISONICS_ACN1 = 1ULL &lt;&lt; 42U,<br>AMBISONICS_ACN2 = 1ULL &lt;&lt; 43U,<br>AMBISONICS_ACN3 = 1ULL &lt;&lt; 44U,<br>AMBISONICS_W = AMBISONICS_ACN0,<br>AMBISONICS_Y = AMBISONICS_ACN1,<br>AMBISONICS_Z = AMBISONICS_ACN2,<br>AMBISONICS_X = AMBISONICS_ACN3,<br>AMBISONICS_ACN4 = 1ULL &lt;&lt; 45U,<br>AMBISONICS_ACN5 = 1ULL &lt;&lt; 46U,<br>AMBISONICS_ACN6 = 1ULL &lt;&lt; 47U,<br>AMBISONICS_ACN7 = 1ULL &lt;&lt; 48U,<br>AMBISONICS_ACN8 = 1ULL &lt;&lt; 49U,<br>AMBISONICS_ACN9 = 1ULL &lt;&lt; 50U,<br>AMBISONICS_ACN10 = 1ULL &lt;&lt; 51U,<br>AMBISONICS_ACN11 = 1ULL &lt;&lt; 52U,<br>AMBISONICS_ACN12 = 1ULL &lt;&lt; 53U,<br>AMBISONICS_ACN13 = 1ULL &lt;&lt; 54U,<br>AMBISONICS_ACN14 = 1ULL &lt;&lt; 55U,<br>AMBISONICS_ACN15 = 1ULL &lt;&lt; 56U<br>} | Enumerates the audio channel sets. Each channel number is mapped to a variable of int64.|
62| [AudioChannelLayout](#audiochannellayout) : uint64_t {<br>UNKNOWN_CHANNEL_LAYOUT = 0,<br>MONO = (AudioChannelSet::FRONT_CENTER),<br>STEREO = (AudioChannelSet::FRONT_LEFT \| AudioChannelSet::FRONT_RIGHT),<br>CH_2POINT1 = (STEREO \| AudioChannelSet::LOW_FREQUENCY),<br>CH_2_1 = (STEREO \| AudioChannelSet::BACK_CENTER),<br>SURROUND = (STEREO \| AudioChannelSet::FRONT_CENTER),<br>CH_3POINT1 = (SURROUND \| AudioChannelSet::LOW_FREQUENCY),<br>CH_4POINT0 = (SURROUND \| AudioChannelSet::BACK_CENTER),<br>CH_4POINT1 = (CH_4POINT0 \| AudioChannelSet::LOW_FREQUENCY),<br>CH_2_2 = (STEREO \| AudioChannelSet::SIDE_LEFT \| AudioChannelSet::SIDE_RIGHT),<br>QUAD = (STEREO \| AudioChannelSet::BACK_LEFT \| AudioChannelSet::BACK_RIGHT),<br>CH_5POINT0 = (SURROUND \| AudioChannelSet::SIDE_LEFT \| AudioChannelSet::SIDE_RIGHT),<br>CH_5POINT1 = (CH_5POINT0 \| AudioChannelSet::LOW_FREQUENCY),<br>CH_5POINT0_BACK = (SURROUND \| AudioChannelSet::BACK_LEFT \| AudioChannelSet::BACK_RIGHT),<br>CH_5POINT1_BACK = (CH_5POINT0_BACK \| AudioChannelSet::LOW_FREQUENCY),<br>CH_6POINT0 = (CH_5POINT0 \| AudioChannelSet::BACK_CENTER),<br>CH_6POINT0_FRONT = (CH_2_2 \| AudioChannelSet::FRONT_LEFT_OF_CENTER \| AudioChannelSet::FRONT_RIGHT_OF_CENTER),<br>HEXAGONAL = (CH_5POINT0_BACK \| AudioChannelSet::BACK_CENTER),<br>CH_6POINT1 = (CH_5POINT1 \| AudioChannelSet::BACK_CENTER),<br>CH_6POINT1_BACK = (CH_5POINT1_BACK \| AudioChannelSet::BACK_CENTER),<br>CH_6POINT1_FRONT = (CH_6POINT0_FRONT \| AudioChannelSet::LOW_FREQUENCY),<br>CH_7POINT0 = (CH_5POINT0 \| AudioChannelSet::BACK_LEFT \| AudioChannelSet::BACK_RIGHT),<br>CH_7POINT0_FRONT = (CH_5POINT0 \| AudioChannelSet::FRONT_LEFT_OF_CENTER \| AudioChannelSet::FRONT_RIGHT_OF_CENTER),<br>CH_7POINT1 = (CH_5POINT1 \| AudioChannelSet::BACK_LEFT \| AudioChannelSet::BACK_RIGHT),<br>CH_7POINT1_WIDE = (CH_5POINT1 \| AudioChannelSet::FRONT_LEFT_OF_CENTER \| AudioChannelSet::FRONT_RIGHT_OF_CENTER),<br>CH_7POINT1_WIDE_BACK, CH_3POINT1POINT2 = (CH_3POINT1 \| AudioChannelSet::TOP_FRONT_LEFT \| AudioChannelSet::TOP_FRONT_RIGHT),<br>CH_5POINT1POINT2 = (CH_5POINT1 \| AudioChannelSet::TOP_SIDE_LEFT \| AudioChannelSet::TOP_SIDE_RIGHT),<br>CH_5POINT1POINT4, CH_7POINT1POINT2 = (CH_7POINT1 \| AudioChannelSet::TOP_SIDE_LEFT \| AudioChannelSet::TOP_SIDE_RIGHT),<br>CH_7POINT1POINT4, CH_9POINT1POINT4 = (CH_7POINT1POINT4 \| AudioChannelSet::WIDE_LEFT \| AudioChannelSet::WIDE_RIGHT),<br>CH_9POINT1POINT6 = (CH_9POINT1POINT4 \| AudioChannelSet::TOP_SIDE_LEFT \| AudioChannelSet::TOP_SIDE_RIGHT),<br>CH_10POINT2, CH_22POINT2, OCTAGONAL = (CH_5POINT0 \| AudioChannelSet::BACK_LEFT \| AudioChannelSet::BACK_CENTER \| AudioChannelSet::BACK_RIGHT),<br>HEXADECAGONAL, STEREO_DOWNMIX = (AudioChannelSet::STEREO_LEFT \| AudioChannelSet::STEREO_RIGHT),<br>HOA_FIRST,<br>HOA_SECOND,<br>HOA_THIRD<br>} | Enumerates the types of the audio channel sets. The output format of the decoder is represented as the channel type of the codec.|
63| [OH_MediaType](#oh_mediatype) {<br>MEDIA_TYPE_AUD = 0,<br>MEDIA_TYPE_VID = 1<br>} | Enumerates the media types.|
64| [OH_AACProfile](#oh_aacprofile) { AAC_PROFILE_LC = 0 } | Enumerates the AAC profiles.|
65| [OH_AVCProfile](#oh_avcprofile) {<br>AVC_PROFILE_BASELINE = 0,<br>AVC_PROFILE_HIGH = 4,<br>AVC_PROFILE_MAIN = 8<br>} | Enumerates the AVC profiles.|
66| [OH_HEVCProfile](#oh_hevcprofile) {<br>HEVC_PROFILE_MAIN = 0,<br>HEVC_PROFILE_MAIN_10 = 1,<br>HEVC_PROFILE_MAIN_STILL = 2,<br>HEVC_PROFILE_MAIN_10_HDR10 = 3,<br>HEVC_PROFILE_MAIN_10_HDR10_PLUS = 4<br>} | Enumerates the HEVC profiles.|
67| [OH_AVOutputFormat](#oh_avoutputformat) {<br>AV_OUTPUT_FORMAT_DEFAULT = 0,<br>AV_OUTPUT_FORMAT_MPEG_4 = 2,<br>AV_OUTPUT_FORMAT_M4A = 6<br>} | Enumerates the output file formats of a muxer.|
68| [OH_AVSeekMode](#oh_avseekmode) {<br>SEEK_MODE_NEXT_SYNC = 0,<br>SEEK_MODE_PREVIOUS_SYNC,<br>SEEK_MODE_CLOSEST_SYNC<br>} | Enumerates the seek modes.|
69| [OH_ScalingMode](#oh_scalingmode) {<br>SCALING_MODE_SCALE_TO_WINDOW = 1,<br>SCALING_MODE_SCALE_CROP = 2<br>} | Enumerates the scaling modes.|
70| [OH_BitsPerSample](#oh_bitspersample) {<br>SAMPLE_U8 = 0, SAMPLE_S16LE = 1,<br>SAMPLE_S24LE = 2, SAMPLE_S32LE = 3,<br>SAMPLE_F32LE = 4, SAMPLE_U8P = 5,<br>SAMPLE_S16P = 6, SAMPLE_S24P = 7,<br>SAMPLE_S32P = 8, SAMPLE_F32P = 9,<br>INVALID_WIDTH = -1<br>} | Enumerates the number of audio bits for each coded sample.|
71| [OH_ColorPrimary](#oh_colorprimary) {<br>COLOR_PRIMARY_BT709 = 1,<br>COLOR_PRIMARY_UNSPECIFIED = 2,<br>COLOR_PRIMARY_BT470_M = 4,<br>COLOR_PRIMARY_BT601_625 = 5,<br>COLOR_PRIMARY_BT601_525 = 6,<br>COLOR_PRIMARY_SMPTE_ST240 = 7,<br>COLOR_PRIMARY_GENERIC_FILM = 8,<br>COLOR_PRIMARY_BT2020 = 9,<br>COLOR_PRIMARY_SMPTE_ST428 = 10,<br>COLOR_PRIMARY_P3DCI = 11,<br>COLOR_PRIMARY_P3D65 = 12<br>} | Enumerates the primary colors.|
72| [OH_TransferCharacteristic](#oh_transfercharacteristic) {<br>TRANSFER_CHARACTERISTIC_BT709 = 1,<br>TRANSFER_CHARACTERISTIC_UNSPECIFIED = 2,<br>TRANSFER_CHARACTERISTIC_GAMMA_2_2 = 4,<br>TRANSFER_CHARACTERISTIC_GAMMA_2_8 = 5,<br>TRANSFER_CHARACTERISTIC_BT601 = 6,<br>TRANSFER_CHARACTERISTIC_SMPTE_ST240 = 7,<br>TRANSFER_CHARACTERISTIC_LINEAR = 8,<br>TRANSFER_CHARACTERISTIC_LOG = 9,<br>TRANSFER_CHARACTERISTIC_LOG_SQRT = 10,<br>TRANSFER_CHARACTERISTIC_IEC_61966_2_4 = 11,<br>TRANSFER_CHARACTERISTIC_BT1361 = 12,<br>TRANSFER_CHARACTERISTIC_IEC_61966_2_1 = 13,<br>TRANSFER_CHARACTERISTIC_BT2020_10BIT = 14,<br>TRANSFER_CHARACTERISTIC_BT2020_12BIT = 15,<br>TRANSFER_CHARACTERISTIC_PQ = 16,<br>TRANSFER_CHARACTERISTIC_SMPTE_ST428 = 17,<br>TRANSFER_CHARACTERISTIC_HLG = 18<br>} | Enumerates the transfer characteristics.|
73| [OH_MatrixCoefficient](#oh_matrixcoefficient) {<br>MATRIX_COEFFICIENT_IDENTITY = 0,<br>MATRIX_COEFFICIENT_BT709 = 1,<br>MATRIX_COEFFICIENT_UNSPECIFIED = 2,<br>MATRIX_COEFFICIENT_FCC = 4,<br>MATRIX_COEFFICIENT_BT601_625 = 5,<br>MATRIX_COEFFICIENT_BT601_525 = 6, MATRIX_COEFFICIENT_SMPTE_ST240 = 7,<br>MATRIX_COEFFICIENT_YCGCO = 8,<br>MATRIX_COEFFICIENT_BT2020_NCL = 9,<br>MATRIX_COEFFICIENT_BT2020_CL = 10,<br>MATRIX_COEFFICIENT_SMPTE_ST2085 = 11,<br>MATRIX_COEFFICIENT_CHROMATICITY_NCL = 12,<br>MATRIX_COEFFICIENT_CHROMATICITY_CL = 13,<br>MATRIX_COEFFICIENT_ICTCP = 14<br>} | Enumerates the matrix coefficients.|
74
75
76### Variables
77
78| Name| Description|
79| -------- | -------- |
80| const char \* [OH_AVCODEC_MIMETYPE_VIDEO_AVC](#oh_avcodec_mimetype_video_avc) | Defines the pointer to the Multipurpose Internet Mail Extension (MIME) type of AVC (H.264) video codec.|
81| const char \* [OH_AVCODEC_MIMETYPE_AUDIO_AAC](#oh_avcodec_mimetype_audio_aac) | Defines the pointer to the MIME type of AAC audio codec.|
82| const char \* [OH_AVCODEC_MIMETYPE_AUDIO_FLAC](#oh_avcodec_mimetype_audio_flac) | Defines the pointer to the MIME type of Free Lossless Audio Codec (FLAC) audio codec.|
83| const char \* [OH_AVCODEC_MIMETYPE_AUDIO_VORBIS](#oh_avcodec_mimetype_audio_vorbis) | Defines the pointer to the MIME type of Vorbis audio decoder.|
84| const char \* [OH_AVCODEC_MIMETYPE_AUDIO_MPEG](#oh_avcodec_mimetype_audio_mpeg) | Defines the pointer to the MIME type of MP3 audio decoder.|
85| const char \* [OH_AVCODEC_MIMETYPE_VIDEO_HEVC](#oh_avcodec_mimetype_video_hevc) | Defines the pointer to the MIME type of HEVC (H.265) video codec.|
86| const char \* [OH_AVCODEC_MIMETYPE_VIDEO_MPEG4](#oh_avcodec_mimetype_video_mpeg4) | Defines the pointer to the MIME type of MPEG4 video encoder, which is used only for muxing MPEG4 video streams.|
87| const char \* [OH_AVCODEC_MIMETYPE_IMAGE_JPG](#oh_avcodec_mimetype_image_jpg) | Defines the pointer to the MIME type of JPG image encoder, which is used only for muxing JPG covers.|
88| const char \* [OH_AVCODEC_MIMETYPE_IMAGE_PNG](#oh_avcodec_mimetype_image_png) | Defines the pointer to the MIME type of PNG image encoder, which is used only for muxing PNG covers.|
89| const char \* [OH_AVCODEC_MIMETYPE_IMAGE_BMP](#oh_avcodec_mimetype_image_bmp) | Defines the pointer to the MIME type of BMP image encoder, which is used only for muxing BMP covers.|
90| const char \* [OH_AVCODEC_MIMETYPE_AUDIO_VIVID](#oh_avcodec_mimetype_audio_vivid) | Defines the pointer to the MIME type of Audio Vivid audio decoder. (This specification is not available yet.)|
91| const char \* [OH_AVCODEC_MIMETYPE_AUDIO_AMR_NB](#oh_avcodec_mimetype_audio_amr_nb) | Defines the pointer to the MIME type of AMR-NB audio decoder.|
92| const char \* [OH_AVCODEC_MIMETYPE_AUDIO_AMR_WB](#oh_avcodec_mimetype_audio_amr_wb) | Defines the pointer to the MIME type of AMR-WB audio decoder.|
93| const char \* [OH_AVCODEC_MIMETYPE_AUDIO_OPUS](#oh_avcodec_mimetype_audio_opus) | Defines the pointer to the MIME type of Opus audio codec. (This specification is not available yet.)|
94| const char \* [OH_AVCODEC_MIMETYPE_AUDIO_G711MU](#oh_avcodec_mimetype_audio_g711mu) | Defines the pointer to the MIME type of G.711 mu-law audio codec.|
95| const char \* [OH_ED_KEY_TIME_STAMP](#oh_ed_key_time_stamp) | Defines the pointer to the timestamp in the extra data of the surface. The value type is int64.|
96| const char \* [OH_ED_KEY_EOS](#oh_ed_key_eos) | Defines the pointer to the end of stream (EOS) in the extra data of the surface. The value type is Boolean.|
97| const char \* [OH_MD_KEY_TRACK_TYPE](#oh_md_key_track_type) | Defines the pointer to the track type. The value type is uint8_t. For details, see [OH_MediaType](#oh_mediatype).|
98| const char \* [OH_MD_KEY_CODEC_MIME](#oh_md_key_codec_mime) | Define the pointer to the MIME type of codec. The value type is string.|
99| const char \* [OH_MD_KEY_DURATION](#oh_md_key_duration) | Defines the pointer to the duration. The value type is int64_t.|
100| const char \* [OH_MD_KEY_BITRATE](#oh_md_key_bitrate) | Defines the pointer to the bit rate. The value type is int64_t.|
101| const char \* [OH_MD_KEY_MAX_INPUT_SIZE](#oh_md_key_max_input_size) | Defines the pointer to the maximum input size. The value type is uint32_t.|
102| const char \* [OH_MD_KEY_WIDTH](#oh_md_key_width) | Defines the pointer to the video width. The value type is uint32_t.|
103| const char \* [OH_MD_KEY_HEIGHT](#oh_md_key_height) | Defines the pointer to the video height. The value type is uint32_t.|
104| const char \* [OH_MD_KEY_PIXEL_FORMAT](#oh_md_key_pixel_format) | Defines the pointer to the video pixel format. The value type is int32_t. For details, see [OH_AVPixelFormat](_core.md#oh_avpixelformat).|
105| const char \* [OH_MD_KEY_AUDIO_SAMPLE_FORMAT](#oh_md_key_audio_sample_format) | Defines the pointer to the original audio format. The value type is uint32_t.|
106| const char \* [OH_MD_KEY_FRAME_RATE](#oh_md_key_frame_rate) | Defines the pointer to the video frame rate. The value type is double.|
107| const char \* [OH_MD_KEY_VIDEO_ENCODE_BITRATE_MODE](#oh_md_key_video_encode_bitrate_mode) | Defines the pointer to the video encoding bit rate mode. The value type is int32_t. For details, see [OH_VideoEncodeBitrateMode](_video_encoder.md#oh_videoencodebitratemode).|
108| const char \* [OH_MD_KEY_PROFILE](#oh_md_key_profile) | Defines the pointer to the encoding template. The value type is number. For details, see [OH_HEVCProfile](#oh_hevcprofile) and [OH_AACProfile](#oh_aacprofile).|
109| const char \* [OH_MD_KEY_AUD_CHANNEL_COUNT](#oh_md_key_aud_channel_count) | Defines the pointer to the number of audio channels. The value type is uint32_t.|
110| const char \* [OH_MD_KEY_AUD_SAMPLE_RATE](#oh_md_key_aud_sample_rate) | Defines the pointer to the audio sampling rate. The value type is uint32_t.|
111| const char \* [OH_MD_KEY_I_FRAME_INTERVAL](#oh_md_key_i_frame_interval) | Defines the pointer to the key frame interval, in milliseconds. The value type is int32_t.|
112| const char \* [OH_MD_KEY_ROTATION](#oh_md_key_rotation) | Defines the pointer to the rotation angle of the surface. The value type is int32_t, and the value range is {0, 90, 180, 270}. The default value is 0.|
113| const char \* [OH_MD_KEY_RANGE_FLAG](#oh_md_key_range_flag) | Defines the pointer to the video YUV value range flag. The value type is Boolean.|
114| const char \* [OH_MD_KEY_COLOR_PRIMARIES](#oh_md_key_color_primaries) | Defines the pointer to the video primary color. The value type is int32_t. For details, see [OH_ColorPrimary](#oh_colorprimary).|
115| const char \* [OH_MD_KEY_TRANSFER_CHARACTERISTICS](#oh_md_key_transfer_characteristics) | Defines the pointer to the video transfer characteristics. The value type is int32_t. For details, see [OH_TransferCharacteristic](#oh_transfercharacteristic).|
116| const char \* [OH_MD_KEY_MATRIX_COEFFICIENTS](#oh_md_key_matrix_coefficients) | Defines the pointer to the video matrix coefficient. The value type is int32_t. For details, see [OH_MatrixCoefficient](#oh_matrixcoefficient).|
117| const char \* [OH_MD_KEY_REQUEST_I_FRAME](#oh_md_key_request_i_frame) | Defines the pointer to the request for immediate encoding of I-frames. The value type is Boolean.|
118| const char \* [OH_MD_KEY_QUALITY](#oh_md_key_quality) | Defines the pointer to the required encoding quality. The value type is uint32_t. This key applies only to encoders configured in constant quality mode.|
119| const char \* [OH_MD_KEY_CODEC_CONFIG](#oh_md_key_codec_config) | Defines the pointer to the codec-specific data. The value type is uint8_t.|
120| const char \* [OH_MD_KEY_TITLE](#oh_md_key_title) | Defines the pointer to the title of the input media. The value type is string.|
121| const char \* [OH_MD_KEY_ARTIST](#oh_md_key_artist) | Defines the pointer to the artist of the input media. The value type is string.|
122| const char \* [OH_MD_KEY_ALBUM](#oh_md_key_album) | Defines the pointer to the album of the input media. The value type is string.|
123| const char \* [OH_MD_KEY_ALBUM_ARTIST](#oh_md_key_album_artist) | Defines the pointer to the album artist of the input media. The value type is string.|
124| const char \* [OH_MD_KEY_DATE](#oh_md_key_date) | Defines the pointer to the date of the input media. The value type is string.|
125| const char \* [OH_MD_KEY_COMMENT](#oh_md_key_comment) | Defines the pointer to the comment of the input media. The value type is string.|
126| const char \* [OH_MD_KEY_GENRE](#oh_md_key_genre) | Defines the pointer to the genre of the input media. The value type is string.|
127| const char \* [OH_MD_KEY_COPYRIGHT](#oh_md_key_copyright) | Defines the pointer to the copyright of the input media. The value type is string.|
128| const char \* [OH_MD_KEY_LANGUAGE](#oh_md_key_language) | Defines the pointer to the language of the input media. The value type is string.|
129| const char \* [OH_MD_KEY_DESCRIPTION](#oh_md_key_description) | Defines the pointer to the description of the input media. The value type is string.|
130| const char \* [OH_MD_KEY_LYRICS](#oh_md_key_lyrics) | Defines the pointer to the lyrics of the input media. The value type is string.|
131| const char \* [OH_MD_KEY_TRACK_COUNT](#oh_md_key_track_count) | Defines the pointer to the track count of the input media. The value type is uint32_t.|
132| const char \* [OH_MD_KEY_CHANNEL_LAYOUT](#oh_md_key_channel_layout) | Defines the pointer to the required encoding channel layout. The value type is int64_t. This key applies only to encoders.|
133| const char \* [OH_MD_KEY_BITS_PER_CODED_SAMPLE](#oh_md_key_bits_per_coded_sample) | Defines the pointer to the number of bits for each coded sample. The value type is uint32_t. This key applies to FLAC encoders. For details, see [OH_BitsPerSample](#oh_bitspersample).|
134| const char \* [OH_MD_KEY_AAC_IS_ADTS](#oh_md_key_aac_is_adts) | Defines the pointer to the AAC format. The value type is uint32_t. This key applies to AAC decoders.|
135| const char \* [OH_MD_KEY_SBR](#oh_md_key_sbr) | Defines the pointer to the AAC SBR format. The value type is uint32_t. This key applies to AAC encoders.|
136| const char \* [OH_MD_KEY_COMPLIANCE_LEVEL](#oh_md_key_compliance_level) | Defines the pointer to the FLAC compliance level. The value type is int32_t.|
137| const char \* [OH_MD_KEY_IDENTIFICATION_HEADER](#oh_md_key_identification_header) | Defines the pointer to the Vorbis identification header. The value type is uint8_t. This key applies only to Vorbis decoders.|
138| const char \* [OH_MD_KEY_SETUP_HEADER](#oh_md_key_setup_header) | Defines the pointer to the Vorbis setup header. The value type is uint8_t. This key applies only to Vorbis decoders.|
139| const char \* [OH_MD_KEY_SCALING_MODE](#oh_md_key_scaling_mode) | Defines the pointer to the video surface scale mode. The value type is int32_t. For details, see [OH_ScalingMode](#oh_scalingmode).|
140| const char \* [OH_MD_MAX_INPUT_BUFFER_COUNT](#oh_md_max_input_buffer_count) | Defines the pointer to the maximum number of input buffers. The value type is int32_t.|
141| const char \* [OH_MD_MAX_OUTPUT_BUFFER_COUNT](#oh_md_max_output_buffer_count) | Defines the pointer to the maximum number of output buffers. The value type is int32_t.|
142| const char \* [OH_MD_KEY_AUDIO_COMPRESSION_LEVEL](#oh_md_key_audio_compression_level) | Defines the pointer to the audio codec compression level. The value type is uint32_t.|
143| const char \* [OH_MD_KEY_VIDEO_IS_HDR_VIVID](#oh_md_key_video_is_hdr_vivid) | Defines the pointer to indicate whether it is HDR Vivid. The value type is Boolean.|
144| const char \* [OH_MD_KEY_AUDIO_OBJECT_NUMBER](#oh_md_key_audio_object_number) | Defines the pointer to the number of audio objects. The value type is int32_t.|
145| const char \* [OH_MD_KEY_AUDIO_VIVID_METADATA](#oh_md_key_audio_vivid_metadata) | Defines the pointer to the Audio Vivid metadata. The value type is uint8_t.|
146
147
148## Type Description
149
150
151### OH_AACProfile
152
153```
154typedef enum OH_AACProfileOH_AACProfile
155```
156
157**Description**
158
159Defines an enum that enumerates the AAC profiles.
160
161**System capability**: SystemCapability.Multimedia.Media.CodecBase
162
163**Since**: 9
164
165
166### OH_AVCodecAsyncCallback
167
168```
169typedef struct OH_AVCodecAsyncCallbackOH_AVCodecAsyncCallback
170```
171
172**Description**
173
174Defines a struct for all the asynchronous callback function pointers of an **OH_AVCodec** instance. To ensure the normal running of **OH_AVCodec**, you must register the instance of this struct with the **OH_AVCodec** instance and process the information reported by the callback function.
175
176**System capability**: SystemCapability.Multimedia.Media.CodecBase
177
178**Since**: 9
179
180**Deprecated from**: 11
181
182**Substitute**: [OH_AVCodecCallback](#oh_avcodeccallback)
183
184**Parameters**
185
186| Name| Description|
187| -------- | -------- |
188| onError | Callback used to report a codec operation error. For details, see [OH_AVCodecOnError](#oh_avcodeconerror).|
189| onStreamChanged | Callback used to report a codec stream change. For details, see [OH_AVCodecOnStreamChanged](#oh_avcodeconstreamchanged).|
190| onNeedInputData | Callback used to report input data required. For details, see [OH_AVCodecOnNeedInputData](#oh_avcodeconneedinputdata).|
191| onNeedOutputData | Callback used to report output data generated. For details, see [OH_AVCodecOnNewOutputData](#oh_avcodeconnewoutputdata).|
192
193
194### OH_AVCodecCallback
195
196```
197typedef struct OH_AVCodecCallbackOH_AVCodecCallback
198```
199
200**Description**
201
202Defines a struct for all the asynchronous callback function pointers of an **OH_AVCodec** instance. To ensure the normal running of **OH_AVCodec**, you must register the instance of this struct with the **OH_AVCodec** instance and process the information reported by the callback function.
203
204**System capability**: SystemCapability.Multimedia.Media.CodecBase
205
206**Since**: 11
207
208**Parameters**
209
210| Name| Description|
211| -------- | -------- |
212| onError | Callback used to report a codec operation error. For details, see [OH_AVCodecOnError](#oh_avcodeconerror).|
213| onStreamChanged | Callback used to report a codec stream change. For details, see [OH_AVCodecOnStreamChanged](#oh_avcodeconstreamchanged).|
214| onNeedInputBuffer | Callback used to report input data required. For details, see [OH_AVCodecOnNeedInputBuffer](#oh_avcodeconneedinputbuffer).|
215| onNewOutputBuffer | Callback used to report output data generated. For details, see [OH_AVCodecOnNewOutputBuffer](#oh_avcodeconnewoutputbuffer).|
216
217
218### OH_AVCodecOnError
219
220```
221typedef void(* OH_AVCodecOnError) (OH_AVCodec *codec, int32_t errorCode, void *userData)
222```
223
224**Description**
225
226Defines the pointer to the function that is called to report error information when an error occurs during the running of an **OH_AVCodec** instance.
227
228**System capability**: SystemCapability.Multimedia.Media.CodecBase
229
230**Since**: 9
231
232**Parameters**
233
234| Name| Description|
235| -------- | -------- |
236| codec | Pointer to an **OH_AVCodec** instance.|
237| errorCode | Error code.|
238| userData | Pointer to user-specific data.|
239
240
241### OH_AVCodecOnNeedInputBuffer
242
243```
244typedef void(* OH_AVCodecOnNeedInputBuffer) (OH_AVCodec *codec, uint32_t index, OH_AVBuffer *buffer, void *userData)
245```
246
247**Description**
248
249Defines the pointer to the function that is called when new input data is required during the running of an **OH_AVCodec** instance. The function carries a buffer to fill in new input data.
250
251**System capability**: SystemCapability.Multimedia.Media.CodecBase
252
253**Since**: 11
254
255**Parameters**
256
257| Name| Description|
258| -------- | -------- |
259| codec | Pointer to an **OH_AVCodec** instance.|
260| index | Index of the new input buffer.|
261| buffer | Pointer to the data to fill in the new input buffer.|
262| userData | Pointer to user-specific data.|
263
264
265### OH_AVCodecOnNeedInputData
266
267```
268typedef void(* OH_AVCodecOnNeedInputData) (OH_AVCodec *codec, uint32_t index, OH_AVMemory *data, void *userData)
269```
270
271**Description**
272
273Defines the pointer to the function that is called when new input data is required during the running of an **OH_AVCodec** instance. The function carries a buffer to fill in new input data.
274
275**System capability**: SystemCapability.Multimedia.Media.CodecBase
276
277**Since**: 9
278
279**Deprecated version**: 11
280
281**Substitute**: [OH_AVCodecOnNeedInputBuffer](#oh_avcodeconneedinputbuffer)
282
283**Parameters**
284
285| Name| Description|
286| -------- | -------- |
287| codec | Pointer to an **OH_AVCodec** instance.|
288| index | Index of the new input buffer.|
289| data | Pointer to the data to fill in the new input buffer.|
290| userData | Pointer to user-specific data.|
291
292
293### OH_AVCodecOnNewOutputBuffer
294
295```
296typedef void(* OH_AVCodecOnNewOutputBuffer) (OH_AVCodec *codec, uint32_t index, OH_AVBuffer *buffer, void *userData)
297```
298
299**Description**
300
301Defines the pointer to the function that is called when new output data is generated during the running of an **OH_AVCodec** instance. The function carries a buffer filled with new output data.
302
303**System capability**: SystemCapability.Multimedia.Media.CodecBase
304
305**Since**: 11
306
307**Parameters**
308
309| Name| Description|
310| -------- | -------- |
311| codec | Pointer to an **OH_AVCodec** instance.|
312| index | Index of the new output buffer.|
313| buffer | Pointer to the data filled in the new output buffer.|
314| userData | Pointer to user-specific data.|
315
316
317### OH_AVCodecOnNewOutputData
318
319```
320typedef void(* OH_AVCodecOnNewOutputData) (OH_AVCodec *codec, uint32_t index, OH_AVMemory *data, OH_AVCodecBufferAttr *attr, void *userData)
321```
322
323**Description**
324
325Defines the pointer to the function that is called when new output data is generated during the running of an **OH_AVCodec** instance. The function carries a buffer filled with new output data. Note that the lifecycle of the pointer to the **OH_AVCodecBufferAttr** instance is valid only when the function pointer is being called. Do not access the pointer to the instance after the function pointer is called.
326
327**System capability**: SystemCapability.Multimedia.Media.CodecBase
328
329**Since**: 9
330
331**Deprecated from**: 11
332
333**Substitute**: [OH_AVCodecOnNewOutputBuffer](#oh_avcodeconnewoutputbuffer)
334
335**Parameters**
336
337| Name| Description|
338| -------- | -------- |
339| codec | Pointer to an **OH_AVCodec** instance.|
340| index | Index of the new output buffer.|
341| data | Pointer to the data filled in the new output buffer.|
342| attr | Pointer to the description information about the new output buffer. For details, see [OH_AVCodecBufferAttr](_o_h___a_v_codec_buffer_attr.md).|
343| userData | Pointer to user-specific data.|
344
345
346### OH_AVCodecOnStreamChanged
347
348```
349typedef void(* OH_AVCodecOnStreamChanged) (OH_AVCodec *codec, OH_AVFormat *format, void *userData)
350```
351
352**Description**
353
354Defines the pointer to the function that is called to report the new stream description when the output stream changes. Note that the lifecycle of the pointer to the **OH_AVFormat** instance is valid only when the function pointer is being called. Do not access the pointer to the instance after the function pointer is called.
355
356**System capability**: SystemCapability.Multimedia.Media.CodecBase
357
358**Since**: 9
359
360**Parameters**
361
362| Name| Description|
363| -------- | -------- |
364| codec | Pointer to an **OH_AVCodec** instance.|
365| format | Pointer to the description information about the new output stream.|
366| userData | Pointer to user-specific data.|
367
368
369### OH_AVCProfile
370
371```
372typedef enum OH_AVCProfileOH_AVCProfile
373```
374
375**Description**
376
377Defines an enum that enumerates the AVC profiles.
378
379**System capability**: SystemCapability.Multimedia.Media.CodecBase
380
381**Since**: 9
382
383
384### OH_AVOutputFormat
385
386```
387typedef enum OH_AVOutputFormatOH_AVOutputFormat
388```
389
390**Description**
391
392Defines an enum that enumerates the output file formats of a muxer.
393
394**System capability**: SystemCapability.Multimedia.Media.CodecBase
395
396**Since**: 10
397
398
399### OH_AVSeekMode
400
401```
402typedef enum OH_AVSeekModeOH_AVSeekMode
403```
404
405**Description**
406
407Defines an enum that enumerates the seek modes.
408
409**System capability**: SystemCapability.Multimedia.Media.CodecBase
410
411**Since**: 10
412
413
414### OH_BitsPerSample
415
416```
417typedef enum OH_BitsPerSampleOH_BitsPerSample
418```
419
420**Description**
421
422Defines an enum that enumerates the number of audio bits for each coded sample.
423
424**System capability**: SystemCapability.Multimedia.Media.CodecBase
425
426**Since**: 10
427
428
429### OH_ColorPrimary
430
431```
432typedef enum OH_ColorPrimaryOH_ColorPrimary
433```
434
435**Description**
436
437Defines an enum that enumerates the primary colors.
438
439**System capability**: SystemCapability.Multimedia.Media.CodecBase
440
441**Since**: 10
442
443
444### OH_HEVCProfile
445
446```
447typedef enum OH_HEVCProfileOH_HEVCProfile
448```
449
450**Description**
451
452Defines an enum that enumerates the HEVC profiles.
453
454**System capability**: SystemCapability.Multimedia.Media.CodecBase
455
456**Since**: 10
457
458
459### OH_MatrixCoefficient
460
461```
462typedef enum OH_MatrixCoefficientOH_MatrixCoefficient
463```
464
465**Description**
466
467Defines an enum that enumerates the matrix coefficients.
468
469**System capability**: SystemCapability.Multimedia.Media.CodecBase
470
471**Since**: 10
472
473
474### OH_MediaType
475
476```
477typedef enum OH_MediaTypeOH_MediaType
478```
479
480**Description**
481
482Defines an enum that enumerates the media types.
483
484**System capability**: SystemCapability.Multimedia.Media.CodecBase
485
486**Since**: 9
487
488
489### OH_ScalingMode
490
491```
492typedef enum OH_ScalingModeOH_ScalingMode
493```
494
495**Description**
496
497Defines an enum that enumerates the scaling modes.
498
499**System capability**: SystemCapability.Multimedia.Media.CodecBase
500
501**Since**: 10
502
503
504### OH_TransferCharacteristic
505
506```
507typedef enum OH_TransferCharacteristicOH_TransferCharacteristic
508```
509
510**Description**
511
512Defines an enum that enumerates the transfer characteristics.
513
514**System capability**: SystemCapability.Multimedia.Media.CodecBase
515
516**Since**: 10
517
518
519## Enum Description
520
521
522### AudioChannelLayout
523
524```
525enum AudioChannelLayout : uint64_t
526```
527
528**Description**
529
530Enumerates the types of the audio channel sets. The output format of the decoder is represented as the channel type of the codec.
531
532**System capability**: SystemCapability.Multimedia.Media.CodecBase
533
534**Since**: 10
535
536**Deprecated from**: 11
537
538**Substitute**: [OH_AudioChannelLayout](_core.md#oh_audiochannellayout)
539
540| Value| Description|
541| -------- | -------- |
542| UNKNOWN_CHANNEL_LAYOUT | Unknown.|
543| MONO | Mono layout.|
544| STEREO | Stereo layout|
545| CH_2POINT1 | 2.1 layout.|
546| CH_2_1 | 2_1 layout.|
547| SURROUND | Surround layout.|
548| CH_3POINT1 | 3.1 layout.|
549| CH_4POINT0 | 4.0 layout.|
550| CH_4POINT1 | 4.1 layout.|
551| CH_2_2 | 2_2 layout.|
552| QUAD | Quad layout.|
553| CH_5POINT0 | 5.0 layout.|
554| CH_5POINT1 | 5.1 layout.|
555| CH_5POINT0_BACK | 5.0 rear layout.|
556| CH_5POINT1_BACK | 5.1 rear layout.|
557| CH_6POINT0 | 6.0 layout.|
558| CH_6POINT0_FRONT | 6.0 front layout.|
559| HEXAGONAL | Hexagonal layout.|
560| CH_6POINT1 | 6.1 layout.|
561| CH_6POINT1_BACK | 6.1 rear layout.|
562| CH_6POINT1_FRONT | 6.1 front layout.|
563| CH_7POINT0 | 7.0 layout.|
564| CH_7POINT0_FRONT | 7.0 front layout.|
565| CH_7POINT1 | 7.1 layout.|
566| CH_7POINT1_WIDE | 7.1 wide layout.|
567| CH_7POINT1_WIDE_BACK | 7.1 rear wide layout.|
568| CH_3POINT1POINT2 | 3.1.2 layout.|
569| CH_5POINT1POINT2 | 5.1.2 layout.|
570| CH_5POINT1POINT4 | 5.1.4 layout.|
571| CH_7POINT1POINT2 | 7.1.2 layout.|
572| CH_7POINT1POINT4 | 7.1.4 layout.|
573| CH_9POINT1POINT4 | 9.1.4 layout.|
574| CH_9POINT1POINT6 | 9.1.6 layout.|
575| CH_10POINT2 | 10.2 layout.|
576| CH_22POINT2 | 22.2 layout.|
577| OCTAGONAL | Octagonal layout.|
578| HEXADECAGONAL | Hexadecagonal layout.|
579| STEREO_DOWNMIX | Stereo downmix layout.|
580| HOA_FIRST | High-Order Ambisonics (HOA) first-order layout.|
581| HOA_SECOND | HOA second-order layout.|
582| HOA_THIRD | HOA third-order layout.|
583
584
585### AudioChannelSet
586
587```
588enum AudioChannelSet : uint64_t
589```
590
591**Description**
592
593Enumerates the audio channel sets. Each channel number is mapped to a variable of int64.
594
595**System capability**: SystemCapability.Multimedia.Media.CodecBase
596
597**Since**: 10
598
599**Deprecated from**: 11. Use [OH_AudioChannelSet](_core.md#oh_audiochannelset) instead.
600
601| Value| Description|
602| -------- | -------- |
603| FRONT_LEFT | Front left channel.|
604| FRONT_RIGHT | Front right channel|
605| FRONT_CENTER | Front center channel.|
606| LOW_FREQUENCY | Low-frequency channel.|
607| BACK_LEFT | Rear left channel.|
608| BACK_RIGHT | Rear right channel|
609| FRONT_LEFT_OF_CENTER | Front left center channel.|
610| FRONT_RIGHT_OF_CENTER | Front right center channel.|
611| BACK_CENTER | Rear center channel.|
612| SIDE_LEFT | Left channel.|
613| SIDE_RIGHT | Right channel.|
614| TOP_CENTER | Top center channel.|
615| TOP_FRONT_LEFT | Top left front channel.|
616| TOP_FRONT_CENTER | Top center front channel.|
617| TOP_FRONT_RIGHT | Top right front channel.|
618| TOP_BACK_LEFT | Top left rear channel.|
619| TOP_BACK_CENTER | Top center rear channel.|
620| TOP_BACK_RIGHT | Top right rear channel.|
621| STEREO_LEFT | Stereo left channel.|
622| STEREO_RIGHT | Stereo right channel.|
623| WIDE_LEFT | Wide left channel.|
624| WIDE_RIGHT | Wide right channel.|
625| SURROUND_DIRECT_LEFT | Left surround channel.|
626| SURROUND_DIRECT_RIGHT | Right surround channel.|
627| LOW_FREQUENCY_2 | Low-frequency channel 2.|
628| TOP_SIDE_LEFT | Top left channel.|
629| TOP_SIDE_RIGHT | Top right channel.|
630| BOTTOM_FRONT_CENTER | Bottom center front channel.|
631| BOTTOM_FRONT_LEFT | Bottom left front channel.|
632| BOTTOM_FRONT_RIGHT | Bottom right front channel.|
633| AMBISONICS_ACN0 | Channel 0 for the zero-order stereo.|
634| AMBISONICS_ACN1 | Channel 1 for the first-order stereo.|
635| AMBISONICS_ACN2 | Channel 2 for the first-order stereo.|
636| AMBISONICS_ACN3 | Channel 3 for the first-order stereo.|
637| AMBISONICS_W | Equivalent to channel 0 for the zero-order stereo.|
638| AMBISONICS_Y | Equivalent to channel 1 for the first-order stereo.|
639| AMBISONICS_Z | Equivalent to channel 2 for the first-order stereo.|
640| AMBISONICS_X | Equivalent to channel 3 for the first-order stereo.|
641| AMBISONICS_ACN4 | Channel 4 for the second-order stereo.|
642| AMBISONICS_ACN5 | Channel 5 for the second-order stereo.|
643| AMBISONICS_ACN6 | Channel 6 for the second-order stereo.|
644| AMBISONICS_ACN7 | Channel 7 for the second-order stereo.|
645| AMBISONICS_ACN8 | Channel 8 for the second-order stereo.|
646| AMBISONICS_ACN9 | Channel 9 for the third-order stereo.|
647| AMBISONICS_ACN10 | Channel 10 for the third-order stereo.|
648| AMBISONICS_ACN11 | Channel 11 for the third-order stereo.|
649| AMBISONICS_ACN12 | Channel 12 for the third-order stereo.|
650| AMBISONICS_ACN13 | Channel 13 for the third-order stereo.|
651| AMBISONICS_ACN14 | Channel 14 for the third-order stereo.|
652| AMBISONICS_ACN15 | Channel 15 for the third-order stereo.|
653
654
655### OH_AACProfile
656
657```
658enum OH_AACProfile
659```
660
661**Description**
662
663Enumerates the AAC profiles.
664
665**System capability**: SystemCapability.Multimedia.Media.CodecBase
666
667**Since**: 9
668
669| Value| Description|
670| -------- | -------- |
671| AAC_PROFILE_LC | Low complexity level.|
672
673
674### OH_AVCProfile
675
676```
677enum OH_AVCProfile
678```
679
680**Description**
681
682Enumerates the AVC profiles.
683
684**System capability**: SystemCapability.Multimedia.Media.CodecBase
685
686**Since**: 9
687
688| Value| Description|
689| -------- | -------- |
690| AVC_PROFILE_BASELINE | Baseline.|
691| AVC_PROFILE_HIGH | High.|
692| AVC_PROFILE_MAIN | Main.|
693
694
695### OH_AVOutputFormat
696
697```
698enum OH_AVOutputFormat
699```
700
701**Description**
702
703Enumerates the output file formats of a muxer.
704
705**System capability**: SystemCapability.Multimedia.Media.CodecBase
706
707**Since**: 10
708
709| Value| Description|
710| -------- | -------- |
711| AV_OUTPUT_FORMAT_DEFAULT | Default format, which is MP4.|
712| AV_OUTPUT_FORMAT_MPEG_4 | MP4.|
713| AV_OUTPUT_FORMAT_M4A | M4A.|
714
715
716### OH_AVSeekMode
717
718```
719enum OH_AVSeekMode
720```
721
722**Description**
723
724Enumerates the seek modes.
725
726**System capability**: SystemCapability.Multimedia.Media.CodecBase
727
728**Since**: 10
729
730| Value| Description|
731| -------- | -------- |
732| SEEK_MODE_NEXT_SYNC | Seeks to the next key frame at the specified position.|
733| SEEK_MODE_PREVIOUS_SYNC | Seeks to the previous key frame at the specified position.|
734| SEEK_MODE_CLOSEST_SYNC | Seeks to the latest key frame at the specified position.|
735
736
737### OH_BitsPerSample
738
739```
740enum OH_BitsPerSample
741```
742
743**Description**
744
745Enumerates the number of audio bits for each coded sample.
746
747**System capability**: SystemCapability.Multimedia.Media.CodecBase
748
749**Since**: 10
750
751| Value| Description|
752| -------- | -------- |
753| SAMPLE_U8 | 8-bit unsigned integer sampling.|
754| SAMPLE_S16LE | 16-bit signed integer sampling.|
755| SAMPLE_S24LE | 24-bit signed integer sampling.|
756| SAMPLE_S32LE | 32-bit signed integer sampling.|
757| SAMPLE_F32LE | 32-bit floating-point sampling.|
758| SAMPLE_U8P | 8-bit unsigned integer plane sampling.|
759| SAMPLE_S16P | 16-bit signed integer plane sampling.|
760| SAMPLE_S24P | 24-bit signed integer plane sampling.|
761| SAMPLE_S32P | 32-bit signed integer plane sampling.|
762| SAMPLE_F32P | 32-bit floating-point plane sampling.|
763| INVALID_WIDTH | Invalid sampling format.|
764
765
766### OH_ColorPrimary
767
768```
769enum OH_ColorPrimary
770```
771
772**Description**
773
774Enumerates the primary colors.
775
776**System capability**: SystemCapability.Multimedia.Media.CodecBase
777
778**Since**: 10
779
780| Value| Description|
781| -------- | -------- |
782| COLOR_PRIMARY_BT709 | BT.709 color gamut.|
783| COLOR_PRIMARY_UNSPECIFIED | Unspecified color gamut.|
784| COLOR_PRIMARY_BT470_M | BT.470 System M color gamut.|
785| COLOR_PRIMARY_BT601_625 | BT.601 625 color gamut.|
786| COLOR_PRIMARY_BT601_525 | BT.601 525 color gamut.|
787| COLOR_PRIMARY_SMPTE_ST240 | SMPTE ST 240 color gamut.|
788| COLOR_PRIMARY_GENERIC_FILM | Generic film color gamut.|
789| COLOR_PRIMARY_BT2020 | BT.2020 color gamut.|
790| COLOR_PRIMARY_SMPTE_ST428 | SMPTE ST 428 color gamut.|
791| COLOR_PRIMARY_P3DCI | DCI-P3 color gamut.|
792| COLOR_PRIMARY_P3D65 | P3-D65 color gamut.|
793
794
795### OH_HEVCProfile
796
797```
798enum OH_HEVCProfile
799```
800
801**Description**
802
803Enumerates the HEVC profiles.
804
805**System capability**: SystemCapability.Multimedia.Media.CodecBase
806
807**Since**: 10
808
809| Value| Description|
810| -------- | -------- |
811| HEVC_PROFILE_MAIN | Main.|
812| HEVC_PROFILE_MAIN_10 | Main 10.|
813| HEVC_PROFILE_MAIN_STILL | Main Still Picture.|
814| HEVC_PROFILE_MAIN_10_HDR10 | Main 10 HDR10.|
815| HEVC_PROFILE_MAIN_10_HDR10_PLUS | Main 10 HDR10+.|
816
817
818### OH_MatrixCoefficient
819
820```
821enum OH_MatrixCoefficient
822```
823
824**Description**
825
826Enumerates the matrix coefficients.
827
828**System capability**: SystemCapability.Multimedia.Media.CodecBase
829
830**Since**: 10
831
832| Value| Description|
833| -------- | -------- |
834| MATRIX_COEFFICIENT_IDENTITY | Identity matrix.|
835| MATRIX_COEFFICIENT_BT709 | BT.709 conversion matrix.|
836| MATRIX_COEFFICIENT_UNSPECIFIED | Unspecified conversion matrix.|
837| MATRIX_COEFFICIENT_FCC | FCC conversion matrix.|
838| MATRIX_COEFFICIENT_BT601_625 | BT.601 625 conversion matrix.|
839| MATRIX_COEFFICIENT_BT601_525 | BT.601 525 conversion matrix.|
840| MATRIX_COEFFICIENT_SMPTE_ST240 | SMPTE ST 240 conversion matrix.|
841| MATRIX_COEFFICIENT_YCGCO | YCgCo conversion matrix.|
842| MATRIX_COEFFICIENT_BT2020_NCL | BT.2020 NCL conversion matrix.|
843| MATRIX_COEFFICIENT_BT2020_CL | BT.2020 CL conversion matrix.|
844| MATRIX_COEFFICIENT_SMPTE_ST2085 | SMPTE ST 2085 conversion matrix.|
845| MATRIX_COEFFICIENT_CHROMATICITY_NCL | Chromaticity NCL conversion matrix.|
846| MATRIX_COEFFICIENT_CHROMATICITY_CL | Chromaticity CL conversion matrix.|
847| MATRIX_COEFFICIENT_ICTCP | ICTCP conversion matrix.|
848
849
850### OH_MediaType
851
852```
853enum OH_MediaType
854```
855
856**Description**
857
858Enumerates the media types.
859
860**System capability**: SystemCapability.Multimedia.Media.CodecBase
861
862**Since**: 9
863
864| Value| Description|
865| -------- | -------- |
866| MEDIA_TYPE_AUD | Audio track.|
867| MEDIA_TYPE_VID | Video track.|
868
869
870### OH_ScalingMode
871
872```
873enum OH_ScalingMode
874```
875
876**Description**
877
878Enumerates the scaling modes.
879
880**System capability**: SystemCapability.Multimedia.Media.CodecBase
881
882**Since**: 10
883
884| Value| Description|
885| -------- | -------- |
886| SCALING_MODE_SCALE_TO_WINDOW | Scales the image based on the window size.|
887| SCALING_MODE_SCALE_CROP | Crops the image based on the window size.|
888
889
890### OH_TransferCharacteristic
891
892```
893enum OH_TransferCharacteristic
894```
895
896**Description**
897
898Enumerates the transfer characteristics.
899
900**System capability**: SystemCapability.Multimedia.Media.CodecBase
901
902**Since**: 10
903
904| Value| Description|
905| -------- | -------- |
906| TRANSFER_CHARACTERISTIC_BT709 | BT.709 transfer function.|
907| TRANSFER_CHARACTERISTIC_UNSPECIFIED | Unspecified transfer function.|
908| TRANSFER_CHARACTERISTIC_GAMMA_2_2 | Gamma 2-2 transfer function.|
909| TRANSFER_CHARACTERISTIC_GAMMA_2_8 | Gamma 2-8 transfer function.|
910| TRANSFER_CHARACTERISTIC_BT601 | BT.601 transfer function.|
911| TRANSFER_CHARACTERISTIC_SMPTE_ST240 | SMPTE ST 240 transfer function.|
912| TRANSFER_CHARACTERISTIC_LINEAR | Linear transfer function.|
913| TRANSFER_CHARACTERISTIC_LOG | Log transfer function.|
914| TRANSFER_CHARACTERISTIC_LOG_SQRT | Log SQRT transfer function.|
915| TRANSFER_CHARACTERISTIC_IEC_61966_2_4 | IEC61966-2.4 transfer function.|
916| TRANSFER_CHARACTERISTIC_BT1361 | BT.1361 transfer function.|
917| TRANSFER_CHARACTERISTIC_IEC_61966_2_1 | IEC61966 2.1 transfer function.|
918| TRANSFER_CHARACTERISTIC_BT2020_10BIT | BT.2020 10-bit transfer function.|
919| TRANSFER_CHARACTERISTIC_BT2020_12BIT | BT.2020 12-bit transfer function.|
920| TRANSFER_CHARACTERISTIC_PQ | PQ transfer function.|
921| TRANSFER_CHARACTERISTIC_SMPTE_ST428 | SMPTE ST.428 transfer function.|
922| TRANSFER_CHARACTERISTIC_HLG | HLG transfer function.|
923
924
925## Variable Description
926
927
928### OH_AVCODEC_MIMETYPE_AUDIO_AAC
929
930```
931const char* OH_AVCODEC_MIMETYPE_AUDIO_AAC
932```
933
934**Description**
935
936Defines the pointer to the MIME type of AAC audio codec.
937
938**System capability**: SystemCapability.Multimedia.Media.CodecBase
939
940**Since**: 9
941
942
943### OH_AVCODEC_MIMETYPE_AUDIO_AMR_NB
944
945```
946const char* OH_AVCODEC_MIMETYPE_AUDIO_AMR_NB
947```
948
949**Description**
950
951Defines the pointer to the MIME type of AMR-NB audio decoder.
952
953**System capability**: SystemCapability.Multimedia.Media.CodecBase
954
955**Since**: 11
956
957
958### OH_AVCODEC_MIMETYPE_AUDIO_AMR_WB
959
960```
961const char* OH_AVCODEC_MIMETYPE_AUDIO_AMR_WB
962```
963
964**Description**
965
966Defines the pointer to the MIME type of AMR-WB audio decoder.
967
968**System capability**: SystemCapability.Multimedia.Media.CodecBase
969
970**Since**: 11
971
972
973### OH_AVCODEC_MIMETYPE_AUDIO_FLAC
974
975```
976const char* OH_AVCODEC_MIMETYPE_AUDIO_FLAC
977```
978
979**Description**
980
981Defines the pointer to the MIME type of FLAC audio codec.
982
983**System capability**: SystemCapability.Multimedia.Media.CodecBase
984
985**Since**: 10
986
987
988### OH_AVCODEC_MIMETYPE_AUDIO_G711MU
989
990```
991const char* OH_AVCODEC_MIMETYPE_AUDIO_G711MU
992```
993
994**Description**
995
996Defines the pointer to the MIME type of G.711 mu-law audio codec.
997
998**System capability**: SystemCapability.Multimedia.Media.CodecBase
999
1000**Since**: 11
1001
1002
1003### OH_AVCODEC_MIMETYPE_AUDIO_MPEG
1004
1005```
1006const char* OH_AVCODEC_MIMETYPE_AUDIO_MPEG
1007```
1008
1009**Description**
1010
1011Defines the pointer to the MIME type of MP3 audio decoder.
1012
1013**System capability**: SystemCapability.Multimedia.Media.CodecBase
1014
1015**Since**: 10
1016
1017
1018### OH_AVCODEC_MIMETYPE_AUDIO_OPUS
1019
1020```
1021const char* OH_AVCODEC_MIMETYPE_AUDIO_OPUS
1022```
1023
1024**Description**
1025
1026Defines the pointer to the MIME type of Opus audio codec. (This specification is not available yet.)
1027
1028**System capability**: SystemCapability.Multimedia.Media.CodecBase
1029
1030**Since**: 11
1031
1032
1033### OH_AVCODEC_MIMETYPE_AUDIO_VIVID
1034
1035```
1036const char* OH_AVCODEC_MIMETYPE_AUDIO_VIVID
1037```
1038
1039**Description**
1040
1041Defines the pointer to the MIME type of Audio Vivid audio decoder. (This specification is not available yet.)
1042
1043**System capability**: SystemCapability.Multimedia.Media.CodecBase
1044
1045**Since**: 11
1046
1047
1048### OH_AVCODEC_MIMETYPE_AUDIO_VORBIS
1049
1050```
1051const char* OH_AVCODEC_MIMETYPE_AUDIO_VORBIS
1052```
1053
1054**Description**
1055
1056Defines the pointer to the MIME type of Vorbis audio decoder.
1057
1058**System capability**: SystemCapability.Multimedia.Media.CodecBase
1059
1060**Since**: 10
1061
1062
1063### OH_AVCODEC_MIMETYPE_IMAGE_BMP
1064
1065```
1066const char* OH_AVCODEC_MIMETYPE_IMAGE_BMP
1067```
1068
1069**Description**
1070
1071Defines the pointer to the MIME type of BMP image encoder, which is used only for muxing BMP covers.
1072
1073**System capability**: SystemCapability.Multimedia.Media.CodecBase
1074
1075**Since**: 10
1076
1077
1078### OH_AVCODEC_MIMETYPE_IMAGE_JPG
1079
1080```
1081const char* OH_AVCODEC_MIMETYPE_IMAGE_JPG
1082```
1083
1084**Description**
1085
1086Defines the pointer to the MIME type of JPG image encoder, which is used only for muxing JPG covers.
1087
1088**System capability**: SystemCapability.Multimedia.Media.CodecBase
1089
1090**Since**: 10
1091
1092
1093### OH_AVCODEC_MIMETYPE_IMAGE_PNG
1094
1095```
1096const char* OH_AVCODEC_MIMETYPE_IMAGE_PNG
1097```
1098
1099**Description**
1100
1101Defines the pointer to the MIME type of PNG image encoder, which is used only for muxing PNG covers.
1102
1103**System capability**: SystemCapability.Multimedia.Media.CodecBase
1104
1105**Since**: 10
1106
1107
1108### OH_AVCODEC_MIMETYPE_VIDEO_AVC
1109
1110```
1111const char* OH_AVCODEC_MIMETYPE_VIDEO_AVC
1112```
1113
1114**Description**
1115
1116Defines the pointer to the MIME type of AVC (H.264) video codec.
1117
1118**System capability**: SystemCapability.Multimedia.Media.CodecBase
1119
1120**Since**: 9
1121
1122
1123### OH_AVCODEC_MIMETYPE_VIDEO_HEVC
1124
1125```
1126const char* OH_AVCODEC_MIMETYPE_VIDEO_HEVC
1127```
1128
1129**Description**
1130
1131Defines the pointer to the MIME type of HEVC (H.265) video codec.
1132
1133**System capability**: SystemCapability.Multimedia.Media.CodecBase
1134
1135**Since**: 10
1136
1137
1138### OH_AVCODEC_MIMETYPE_VIDEO_MPEG4
1139
1140```
1141const char* OH_AVCODEC_MIMETYPE_VIDEO_MPEG4
1142```
1143
1144**Description**
1145
1146Defines the pointer to the MIME type of MPEG4 video encoder, which is used only for muxing MPEG4 video streams.
1147
1148**System capability**: SystemCapability.Multimedia.Media.CodecBase
1149
1150**Since**: 10
1151
1152**Deprecated from**: 11
1153
1154
1155### OH_ED_KEY_EOS
1156
1157```
1158const char* OH_ED_KEY_EOS
1159```
1160
1161**Description**
1162
1163Defines the pointer to the EOS in the extra data of the surface. The value type is Boolean.
1164
1165**System capability**: SystemCapability.Multimedia.Media.CodecBase
1166
1167**Since**: 9
1168
1169
1170### OH_ED_KEY_TIME_STAMP
1171
1172```
1173const char* OH_ED_KEY_TIME_STAMP
1174```
1175
1176**Description**
1177
1178Defines the pointer to the timestamp in the extra data of the surface. The value type is int64.
1179
1180**System capability**: SystemCapability.Multimedia.Media.CodecBase
1181
1182**Since**: 9
1183
1184
1185### OH_MD_KEY_AAC_IS_ADTS
1186
1187```
1188const char* OH_MD_KEY_AAC_IS_ADTS
1189```
1190
1191**Description**
1192
1193Defines the pointer to the AAC format. The value type is uint32_t. This key applies to AAC decoders.
1194
1195**System capability**: SystemCapability.Multimedia.Media.CodecBase
1196
1197**Since**: 10
1198
1199
1200### OH_MD_KEY_ALBUM
1201
1202```
1203const char* OH_MD_KEY_ALBUM
1204```
1205
1206**Description**
1207
1208Defines the pointer to the album of the input media. The value type is string.
1209
1210**System capability**: SystemCapability.Multimedia.Media.CodecBase
1211
1212**Since**: 10
1213
1214
1215### OH_MD_KEY_ALBUM_ARTIST
1216
1217```
1218const char* OH_MD_KEY_ALBUM_ARTIST
1219```
1220
1221**Description**
1222
1223Defines the pointer to the album artist of the input media. The value type is string.
1224
1225**System capability**: SystemCapability.Multimedia.Media.CodecBase
1226
1227**Since**: 10
1228
1229
1230### OH_MD_KEY_ARTIST
1231
1232```
1233const char* OH_MD_KEY_ARTIST
1234```
1235
1236**Description**
1237
1238Defines the pointer to the artist of the input media. The value type is string.
1239
1240**System capability**: SystemCapability.Multimedia.Media.CodecBase
1241
1242**Since**: 10
1243
1244
1245### OH_MD_KEY_AUD_CHANNEL_COUNT
1246
1247```
1248const char* OH_MD_KEY_AUD_CHANNEL_COUNT
1249```
1250
1251**Description**
1252
1253Defines the pointer to the number of audio channels. The value type is uint32_t.
1254
1255**System capability**: SystemCapability.Multimedia.Media.CodecBase
1256
1257**Since**: 9
1258
1259
1260### OH_MD_KEY_AUD_SAMPLE_RATE
1261
1262```
1263const char* OH_MD_KEY_AUD_SAMPLE_RATE
1264```
1265
1266**Description**
1267
1268Defines the pointer to the audio sampling rate. The value type is uint32_t.
1269
1270**System capability**: SystemCapability.Multimedia.Media.CodecBase
1271
1272**Since**: 9
1273
1274
1275### OH_MD_KEY_AUDIO_COMPRESSION_LEVEL
1276
1277```
1278const char* OH_MD_KEY_AUDIO_COMPRESSION_LEVEL
1279```
1280
1281**Description**
1282
1283Defines the pointer to the audio codec compression level. The value type is uint32_t.
1284
1285**System capability**: SystemCapability.Multimedia.Media.CodecBase
1286
1287**Since**: 11
1288
1289
1290### OH_MD_KEY_AUDIO_OBJECT_NUMBER
1291
1292```
1293const char* OH_MD_KEY_AUDIO_OBJECT_NUMBER
1294```
1295
1296**Description**
1297
1298Defines the pointer to the number of audio objects. The value type is int32_t.
1299
1300**System capability**: SystemCapability.Multimedia.Media.CodecBase
1301
1302**Since**: 11
1303
1304
1305### OH_MD_KEY_AUDIO_SAMPLE_FORMAT
1306
1307```
1308const char* OH_MD_KEY_AUDIO_SAMPLE_FORMAT
1309```
1310
1311**Description**
1312
1313Defines the pointer to the original audio format. The value type is uint32_t.
1314
1315**System capability**: SystemCapability.Multimedia.Media.CodecBase
1316
1317**Since**: 9
1318
1319
1320### OH_MD_KEY_AUDIO_VIVID_METADATA
1321
1322```
1323const char* OH_MD_KEY_AUDIO_VIVID_METADATA
1324```
1325
1326**Description**
1327
1328Defines the pointer to the Audio Vivid metadata. The value type is uint8_t.
1329
1330**System capability**: SystemCapability.Multimedia.Media.CodecBase
1331
1332**Since**: 11
1333
1334
1335### OH_MD_KEY_BITRATE
1336
1337```
1338const char* OH_MD_KEY_BITRATE
1339```
1340
1341**Description**
1342
1343Defines the pointer to the bit rate. The value type is int64_t.
1344
1345**System capability**: SystemCapability.Multimedia.Media.CodecBase
1346
1347**Since**: 9
1348
1349
1350### OH_MD_KEY_BITS_PER_CODED_SAMPLE
1351
1352```
1353const char* OH_MD_KEY_BITS_PER_CODED_SAMPLE
1354```
1355
1356**Description**
1357
1358Defines the pointer to the number of bits for each coded sample. The value type is uint32_t. This key applies to FLAC encoders. For details, see [OH_BitsPerSample](#oh_bitspersample).
1359
1360**System capability**: SystemCapability.Multimedia.Media.CodecBase
1361
1362**Since**: 10
1363
1364
1365### OH_MD_KEY_CHANNEL_LAYOUT
1366
1367```
1368const char* OH_MD_KEY_CHANNEL_LAYOUT
1369```
1370
1371**Description**
1372
1373Defines the pointer to the required encoding channel layout. The value type is int64_t. This key applies only to encoders.
1374
1375**System capability**: SystemCapability.Multimedia.Media.CodecBase
1376
1377**Since**: 10
1378
1379
1380### OH_MD_KEY_CODEC_CONFIG
1381
1382```
1383const char* OH_MD_KEY_CODEC_CONFIG
1384```
1385
1386**Description**
1387
1388Defines the pointer to the codec-specific data. The value type is uint8_t.
1389
1390**System capability**: SystemCapability.Multimedia.Media.CodecBase
1391
1392**Since**: 10
1393
1394
1395### OH_MD_KEY_CODEC_MIME
1396
1397```
1398const char* OH_MD_KEY_CODEC_MIME
1399```
1400
1401**Description**
1402
1403Define the pointer to the MIME type of codec. The value type is string.
1404
1405**System capability**: SystemCapability.Multimedia.Media.CodecBase
1406
1407**Since**: 9
1408
1409
1410### OH_MD_KEY_COLOR_PRIMARIES
1411
1412```
1413const char* OH_MD_KEY_COLOR_PRIMARIES
1414```
1415
1416**Description**
1417
1418Defines the pointer to the video primary color. The value type is int32_t. For details, see [OH_ColorPrimary](#oh_colorprimary).
1419
1420**System capability**: SystemCapability.Multimedia.Media.CodecBase
1421
1422**Since**: 10
1423
1424
1425### OH_MD_KEY_COMMENT
1426
1427```
1428const char* OH_MD_KEY_COMMENT
1429```
1430
1431**Description**
1432
1433Defines the pointer to the comment of the input media. The value type is string.
1434
1435**System capability**: SystemCapability.Multimedia.Media.CodecBase
1436
1437**Since**: 10
1438
1439
1440### OH_MD_KEY_COMPLIANCE_LEVEL
1441
1442```
1443const char* OH_MD_KEY_COMPLIANCE_LEVEL
1444```
1445
1446**Description**
1447
1448Defines the pointer to the FLAC compliance level. The value type is int32_t.
1449
1450**System capability**: SystemCapability.Multimedia.Media.CodecBase
1451
1452**Since**: 10
1453
1454
1455### OH_MD_KEY_COPYRIGHT
1456
1457```
1458const char* OH_MD_KEY_COPYRIGHT
1459```
1460
1461**Description**
1462
1463Defines the pointer to the copyright of the input media. The value type is string.
1464
1465**System capability**: SystemCapability.Multimedia.Media.CodecBase
1466
1467**Since**: 10
1468
1469
1470### OH_MD_KEY_DATE
1471
1472```
1473const char* OH_MD_KEY_DATE
1474```
1475
1476**Description**
1477
1478Defines the pointer to the date of the input media. The value type is string.
1479
1480**System capability**: SystemCapability.Multimedia.Media.CodecBase
1481
1482**Since**: 10
1483
1484
1485### OH_MD_KEY_DESCRIPTION
1486
1487```
1488const char* OH_MD_KEY_DESCRIPTION
1489```
1490
1491**Description**
1492
1493Defines the pointer to the description of the input media. The value type is string.
1494
1495**System capability**: SystemCapability.Multimedia.Media.CodecBase
1496
1497**Since**: 10
1498
1499
1500### OH_MD_KEY_DURATION
1501
1502```
1503const char* OH_MD_KEY_DURATION
1504```
1505
1506**Description**
1507
1508Defines the pointer to the duration. The value type is int64_t.
1509
1510**System capability**: SystemCapability.Multimedia.Media.CodecBase
1511
1512**Since**: 9
1513
1514
1515### OH_MD_KEY_FRAME_RATE
1516
1517```
1518const char* OH_MD_KEY_FRAME_RATE
1519```
1520
1521**Description**
1522
1523Defines the pointer to the video frame rate. The value type is double.
1524
1525**System capability**: SystemCapability.Multimedia.Media.CodecBase
1526
1527**Since**: 9
1528
1529
1530### OH_MD_KEY_GENRE
1531
1532```
1533const char* OH_MD_KEY_GENRE
1534```
1535
1536**Description**
1537
1538Defines the pointer to the genre of the input media. The value type is string.
1539
1540**System capability**: SystemCapability.Multimedia.Media.CodecBase
1541
1542**Since**: 10
1543
1544
1545### OH_MD_KEY_HEIGHT
1546
1547```
1548const char* OH_MD_KEY_HEIGHT
1549```
1550
1551**Description**
1552
1553Defines the pointer to the video height. The value type is uint32_t.
1554
1555**System capability**: SystemCapability.Multimedia.Media.CodecBase
1556
1557**Since**: 9
1558
1559
1560### OH_MD_KEY_I_FRAME_INTERVAL
1561
1562```
1563const char* OH_MD_KEY_I_FRAME_INTERVAL
1564```
1565
1566**Description**
1567
1568Defines the pointer to the key frame interval, in milliseconds. The value type is int32_t.
1569
1570**System capability**: SystemCapability.Multimedia.Media.CodecBase
1571
1572**Since**: 9
1573
1574
1575### OH_MD_KEY_IDENTIFICATION_HEADER
1576
1577```
1578const char* OH_MD_KEY_IDENTIFICATION_HEADER
1579```
1580
1581**Description**
1582
1583Defines the pointer to the Vorbis identification header. The value type is uint8_t. This key applies only to Vorbis decoders.
1584
1585**System capability**: SystemCapability.Multimedia.Media.CodecBase
1586
1587**Since**: 10
1588
1589
1590### OH_MD_KEY_LANGUAGE
1591
1592```
1593const char* OH_MD_KEY_LANGUAGE
1594```
1595
1596**Description**
1597
1598Defines the pointer to the language of the input media. The value type is string.
1599
1600**System capability**: SystemCapability.Multimedia.Media.CodecBase
1601
1602**Since**: 10
1603
1604
1605### OH_MD_KEY_LYRICS
1606
1607```
1608const char* OH_MD_KEY_LYRICS
1609```
1610
1611**Description**
1612
1613Defines the pointer to the lyrics of the input media. The value type is string.
1614
1615**System capability**: SystemCapability.Multimedia.Media.CodecBase
1616
1617**Since**: 10
1618
1619
1620### OH_MD_KEY_MATRIX_COEFFICIENTS
1621
1622```
1623const char* OH_MD_KEY_MATRIX_COEFFICIENTS
1624```
1625
1626**Description**
1627
1628Defines the pointer to the video matrix coefficient. The value type is int32_t. For details, see [OH_MatrixCoefficient](#oh_matrixcoefficient).
1629
1630**System capability**: SystemCapability.Multimedia.Media.CodecBase
1631
1632**Since**: 10
1633
1634
1635### OH_MD_KEY_MAX_INPUT_SIZE
1636
1637```
1638const char* OH_MD_KEY_MAX_INPUT_SIZE
1639```
1640
1641**Description**
1642
1643Defines the pointer to the maximum input size. The value type is uint32_t.
1644
1645**System capability**: SystemCapability.Multimedia.Media.CodecBase
1646
1647**Since**: 9
1648
1649
1650### OH_MD_KEY_PIXEL_FORMAT
1651
1652```
1653const char* OH_MD_KEY_PIXEL_FORMAT
1654```
1655
1656**Description**
1657
1658Defines the pointer to the video pixel format. The value type is int32_t. For details, see [OH_AVPixelFormat](_core.md#oh_avpixelformat).
1659
1660**System capability**: SystemCapability.Multimedia.Media.CodecBase
1661
1662**Since**: 9
1663
1664
1665### OH_MD_KEY_PROFILE
1666
1667```
1668const char* OH_MD_KEY_PROFILE
1669```
1670
1671**Description**
1672
1673Defines the pointer to the encoding template. The value type is number. For details, see [OH_HEVCProfile](#oh_hevcprofile) and [OH_AACProfile](#oh_aacprofile).
1674
1675**System capability**: SystemCapability.Multimedia.Media.CodecBase
1676
1677**Since**: 9
1678
1679
1680### OH_MD_KEY_QUALITY
1681
1682```
1683const char* OH_MD_KEY_QUALITY
1684```
1685
1686**Description**
1687
1688Defines the pointer to the required encoding quality. The value type is uint32_t. This key applies only to encoders configured in constant quality mode.
1689
1690**System capability**: SystemCapability.Multimedia.Media.CodecBase
1691
1692**Since**: 10
1693
1694
1695### OH_MD_KEY_RANGE_FLAG
1696
1697```
1698const char* OH_MD_KEY_RANGE_FLAG
1699```
1700
1701**Description**
1702
1703Defines the pointer to the video YUV value range flag. The value type is Boolean.
1704
1705**System capability**: SystemCapability.Multimedia.Media.CodecBase
1706
1707**Since**: 10
1708
1709
1710### OH_MD_KEY_REQUEST_I_FRAME
1711
1712```
1713const char* OH_MD_KEY_REQUEST_I_FRAME
1714```
1715
1716**Description**
1717
1718Defines the pointer to the request for immediate encoding of I-frames. The value type is Boolean.
1719
1720**System capability**: SystemCapability.Multimedia.Media.CodecBase
1721
1722**Since**: 10
1723
1724
1725### OH_MD_KEY_ROTATION
1726
1727```
1728const char* OH_MD_KEY_ROTATION
1729```
1730
1731**Description**
1732
1733Defines the pointer to the rotation angle of the surface. The value type is int32_t, and the value range is {0, 90, 180, 270}. The default value is 0.
1734
1735**System capability**: SystemCapability.Multimedia.Media.CodecBase
1736
1737**Since**: 9
1738
1739
1740### OH_MD_KEY_SBR
1741
1742```
1743const char* OH_MD_KEY_SBR
1744```
1745
1746**Description**
1747
1748Defines the pointer to the AAC SBR format. The value type is uint32_t. This key applies to AAC encoders.
1749
1750**System capability**: SystemCapability.Multimedia.Media.CodecBase
1751
1752**Since**: 10
1753
1754
1755### OH_MD_KEY_SCALING_MODE
1756
1757```
1758const char* OH_MD_KEY_SCALING_MODE
1759```
1760
1761**Description**
1762
1763Defines the pointer to the video surface scale mode. The value type is int32_t. For details, see [OH_ScalingMode](#oh_scalingmode).
1764
1765**System capability**: SystemCapability.Multimedia.Media.CodecBase
1766
1767**Since**: 10
1768
1769
1770### OH_MD_KEY_SETUP_HEADER
1771
1772```
1773const char* OH_MD_KEY_SETUP_HEADER
1774```
1775
1776**Description**
1777
1778Defines the pointer to the Vorbis setup header. The value type is uint8_t. This key applies only to Vorbis decoders.
1779
1780**System capability**: SystemCapability.Multimedia.Media.CodecBase
1781
1782**Since**: 10
1783
1784
1785### OH_MD_KEY_TITLE
1786
1787```
1788const char* OH_MD_KEY_TITLE
1789```
1790
1791**Description**
1792
1793Defines the pointer to the title of the input media. The value type is string.
1794
1795**System capability**: SystemCapability.Multimedia.Media.CodecBase
1796
1797**Since**: 10
1798
1799
1800### OH_MD_KEY_TRACK_COUNT
1801
1802```
1803const char* OH_MD_KEY_TRACK_COUNT
1804```
1805
1806**Description**
1807
1808Defines the pointer to the track count of the input media. The value type is uint32_t.
1809
1810**System capability**: SystemCapability.Multimedia.Media.CodecBase
1811
1812**Since**: 10
1813
1814
1815### OH_MD_KEY_TRACK_TYPE
1816
1817```
1818const char* OH_MD_KEY_TRACK_TYPE
1819```
1820
1821**Description**
1822
1823Defines the pointer to the track type. The value type is uint8_t. For details, see [OH_MediaType](#oh_mediatype).
1824
1825**System capability**: SystemCapability.Multimedia.Media.CodecBase
1826
1827**Since**: 9
1828
1829
1830### OH_MD_KEY_TRANSFER_CHARACTERISTICS
1831
1832```
1833const char* OH_MD_KEY_TRANSFER_CHARACTERISTICS
1834```
1835
1836**Description**
1837
1838Defines the pointer to the video transfer characteristics. The value type is int32_t. For details, see [OH_TransferCharacteristic](#oh_transfercharacteristic).
1839
1840**System capability**: SystemCapability.Multimedia.Media.CodecBase
1841
1842**Since**: 10
1843
1844
1845### OH_MD_KEY_VIDEO_ENCODE_BITRATE_MODE
1846
1847```
1848const char* OH_MD_KEY_VIDEO_ENCODE_BITRATE_MODE
1849```
1850
1851**Description**
1852
1853Defines the pointer to the video encoding bit rate mode. The value type is int32_t. For details, see [OH_VideoEncodeBitrateMode](_video_encoder.md#oh_videoencodebitratemode).
1854
1855**System capability**: SystemCapability.Multimedia.Media.CodecBase
1856
1857**Since**: 9
1858
1859
1860### OH_MD_KEY_VIDEO_IS_HDR_VIVID
1861
1862```
1863const char* OH_MD_KEY_VIDEO_IS_HDR_VIVID
1864```
1865
1866**Description**
1867
1868Defines the pointer to indicate whether it is HDR Vivid. The value type is Boolean.
1869
1870**System capability**: SystemCapability.Multimedia.Media.CodecBase
1871
1872**Since**: 11
1873
1874
1875### OH_MD_KEY_WIDTH
1876
1877```
1878const char* OH_MD_KEY_WIDTH
1879```
1880
1881**Description**
1882
1883Defines the pointer to the video width. The value type is uint32_t.
1884
1885**System capability**: SystemCapability.Multimedia.Media.CodecBase
1886
1887**Since**: 9
1888
1889
1890### OH_MD_MAX_INPUT_BUFFER_COUNT
1891
1892```
1893const char* OH_MD_MAX_INPUT_BUFFER_COUNT
1894```
1895
1896**Description**
1897
1898Defines the pointer to the maximum number of input buffers. The value type is int32_t.
1899
1900**System capability**: SystemCapability.Multimedia.Media.CodecBase
1901
1902**Since**: 10
1903
1904
1905### OH_MD_MAX_OUTPUT_BUFFER_COUNT
1906
1907```
1908const char* OH_MD_MAX_OUTPUT_BUFFER_COUNT
1909```
1910
1911**Description**
1912
1913Defines the pointer to the maximum number of output buffers. The value type is int32_t.
1914
1915**System capability**: SystemCapability.Multimedia.Media.CodecBase
1916
1917**Since**: 10
1918