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### Media Codec Formats
13
14The table below lists the media codec formats. The type is a constant string.
15
16| Name                                                        | Description                                                  |
17| ------------------------------------------------------------ | ------------------------------------------------------ |
18| [OH_AVCODEC_MIMETYPE_AUDIO_AAC](#oh_avcodec_mimetype_audio_aac) | MIME type of the AAC audio codec.                           |
19| [OH_AVCODEC_MIMETYPE_AUDIO_FLAC](#oh_avcodec_mimetype_audio_flac) | MIME type of the Free Lossless Audio Codec (FLAC) audio codec.                          |
20| [OH_AVCODEC_MIMETYPE_AUDIO_OPUS](#oh_avcodec_mimetype_audio_opus) | MIME type of the Opus audio codec. <!--Del-->(This specification is not available yet.)<!--DelEnd-->        |
21| [OH_AVCODEC_MIMETYPE_AUDIO_G711MU](#oh_avcodec_mimetype_audio_g711mu) | MIME type of the G.711 mu-law audio codec.                        |
22| [OH_AVCODEC_MIMETYPE_AUDIO_VORBIS](#oh_avcodec_mimetype_audio_vorbis) | MIME type of the Vorbis audio decoder.                          |
23| [OH_AVCODEC_MIMETYPE_AUDIO_MPEG](#oh_avcodec_mimetype_audio_mpeg) | MIME type of the MP3 audio decoder.                             |
24| [OH_AVCODEC_MIMETYPE_AUDIO_VIVID](#oh_avcodec_mimetype_audio_vivid) | MIME type of the Audio Vivid audio decoder. <!--Del-->(This specification is not available yet.)<!--DelEnd-->     |
25| [OH_AVCODEC_MIMETYPE_AUDIO_AMR_NB](#oh_avcodec_mimetype_audio_amr_nb) | MIME type of the AMR-NB audio decoder.                          |
26| [OH_AVCODEC_MIMETYPE_AUDIO_AMR_WB](#oh_avcodec_mimetype_audio_amr_wb) | MIME type of the AMR-WB audio decoder.                          |
27| [OH_AVCODEC_MIMETYPE_AUDIO_APE](#oh_avcodec_mimetype_audio_ape) |MIME type of the APE audio decoder.                        |
28| [OH_AVCODEC_MIMETYPE_VIDEO_HEVC](#oh_avcodec_mimetype_video_hevc) | MIME type of the HEVC (H.265) video codec.                   |
29| [OH_AVCODEC_MIMETYPE_VIDEO_AVC](#oh_avcodec_mimetype_video_avc) | Multipurpose Internet Mail Extension (MIME) type of AVC (H.264) video codec.                    |
30| [OH_AVCODEC_MIMETYPE_VIDEO_MPEG4](#oh_avcodec_mimetype_video_mpeg4) | MIME type of the MPEG4 video encoder, which is used only for muxing MPEG4 video streams.|
31| [OH_AVCODEC_MIMETYPE_IMAGE_JPG](#oh_avcodec_mimetype_image_jpg) | MIME type of the JPG image encoder, which is used only for muxing JPG covers.      |
32| [OH_AVCODEC_MIMETYPE_IMAGE_PNG](#oh_avcodec_mimetype_image_png) | MIME type of the PNG image encoder, which is used only for muxing PNG covers.      |
33| [OH_AVCODEC_MIMETYPE_IMAGE_BMP](#oh_avcodec_mimetype_image_bmp) | MIME type of the BMP image encoder, which is used only for muxing BMP covers.      |
34| [OH_AVCODEC_MIMETYPE_SUBTITLE_WEBVTT](#oh_avcodec_mimetype_subtitle_webvtt) |MIME type of the WEBVTT subtitle demuxer.                        |
35| [OH_AVCODEC_MIMETYPE_SUBTITLE_SRT](#oh_avcodec_mimetype_subtitle_srt) |MIME type of the SRT subtitle demuxer.                        |
36
37
38### Media Data Key-Value Pairs
39
40The table below lists the key-value pairs used to describe media data. The key type is a constant string, and the value type can be int32_t, int64_t, float, double, char *, or uint8_t *.
41
42The OH_AVFormat API is used to configure or query parameters.
43
44Key-value pairs dedicated for capability query:
45
46| Name                                                        | Description                                                        |
47| ------------------------------------------------------------ | ------------------------------------------------------------ |
48| [OH_FEATURE_PROPERTY_KEY_VIDEO_ENCODER_MAX_LTR_FRAME_COUNT](#oh_feature_property_key_video_encoder_max_ltr_frame_count)     | Maximum number of long-term reference (LTR) frames obtained during video encoding. The value type is int32_t.|
49
50Common key-value pairs of audio and video:
51
52| Name                                                        | Description                                                        |
53| ------------------------------------------------------------ | ------------------------------------------------------------ |
54| [OH_MD_KEY_CODEC_CONFIG](#oh_md_key_codec_config)            | Codec-specific data. In the case of video, data carried in **SPS/PPS** is transferred. In the case of audio, data carried in **extraData** is transferred. The value type is uint8_t\*. This key is optional. <!--Del-->(This key is not supported yet for the video codec.)<!--DelEnd--> |
55| [OH_MD_MAX_INPUT_BUFFER_COUNT](#oh_md_max_input_buffer_count) | Maximum number of input buffers. The value type is int32_t. This key is optional.     |
56| [OH_MD_MAX_OUTPUT_BUFFER_COUNT](#oh_md_max_output_buffer_count) | Maximum number of output buffers. The value type is int32_t. This key is optional.       |
57| [OH_MD_KEY_BITRATE](#oh_md_key_bitrate)                      | Bit rate. The value type is int64_t. This key is used in audio and video encoding scenarios. It is optional in video encoding scenarios.|
58| [OH_MD_KEY_PROFILE](#oh_md_key_profile)                      | Encoding grading. The value type is int32_t. For details, see [OH_AVCProfile](#oh_avcprofile), [OH_HEVCProfile](#oh_hevcprofile), and [OH_AACProfile](#oh_aacprofile). This key is optional.|
59| [OH_MD_KEY_MAX_INPUT_SIZE](#oh_md_key_max_input_size)        | Maximum size of an input stream to decode. The value type is int32_t. This key is optional.          |
60
61
62The table below lists the video-dedicated key-value pairs.
63
64| Name                                                        | Description                                                        |
65| ------------------------------------------------------------ | ------------------------------------------------------------ |
66| [OH_ED_KEY_TIME_STAMP](#oh_ed_key_time_stamp)                | Surface buffer timestamp. The value is of the int64_t type. This key is optional. <!--Del-->(This key is not supported yet.)<!--DelEnd--> |
67| [OH_ED_KEY_EOS](#oh_ed_key_eos)                              | End of stream for the surface buffer. The value type is int32_t. This key is optional. <!--Del-->(This key is not supported yet.)<!--DelEnd-->|
68| [OH_MD_KEY_WIDTH](#oh_md_key_width)                          | Video width. The value type is int32_t.                            |
69| [OH_MD_KEY_HEIGHT](#oh_md_key_height)                        | Video height. The value type is int32_t.                              |
70| [OH_MD_KEY_PIXEL_FORMAT](#oh_md_key_pixel_format)            | Video pixel format. The value type is int32_t. For details, see [OH_AVPixelFormat](_core.md#oh_avpixelformat).|
71| [OH_MD_KEY_FRAME_RATE](#oh_md_key_frame_rate)                | Video frame rate. The value type is double. This key is optional.                |
72| [OH_MD_KEY_RANGE_FLAG](#oh_md_key_range_flag)                | Video YUV value range flag. The value type is int32_t. The value **1** means a full range, and **0** means a limited range. This key is optional.|
73| [OH_MD_KEY_COLOR_PRIMARIES](#oh_md_key_color_primaries)      | Video primary color. The value type is int32_t. For details, see [OH_ColorPrimary](#oh_colorprimary). The video primary color complies with Table 2 in the H.273 standard. This key is optional.|
74| [OH_MD_KEY_TRANSFER_CHARACTERISTICS](#oh_md_key_transfer_characteristics) | Video transfer characteristics. The value type is int32_t. For details, see [OH_TransferCharacteristic](#oh_transfercharacteristic). The video transfer characteristics comply with Table 3 in the H.273 standard. This key is optional.|
75| [OH_MD_KEY_MATRIX_COEFFICIENTS](#oh_md_key_matrix_coefficients) | Video matrix coefficient. The value type is int32_t. For details, see [OH_MatrixCoefficient](#oh_matrixcoefficient). The video matrix coefficient complies with Table 4 in the H.273 standard. This key is optional.|
76| [OH_MD_KEY_VIDEO_STRIDE](#oh_md_key_video_stride)       | Stride of the video frame. The value type is int32_t. This key is optional.       |
77| [OH_MD_KEY_VIDEO_SLICE_HEIGHT](#oh_md_key_video_slice_height)    | Height of the video frame. The value type is int32_t. This key is optional.       |
78| [OH_MD_KEY_VIDEO_PIC_WIDTH](#oh_md_key_video_pic_width)       | Width of the video frame. The value type is int32_t. This key is optional.       |
79| [OH_MD_KEY_VIDEO_PIC_HEIGHT](#oh_md_key_video_pic_height)    | Height of the video frame. The value type is int32_t. This key is optional.       |
80| [OH_MD_KEY_VIDEO_ENABLE_LOW_LATENCY](#oh_md_key_video_enable_low_latency)   | Enabled status of low-latency video codec. The value type is int32_t. The value **1** means that low-latency video codec is enabled, and **0** means the opposite. This key is optional and used only in the configuration phase.|
81| [OH_MD_KEY_VIDEO_ENCODE_BITRATE_MODE](#oh_md_key_video_encode_bitrate_mode) | Video encoding bit rate mode. The value type is int32_t. For details, see [OH_VideoEncodeBitrateMode](_video_encoder.md#oh_videoencodebitratemode). This key is optional.|
82| [OH_MD_KEY_QUALITY](#oh_md_key_quality)                      | Required encoding quality. The value type is int32_t. This key applies only to encoders configured in constant quality mode. This key is optional.|
83| [OH_MD_KEY_REQUEST_I_FRAME](#oh_md_key_request_i_frame)      | Request for immediate encoding of I-frames. The value type is int32_t. This key is optional.           |
84| [OH_MD_KEY_I_FRAME_INTERVAL](#oh_md_key_i_frame_interval)    | Key frame interval, in milliseconds. The value type is int32_t. This key is optional and is used only for video encoding.|
85| [OH_MD_KEY_VIDEO_ENCODER_ENABLE_TEMPORAL_SCALABILITY](#oh_md_key_video_encoder_enable_temporal_scalability)          | Enabled status of temporal scalability. The value type is int32_t. The value **1** means temporal scalability is enabled, and **0** means the opposite. This key is optional and used only in the configuration phase of video encoding.|
86| [OH_MD_KEY_VIDEO_ENCODER_TEMPORAL_GOP_SIZE](#oh_md_key_video_encoder_temporal_gop_size)       | Size of a temporal image group. The value type is int32_t. This key is valid only when temporal scalability is enabled. This key is optional and used only in the configuration phase of video encoding.|
87| [OH_MD_KEY_VIDEO_ENCODER_TEMPORAL_GOP_REFERENCE_MODE](#oh_md_key_video_encoder_temporal_gop_reference_mode)         | Reference mode in a temporal image group. The value type is int32_t. For details, see [OH_TemporalGopReferenceMode](#oh_temporalgopreferencemode-1). This key is valid only when temporal scalability is enabled. This key is optional and used only in the configuration phase of video encoding.|
88| [OH_MD_KEY_VIDEO_ENCODER_LTR_FRAME_COUNT](#oh_md_key_video_encoder_ltr_frame_count)        | Number of LTR frames. The value type is int32_t. The value must be within the supported value range. This key is optional and is used only for video encoding.|
89| [OH_MD_KEY_VIDEO_ENCODER_PER_FRAME_MARK_LTR](#oh_md_key_video_encoder_per_frame_mark_ltr)  | Whether the current frame is marked as an LTR frame. The value type is int32_t. The value **1** means that the frame is marked as an LTR frame, and **0** means the opposite. This key is optional and is used only for video encoding.|
90| [OH_MD_KEY_VIDEO_ENCODER_PER_FRAME_USE_LTR](#oh_md_key_video_encoder_per_frame_use_ltr)    | 	LTR frame referenced by the current frame. The value type is int32_t. This key is optional and is used only for video encoding.|
91| [OH_MD_KEY_VIDEO_PER_FRAME_IS_LTR](#oh_md_key_video_per_frame_is_ltr)      | Whether the frame corresponding to the stream output from the current OH_AVBuffer is marked as an LTR frame. The value type is int32_t. The value **1** means that the frame is an LTR frame, and **0** means the opposite. This key is optional and is used only for video encoding.|
92| [OH_MD_KEY_VIDEO_PER_FRAME_POC](#oh_md_key_video_per_frame_poc)            | POC of the frame. The value type is int32_t. This key is optional and is used only for video encoding.|
93| [OH_MD_KEY_VIDEO_ENCODER_QP_MAX](#oh_md_key_video_encoder_qp_max)       | Maximum Quantization Parameter (QP) allowed by the video encoder. The value type is int32_t. This key is optional.|
94| [OH_MD_KEY_VIDEO_ENCODER_QP_MIN](#oh_md_key_video_encoder_qp_min)      | Minimum QP allowed by the video encoder. The value type is int32_t. This key is optional.|
95| [OH_MD_KEY_VIDEO_ENCODER_QP_AVERAGE](#oh_md_key_video_encoder_qp_average)     |Average QP of video frames. The value type is int32_t. This key is optional. |
96| [OH_MD_KEY_VIDEO_ENCODER_MSE](#oh_md_key_video_encoder_mse)     |Mean Squared Error (MSE) of video frames. The value type is double. This key is optional. |
97| [OH_MD_KEY_VIDEO_DECODER_OUTPUT_COLOR_SPACE](#oh_md_key_video_decoder_output_color_space)    | Output color space of the video decoder. The value type is int32_t. The supported value is **OH_COLORSPACE_BT709_LIMIT**.|
98| [OH_MD_KEY_ROTATION](#oh_md_key_rotation)                    | 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. This key is optional and is used only for video decoding in surface mode  |
99| [OH_MD_KEY_SCALING_MODE](#oh_md_key_scaling_mode)            | Video scaling mode. The value type is int32_t. For details, see [OH_ScalingMode](#oh_scalingmode). This key is optional and is used only for video decoding in surface mode. You are advised to set the scaling mode by calling [OH_NativeWindow_NativeWindowSetScalingModeV2](../apis-arkgraphics2d/_native_window.md).|
100| [OH_MD_KEY_VIDEO_CROP_TOP](#oh_md_key_video_crop_top)       | Top coordinate (y) of the cropped rectangle. The value type is int32_t. This key is optional and is used only for video decoding.|
101| [OH_MD_KEY_VIDEO_CROP_BOTTOM](#oh_md_key_video_crop_bottom)        | Bottom coordinate (y) of the cropped rectangle. The value type is int32_t. This key is optional and is used only for video decoding.|
102| [OH_MD_KEY_VIDEO_CROP_LEFT](#oh_md_key_video_crop_left)     | Left coordinate (x) of the cropped rectangle. The value type is int32_t. This key is optional and is used only for video decoding.|
103| [OH_MD_KEY_VIDEO_CROP_RIGHT](#oh_md_key_video_crop_right)     | Right coordinate (x) of the cropped rectangle. The value type is int32_t. This key is optional and is used only for video decoding.|
104
105
106The table below lists the audio-dedicated key-value pairs.
107
108| Name                                                        | Description                                                        |
109| ------------------------------------------------------------ | ------------------------------------------------------------ |
110| [OH_MD_KEY_AUDIO_SAMPLE_FORMAT](#oh_md_key_audio_sample_format) | Original audio format. The value type is int32_t. For details, see [AudioSampleFormat](../apis-audio-kit/js-apis-audio.md#audiosampleformat8).                       |
111| [OH_MD_KEY_AUD_CHANNEL_COUNT](#oh_md_key_aud_channel_count)  | Number of audio channels. The value type is int32_t.                          |
112| [OH_MD_KEY_AUD_SAMPLE_RATE](#oh_md_key_aud_sample_rate)      | Audio sampling rate. The value type is int32_t.                            |
113| [OH_MD_KEY_AUDIO_COMPRESSION_LEVEL](#oh_md_key_audio_compression_level) | Audio codec compression level. The value type is int32_t type. This key is used only for audio encoding. This key is optional.    |
114| [OH_MD_KEY_CHANNEL_LAYOUT](#oh_md_key_channel_layout)        | Required encoding channel layout. The value type is int64_t. This key applies only to encoders. |
115| [OH_MD_KEY_BITS_PER_CODED_SAMPLE](#oh_md_key_bits_per_coded_sample) | Number of bits for each coded sample. The value type is int32_t. This key applies to FLAC encoders. For details, see [OH_BitsPerSample](#oh_bitspersample). This key is optional.|
116| [OH_MD_KEY_SBR](#oh_md_key_sbr)                              | AAC SBR format. The value type is int32_t. This key applies to AAC encoders. This key is optional.|
117| [OH_MD_KEY_COMPLIANCE_LEVEL](#oh_md_key_compliance_level)    | FLAC compliance level. The value type is int32_t. This key is used only for audio encoding. This key is optional.         |
118| [OH_MD_KEY_AAC_IS_ADTS](#oh_md_key_aac_is_adts)              | AAC format, which can be ADTS or LATM. The value type is int32_t. This key applies to AAC decoders. This key is optional. |
119| [OH_MD_KEY_IDENTIFICATION_HEADER](#oh_md_key_identification_header) | Vorbis identification header. The value type is uint8_t\*. This key applies only to Vorbis decoders. This key is optional.|
120| [OH_MD_KEY_SETUP_HEADER](#oh_md_key_setup_header)            | Vorbis setup header. The value type is uint8_t\*. This key applies only to Vorbis decoders. This key is optional.|
121| [OH_MD_KEY_AUDIO_OBJECT_NUMBER](#oh_md_key_audio_object_number) | Number of audio objects. The value type is int32_t. This key is used only for Audio Vivid decoding. This key is optional.           |
122| [OH_MD_KEY_AUDIO_VIVID_METADATA](#oh_md_key_audio_vivid_metadata) | Audio Vivid metadata. The value type is uint8_t\*. This key is used only for Audio Vivid decoding. This key is optional.    |
123
124The table below lists the key-value pairs dedicated for muxing and demuxing.
125
126| Name                                                        | Description                                                        |
127| ------------------------------------------------------------ | ------------------------------------------------------------ |
128| [OH_MD_KEY_VIDEO_IS_HDR_VIVID](#oh_md_key_video_is_hdr_vivid) | Whether the video track in a media file is HDR Vivid. The value type is int32_t. This key is used for both muxing and demuxing. This key is optional. |
129| [OH_MD_KEY_START_TIME](#oh_md_key_start_time) | Start time of the first frame in a media file. The value type is int64_t. This key is optional.           |
130| [OH_MD_KEY_TRACK_START_TIME](#oh_md_key_track_start_time) | Track start time. The value type is int64_t. This key is optional.           |
131| [OH_MD_KEY_TRACK_TYPE](#oh_md_key_track_type)                | Track type in a media file. The value type is int32_t. For details, see [OH_MediaType](#oh_mediatype-1). This key is optional.|
132| [OH_MD_KEY_DURATION](#oh_md_key_duration)                    | Duration in a media file. The value type is int64_t. This key is optional.                 |
133| [OH_MD_KEY_TITLE](#oh_md_key_title)                          | Title in a media file. The value type is string. This key is optional.              |
134| [OH_MD_KEY_ARTIST](#oh_md_key_artist)                        | Artist in a media file. The value type is string. This key is optional.            |
135| [OH_MD_KEY_ALBUM](#oh_md_key_album)                          | Album in a media file. The value type is string. This key is optional.              |
136| [OH_MD_KEY_ALBUM_ARTIST](#oh_md_key_album_artist)            | Album artist of the input media. The value type is string. This key is optional.              |
137| [OH_MD_KEY_DATE](#oh_md_key_date)                            | Date in a media file, for example, 2024. The value type is string. This key is optional.   |
138| [OH_MD_KEY_COMMENT](#oh_md_key_comment)                      | Comment in a media file. The value type is string. This key is optional.              |
139| [OH_MD_KEY_GENRE](#oh_md_key_genre)                          | Genre in a media file. The value type is string. This key is optional.              |
140| [OH_MD_KEY_COPYRIGHT](#oh_md_key_copyright)                  | Copyright in a media file. The value type is string. This key is optional.              |
141| [OH_MD_KEY_LANGUAGE](#oh_md_key_language)                    | Language in a media file. The value type is string. This key is optional.              |
142| [OH_MD_KEY_DESCRIPTION](#oh_md_key_description)              | Description in a media file. The value type is string. This key is optional.              |
143| [OH_MD_KEY_LYRICS](#oh_md_key_lyrics)                        | Lyrics in a media file. The value type is string. This key is optional.              |
144| [OH_MD_KEY_TRACK_COUNT](#oh_md_key_track_count)              | Number of tracks in a media file. The value type is int32_t. This key is optional.        |
145| [OH_MD_KEY_BUFFER_DURATION](#oh_md_key_buffer_duration) | Duration corresponding to the audio, video, or subtitle sample carried in AVBuffer, in microseconds. The value type is int64_t. This key is optional.           |
146| [OH_MD_KEY_DECODING_TIMESTAMP](#oh_md_key_decoding_timestamp) | Decoding timestamp corresponding to the audio, video, or subtitle sample carried in AVBuffer, in microseconds. The value type is int64_t. This key is optional.           |
147| [OH_MD_KEY_CODEC_MIME](#oh_md_key_codec_mime)                | MIME type of the codec. The value type is string. This key is optional.        |
148| [OH_MD_KEY_VIDEO_SAR](#oh_md_key_video_sar)                  | Aspect ratio of the sample. The value type is double.|
149
150
151## Summary
152
153
154### Files
155
156| Name| Description| 
157| -------- | -------- |
158| [avcodec_audio_channel_layout.h](avcodec__audio__channel__layout_8h.md) | Declares the enums used for audio codec.| 
159| [native_avcodec_base.h](native__avcodec__base_8h.md) | Declares the native APIs used for basic audio and video muxing, demuxing, encoding, and decoding.| 
160
161
162### Structs
163
164| Name| Description| 
165| -------- | -------- |
166| struct  [OH_AVCodecAsyncCallback](_o_h___a_v_codec_async_callback.md) | Describes all the asynchronous callback function pointers of an **OH_AVCodec** instance. (This function is deprecated in API version 11.)| 
167| struct  [OH_AVCodecCallback](_o_h___a_v_codec_callback.md) | Describes all the asynchronous callback function pointers of an **OH_AVCodec** instance.| 
168| struct  [OH_AVDataSource](_o_h___a_v_data_source.md) | Describes a user-defined data source. | 
169
170
171### Types
172
173| Name| Description| 
174| -------- | -------- |
175| typedef struct NativeWindow [OHNativeWindow](#ohnativewindow) | Defines a struct for a native object for the graphics interface. | 
176| typedef struct [OH_AVCodec](#oh_avcodec) [OH_AVCodec](#oh_avcodec) | Defines a struct for a native object for the audio and video codec interface. | 
177| typedef void(\* [OH_AVCodecOnError](#oh_avcodeconerror)) ([OH_AVCodec](#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.| 
178| typedef void(\* [OH_AVCodecOnStreamChanged](#oh_avcodeconstreamchanged)) ([OH_AVCodec](#oh_avcodec) \*codec, [OH_AVFormat](_core.md#oh_avformat) \*format, void \*userData) | Defines the pointer to the function that is called to report the new stream description when the resolution of the input stream being decoded or the output stream that has been encoded changes.| 
179| typedef void(\* [OH_AVCodecOnNeedInputData](#oh_avcodeconneedinputdata)) ([OH_AVCodec](#oh_avcodec) \*codec, uint32_t index, [OH_AVMemory](_core.md#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. (This function is deprecated in API version 11.)| 
180| typedef void(\* [OH_AVCodecOnNewOutputData](#oh_avcodeconnewoutputdata)) ([OH_AVCodec](#oh_avcodec) \*codec, uint32_t index, [OH_AVMemory](_core.md#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. (This function is deprecated in API version 11.)| 
181| typedef void(\* [OH_AVCodecOnNeedInputBuffer](#oh_avcodeconneedinputbuffer)) ([OH_AVCodec](#oh_avcodec) \*codec, uint32_t index, [OH_AVBuffer](_core.md#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.| 
182| typedef void(\* [OH_AVCodecOnNewOutputBuffer](#oh_avcodeconnewoutputbuffer)) ([OH_AVCodec](#oh_avcodec) \*codec, uint32_t index, [OH_AVBuffer](_core.md#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.| 
183| 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. (This function is deprecated in API version 11.)| 
184| 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.| 
185| typedef int32_t(\* [OH_AVDataSourceReadAt](#oh_avdatasourcereadat)) (OH_AVBuffer \*data, int32_t length, int64_t pos) | Defines a function pointer used to provide the capability of obtaining user-defined media data. | 
186| typedef struct [OH_AVDataSource](_o_h___a_v_data_source.md) [OH_AVDataSource](#oh_avdatasource) | Defines a struct for a user-defined data source. | 
187| typedef enum [OH_MediaType](#oh_mediatype-1) [OH_MediaType](#oh_mediatype) | Defines an enum for the media types.| 
188| typedef enum [OH_AACProfile](#oh_aacprofile-1) [OH_AACProfile](#oh_aacprofile) | Defines an enum for the Advanced Audio Coding (AAC) profiles.| 
189| typedef enum [OH_AVCProfile](#oh_avcprofile-1) [OH_AVCProfile](#oh_avcprofile) | Defines an enum for the Advanced Video Coding (AVC) profiles.| 
190| typedef enum [OH_HEVCProfile](#oh_hevcprofile-1) [OH_HEVCProfile](#oh_hevcprofile) | Defines an enum for the High Efficiency Video Coding (HEVC) profiles.| 
191| typedef enum [OH_AVOutputFormat](#oh_avoutputformat-1) [OH_AVOutputFormat](#oh_avoutputformat) | Defines an enum for the output file formats supported by a muxer.| 
192| typedef enum [OH_AVSeekMode](#oh_avseekmode-1) [OH_AVSeekMode](#oh_avseekmode) | Defines an enum for the seek modes.| 
193| typedef enum [OH_ScalingMode](#oh_scalingmode-1) [OH_ScalingMode](#oh_scalingmode) | Defines an enum for the scaling modes. This enum is used only in surface mode.| 
194| typedef enum [OH_BitsPerSample](#oh_bitspersample-1) [OH_BitsPerSample](#oh_bitspersample) | Defines an enum for the number of audio bits for each coded sample.| 
195| typedef enum [OH_ColorPrimary](#oh_colorprimary-1) [OH_ColorPrimary](#oh_colorprimary) | Defines an enum for the primary colors.| 
196| typedef enum [OH_TransferCharacteristic](#oh_transfercharacteristic-1) [OH_TransferCharacteristic](#oh_transfercharacteristic) | Defines an enum for the transfer characteristics.| 
197| typedef enum [OH_MatrixCoefficient](#oh_matrixcoefficient-1) [OH_MatrixCoefficient](#oh_matrixcoefficient) | Defines an enum for the matrix coefficients.| 
198| typedef enum [OH_AVCLevel](#oh_avclevel-1) [OH_AVCLevel](#oh_avclevel) | Defines an enum for the AVC levels. | 
199| typedef enum [OH_HEVCLevel](#oh_hevclevel-1) [OH_HEVCLevel](#oh_hevclevel) | Defines an enum for the HEVC levels. | 
200| typedef enum [OH_TemporalGopReferenceMode](#oh_temporalgopreferencemode-1) [OH_TemporalGopReferenceMode](#oh_temporalgopreferencemode) | Defines an enum for the reference modes of temporal image groups. | 
201
202
203### Enums
204
205| Name| Description| 
206| -------- | -------- |
207| [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_t. (This function is deprecated in API version 11.)| 
208| [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.| 
209| [OH_MediaType](#oh_mediatype-1) {<br>MEDIA_TYPE_AUD = 0,<br>MEDIA_TYPE_VID = 1,<br>MEDIA_TYPE_SUBTITILE = 2<br>} | Enumerates the media types.|
210| [OH_AACProfile](#oh_aacprofile-1) { AAC_PROFILE_LC = 0 } | Enumerates the AAC profiles.| 
211| [OH_AVCProfile](#oh_avcprofile-1) {<br>AVC_PROFILE_BASELINE = 0,<br>AVC_PROFILE_HIGH = 4,<br>AVC_PROFILE_MAIN = 8<br>} | Enumerates the AVC profiles.| 
212| [OH_HEVCProfile](#oh_hevcprofile-1) {<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.| 
213| [OH_AVOutputFormat](#oh_avoutputformat-1) {<br>AV_OUTPUT_FORMAT_DEFAULT = 0,<br>AV_OUTPUT_FORMAT_MPEG_4 = 2,<br>AV_OUTPUT_FORMAT_M4A = 6,<br>AV_OUTPUT_FORMAT_AMR = 8,<br>AV_OUTPUT_FORMAT_MP3 = 9,<br>AV_OUTPUT_FORMAT_WAV = 10<br>} | Enumerates the output file formats supported by a muxer.|
214| [OH_AVSeekMode](#oh_avseekmode-1) {<br>SEEK_MODE_NEXT_SYNC = 0,<br>SEEK_MODE_PREVIOUS_SYNC,<br>SEEK_MODE_CLOSEST_SYNC<br>} | Enumerates the seek modes.| 
215| [OH_ScalingMode](#oh_scalingmode-1) {<br>SCALING_MODE_SCALE_TO_WINDOW = 1,<br>SCALING_MODE_SCALE_CROP = 2<br>} | Enumerates the scaling modes.| 
216| [OH_BitsPerSample](#oh_bitspersample-1) {<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.| 
217| [OH_ColorPrimary](#oh_colorprimary-1) {<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.| 
218| [OH_TransferCharacteristic](#oh_transfercharacteristic-1) {<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.| 
219| [OH_MatrixCoefficient](#oh_matrixcoefficient-1) {<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.| 
220| [OH_AVCLevel](#oh_avclevel-1) {<br>AVC_LEVEL_1 = 0, <br>AVC_LEVEL_1b = 1, <br>AVC_LEVEL_11 = 2, <br>AVC_LEVEL_12 = 3,<br>AVC_LEVEL_13 = 4, <br>AVC_LEVEL_2 = 5, <br>AVC_LEVEL_21 = 6, <br>AVC_LEVEL_22 = 7,<br>AVC_LEVEL_3 = 8, <br>AVC_LEVEL_31 = 9, <br>AVC_LEVEL_32 = 10, <br>AVC_LEVEL_4 = 11,<br>AVC_LEVEL_41 = 12, <br>AVC_LEVEL_42 = 13, <br>AVC_LEVEL_5 = 14, <br>AVC_LEVEL_51 = 15, <br>AVC_LEVEL_52 = 16, <br>AVC_LEVEL_6 = 17, <br>AVC_LEVEL_61 = 18, <br>AVC_LEVEL_62 = 19<br>} | Enumerates the AVC levels. | 
221| [OH_HEVCLevel](#oh_hevclevel-1) {<br>HEVC_LEVEL_1 = 0, <br>HEVC_LEVEL_2 = 1, <br>HEVC_LEVEL_21 = 2, <br>HEVC_LEVEL_3 = 3,<br>HEVC_LEVEL_31 = 4, <br>HEVC_LEVEL_4 = 5, <br>HEVC_LEVEL_41 = 6, <br>HEVC_LEVEL_5 = 7,<br>HEVC_LEVEL_51 = 8, <br>HEVC_LEVEL_52 = 9, <br>HEVC_LEVEL_6 = 10, <br>HEVC_LEVEL_61 = 11,<br>HEVC_LEVEL_62 = 12<br>} | Enumerates the HEVC levels. | 
222| [OH_TemporalGopReferenceMode](#oh_temporalgopreferencemode-1) { <br>ADJACENT_REFERENCE = 0, <br>JUMP_REFERENCE = 1, <br>UNIFORMLY_SCALED_REFERENCE = 2 <br>} | Enumerates the reference modes of temporal image groups. | 
223
224
225### Variables
226
227| Name| Description| 
228| -------- | -------- |
229| const char \* [OH_AVCODEC_MIMETYPE_AUDIO_AAC](#oh_avcodec_mimetype_audio_aac) | Pointer to the key that describes the MIME type of the AAC audio codec.|
230| const char \* [OH_AVCODEC_MIMETYPE_AUDIO_FLAC](#oh_avcodec_mimetype_audio_flac) | Pointer to the key that describes the MIME type of the Free Lossless Audio Codec (FLAC) audio codec.|
231| const char \* [OH_AVCODEC_MIMETYPE_AUDIO_OPUS](#oh_avcodec_mimetype_audio_opus) | Pointer to the key that describes the MIME type of the Opus audio codec. <!--Del-->(This specification is not available yet.)<!--DelEnd-->  |
232| const char \* [OH_AVCODEC_MIMETYPE_AUDIO_G711MU](#oh_avcodec_mimetype_audio_g711mu) | Pointer to the key that describes the MIME type of the G.711 mu-law audio codec.|
233| const char \* [OH_AVCODEC_MIMETYPE_AUDIO_VORBIS](#oh_avcodec_mimetype_audio_vorbis) | Pointer to the key that describes the MIME type of the Vorbis audio decoder.|
234| const char \* [OH_AVCODEC_MIMETYPE_AUDIO_MPEG](#oh_avcodec_mimetype_audio_mpeg) | Pointer to the key that describes the MIME type of the MP3 audio decoder.|
235| const char \* [OH_AVCODEC_MIMETYPE_AUDIO_VIVID](#oh_avcodec_mimetype_audio_vivid) | Pointer to the key that describes the MIME type of the Audio Vivid audio decoder. <!--Del-->(This specification is not available yet.)<!--DelEnd-->  |
236| const char \* [OH_AVCODEC_MIMETYPE_AUDIO_AMR_NB](#oh_avcodec_mimetype_audio_amr_nb) | Pointer to the key that describes the MIME type of the AMR-NB audio decoder.|
237| const char \* [OH_AVCODEC_MIMETYPE_AUDIO_AMR_WB](#oh_avcodec_mimetype_audio_amr_wb) | Pointer to the key that describes the MIME type of the AMR-WB audio decoder.|
238| const char \* [OH_AVCODEC_MIMETYPE_AUDIO_APE](#oh_avcodec_mimetype_audio_ape) |Pointer to the key that describes the MIME type of the APE audio decoder.                        |
239| const char \* [OH_AVCODEC_MIMETYPE_VIDEO_HEVC](#oh_avcodec_mimetype_video_hevc) | Pointer to the key that describes the MIME type of the HEVC (H.265) video codec.|
240| const char \* [OH_AVCODEC_MIMETYPE_VIDEO_AVC](#oh_avcodec_mimetype_video_avc) | Pointer to the key that describes the MIME type of the AVC (H.264) video codec.|
241| const char \* [OH_AVCODEC_MIMETYPE_VIDEO_MPEG4](#oh_avcodec_mimetype_video_mpeg4) | Pointer to the key that describes the MIME type of the MPEG4 video encoder, which is used only for muxing MPEG4 video streams.|
242| const char \* [OH_AVCODEC_MIMETYPE_IMAGE_JPG](#oh_avcodec_mimetype_image_jpg) | Pointer to the key that describes the MIME type of the JPG image encoder, which is used only for muxing JPG covers.|
243| const char \* [OH_AVCODEC_MIMETYPE_IMAGE_PNG](#oh_avcodec_mimetype_image_png) | Pointer to the key that describes the MIME type of the PNG image encoder, which is used only for muxing PNG covers.|
244| const char \* [OH_AVCODEC_MIMETYPE_IMAGE_BMP](#oh_avcodec_mimetype_image_bmp) | Pointer to the key that describes the MIME type of the BMP image encoder, which is used only for muxing BMP covers.|
245| const char \* [OH_AVCODEC_MIMETYPE_SUBTITLE_WEBVTT](#oh_avcodec_mimetype_subtitle_webvtt) |Pointer to the key that describes the MIME type of the WEBVTT subtitle demuxer.                |
246| const char \* [OH_AVCODEC_MIMETYPE_SUBTITLE_SRT](#oh_avcodec_mimetype_subtitle_srt) |Pointer to the key that describes the MIME type of the SRT subtitle demuxer.                        |
247| const char \* [OH_FEATURE_PROPERTY_KEY_VIDEO_ENCODER_MAX_LTR_FRAME_COUNT](#oh_feature_property_key_video_encoder_max_ltr_frame_count) | Pointer to the key that describes the maximum number of LTR frames obtained during video encoding. The value type is int32_t. |
248| const char \* [OH_MD_KEY_CODEC_CONFIG](#oh_md_key_codec_config) | Pointer to the key that describes codec-specific data. In the case of video, data carried in **SPS/PPS** is transferred. In the case of audio, data carried in **extraData** is transferred. The value type is uint8_t\*. <!--Del-->(This key is not supported yet for the video codec.)<!--DelEnd--> |
249| const char \* [OH_MD_MAX_INPUT_BUFFER_COUNT](#oh_md_max_input_buffer_count) | Pointer to the key that describes the maximum number of input buffers. The value type is int32_t.|
250| const char \* [OH_MD_MAX_OUTPUT_BUFFER_COUNT](#oh_md_max_output_buffer_count) | Pointer to the key that describes the maximum number of output buffers. The value type is int32_t.|
251| const char \* [OH_MD_KEY_BITRATE](#oh_md_key_bitrate) | Pointer to the key that describes the bit rate. The value type is int64_t.|
252| const char \* [OH_MD_KEY_PROFILE](#oh_md_key_profile) | Pointer to the key that describes the encoding grading. The value type is int32_t. For details, see [OH_AVCProfile](#oh_avcprofile), [OH_HEVCProfile](#oh_hevcprofile), and [OH_AACProfile](#oh_aacprofile).|
253| const char \* [OH_MD_KEY_MAX_INPUT_SIZE](#oh_md_key_max_input_size) | Pointer to the key that describes the maximum size of an input stream to decode. The value type is int32_t.|
254| const char \* [OH_ED_KEY_TIME_STAMP](#oh_ed_key_time_stamp) | Pointer to the key that describes the surface buffer timestamp. The value is of the int64_t type. <!--Del-->(This key is not supported yet.)<!--DelEnd--> |
255| const char \* [OH_ED_KEY_EOS](#oh_ed_key_eos) | Pointer to the key that describes the end of stream for the surface buffer. The value type is int32_t. <!--Del-->(This key is not supported yet.)<!--DelEnd--> |
256| const char \* [OH_MD_KEY_WIDTH](#oh_md_key_width) | Pointer to the key that describes the video width. The value type is int32_t.|
257| const char \* [OH_MD_KEY_HEIGHT](#oh_md_key_height) | Pointer to the key that describes the video height. The value type is int32_t.|
258| const char \* [OH_MD_KEY_PIXEL_FORMAT](#oh_md_key_pixel_format) | Pointer to the key that describes the video pixel format. The value type is int32_t. For details, see [OH_AVPixelFormat](_core.md#oh_avpixelformat).|
259| const char \* [OH_MD_KEY_FRAME_RATE](#oh_md_key_frame_rate) | Pointer to the key that describes the video frame rate. The value type is double.|
260| const char \* [OH_MD_KEY_ROTATION](#oh_md_key_rotation) | Pointer to the key that describes 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. This key is used only for video decoding in surface mode.|
261| const char \* [OH_MD_KEY_RANGE_FLAG](#oh_md_key_range_flag) | Pointer to the key that describes the video YUV value range flag. The value type is int32_t. The value **1** means a full range, and **0** means a limited range.|
262| const char \* [OH_MD_KEY_COLOR_PRIMARIES](#oh_md_key_color_primaries) | Pointer to the key that describes the video primary color. The value type is int32_t. For details, see [OH_ColorPrimary](#oh_colorprimary). The video primary color complies with Table 2 in the H.273 standard.|
263| const char \* [OH_MD_KEY_TRANSFER_CHARACTERISTICS](#oh_md_key_transfer_characteristics) | Pointer to the key that describes the video transfer characteristics. The value type is int32_t. For details, see [OH_TransferCharacteristic](#oh_transfercharacteristic). The video transfer characteristics comply with Table 3 in the H.273 standard.|
264| const char \* [OH_MD_KEY_MATRIX_COEFFICIENTS](#oh_md_key_matrix_coefficients) | Pointer to the key that describes the video matrix coefficient. The value type is int32_t. For details, see [OH_MatrixCoefficient](#oh_matrixcoefficient). The video matrix coefficient complies with Table 4 in the H.273 standard.|
265| const char \* [OH_MD_KEY_SCALING_MODE](#oh_md_key_scaling_mode) | Pointer to the key that describes the video scaling mode. The value type is int32_t. For details, see [OH_ScalingMode](#oh_scalingmode). This key is optional and is used only for video decoding in surface mode. You are advised to set the scaling mode by calling [OH_NativeWindow_NativeWindowSetScalingModeV2](../apis-arkgraphics2d/_native_window.md).|
266| const char \* [OH_MD_KEY_VIDEO_CROP_TOP](#oh_md_key_video_crop_top) | Pointer to the key that describes the top coordinate (y) of the cropped rectangle. The value type is int32_t. | 
267| const char \* [OH_MD_KEY_VIDEO_CROP_BOTTOM](#oh_md_key_video_crop_bottom) | Pointer to the key that describes the bottom coordinate (y) of the cropped rectangle. The value type is int32_t. | 
268| const char \* [OH_MD_KEY_VIDEO_CROP_LEFT](#oh_md_key_video_crop_left) | Pointer to the key that describes the left coordinate (x) of the cropped rectangle. The value type is int32_t. | 
269| const char \* [OH_MD_KEY_VIDEO_CROP_RIGHT](#oh_md_key_video_crop_right) | Pointer to the key that describes the right coordinate (x) of the cropped rectangle. The value type is int32_t.| 
270| const char \* [OH_MD_KEY_VIDEO_STRIDE](#oh_md_key_video_stride) | Pointer to the key that describes the stride of the video frame. The value type is int32_t.   | 
271| const char \* [OH_MD_KEY_VIDEO_SLICE_HEIGHT](#oh_md_key_video_slice_height) | Pointer to the key that describes the height of the video frame. The value type is int32_t. | 
272| const char \* [OH_MD_KEY_VIDEO_PIC_WIDTH](#oh_md_key_video_pic_width) | Pointer to the key that describes the width of the video frame. The value type is int32_t. | 
273| const char \* [OH_MD_KEY_VIDEO_PIC_HEIGHT](#oh_md_key_video_pic_height) | Pointer to the key that describes the height of the video frame. The value type is int32_t. | 
274| const char \* [OH_MD_KEY_VIDEO_ENABLE_LOW_LATENCY](#oh_md_key_video_enable_low_latency) | Pointer to the key that describes the enabled status of low-latency video codec. The value type is int32_t. The value **1** means that low-latency video codec is enabled, and **0** means the opposite. If enabled, the input and output data held by the video encoder or decoder does not exceed the amount required by the codec standard.  | 
275| const char \* [OH_MD_KEY_VIDEO_ENCODE_BITRATE_MODE](#oh_md_key_video_encode_bitrate_mode) | Pointer to the key that describes the video encoding bit rate mode. The value type is int32_t. For details, see [OH_VideoEncodeBitrateMode](_video_encoder.md#oh_videoencodebitratemode).|
276| const char \* [OH_MD_KEY_QUALITY](#oh_md_key_quality) | Pointer to the key that describes the required encoding quality. The value type is int32_t. This key applies only to encoders configured in constant quality mode.|
277| const char \* [OH_MD_KEY_REQUEST_I_FRAME](#oh_md_key_request_i_frame) | Pointer to the key that describes the request for immediate encoding of I-frames. The value type is int32_t.|
278| const char \* [OH_MD_KEY_I_FRAME_INTERVAL](#oh_md_key_i_frame_interval) | Pointer to the key that describes the key frame interval, in milliseconds. The value type is int32_t. This key is optional and is used only for video encoding.|
279| const char \* [OH_MD_KEY_VIDEO_ENCODER_ENABLE_TEMPORAL_SCALABILITY](#oh_md_key_video_encoder_enable_temporal_scalability) | Pointer to the key that describes the enabled status of temporal scalability. The value type is int32_t. The value **1** means temporal scalability is enabled, and **0** means the opposite. | 
280| const char \* [OH_MD_KEY_VIDEO_ENCODER_TEMPORAL_GOP_SIZE](#oh_md_key_video_encoder_temporal_gop_size) | Pointer to the key that describes the size of a temporal image group. The value type is int32_t. This key is valid only when temporal scalability is enabled. |
281| const char \* [OH_MD_KEY_VIDEO_ENCODER_TEMPORAL_GOP_REFERENCE_MODE](#oh_md_key_video_encoder_temporal_gop_reference_mode) | Pointer to the key that describes the reference mode in a temporal image group. The value type is int32_t. For details, see [OH_TemporalGopReferenceMode](#oh_temporalgopreferencemode). This key is valid only when temporal scalability is enabled. | 
282| const char \* [OH_MD_KEY_VIDEO_ENCODER_LTR_FRAME_COUNT](#oh_md_key_video_encoder_ltr_frame_count) | Pointer to the key that describes the number of LTR frames. The value type is int32_t. The value must be within the supported value range. This key is optional and is used only for video encoding. | 
283| const char \* [OH_MD_KEY_VIDEO_ENCODER_PER_FRAME_MARK_LTR](#oh_md_key_video_encoder_per_frame_mark_ltr) | Pointer to the key that describes the key that marks the current frame as an LTR frame. The value type is int32_t. The value **1** means that the frame is marked as an LTR frame, and **0** means the opposite. This key is optional and is used only for video encoding. | 
284| const char \* [OH_MD_KEY_VIDEO_ENCODER_PER_FRAME_USE_LTR](#oh_md_key_video_encoder_per_frame_use_ltr) | Pointer to the key that describes the LTR frame referenced by the current frame. The value type is int32_t. This key is optional and is used only for video encoding. | 
285| const char \* [OH_MD_KEY_VIDEO_PER_FRAME_IS_LTR](#oh_md_key_video_per_frame_is_ltr) | Pointer to the key that specifies whether the frame corresponding to the stream output from the current OH_AVBuffer is marked as an LTR frame. The value type is int32_t. The value **1** means that the frame is an LTR frame, and **0** means the opposite. This key is optional and is used only for video encoding. | 
286| const char \* [OH_MD_KEY_VIDEO_PER_FRAME_POC](#oh_md_key_video_per_frame_poc) | Pointer to the key that describes the POC of the frame. The value type is int32_t. This key is optional and is used only for video encoding. | 
287| const char \* [OH_MD_KEY_VIDEO_ENCODER_QP_MAX](#oh_md_key_video_encoder_qp_max) | Pointer to the key that describes the maximum QP allowed by the video encoder. The value type is int32_t. | 
288| const char \* [OH_MD_KEY_VIDEO_ENCODER_QP_MIN](#oh_md_key_video_encoder_qp_min) | Pointer to the key that describes the minimum QP allowed by the video encoder. The value type is int32_t. | 
289| const char \* [OH_MD_KEY_VIDEO_ENCODER_QP_AVERAGE](#oh_md_key_video_encoder_qp_average) | Pointer to the key that describes the average QP of video frames. The value type is int32_t.|
290| const char \* [OH_MD_KEY_VIDEO_ENCODER_MSE](#oh_md_key_video_encoder_mse)     |Pointer to the key that describes the MSE of video frames. The value type is double. |
291| const char \* [OH_MD_KEY_VIDEO_DECODER_OUTPUT_COLOR_SPACE](#oh_md_key_video_decoder_output_color_space)   | Pointer to the key that describes the output color space of the video decoder. The value type is int32_t. The supported value is **OH_COLORSPACE_BT709_LIMIT**.|
292| const char \* [OH_MD_KEY_AUDIO_SAMPLE_FORMAT](#oh_md_key_audio_sample_format) | Pointer to the key that describes the original audio format. The value type is int32_t.|
293| const char \* [OH_MD_KEY_AUD_CHANNEL_COUNT](#oh_md_key_aud_channel_count) | Pointer to the key that describes the number of audio channels. The value type is int32_t.|
294| const char \* [OH_MD_KEY_AUD_SAMPLE_RATE](#oh_md_key_aud_sample_rate) | Pointer to the key that describes the audio sampling rate. The value type is int32_t.|
295| const char \* [OH_MD_KEY_AUDIO_COMPRESSION_LEVEL](#oh_md_key_audio_compression_level) | Pointer to the key that describes the audio codec compression level. The value type is int32_t type. This key is used only for audio encoding.|
296| const char \* [OH_MD_KEY_CHANNEL_LAYOUT](#oh_md_key_channel_layout) | Pointer to the key that describes the required encoding channel layout. The value type is int64_t. This key applies only to encoders.|
297| const char \* [OH_MD_KEY_BITS_PER_CODED_SAMPLE](#oh_md_key_bits_per_coded_sample) | Pointer to the key that describes the number of bits for each coded sample. The value type is int32_t. This key applies to FLAC encoders. For details, see [OH_BitsPerSample](#oh_bitspersample).|
298| const char \* [OH_MD_KEY_SBR](#oh_md_key_sbr) | Pointer to the key that describes the AAC SBR format. The value type is int32_t. This key applies to AAC encoders.|
299| const char \* [OH_MD_KEY_COMPLIANCE_LEVEL](#oh_md_key_compliance_level) | Pointer to the key that describes the FLAC compliance level. The value type is int32_t. This key is used only for audio encoding.|
300| const char \* [OH_MD_KEY_AAC_IS_ADTS](#oh_md_key_aac_is_adts) | Pointer to the key that describes the AAC format, which can be ADTS or LATM. The value type is int32_t. This key applies to AAC decoders.|
301| const char \* [OH_MD_KEY_IDENTIFICATION_HEADER](#oh_md_key_identification_header) | Pointer to the key that describes the Vorbis identification header. The value type is uint8_t. This key applies only to Vorbis decoders.|
302| const char \* [OH_MD_KEY_SETUP_HEADER](#oh_md_key_setup_header) | Pointer to the key that describes the Vorbis setup header. The value type is uint8_t. This key applies only to Vorbis decoders.|
303| const char \* [OH_MD_KEY_AUDIO_OBJECT_NUMBER](#oh_md_key_audio_object_number) | Pointer to the key that describes the number of audio objects. The value type is int32_t. This key is used only for Audio Vivid decoding.|
304| const char \* [OH_MD_KEY_AUDIO_VIVID_METADATA](#oh_md_key_audio_vivid_metadata) | Pointer to the key that describes the Audio Vivid metadata. The value type is uint8_t\*. This key is used only for Audio Vivid decoding.|
305| const char \* [OH_MD_KEY_VIDEO_IS_HDR_VIVID](#oh_md_key_video_is_hdr_vivid) | Pointer to the key that describes whether the video track in a media file is HDR Vivid. The value type is int32_t. This key is used for both muxing and demuxing.|
306| const char \* [OH_MD_KEY_START_TIME](#oh_md_key_start_time) | Pointer to the key that describes the start time of the first frame in a media file. The value type is int64_t.    |
307| const char \* [OH_MD_KEY_TRACK_START_TIME](#oh_md_key_track_start_time) | Pointer to the key that describes the track start time. The value type is int64_t.    |
308| const char \* [OH_MD_KEY_TRACK_TYPE](#oh_md_key_track_type) | Pointer to the key that describes the track type in a media file. The value type is int32_t. For details, see [OH_MediaType](#oh_mediatype-1).|
309| const char \* [OH_MD_KEY_DURATION](#oh_md_key_duration) | Pointer to the key that describes the duration in a media file. The value type is int64_t.|
310| const char \* [OH_MD_KEY_TITLE](#oh_md_key_title) | Pointer to the key that describes the title in a media file. The value type is string.|
311| const char \* [OH_MD_KEY_ARTIST](#oh_md_key_artist) | Pointer to the key that describes the lyrics in a media file. The value type is string.|
312| const char \* [OH_MD_KEY_ALBUM](#oh_md_key_album) | Pointer to the key that describes the album in a media file. The value type is string.|
313| const char \* [OH_MD_KEY_ALBUM_ARTIST](#oh_md_key_album_artist) | Pointer to the key that describes the album artist of the input media. The value type is string.|
314| const char \* [OH_MD_KEY_DATE](#oh_md_key_date) | Pointer to the key that describes the date in a media file, for example, 2024. The value type is string.|
315| const char \* [OH_MD_KEY_COMMENT](#oh_md_key_comment) | Pointer to the key that describes the comment in a media file. The value type is string.|
316| const char \* [OH_MD_KEY_GENRE](#oh_md_key_genre) | Pointer to the key that describes the genre in a media file. The value type is string.|
317| const char \* [OH_MD_KEY_COPYRIGHT](#oh_md_key_copyright) | Pointer to the key that describes the copyright in a media file. The value type is string.|
318| const char \* [OH_MD_KEY_LANGUAGE](#oh_md_key_language) | Pointer to the key that describes the language in a media file. The value type is string.|
319| const char \* [OH_MD_KEY_DESCRIPTION](#oh_md_key_description) | Pointer to the key that describes the description in a media file. The value type is string.|
320| const char \* [OH_MD_KEY_LYRICS](#oh_md_key_lyrics) | Pointer to the key that describes the lyrics in a media file. The value type is string.|
321| const char \* [OH_MD_KEY_TRACK_COUNT](#oh_md_key_track_count) | Pointer to the key that describes the number of tracks in a media file. The value type is int32_t.|
322| const char \* [OH_MD_KEY_BUFFER_DURATION](#oh_md_key_buffer_duration) | Pointer to the key that describes the duration corresponding to the audio, video, or subtitle sample carried in AVBuffer, in microseconds. The value type is int64_t.      |
323| const char \* [OH_MD_KEY_DECODING_TIMESTAMP](#oh_md_key_decoding_timestamp) | Pointer to the key that describes the decoding timestamp corresponding to the audio, video, or subtitle sample carried in AVBuffer, in microseconds. The value type is int64_t. |
324| const char \* [OH_MD_KEY_CODEC_MIME](#oh_md_key_codec_mime) | Pointer to the key that describes the MIME type of the codec. The value type is string.|
325| const char \* [OH_MD_KEY_VIDEO_SAR](#oh_md_key_video_sar)            | Pointer to the key that describes the aspect ratio of the sample. The value type is double.|
326
327
328## Type Description
329
330
331### OH_AACProfile
332
333```
334typedef enum OH_AACProfile OH_AACProfile
335```
336
337**Description**
338
339Defines an enum for the AAC profiles.
340
341**System capability**: SystemCapability.Multimedia.Media.CodecBase
342
343**Since**: 9
344
345
346### OH_AVCLevel
347
348```
349typedef enum OH_AVCLevel OH_AVCLevel
350```
351**Description**
352
353Defines an enum for the AVC levels.
354
355**System capability**: SystemCapability.Multimedia.Media.CodecBase
356
357**Since**: 12
358
359
360### OH_AVCodec
361
362```
363typedef struct OH_AVCodec OH_AVCodec
364```
365**Description**
366
367Defines a struct for a native object for the audio and video codec interface.
368
369**Since**: 9
370
371
372### OH_AVCodecAsyncCallback
373
374```
375typedef struct OH_AVCodecAsyncCallback OH_AVCodecAsyncCallback
376```
377
378**Description**
379
380Defines 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.
381
382**System capability**: SystemCapability.Multimedia.Media.CodecBase
383
384**Since**: 9
385
386**Deprecated from**: 11
387
388**Substitute**: [OH_AVCodecCallback](#oh_avcodeccallback)
389
390**Parameters**
391
392| Name| Description| 
393| -------- | -------- |
394| onError | Callback used to report a codec operation error. For details, see [OH_AVCodecOnError](#oh_avcodeconerror).| 
395| onStreamChanged | Callback used to report a codec stream change. For details, see [OH_AVCodecOnStreamChanged](#oh_avcodeconstreamchanged).| 
396| onNeedInputData | Callback used to report input data required. For details, see [OH_AVCodecOnNeedInputData](#oh_avcodeconneedinputdata).| 
397| onNeedOutputData | Callback used to report output data generated. For details, see [OH_AVCodecOnNewOutputData](#oh_avcodeconnewoutputdata).| 
398
399
400### OH_AVCodecCallback
401
402```
403typedef struct OH_AVCodecCallback OH_AVCodecCallback
404```
405
406**Description**
407
408Defines 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.
409
410**System capability**: SystemCapability.Multimedia.Media.CodecBase
411
412**Since**: 11
413
414**Parameters**
415
416| Name| Description| 
417| -------- | -------- |
418| onError | Callback used to report a codec operation error. For details, see [OH_AVCodecOnError](#oh_avcodeconerror).| 
419| onStreamChanged | Callback used to report a codec stream change. For details, see [OH_AVCodecOnStreamChanged](#oh_avcodeconstreamchanged).| 
420| onNeedInputBuffer | Callback used to report input data required. For details, see [OH_AVCodecOnNeedInputBuffer](#oh_avcodeconneedinputbuffer).| 
421| onNewOutputBuffer | Callback used to report output data generated. For details, see [OH_AVCodecOnNewOutputBuffer](#oh_avcodeconnewoutputbuffer).| 
422
423
424### OH_AVCodecOnError
425
426```
427typedef void(* OH_AVCodecOnError) (OH_AVCodec *codec, int32_t errorCode, void *userData)
428```
429
430**Description**
431
432Defines the pointer to the function that is called to report error information when an error occurs during the running of an **OH_AVCodec** instance.
433
434| Use Case| Error Code|
435| -------- | -------- |
436| Audio encoding/decoding| **AV_ERR_DRM_DECRYPT_FAILED**: DRM decryption failed. |
437| Video encoding and decoding| **AV_ERROR_NO_MEMORY**: System resources are insufficient.<br>**AV_ERROR_UNKNOWN**: An unknown error occurs. Analyze the error based on specific logs.<br>**AV_ERR_SERVICE_DIED**: The service is dead. |
438| Video decoding| **AV_ERR_VIDEO_UNSUPPORTED_COLOR_SPACE_CONVERSION**: The current input does not support CSC. |
439<!--RP1--><!--RP1End-->
440
441**System capability**: SystemCapability.Multimedia.Media.CodecBase
442
443**Since**: 9
444
445**Parameters**
446
447| Name| Description| 
448| -------- | -------- |
449| codec | Pointer to an **OH_AVCodec** instance. | 
450| errorCode | Error code. | 
451| userData | Pointer to the data on which the caller depends when executing the callback. |
452
453
454### OH_AVCodecOnNeedInputBuffer
455
456```
457typedef void(* OH_AVCodecOnNeedInputBuffer) (OH_AVCodec *codec, uint32_t index, OH_AVBuffer *buffer, void *userData)
458```
459
460**Description**
461
462Defines 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.
463
464**System capability**: SystemCapability.Multimedia.Media.CodecBase
465
466**Since**: 11
467
468**Parameters**
469
470| Name| Description| 
471| -------- | -------- |
472| codec | Pointer to an **OH_AVCodec** instance. | 
473| index | Index of the new input buffer. | 
474| buffer | Pointer to the data to fill in the new input buffer. | 
475| userData | Pointer to the data on which the caller depends when executing the callback. | 
476
477
478### OH_AVCodecOnNeedInputData
479
480```
481typedef void(* OH_AVCodecOnNeedInputData) (OH_AVCodec *codec, uint32_t index, OH_AVMemory *data, void *userData)
482```
483
484**Description**
485
486Defines 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.
487
488**System capability**: SystemCapability.Multimedia.Media.CodecBase
489
490**Since**: 9
491
492**Deprecated from**: 11
493
494**Substitute**: [OH_AVCodecOnNeedInputBuffer](#oh_avcodeconneedinputbuffer)
495
496**Parameters**
497
498| Name| Description| 
499| -------- | -------- |
500| codec | Pointer to an **OH_AVCodec** instance. | 
501| index | Index of the new input buffer. | 
502| data | Pointer to the data to fill in the new input buffer. | 
503| userData | Pointer to the data on which the caller depends when executing the callback. | 
504
505
506### OH_AVCodecOnNewOutputBuffer
507
508```
509typedef void(* OH_AVCodecOnNewOutputBuffer) (OH_AVCodec *codec, uint32_t index, OH_AVBuffer *buffer, void *userData)
510```
511
512**Description**
513
514Defines 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.
515
516**System capability**: SystemCapability.Multimedia.Media.CodecBase
517
518**Since**: 11
519
520**Parameters**
521
522| Name| Description| 
523| -------- | -------- |
524| codec | Pointer to an **OH_AVCodec** instance. | 
525| index | Index of the new output buffer. | 
526| buffer | Pointer to the data filled in the new output buffer. | 
527| userData | Pointer to the data on which the caller depends when executing the callback. | 
528
529
530### OH_AVCodecOnNewOutputData
531
532```
533typedef void(* OH_AVCodecOnNewOutputData) (OH_AVCodec *codec, uint32_t index, OH_AVMemory *data, OH_AVCodecBufferAttr *attr, void *userData)
534```
535
536**Description**
537
538Defines 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.
539
540**System capability**: SystemCapability.Multimedia.Media.CodecBase
541
542**Since**: 9
543
544**Deprecated from**: 11
545
546**Substitute**: [OH_AVCodecOnNewOutputBuffer](#oh_avcodeconnewoutputbuffer)
547
548**Parameters**
549
550| Name| Description| 
551| -------- | -------- |
552| codec | Pointer to an **OH_AVCodec** instance. | 
553| index | Index of the new output buffer. | 
554| data | Pointer to the data filled in the new output buffer. | 
555| attr | Pointer to the description information about the new output buffer. For details, see **OH_AVCodecBufferAttr**. | 
556| userData | Pointer to the data on which the caller depends when executing the callback. | 
557
558
559### OH_AVCodecOnStreamChanged
560
561```
562typedef void(* OH_AVCodecOnStreamChanged) (OH_AVCodec *codec, OH_AVFormat *format, void *userData)
563```
564
565**Description**
566
567Defines the pointer to the function that is called to report the new stream description when the resolution of the input stream being decoded or the output stream that has been encoded 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.
568
569**System capability**: SystemCapability.Multimedia.Media.CodecBase
570
571**Since**: 9
572
573**Parameters**
574
575| Name| Description| 
576| -------- | -------- |
577| codec | Pointer to an **OH_AVCodec** instance. |
578| format | Pointer to the description information about the new output stream. |
579| userData | Pointer to the data on which the caller depends when executing the callback. |
580
581
582### OH_AVCProfile
583
584```
585typedef enum OH_AVCProfile OH_AVCProfile
586```
587
588**Description**
589
590Defines an enum for the AVC profiles.
591
592**System capability**: SystemCapability.Multimedia.Media.CodecBase
593
594**Since**: 9
595
596
597### OH_AVDataSource
598
599```
600typedef struct OH_AVDataSource OH_AVDataSource
601```
602
603**Description**
604
605Defines a struct for a user-defined data source.
606
607**System capability**: SystemCapability.Multimedia.Media.CodecBase
608
609**Since**: 12
610
611
612### OH_AVDataSourceReadAt
613
614```
615typedef int32_t(* OH_AVDataSourceReadAt) (OH_AVBuffer *data, int32_t length, int64_t pos)
616```
617
618**Description**
619
620Defines a function pointer used to provide the capability of obtaining user-defined media data.
621
622**System capability**: SystemCapability.Multimedia.Media.CodecBase
623
624**Since**: 12
625
626**Parameters**
627
628| Name| Description| 
629| -------- | -------- |
630| data | Buffer to be filled in. | 
631| length | Length of the data to read. | 
632| pos | Offset from which the data is read. | 
633
634**Returns**
635
636Actual length of the data read to the buffer.
637
638
639### OH_AVOutputFormat
640
641```
642typedef enum OH_AVOutputFormat OH_AVOutputFormat
643```
644
645**Description**
646
647Defines an enum for the output file formats supported by a muxer.
648
649**System capability**: SystemCapability.Multimedia.Media.CodecBase
650
651**Since**: 10
652
653
654### OH_AVSeekMode
655
656```
657typedef enum OH_AVSeekMode OH_AVSeekMode
658```
659
660**Description**
661
662Defines an enum for the seek modes.
663
664**System capability**: SystemCapability.Multimedia.Media.CodecBase
665
666**Since**: 10
667
668
669### OH_BitsPerSample
670
671```
672typedef enum OH_BitsPerSample OH_BitsPerSample
673```
674
675**Description**
676
677Defines an enum for the number of audio bits for each coded sample.
678
679**System capability**: SystemCapability.Multimedia.Media.CodecBase
680
681**Since**: 10
682
683
684### OH_ColorPrimary
685
686```
687typedef enum OH_ColorPrimary OH_ColorPrimary
688```
689
690**Description**
691
692Defines an enum for the primary colors.
693
694**System capability**: SystemCapability.Multimedia.Media.CodecBase
695
696**Since**: 10
697
698
699### OH_HEVCLevel
700
701```
702typedef enum OH_HEVCLevel OH_HEVCLevel
703```
704
705**Description**
706
707Defines an enum for the HEVC levels.
708
709**System capability**: SystemCapability.Multimedia.Media.CodecBase
710
711**Since**: 12
712
713
714### OH_HEVCProfile
715
716```
717typedef enum OH_HEVCProfile OH_HEVCProfile
718```
719
720**Description**
721
722Defines an enum for the HEVC profiles.
723
724**System capability**: SystemCapability.Multimedia.Media.CodecBase
725
726**Since**: 10
727
728
729### OH_MatrixCoefficient
730
731```
732typedef enum OH_MatrixCoefficient OH_MatrixCoefficient
733```
734
735**Description**
736
737Defines an enum for the matrix coefficients.
738
739**System capability**: SystemCapability.Multimedia.Media.CodecBase
740
741**Since**: 10
742
743
744### OH_MediaType
745
746```
747typedef enum OH_MediaType OH_MediaType
748```
749
750**Description**
751
752Defines an enum for the media types.
753
754**System capability**: SystemCapability.Multimedia.Media.CodecBase
755
756**Since**: 9
757
758
759### OH_ScalingMode
760
761```
762typedef enum OH_ScalingMode OH_ScalingMode
763```
764
765**Description**
766
767Defines an enum for the scaling modes. This enum is used only in surface mode.
768
769**System capability**: SystemCapability.Multimedia.Media.CodecBase
770
771**Since**: 10
772
773
774### OH_TemporalGopReferenceMode
775
776```
777typedef enum OH_TemporalGopReferenceMode OH_TemporalGopReferenceMode
778```
779
780**Description**
781
782Defines an enum for the reference modes of temporal image groups.
783
784**System capability**: SystemCapability.Multimedia.Media.CodecBase
785
786**Since**: 12
787
788
789### OH_TransferCharacteristic
790
791```
792typedef enum OH_TransferCharacteristic OH_TransferCharacteristic
793```
794**Description**
795
796Defines an enum for the transfer characteristics.
797
798**System capability**: SystemCapability.Multimedia.Media.CodecBase
799
800**Since**: 10
801
802
803### OHNativeWindow
804
805```
806typedef struct NativeWindow OHNativeWindow
807```
808**Description**
809
810Defines a struct for a native object for the graphics interface.
811
812**Since**: 9
813
814
815## Enum Description
816
817
818### AudioChannelLayout
819
820```
821enum AudioChannelLayout : uint64_t
822```
823
824**Description**
825
826Enumerates the types of the audio channel sets. The output format of the decoder is represented as the channel type of the codec.
827
828**System capability**: SystemCapability.Multimedia.Media.CodecBase
829
830**Since**: 10
831
832**Deprecated from**: 11
833
834**Substitute**: [OH_AudioChannelLayout](_core.md#oh_audiochannellayout)
835
836| Value| Description| 
837| -------- | -------- |
838| UNKNOWN_CHANNEL_LAYOUT | Unknown.| 
839| MONO | Mono layout.| 
840| STEREO | Stereo layout| 
841| CH_2POINT1 | 2.1 layout.| 
842| CH_2_1 | 2_1 layout.| 
843| SURROUND | Surround layout.| 
844| CH_3POINT1 | 3.1 layout.| 
845| CH_4POINT0 | 4.0 layout.| 
846| CH_4POINT1 | 4.1 layout.| 
847| CH_2_2 | 2_2 layout.| 
848| QUAD | Quad layout.| 
849| CH_5POINT0 | 5.0 layout.| 
850| CH_5POINT1 | 5.1 layout.| 
851| CH_5POINT0_BACK | 5.0 rear layout.| 
852| CH_5POINT1_BACK | 5.1 rear layout.| 
853| CH_6POINT0 | 6.0 layout.| 
854| CH_6POINT0_FRONT | 6.0 front layout.| 
855| HEXAGONAL | Hexagonal layout.| 
856| CH_6POINT1 | 6.1 layout.| 
857| CH_6POINT1_BACK | 6.1 rear layout.| 
858| CH_6POINT1_FRONT | 6.1 front layout.| 
859| CH_7POINT0 | 7.0 layout.| 
860| CH_7POINT0_FRONT | 7.0 front layout.| 
861| CH_7POINT1 | 7.1 layout.| 
862| CH_7POINT1_WIDE | 7.1 wide layout.| 
863| CH_7POINT1_WIDE_BACK | 7.1 rear wide layout.| 
864| CH_3POINT1POINT2 | 3.1.2 layout.| 
865| CH_5POINT1POINT2 | 5.1.2 layout.| 
866| CH_5POINT1POINT4 | 5.1.4 layout.| 
867| CH_7POINT1POINT2 | 7.1.2 layout.| 
868| CH_7POINT1POINT4 | 7.1.4 layout.| 
869| CH_9POINT1POINT4 | 9.1.4 layout.| 
870| CH_9POINT1POINT6 | 9.1.6 layout.| 
871| CH_10POINT2 | 10.2 layout.| 
872| CH_22POINT2 | 22.2 layout.| 
873| OCTAGONAL | Octagonal layout.| 
874| HEXADECAGONAL | Hexadecagonal layout.| 
875| STEREO_DOWNMIX | Stereo downmix layout.| 
876| HOA_FIRST | High-Order Ambisonics (HOA) first-order layout.| 
877| HOA_SECOND | HOA second-order layout.| 
878| HOA_THIRD | HOA third-order layout.| 
879
880
881### AudioChannelSet
882
883```
884enum AudioChannelSet : uint64_t
885```
886
887**Description**
888
889Enumerates the audio channel sets. Each channel number is mapped to a variable of int64_t.
890
891**System capability**: SystemCapability.Multimedia.Media.CodecBase
892
893**Since**: 10
894
895**Deprecated from**: 11. Use [OH_AudioChannelSet](_core.md#oh_audiochannelset) instead.
896
897| Value| Description| 
898| -------- | -------- |
899| FRONT_LEFT | Front left channel.| 
900| FRONT_RIGHT | Front right channel| 
901| FRONT_CENTER | Front center channel.| 
902| LOW_FREQUENCY | Low-frequency channel.| 
903| BACK_LEFT | Rear left channel.| 
904| BACK_RIGHT | Rear right channel| 
905| FRONT_LEFT_OF_CENTER | Front left center channel.| 
906| FRONT_RIGHT_OF_CENTER | Front right center channel.| 
907| BACK_CENTER | Rear center channel.| 
908| SIDE_LEFT | Left channel.| 
909| SIDE_RIGHT | Right channel.| 
910| TOP_CENTER | Top center channel.| 
911| TOP_FRONT_LEFT | Top left front channel.| 
912| TOP_FRONT_CENTER | Top center front channel.| 
913| TOP_FRONT_RIGHT | Top right front channel.| 
914| TOP_BACK_LEFT | Top left rear channel.| 
915| TOP_BACK_CENTER | Top center rear channel.| 
916| TOP_BACK_RIGHT | Top right rear channel.| 
917| STEREO_LEFT | Stereo left channel.| 
918| STEREO_RIGHT | Stereo right channel.| 
919| WIDE_LEFT | Wide left channel.| 
920| WIDE_RIGHT | Wide right channel.| 
921| SURROUND_DIRECT_LEFT | Left surround channel.| 
922| SURROUND_DIRECT_RIGHT | Right surround channel.| 
923| LOW_FREQUENCY_2 | Low-frequency channel 2.| 
924| TOP_SIDE_LEFT | Top left channel.| 
925| TOP_SIDE_RIGHT | Top right channel.| 
926| BOTTOM_FRONT_CENTER | Bottom center front channel.| 
927| BOTTOM_FRONT_LEFT | Bottom left front channel.| 
928| BOTTOM_FRONT_RIGHT | Bottom right front channel.| 
929| AMBISONICS_ACN0 | Channel 0 for the zero-order stereo.| 
930| AMBISONICS_ACN1 | Channel 1 for the first-order stereo.| 
931| AMBISONICS_ACN2 | Channel 2 for the first-order stereo.| 
932| AMBISONICS_ACN3 | Channel 3 for the first-order stereo.| 
933| AMBISONICS_W | Equivalent to channel 0 for the zero-order stereo.| 
934| AMBISONICS_Y | Equivalent to channel 1 for the first-order stereo.| 
935| AMBISONICS_Z | Equivalent to channel 2 for the first-order stereo.| 
936| AMBISONICS_X | Equivalent to channel 3 for the first-order stereo.| 
937| AMBISONICS_ACN4 | Channel 4 for the second-order stereo.| 
938| AMBISONICS_ACN5 | Channel 5 for the second-order stereo.| 
939| AMBISONICS_ACN6 | Channel 6 for the second-order stereo.| 
940| AMBISONICS_ACN7 | Channel 7 for the second-order stereo.| 
941| AMBISONICS_ACN8 | Channel 8 for the second-order stereo.| 
942| AMBISONICS_ACN9 | Channel 9 for the third-order stereo.| 
943| AMBISONICS_ACN10 | Channel 10 for the third-order stereo.| 
944| AMBISONICS_ACN11 | Channel 11 for the third-order stereo.| 
945| AMBISONICS_ACN12 | Channel 12 for the third-order stereo.| 
946| AMBISONICS_ACN13 | Channel 13 for the third-order stereo.| 
947| AMBISONICS_ACN14 | Channel 14 for the third-order stereo.| 
948| AMBISONICS_ACN15 | Channel 15 for the third-order stereo.| 
949
950
951### OH_AACProfile
952
953```
954enum OH_AACProfile
955```
956
957**Description**
958
959Enumerates the AAC profiles.
960
961**System capability**: SystemCapability.Multimedia.Media.CodecBase
962
963**Since**: 9
964
965| Value| Description| 
966| -------- | -------- |
967| AAC_PROFILE_LC  | AAC profile of the low complexity level.  | 
968
969
970### OH_AVCLevel
971
972```
973enum OH_AVCLevel
974```
975
976**Description**
977
978Enumerates the AVC levels.
979
980**System capability**: SystemCapability.Multimedia.Media.CodecBase
981
982**Since**: 12
983
984| Value| Description| 
985| -------- | -------- |
986| AVC_LEVEL_1  | Level 1.  | 
987| AVC_LEVEL_1b  | Level 1b.  | 
988| AVC_LEVEL_11  | Level 1.1.  | 
989| AVC_LEVEL_12  | Level 1.2.  | 
990| AVC_LEVEL_13  | Level 1.3.  | 
991| AVC_LEVEL_2  | Level 2.  | 
992| AVC_LEVEL_21  | Level 2.1.  | 
993| AVC_LEVEL_22  | Level 2.2.  | 
994| AVC_LEVEL_3  | Level 3.  | 
995| AVC_LEVEL_31  | Level 3.1.  | 
996| AVC_LEVEL_32  | Level 3.2.  | 
997| AVC_LEVEL_4  | Level 4.  | 
998| AVC_LEVEL_41  | Level 4.1.  | 
999| AVC_LEVEL_42  | Level 4.2.  | 
1000| AVC_LEVEL_5  | Level 5.  | 
1001| AVC_LEVEL_51  | Level 5.1.  | 
1002| AVC_LEVEL_52  | Level 5.2.  | 
1003| AVC_LEVEL_6  | Level 6.  | 
1004| AVC_LEVEL_61  | Level 6.1.  | 
1005| AVC_LEVEL_62  | Level 6.2.  | 
1006
1007
1008### OH_AVCProfile
1009
1010```
1011enum OH_AVCProfile
1012```
1013
1014**Description**
1015
1016Enumerates the AVC profiles.
1017
1018**System capability**: SystemCapability.Multimedia.Media.CodecBase
1019
1020**Since**: 9
1021
1022| Value| Description| 
1023| -------- | -------- |
1024| AVC_PROFILE_BASELINE  | AVC baseline profile.  |
1025| AVC_PROFILE_HIGH  | AVC high profile.  |
1026| AVC_PROFILE_MAIN  | AVC main profile.  |
1027
1028
1029### OH_AVOutputFormat
1030
1031```
1032enum OH_AVOutputFormat
1033```
1034
1035**Description**
1036
1037Enumerates the output file formats supported by a muxer.
1038
1039**System capability**: SystemCapability.Multimedia.Media.CodecBase
1040
1041**Since**: 10
1042
1043| Value| Description| 
1044| -------- | -------- |
1045| AV_OUTPUT_FORMAT_DEFAULT  | Default format, which is MP4.  | 
1046| AV_OUTPUT_FORMAT_MPEG_4  | MP4.  | 
1047| AV_OUTPUT_FORMAT_M4A  | M4A.  | 
1048| AV_OUTPUT_FORMAT_AMR  | AMR.<br>**Since**: 12   | 
1049| AV_OUTPUT_FORMAT_MP3  | MP3.<br>**Since**: 12  | 
1050| AV_OUTPUT_FORMAT_WAV  | WAV.<br>**Since**: 12  | 
1051
1052### OH_AVSeekMode
1053
1054```
1055enum OH_AVSeekMode
1056```
1057
1058**Description**
1059
1060Enumerates the seek modes.
1061
1062**System capability**: SystemCapability.Multimedia.Media.CodecBase
1063
1064**Since**: 10
1065
1066| Value| Description| 
1067| -------- | -------- |
1068| SEEK_MODE_NEXT_SYNC  | Seeks to the next I-frame at the specified position. If there is no I-frame after the specified position, the seek operation may fail.  |
1069| SEEK_MODE_PREVIOUS_SYNC  | Seeks to the previous I-frame at the specified position.  | 
1070| SEEK_MODE_CLOSEST_SYNC  | Seeks to the latest I-frame at the specified position.  | 
1071
1072
1073### OH_BitsPerSample
1074
1075```
1076enum OH_BitsPerSample
1077```
1078
1079**Description**
1080
1081Enumerates the number of audio bits for each coded sample.
1082
1083**System capability**: SystemCapability.Multimedia.Media.CodecBase
1084
1085**Since**: 10
1086
1087| Value| Description| 
1088| -------- | -------- |
1089| SAMPLE_U8  | 8-bit unsigned integer sampling.  | 
1090| SAMPLE_S16LE  | 16-bit signed integer sampling.  | 
1091| SAMPLE_S24LE  | 24-bit signed integer sampling.  | 
1092| SAMPLE_S32LE  | 32-bit signed integer sampling.  | 
1093| SAMPLE_F32LE  | 32-bit floating-point sampling.  | 
1094| SAMPLE_U8P  | 8-bit unsigned integer plane sampling.  | 
1095| SAMPLE_S16P  | 16-bit signed integer plane sampling.  | 
1096| SAMPLE_S24P  | 24-bit signed integer plane sampling.  | 
1097| SAMPLE_S32P  | 32-bit signed integer plane sampling.  | 
1098| SAMPLE_F32P  | 32-bit floating-point plane sampling.  | 
1099| INVALID_WIDTH  | Invalid sampling format.  | 
1100
1101
1102### OH_ColorPrimary
1103
1104```
1105enum OH_ColorPrimary
1106```
1107
1108**Description**
1109
1110Enumerates the primary colors. This enum is used for both encoding and decoding.
1111
1112**System capability**: SystemCapability.Multimedia.Media.CodecBase
1113
1114**Since**: 10
1115
1116| Value| Description| 
1117| -------- | -------- |
1118| COLOR_PRIMARY_BT709  | BT.709 color gamut.  | 
1119| COLOR_PRIMARY_UNSPECIFIED  | Unspecified color gamut.  | 
1120| COLOR_PRIMARY_BT470_M  | BT.470 System M color gamut.  | 
1121| COLOR_PRIMARY_BT601_625  | BT.601 625 color gamut.  | 
1122| COLOR_PRIMARY_BT601_525  | BT.601 525 color gamut.  | 
1123| COLOR_PRIMARY_SMPTE_ST240  | SMPTE ST 240 color gamut.  | 
1124| COLOR_PRIMARY_GENERIC_FILM  | Generic film color gamut.  | 
1125| COLOR_PRIMARY_BT2020  | BT.2020 color gamut.  | 
1126| COLOR_PRIMARY_SMPTE_ST428  | SMPTE ST 428 color gamut.  | 
1127| COLOR_PRIMARY_P3DCI  | DCI-P3 color gamut.  | 
1128| COLOR_PRIMARY_P3D65  | P3-D65 color gamut.  | 
1129
1130### OH_HEVCLevel
1131
1132```
1133enum OH_HEVCLevel
1134```
1135
1136**Description**
1137
1138Enumerates the HEVC levels.
1139
1140**System capability**: SystemCapability.Multimedia.Media.CodecBase
1141
1142**Since**: 12
1143
1144| Value| Description| 
1145| -------- | -------- |
1146| HEVC_LEVEL_1  | Level 1.  | 
1147| HEVC_LEVEL_2  | Level 2.  | 
1148| HEVC_LEVEL_21  | Level 2.1.  | 
1149| HEVC_LEVEL_3  | Level 3.  | 
1150| HEVC_LEVEL_31  | Level 3.1.  | 
1151| HEVC_LEVEL_4  | Level 4.  | 
1152| HEVC_LEVEL_41  | Level 4.1.  | 
1153| HEVC_LEVEL_5  | Level 5.  | 
1154| HEVC_LEVEL_51  | Level 5.1.  | 
1155| HEVC_LEVEL_52  | Level 5.2.  | 
1156| HEVC_LEVEL_6  | Level 6.  | 
1157| HEVC_LEVEL_61  | Level 6.1.  | 
1158| HEVC_LEVEL_62  | Level 6.2.  | 
1159
1160
1161### OH_HEVCProfile
1162
1163```
1164enum OH_HEVCProfile
1165```
1166
1167**Description**
1168
1169Enumerates the HEVC profiles.
1170
1171**System capability**: SystemCapability.Multimedia.Media.CodecBase
1172
1173**Since**: 10
1174
1175| Value| Description| 
1176| -------- | -------- |
1177| HEVC_PROFILE_MAIN  | HEVC profile of the main level.  | 
1178| HEVC_PROFILE_MAIN_10  | HEVC profile of the 10-bit main level.  | 
1179| HEVC_PROFILE_MAIN_STILL  | HEVC profile of the main still picture level.  | 
1180| HEVC_PROFILE_MAIN_10_HDR10  | HEVC profile of the main 10 HDR10 level.  | 
1181| HEVC_PROFILE_MAIN_10_HDR10_PLUS  | HEVC profile of the main 10 HDR10+ level.  | 
1182
1183
1184### OH_MatrixCoefficient
1185
1186```
1187enum OH_MatrixCoefficient
1188```
1189
1190**Description**
1191
1192Enumerates the matrix coefficients. This enum is used for both encoding and decoding.
1193
1194**System capability**: SystemCapability.Multimedia.Media.CodecBase
1195
1196**Since**: 10
1197
1198| Value| Description| 
1199| -------- | -------- |
1200| MATRIX_COEFFICIENT_IDENTITY  | Identity matrix.  | 
1201| MATRIX_COEFFICIENT_BT709  | BT.709 conversion matrix.  | 
1202| MATRIX_COEFFICIENT_UNSPECIFIED  | Unspecified conversion matrix.  | 
1203| MATRIX_COEFFICIENT_FCC  | FCC conversion matrix.  | 
1204| MATRIX_COEFFICIENT_BT601_625  | BT.601 625 conversion matrix.  | 
1205| MATRIX_COEFFICIENT_BT601_525  | BT.601 525 conversion matrix.  | 
1206| MATRIX_COEFFICIENT_SMPTE_ST240  | SMPTE ST 240 conversion matrix.  | 
1207| MATRIX_COEFFICIENT_YCGCO  | YCgCo conversion matrix.  | 
1208| MATRIX_COEFFICIENT_BT2020_NCL  | BT.2020 NCL conversion matrix.  | 
1209| MATRIX_COEFFICIENT_BT2020_CL  | BT.2020 CL conversion matrix.  | 
1210| MATRIX_COEFFICIENT_SMPTE_ST2085  | SMPTE ST 2085 conversion matrix.  | 
1211| MATRIX_COEFFICIENT_CHROMATICITY_NCL  | Chromaticity NCL conversion matrix.  | 
1212| MATRIX_COEFFICIENT_CHROMATICITY_CL  | Chromaticity CL conversion matrix.  | 
1213| MATRIX_COEFFICIENT_ICTCP  | ICTCP conversion matrix.  | 
1214
1215
1216### OH_MediaType
1217
1218```
1219enum OH_MediaType
1220```
1221
1222**Description**
1223
1224Enumerates the media types.
1225
1226**System capability**: SystemCapability.Multimedia.Media.CodecBase
1227
1228**Since**: 9
1229
1230| Value| Description| 
1231| -------- | -------- |
1232| MEDIA_TYPE_AUD  | Audio track.  | 
1233| MEDIA_TYPE_VID  | Video track.  | 
1234| MEDIA_TYPE_SUBTITILE  | Subtitle track.<br>**Since**: 12  |
1235
1236### OH_ScalingMode
1237
1238```
1239enum OH_ScalingMode
1240```
1241
1242**Description**
1243
1244Enumerates the scaling modes. This enum is used only in surface mode.
1245
1246**System capability**: SystemCapability.Multimedia.Media.CodecBase
1247
1248**Since**: 10
1249
1250| Value| Description| 
1251| -------- | -------- |
1252| SCALING_MODE_SCALE_TO_WINDOW  | Scales the image based on the window size.  | 
1253| SCALING_MODE_SCALE_CROP  | Crops the image based on the window size.  | 
1254
1255
1256### OH_TemporalGopReferenceMode
1257
1258```
1259enum OH_TemporalGopReferenceMode
1260```
1261
1262**Description**
1263
1264Enumerates the reference modes of temporal image groups.
1265
1266**System capability**: SystemCapability.Multimedia.Media.CodecBase
1267
1268**Since**: 12
1269
1270| Value| Description| 
1271| -------- | -------- |
1272| ADJACENT_REFERENCE  | Refers to the nearest short-term reference frame.  | 
1273| JUMP_REFERENCE  | Refers to the latest LTR frame.  | 
1274| UNIFORMLY_SCALED_REFERENCE  | Drops video frames at the highest level, and evenly distributes the remaining frames. The number of temporal image groups must be a power of 2.  | 
1275
1276
1277### OH_TransferCharacteristic
1278
1279```
1280enum OH_TransferCharacteristic
1281```
1282
1283**Description**
1284
1285Enumerates the transfer characteristics. This enum can be used for both encoding and decoding.
1286
1287**System capability**: SystemCapability.Multimedia.Media.CodecBase
1288
1289**Since**: 10
1290
1291| Value| Description| 
1292| -------- | -------- |
1293| TRANSFER_CHARACTERISTIC_BT709  | BT.709 transfer function.  | 
1294| TRANSFER_CHARACTERISTIC_UNSPECIFIED  | Unspecified transfer function.  | 
1295| TRANSFER_CHARACTERISTIC_GAMMA_2_2  | Gamma 2-2 transfer function.  | 
1296| TRANSFER_CHARACTERISTIC_GAMMA_2_8  | Gamma 2-8 transfer function.  | 
1297| TRANSFER_CHARACTERISTIC_BT601  | BT.601 transfer function.  | 
1298| TRANSFER_CHARACTERISTIC_SMPTE_ST240  | SMPTE ST 240 transfer function.  | 
1299| TRANSFER_CHARACTERISTIC_LINEAR  | Linear transfer function.  | 
1300| TRANSFER_CHARACTERISTIC_LOG  | Log transfer function.  | 
1301| TRANSFER_CHARACTERISTIC_LOG_SQRT  | Log SQRT transfer function.  | 
1302| TRANSFER_CHARACTERISTIC_IEC_61966_2_4  | IEC61966-2.4 transfer function.  | 
1303| TRANSFER_CHARACTERISTIC_BT1361  | BT.1361 transfer function.  | 
1304| TRANSFER_CHARACTERISTIC_IEC_61966_2_1  | IEC61966 2.1 transfer function.  | 
1305| TRANSFER_CHARACTERISTIC_BT2020_10BIT  | BT.2020 10-bit transfer function.  | 
1306| TRANSFER_CHARACTERISTIC_BT2020_12BIT  | BT.2020 12-bit transfer function.  | 
1307| TRANSFER_CHARACTERISTIC_PQ  | PQ transfer function.  | 
1308| TRANSFER_CHARACTERISTIC_SMPTE_ST428  | SMPTE ST.428 transfer function.  | 
1309| TRANSFER_CHARACTERISTIC_HLG  | HLG transfer function.  | 
1310
1311
1312## Variable Description
1313
1314
1315### OH_AVCODEC_MIMETYPE_SUBTITLE_SRT
1316
1317```
1318const char* OH_AVCODEC_MIMETYPE_SUBTITLE_SRT
1319```
1320
1321**Description**
1322
1323Pointer to the key that describes the MIME type of the SRT subtitle demuxer.
1324
1325**System capability**: SystemCapability.Multimedia.Media.CodecBase
1326
1327**Since**: 12
1328
1329
1330### OH_AVCODEC_MIMETYPE_SUBTITLE_WEBVTT
1331
1332```
1333const char* OH_AVCODEC_MIMETYPE_SUBTITLE_WEBVTT
1334```
1335
1336**Description**
1337
1338Pointer to the key that describes the MIME type of the WEBVTT subtitle demuxer.
1339
1340**System capability**: SystemCapability.Multimedia.Media.CodecBase
1341
1342**Since**: 12
1343
1344
1345### OH_AVCODEC_MIMETYPE_AUDIO_APE
1346
1347```
1348const char* OH_AVCODEC_MIMETYPE_AUDIO_APE
1349```
1350
1351**Description**
1352
1353Pointer to the key that describes the MIME type of the APE audio decoder.
1354
1355**System capability**: SystemCapability.Multimedia.Media.CodecBase
1356
1357**Since**: 12
1358
1359
1360### OH_AVCODEC_MIMETYPE_AUDIO_AAC
1361
1362```
1363const char* OH_AVCODEC_MIMETYPE_AUDIO_AAC
1364```
1365
1366**Description**
1367
1368Pointer to the key that describes the MIME type of the AAC audio codec.
1369
1370**System capability**: SystemCapability.Multimedia.Media.CodecBase
1371
1372**Since**: 9
1373
1374
1375### OH_AVCODEC_MIMETYPE_AUDIO_AMR_NB
1376
1377```
1378const char* OH_AVCODEC_MIMETYPE_AUDIO_AMR_NB
1379```
1380
1381**Description**
1382
1383Pointer to the key that describes the MIME type of the AMR-NB audio decoder.
1384
1385**System capability**: SystemCapability.Multimedia.Media.CodecBase
1386
1387**Since**: 11
1388
1389
1390### OH_AVCODEC_MIMETYPE_AUDIO_AMR_WB
1391
1392```
1393const char* OH_AVCODEC_MIMETYPE_AUDIO_AMR_WB
1394```
1395
1396**Description**
1397
1398Pointer to the key that describes the MIME type of the AMR-WB audio decoder.
1399
1400**System capability**: SystemCapability.Multimedia.Media.CodecBase
1401
1402**Since**: 11
1403
1404
1405### OH_AVCODEC_MIMETYPE_AUDIO_FLAC
1406
1407```
1408const char* OH_AVCODEC_MIMETYPE_AUDIO_FLAC
1409```
1410
1411**Description**
1412
1413Pointer to the key that describes the MIME type for FLAC audio codec.
1414
1415**System capability**: SystemCapability.Multimedia.Media.CodecBase
1416
1417**Since**: 10
1418
1419
1420### OH_AVCODEC_MIMETYPE_AUDIO_G711MU
1421
1422```
1423const char* OH_AVCODEC_MIMETYPE_AUDIO_G711MU
1424```
1425
1426**Description**
1427
1428Pointer to the key that describes the MIME type of the G.711 mu-law audio codec.
1429
1430**System capability**: SystemCapability.Multimedia.Media.CodecBase
1431
1432**Since**: 11
1433
1434
1435### OH_AVCODEC_MIMETYPE_AUDIO_MPEG
1436
1437```
1438const char* OH_AVCODEC_MIMETYPE_AUDIO_MPEG
1439```
1440
1441**Description**
1442
1443Pointer to the key that describes the MIME type of the MP3 audio decoder.
1444
1445**System capability**: SystemCapability.Multimedia.Media.CodecBase
1446
1447**Since**: 10
1448
1449
1450### OH_AVCODEC_MIMETYPE_AUDIO_OPUS
1451
1452```
1453const char* OH_AVCODEC_MIMETYPE_AUDIO_OPUS
1454```
1455
1456**Description**
1457
1458Pointer to the key that describes the MIME type of the Opus audio codec. <!--Del-->(This specification is not available yet.)<!--DelEnd--> 
1459
1460**System capability**: SystemCapability.Multimedia.Media.CodecBase
1461
1462**Since**: 11
1463
1464
1465### OH_AVCODEC_MIMETYPE_AUDIO_VIVID
1466
1467```
1468const char* OH_AVCODEC_MIMETYPE_AUDIO_VIVID
1469```
1470
1471**Description**
1472
1473Pointer to the key that describes the MIME type of the Audio Vivid audio decoder. <!--Del-->(This specification is not available yet.)<!--DelEnd-->
1474
1475**System capability**: SystemCapability.Multimedia.Media.CodecBase
1476
1477**Since**: 11
1478
1479
1480### OH_AVCODEC_MIMETYPE_AUDIO_VORBIS
1481
1482```
1483const char* OH_AVCODEC_MIMETYPE_AUDIO_VORBIS
1484```
1485
1486**Description**
1487
1488Pointer to the key that describes the MIME type of the Vorbis audio decoder.
1489
1490**System capability**: SystemCapability.Multimedia.Media.CodecBase
1491
1492**Since**: 10
1493
1494
1495### OH_AVCODEC_MIMETYPE_IMAGE_BMP
1496
1497```
1498const char* OH_AVCODEC_MIMETYPE_IMAGE_BMP
1499```
1500
1501**Description**
1502
1503Pointer to the key that describes the MIME type of the BMP image encoder, which is used only for muxing BMP covers.
1504
1505**System capability**: SystemCapability.Multimedia.Media.CodecBase
1506
1507**Since**: 10
1508
1509
1510### OH_AVCODEC_MIMETYPE_IMAGE_JPG
1511
1512```
1513const char* OH_AVCODEC_MIMETYPE_IMAGE_JPG
1514```
1515
1516**Description**
1517
1518Pointer to the key that describes the MIME type of the JPG image encoder, which is used only for muxing JPG covers.
1519
1520**System capability**: SystemCapability.Multimedia.Media.CodecBase
1521
1522**Since**: 10
1523
1524
1525### OH_AVCODEC_MIMETYPE_IMAGE_PNG
1526
1527```
1528const char* OH_AVCODEC_MIMETYPE_IMAGE_PNG
1529```
1530
1531**Description**
1532
1533Pointer to the key that describes the MIME type of the PNG image encoder, which is used only for muxing PNG covers.
1534
1535**System capability**: SystemCapability.Multimedia.Media.CodecBase
1536
1537**Since**: 10
1538
1539
1540### OH_AVCODEC_MIMETYPE_VIDEO_AVC
1541
1542```
1543const char* OH_AVCODEC_MIMETYPE_VIDEO_AVC
1544```
1545
1546**Description**
1547
1548Pointer to the key that describes the MIME type of the AVC (H.264) video codec.
1549
1550**System capability**: SystemCapability.Multimedia.Media.CodecBase
1551
1552**Since**: 9
1553
1554
1555### OH_AVCODEC_MIMETYPE_VIDEO_HEVC
1556
1557```
1558const char* OH_AVCODEC_MIMETYPE_VIDEO_HEVC
1559```
1560
1561**Description**
1562
1563Pointer to the key that describes the MIME type of the HEVC (H.265) video codec.
1564
1565**System capability**: SystemCapability.Multimedia.Media.CodecBase
1566
1567**Since**: 10
1568
1569
1570### OH_AVCODEC_MIMETYPE_VIDEO_MPEG4
1571
1572```
1573const char* OH_AVCODEC_MIMETYPE_VIDEO_MPEG4
1574```
1575
1576**Description**
1577
1578Pointer to the key that describes the MIME type of the MPEG4 video encoder, which is used only for muxing MPEG4 video streams.
1579
1580**System capability**: SystemCapability.Multimedia.Media.CodecBase
1581
1582**Since**: 10
1583
1584**Deprecated from**: 11
1585
1586
1587### OH_ED_KEY_EOS
1588
1589```
1590const char* OH_ED_KEY_EOS
1591```
1592
1593**Description**
1594
1595Pointer to the key that describes the end of stream for the surface buffer. The value type is int32_t. <!--Del-->(This key is not supported yet.)<!--DelEnd-->
1596
1597**System capability**: SystemCapability.Multimedia.Media.CodecBase
1598
1599**Since**: 9
1600
1601
1602### OH_ED_KEY_TIME_STAMP
1603
1604```
1605const char* OH_ED_KEY_TIME_STAMP
1606```
1607
1608**Description**
1609
1610Pointer to the key that describes the surface buffer timestamp. The value is of the int64_t type. <!--Del-->(This key is not supported yet.)<!--DelEnd-->
1611
1612**System capability**: SystemCapability.Multimedia.Media.CodecBase
1613
1614**Since**: 9
1615
1616
1617### OH_FEATURE_PROPERTY_KEY_VIDEO_ENCODER_MAX_LTR_FRAME_COUNT
1618
1619```
1620const char* OH_FEATURE_PROPERTY_KEY_VIDEO_ENCODER_MAX_LTR_FRAME_COUNT
1621```
1622
1623**Description**
1624
1625Pointer to the key that describes the maximum number of LTR frames obtained during video encoding. The value type is int32_t.
1626
1627You can use the API [OH_AVCapability_GetFeatureProperties](_a_v_capability.md#oh_avcapability_getfeatureproperties) and the enum [VIDEO_ENCODER_LONG_TERM_REFERENCE](_a_v_capability.md#oh_avcapabilityfeature) to query the maximum number.
1628
1629**System capability**: SystemCapability.Multimedia.Media.CodecBase
1630
1631**Since**: 12
1632
1633
1634### OH_MD_KEY_AAC_IS_ADTS
1635
1636```
1637const char* OH_MD_KEY_AAC_IS_ADTS
1638```
1639
1640**Description**
1641
1642Pointer to the key that describes the AAC format, which can be ADTS or LATM. The value type is int32_t. The value **0** means the LATM format, and **1** means the ADTS format. This key is supported by AAC decoders.
1643
1644**System capability**: SystemCapability.Multimedia.Media.CodecBase
1645
1646**Since**: 10
1647
1648
1649### OH_MD_KEY_ALBUM
1650
1651```
1652const char* OH_MD_KEY_ALBUM
1653```
1654
1655**Description**
1656
1657Pointer to the key that describes the album in a media file. The value type is string.
1658
1659**System capability**: SystemCapability.Multimedia.Media.CodecBase
1660
1661**Since**: 10
1662
1663
1664### OH_MD_KEY_ALBUM_ARTIST
1665
1666```
1667const char* OH_MD_KEY_ALBUM_ARTIST
1668```
1669
1670**Description**
1671
1672Pointer to the key that describes the album artist in a media file. The value type is string.
1673
1674**System capability**: SystemCapability.Multimedia.Media.CodecBase
1675
1676**Since**: 10
1677
1678
1679### OH_MD_KEY_ARTIST
1680
1681```
1682const char* OH_MD_KEY_ARTIST
1683```
1684
1685**Description**
1686
1687Pointer to the key that describes lyrics in a media file. The value type is string.
1688
1689**System capability**: SystemCapability.Multimedia.Media.CodecBase
1690
1691**Since**: 10
1692
1693
1694### OH_MD_KEY_AUD_CHANNEL_COUNT
1695
1696```
1697const char* OH_MD_KEY_AUD_CHANNEL_COUNT
1698```
1699
1700**Description**
1701
1702Pointer to the key that describes the number of audio channels. The value type is int32_t.
1703
1704**System capability**: SystemCapability.Multimedia.Media.CodecBase
1705
1706**Since**: 9
1707
1708
1709### OH_MD_KEY_AUD_SAMPLE_RATE
1710
1711```
1712const char* OH_MD_KEY_AUD_SAMPLE_RATE
1713```
1714
1715**Description**
1716
1717Pointer to the key that describes the audio sampling rate. The value type is int32_t.
1718
1719**System capability**: SystemCapability.Multimedia.Media.CodecBase
1720
1721**Since**: 9
1722
1723
1724### OH_MD_KEY_AUDIO_COMPRESSION_LEVEL
1725
1726```
1727const char* OH_MD_KEY_AUDIO_COMPRESSION_LEVEL
1728```
1729
1730**Description**
1731
1732Pointer to the key that describes the audio codec compression level. The value type is int32_t type. This key is used only for audio encoding.
1733
1734**System capability**: SystemCapability.Multimedia.Media.CodecBase
1735
1736**Since**: 11
1737
1738
1739### OH_MD_KEY_AUDIO_OBJECT_NUMBER
1740
1741```
1742const char* OH_MD_KEY_AUDIO_OBJECT_NUMBER
1743```
1744
1745**Description**
1746
1747Pointer to the key that describes the number of audio objects. The value type is int32_t. This key is used only for Audio Vivid decoding.
1748
1749**System capability**: SystemCapability.Multimedia.Media.CodecBase
1750
1751**Since**: 11
1752
1753
1754### OH_MD_KEY_AUDIO_SAMPLE_FORMAT
1755
1756```
1757const char* OH_MD_KEY_AUDIO_SAMPLE_FORMAT
1758```
1759
1760**Description**
1761
1762Pointer to the key that describes the original audio format. The value type is int32_t. For details, see [AudioSampleFormat](../apis-audio-kit/js-apis-audio.md#audiosampleformat8).
1763
1764**System capability**: SystemCapability.Multimedia.Media.CodecBase
1765
1766**Since**: 9
1767
1768
1769### OH_MD_KEY_AUDIO_VIVID_METADATA
1770
1771```
1772const char* OH_MD_KEY_AUDIO_VIVID_METADATA
1773```
1774
1775**Description**
1776
1777Pointer to the key that describes the Audio Vivid metadata. The value type is uint8_t\*. This key is used only for Audio Vivid decoding.
1778
1779**System capability**: SystemCapability.Multimedia.Media.CodecBase
1780
1781**Since**: 11
1782
1783
1784### OH_MD_KEY_BITRATE
1785
1786```
1787const char* OH_MD_KEY_BITRATE
1788```
1789
1790**Description**
1791
1792Pointer to the key that describes the bit rate. The value type is int64_t.
1793
1794**System capability**: SystemCapability.Multimedia.Media.CodecBase
1795
1796**Since**: 9
1797
1798
1799### OH_MD_KEY_BITS_PER_CODED_SAMPLE
1800
1801```
1802const char* OH_MD_KEY_BITS_PER_CODED_SAMPLE
1803```
1804
1805**Description**
1806
1807Pointer to the key that describes the number of bits for each coded sample. The value type is int32_t. This key applies to FLAC encoders. For details, see [OH_BitsPerSample](#oh_bitspersample).
1808
1809**System capability**: SystemCapability.Multimedia.Media.CodecBase
1810
1811**Since**: 10
1812
1813
1814### OH_MD_KEY_CHANNEL_LAYOUT
1815
1816```
1817const char* OH_MD_KEY_CHANNEL_LAYOUT
1818```
1819
1820**Description**
1821
1822Pointer to the key that describes the required encoding channel layout. The value type is int64_t. This key applies only to encoders.
1823
1824**System capability**: SystemCapability.Multimedia.Media.CodecBase
1825
1826**Since**: 10
1827
1828
1829### OH_MD_KEY_CODEC_CONFIG
1830
1831```
1832const char* OH_MD_KEY_CODEC_CONFIG
1833```
1834
1835**Description**
1836
1837Pointer to the key that describes the codec-specific data. In the case of video, data carried in **SPS/PPS** is transferred. In the case of audio, data carried in **extraData** is transferred. The value type is uint8_t\*. <!--Del-->(This key is not supported yet for the video codec.)<!--DelEnd-->
1838
1839**System capability**: SystemCapability.Multimedia.Media.CodecBase
1840
1841**Since**: 10
1842
1843
1844### OH_MD_KEY_CODEC_MIME
1845
1846```
1847const char* OH_MD_KEY_CODEC_MIME
1848```
1849
1850**Description**
1851
1852Pointer to the key that describes the MIME type of the codec. The value type is string.
1853
1854**System capability**: SystemCapability.Multimedia.Media.CodecBase
1855
1856**Since**: 9
1857
1858
1859### OH_MD_KEY_COLOR_PRIMARIES
1860
1861```
1862const char* OH_MD_KEY_COLOR_PRIMARIES
1863```
1864
1865**Description**
1866
1867Pointer to the key that describes the video primary color. The value type is int32_t. For details, see [OH_ColorPrimary](#oh_colorprimary). The video primary color complies with Table 2 in the H.273 standard.
1868
1869**System capability**: SystemCapability.Multimedia.Media.CodecBase
1870
1871**Since**: 10
1872
1873
1874### OH_MD_KEY_COMMENT
1875
1876```
1877const char* OH_MD_KEY_COMMENT
1878```
1879
1880**Description**
1881
1882Pointer to the key that describes the comment in a media file. The value type is string.
1883
1884**System capability**: SystemCapability.Multimedia.Media.CodecBase
1885
1886**Since**: 10
1887
1888
1889### OH_MD_KEY_COMPLIANCE_LEVEL
1890
1891```
1892const char* OH_MD_KEY_COMPLIANCE_LEVEL
1893```
1894
1895**Description**
1896
1897Pointer to the key that describes the FLAC compliance level. The value type is int32_t. This key is used only for audio encoding.
1898
1899**System capability**: SystemCapability.Multimedia.Media.CodecBase
1900
1901**Since**: 10
1902
1903
1904### OH_MD_KEY_COPYRIGHT
1905
1906```
1907const char* OH_MD_KEY_COPYRIGHT
1908```
1909
1910**Description**
1911
1912Pointer to the key that describes the copyright in a media file. The value type is string.
1913
1914**System capability**: SystemCapability.Multimedia.Media.CodecBase
1915
1916**Since**: 10
1917
1918
1919### OH_MD_KEY_DATE
1920
1921```
1922const char* OH_MD_KEY_DATE
1923```
1924
1925**Description**
1926
1927Pointer to the key that describes the date in a media file, for example, 2024. The value type is string.
1928
1929**System capability**: SystemCapability.Multimedia.Media.CodecBase
1930
1931**Since**: 10
1932
1933
1934### OH_MD_KEY_DESCRIPTION
1935
1936```
1937const char* OH_MD_KEY_DESCRIPTION
1938```
1939
1940**Description**
1941
1942Pointer to the key that describes the description in a media file. The value type is string.
1943
1944**System capability**: SystemCapability.Multimedia.Media.CodecBase
1945
1946**Since**: 10
1947
1948
1949### OH_MD_KEY_DURATION
1950
1951```
1952const char* OH_MD_KEY_DURATION
1953```
1954
1955**Description**
1956
1957Pointer to the key that describes the duration in a media file, in microseconds. The value type is int64_t.
1958
1959**System capability**: SystemCapability.Multimedia.Media.CodecBase
1960
1961**Since**: 9
1962
1963
1964### OH_MD_KEY_FRAME_RATE
1965
1966```
1967const char* OH_MD_KEY_FRAME_RATE
1968```
1969
1970**Description**
1971
1972Pointer to the key that describes the video frame rate. The value type is double. The value must be greater than **0**.
1973
1974**System capability**: SystemCapability.Multimedia.Media.CodecBase
1975
1976**Since**: 9
1977
1978
1979### OH_MD_KEY_GENRE
1980
1981```
1982const char* OH_MD_KEY_GENRE
1983```
1984
1985**Description**
1986
1987Pointer to the key that describes the genre in a media file. The value type is string.
1988
1989**System capability**: SystemCapability.Multimedia.Media.CodecBase
1990
1991**Since**: 10
1992
1993
1994### OH_MD_KEY_HEIGHT
1995
1996```
1997const char* OH_MD_KEY_HEIGHT
1998```
1999
2000**Description**
2001
2002Pointer to the key that describes the video height. The value type is int32_t.
2003
2004**System capability**: SystemCapability.Multimedia.Media.CodecBase
2005
2006**Since**: 9
2007
2008
2009### OH_MD_KEY_I_FRAME_INTERVAL
2010
2011```
2012const char* OH_MD_KEY_I_FRAME_INTERVAL
2013```
2014
2015**Description**
2016
2017Pointer to the key that describes the key frame interval, in milliseconds. The value type is int32_t. This key is optional and is used only for video encoding.
2018
2019A negative value indicates that only the first frame is a key frame, and a zero value indicates that all frames are key frames.
2020
2021**System capability**: SystemCapability.Multimedia.Media.CodecBase
2022
2023**Since**: 9
2024
2025
2026### OH_MD_KEY_IDENTIFICATION_HEADER
2027
2028```
2029const char* OH_MD_KEY_IDENTIFICATION_HEADER
2030```
2031
2032**Description**
2033
2034Pointer to the key that describes the Vorbis identification header. The value type is uint8_t. This key applies only to Vorbis decoders.
2035
2036**System capability**: SystemCapability.Multimedia.Media.CodecBase
2037
2038**Since**: 10
2039
2040
2041### OH_MD_KEY_LANGUAGE
2042
2043```
2044const char* OH_MD_KEY_LANGUAGE
2045```
2046
2047**Description**
2048
2049Pointer to the key that describes the language in a media file. The value type is string.
2050
2051**System capability**: SystemCapability.Multimedia.Media.CodecBase
2052
2053**Since**: 10
2054
2055
2056### OH_MD_KEY_LYRICS
2057
2058```
2059const char* OH_MD_KEY_LYRICS
2060```
2061
2062**Description**
2063
2064Pointer to the key that describes the lyrics in a media file. The value type is string.
2065
2066**System capability**: SystemCapability.Multimedia.Media.CodecBase
2067
2068**Since**: 10
2069
2070
2071### OH_MD_KEY_MATRIX_COEFFICIENTS
2072
2073```
2074const char* OH_MD_KEY_MATRIX_COEFFICIENTS
2075```
2076
2077**Description**
2078
2079Pointer to the key that describes the video matrix coefficient. The value type is int32_t. For details, see [OH_MatrixCoefficient](#oh_matrixcoefficient). The video matrix coefficient complies with Table 4 in the H.273 standard.
2080
2081**System capability**: SystemCapability.Multimedia.Media.CodecBase
2082
2083**Since**: 10
2084
2085
2086### OH_MD_KEY_MAX_INPUT_SIZE
2087
2088```
2089const char* OH_MD_KEY_MAX_INPUT_SIZE
2090```
2091
2092**Description**
2093
2094Pointer to the key that describes the maximum size of an input stream to decode. The value type is int32_t.
2095
2096**System capability**: SystemCapability.Multimedia.Media.CodecBase
2097
2098**Since**: 9
2099
2100
2101### OH_MD_KEY_PIXEL_FORMAT
2102
2103```
2104const char* OH_MD_KEY_PIXEL_FORMAT
2105```
2106
2107**Description**
2108
2109Pointer to the key that describes the video pixel format. The value type is int32_t. For details, see [OH_AVPixelFormat](_core.md#oh_avpixelformat).
2110
2111**System capability**: SystemCapability.Multimedia.Media.CodecBase
2112
2113**Since**: 9
2114
2115
2116### OH_MD_KEY_PROFILE
2117
2118```
2119const char* OH_MD_KEY_PROFILE
2120```
2121
2122**Description**
2123
2124Pointer to the key that describes the encoding grading. The value type is int32_t. For details, see [OH_AVCProfile](#oh_avcprofile), [OH_HEVCProfile](#oh_hevcprofile), and [OH_AACProfile](#oh_aacprofile).
2125
2126**System capability**: SystemCapability.Multimedia.Media.CodecBase
2127
2128**Since**: 9
2129
2130
2131### OH_MD_KEY_QUALITY
2132
2133```
2134const char* OH_MD_KEY_QUALITY
2135```
2136
2137**Description**
2138
2139Pointer to the key that describes the required encoding quality. The value type is int32_t. In H.264 and H.265 encoding scenarios, the value range can be obtained by calling **OH_AVCapability_GetEncoderQualityRange()**. This key applies only to the encoder in constant quality mode.
2140
2141**System capability**: SystemCapability.Multimedia.Media.CodecBase
2142
2143**Since**: 10
2144
2145
2146### OH_MD_KEY_RANGE_FLAG
2147
2148```
2149const char* OH_MD_KEY_RANGE_FLAG
2150```
2151
2152**Description**
2153
2154Pointer to the key that describes the video YUV value range flag. The value type is int32_t. The value **1** means a full range, and **0** means a limited range.
2155
2156**System capability**: SystemCapability.Multimedia.Media.CodecBase
2157
2158**Since**: 10
2159
2160
2161### OH_MD_KEY_REQUEST_I_FRAME
2162
2163```
2164const char* OH_MD_KEY_REQUEST_I_FRAME
2165```
2166
2167**Description**
2168
2169Pointer to the key that describes the request for immediate encoding of I-frames. The value type is int32_t. This key is used in **OH_VideoEncoder_SetParameter()** or takes effect immediately with the frame.
2170
2171**System capability**: SystemCapability.Multimedia.Media.CodecBase
2172
2173**Since**: 10
2174
2175
2176### OH_MD_KEY_ROTATION
2177
2178```
2179const char* OH_MD_KEY_ROTATION
2180```
2181
2182**Description**
2183
2184Pointer to the key that describes 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. This key is used only in video decoding surface mode.
2185
2186**System capability**: SystemCapability.Multimedia.Media.CodecBase
2187
2188**Since**: 9
2189
2190
2191### OH_MD_KEY_SBR
2192
2193```
2194const char* OH_MD_KEY_SBR
2195```
2196
2197**Description**
2198
2199Pointer to the key that describes the AAC SBR format. The value type is int32_t. This key applies to AAC encoders.
2200
2201**System capability**: SystemCapability.Multimedia.Media.CodecBase
2202
2203**Since**: 10
2204
2205
2206### OH_MD_KEY_SCALING_MODE
2207
2208```
2209const char* OH_MD_KEY_SCALING_MODE
2210```
2211
2212**Description**
2213
2214Pointer to the key that describes the video scaling mode. The value type is int32_t. For details, see [OH_ScalingMode](#oh_scalingmode). You are advised to set the scaling mode by calling [OH_NativeWindow_NativeWindowSetScalingModeV2](../apis-arkgraphics2d/_native_window.md). This key is optional and is used only for video decoding in surface mode.
2215
2216**System capability**: SystemCapability.Multimedia.Media.CodecBase
2217
2218**Since**: 10
2219
2220
2221### OH_MD_KEY_SETUP_HEADER
2222
2223```
2224const char* OH_MD_KEY_SETUP_HEADER
2225```
2226
2227**Description**
2228
2229Pointer to the key that describes the Vorbis setup header. The value type is uint8_t. This key applies only to Vorbis decoders.
2230
2231**System capability**: SystemCapability.Multimedia.Media.CodecBase
2232
2233**Since**: 10
2234
2235
2236### OH_MD_KEY_TITLE
2237
2238```
2239const char* OH_MD_KEY_TITLE
2240```
2241
2242**Description**
2243
2244Pointer to the key that describes the title in a media file. The value type is string.
2245
2246**System capability**: SystemCapability.Multimedia.Media.CodecBase
2247
2248**Since**: 10
2249
2250
2251### OH_MD_KEY_TRACK_COUNT
2252
2253```
2254const char* OH_MD_KEY_TRACK_COUNT
2255```
2256
2257**Description**
2258
2259Pointer to the key that describes the number of tracks in a media file. The value type is int32_t.
2260
2261**System capability**: SystemCapability.Multimedia.Media.CodecBase
2262
2263**Since**: 10
2264
2265
2266### OH_MD_KEY_TRACK_TYPE
2267
2268```
2269const char* OH_MD_KEY_TRACK_TYPE
2270```
2271
2272**Description**
2273
2274Pointer to the key that describes the track type in a media file. The value type is int32_t. For details, see [OH_MediaType](#oh_mediatype-1).
2275
2276**System capability**: SystemCapability.Multimedia.Media.CodecBase
2277
2278**Since**: 9
2279
2280
2281### OH_MD_KEY_TRANSFER_CHARACTERISTICS
2282
2283```
2284const char* OH_MD_KEY_TRANSFER_CHARACTERISTICS
2285```
2286
2287**Description**
2288
2289Pointer to the key that describes the video transfer characteristics. The value type is int32_t. For details, see [OH_TransferCharacteristic](#oh_transfercharacteristic). The video transfer characteristics comply with Table 3 in the H.273 standard.
2290
2291**System capability**: SystemCapability.Multimedia.Media.CodecBase
2292
2293**Since**: 10
2294
2295### OH_MD_KEY_VIDEO_CROP_BOTTOM
2296
2297```
2298const char* OH_MD_KEY_VIDEO_CROP_BOTTOM
2299```
2300
2301**Description**
2302
2303Pointer to the key that describes the bottom coordinate (y) of the cropped rectangle. The value type is int32_t. The row at the bottom of the cropped rectangle is contained, and the row index starts from 0. This key is used only for video decoding.
2304
2305**System capability**: SystemCapability.Multimedia.Media.CodecBase
2306
2307**Since**: 12
2308
2309
2310### OH_MD_KEY_VIDEO_CROP_LEFT
2311
2312```
2313const char* OH_MD_KEY_VIDEO_CROP_LEFT
2314```
2315
2316**Description**
2317
2318Pointer to the key that describes the left coordinate (x) of the cropped rectangle. The value type is int32_t. The leftmost column of the cropped rectangle is contained, and the column index starts from 0. This key is used only for video decoding.
2319
2320**System capability**: SystemCapability.Multimedia.Media.CodecBase
2321
2322**Since**: 12
2323
2324
2325### OH_MD_KEY_VIDEO_CROP_RIGHT
2326
2327```
2328const char* OH_MD_KEY_VIDEO_CROP_RIGHT
2329```
2330
2331**Description**
2332
2333Pointer to the key that describes the right coordinate (x) of the cropped rectangle. The value type is int32_t. The rightmost column of the cropped rectangle is contained, and the column index starts from 0. This key is used only for video decoding.
2334
2335**System capability**: SystemCapability.Multimedia.Media.CodecBase
2336
2337**Since**: 12
2338
2339
2340### OH_MD_KEY_VIDEO_CROP_TOP
2341
2342```
2343const char* OH_MD_KEY_VIDEO_CROP_TOP
2344```
2345
2346**Description**
2347
2348Pointer to the key that describes the top coordinate (y) of the cropped rectangle. The value type is int32_t. The row at the top of the cropped rectangle is contained, and the row index starts from 0. This key is used only for video decoding.
2349
2350**System capability**: SystemCapability.Multimedia.Media.CodecBase
2351
2352**Since**: 12
2353
2354
2355### OH_MD_KEY_VIDEO_ENABLE_LOW_LATENCY
2356
2357```
2358const char* OH_MD_KEY_VIDEO_ENABLE_LOW_LATENCY
2359```
2360
2361**Description**
2362
2363Pointer to the key that describes the enabled status of low-latency video codec. The value type is int32_t. The value **1** means that low-latency video codec is enabled, and **0** means the opposite.
2364
2365If enabled, the input and output data held by the video encoder or decoder does not exceed the amount required by the codec standard.
2366
2367This key is optional and used only in the configuration phase.
2368
2369**System capability**: SystemCapability.Multimedia.Media.CodecBase
2370
2371**Since**: 12
2372
2373
2374### OH_MD_KEY_VIDEO_ENCODE_BITRATE_MODE
2375
2376```
2377const char* OH_MD_KEY_VIDEO_ENCODE_BITRATE_MODE
2378```
2379
2380**Description**
2381
2382Pointer to the key that describes the video encoding bit rate mode. The value type is int32_t. For details, see [OH_VideoEncodeBitrateMode](_video_encoder.md#oh_videoencodebitratemode).
2383
2384**System capability**: SystemCapability.Multimedia.Media.CodecBase
2385
2386**Since**: 9
2387
2388### OH_MD_KEY_VIDEO_ENCODER_ENABLE_TEMPORAL_SCALABILITY
2389
2390```
2391const char* OH_MD_KEY_VIDEO_ENCODER_ENABLE_TEMPORAL_SCALABILITY
2392```
2393
2394**Description**
2395
2396Pointer to the key that describes the enabled status of temporal scalability. The value type is int32_t. The value **1** means temporal scalability is enabled, and **0** means the opposite.
2397
2398Before using this variable, you can call [OH_AVCapability_IsFeatureSupported](_a_v_capability.md#oh_avcapability_isfeaturesupported) and use [VIDEO_ENCODER_TEMPORAL_SCALABILITY](_a_v_capability.md#oh_avcapabilityfeature) to check whether the video encoder supports temporal scalability.
2399
2400This key is optional and used only in the configuration phase of video encoding.
2401
2402**System capability**: SystemCapability.Multimedia.Media.CodecBase
2403
2404**Since**: 12
2405
2406
2407### OH_MD_KEY_VIDEO_ENCODER_LTR_FRAME_COUNT
2408
2409```
2410const char* OH_MD_KEY_VIDEO_ENCODER_LTR_FRAME_COUNT
2411```
2412**Description**
2413
2414Pointer to the key that describes the number of LTR frames. The value type is int32_t. The value must be within the supported value range.
2415
2416Before using this key, you can use the API [OH_AVCapability_GetFeatureProperties](_a_v_capability.md#oh_avcapability_getfeatureproperties) and the enum [VIDEO_ENCODER_LONG_TERM_REFERENCE](_a_v_capability.md#oh_avcapabilityfeature) to query the number of supported LTR frames.
2417
2418This key is optional and used only in the configuration phase of video encoding.
2419
2420**System capability**: SystemCapability.Multimedia.Media.CodecBase
2421
2422**Since**: 12
2423
2424
2425### OH_MD_KEY_VIDEO_ENCODER_PER_FRAME_MARK_LTR
2426
2427```
2428const char* OH_MD_KEY_VIDEO_ENCODER_PER_FRAME_MARK_LTR
2429```
2430**Description**
2431
2432Pointer to the key that describes the key that marks the current frame as an LTR frame. The value type is int32_t. The value **1** means that the frame is marked as an LTR frame, and **0** means the opposite.
2433
2434This key takes effect only after the number of LTR frames is configured.
2435
2436This key is optional and is used only for video encoding input rotation. The configuration takes effect immediately.
2437
2438**System capability**: SystemCapability.Multimedia.Media.CodecBase
2439
2440**Since**: 12
2441
2442
2443### OH_MD_KEY_VIDEO_ENCODER_PER_FRAME_USE_LTR
2444
2445```
2446const char* OH_MD_KEY_VIDEO_ENCODER_PER_FRAME_USE_LTR
2447```
2448**Description**
2449
2450Pointer to the key that describes the LTR frame referenced by the current frame. The value type is int32_t.
2451
2452This key is optional and is used only for video encoding input rotation. The configuration takes effect immediately.
2453
2454**System capability**: SystemCapability.Multimedia.Media.CodecBase
2455
2456**Since**: 12
2457
2458
2459### OH_MD_KEY_VIDEO_ENCODER_QP_MAX
2460
2461```
2462const char* OH_MD_KEY_VIDEO_ENCODER_QP_MAX
2463```
2464
2465**Description**
2466
2467Pointer to the key that describes the maximum QP allowed by the video encoder. The value type is int32_t.
2468
2469This key is used in the configuration or parameter setting phase or takes effect immediately with the frame.
2470
2471**System capability**: SystemCapability.Multimedia.Media.CodecBase
2472
2473**Since**: 12
2474
2475
2476### OH_MD_KEY_VIDEO_ENCODER_QP_MIN
2477
2478```
2479const char* OH_MD_KEY_VIDEO_ENCODER_QP_MIN
2480```
2481
2482**Description**
2483
2484Pointer to the key that describes the minimum QP allowed by the video encoder. The value type is int32_t.
2485
2486This key is used in the configuration or parameter setting phase or takes effect immediately with the frame.
2487
2488**System capability**: SystemCapability.Multimedia.Media.CodecBase
2489
2490**Since**: 12
2491
2492
2493### OH_MD_KEY_VIDEO_ENCODER_QP_AVERAGE
2494
2495```
2496const char* OH_MD_KEY_VIDEO_ENCODER_QP_AVERAGE
2497```
2498
2499**Description**
2500
2501Pointer to the key that describes the average QP of video frames. The value type is int32_t.
2502
2503Pointer to the key that describes the average QP value of the current frame encoding block. It is output with OH_AVBuffer.
2504
2505**System capability**: SystemCapability.Multimedia.Media.CodecBase
2506
2507**Since**: 12
2508
2509
2510### OH_MD_KEY_VIDEO_ENCODER_MSE
2511
2512```
2513const char* OH_MD_KEY_VIDEO_ENCODER_MSE
2514```
2515
2516**Description**
2517
2518Pointer to the key that describes the MSE of video frames. The value type is double.
2519
2520Pointer to the key that describes the MSE of the current frame encoding block. It is output with OH_AVBuffer.
2521
2522**System capability**: SystemCapability.Multimedia.Media.CodecBase
2523
2524**Since**: 12
2525
2526
2527### OH_MD_KEY_VIDEO_ENCODER_TEMPORAL_GOP_REFERENCE_MODE
2528
2529```
2530const char* OH_MD_KEY_VIDEO_ENCODER_TEMPORAL_GOP_REFERENCE_MODE
2531```
2532
2533**Description**
2534
2535Pointer to the key that describes the reference mode in a temporal image group. The value type is int32_t. For details, see [OH_TemporalGopReferenceMode](#oh_temporalgopreferencemode). This key is valid only when temporal scalability is enabled.
2536
2537This key is optional and used only in the configuration phase of video encoding.
2538
2539**System capability**: SystemCapability.Multimedia.Media.CodecBase
2540
2541**Since**: 12
2542
2543
2544### OH_MD_KEY_VIDEO_ENCODER_TEMPORAL_GOP_SIZE
2545
2546```
2547const char* OH_MD_KEY_VIDEO_ENCODER_TEMPORAL_GOP_SIZE
2548```
2549
2550**Description**
2551
2552Pointer to the key that describes the size of a temporal image group. The value type is int32_t. This key is valid only when temporal scalability is enabled.
2553
2554This key is optional and used only in the configuration phase of video encoding.
2555
2556**System capability**: SystemCapability.Multimedia.Media.CodecBase
2557
2558**Since**: 12
2559
2560
2561### OH_MD_KEY_VIDEO_IS_HDR_VIVID
2562
2563```
2564const char* OH_MD_KEY_VIDEO_IS_HDR_VIVID
2565```
2566
2567**Description**
2568
2569Pointer to the key that describes whether the video track in a media file is HDR Vivid. The value type is int32_t. This key is used for both muxing and demuxing.
2570
2571**System capability**: SystemCapability.Multimedia.Media.CodecBase
2572
2573**Since**: 11
2574
2575
2576### OH_MD_KEY_DECODING_TIMESTAMP
2577
2578```
2579const char* OH_MD_KEY_DECODING_TIMESTAMP
2580```
2581
2582**Description**
2583
2584Pointer to the key that describes the decoding timestamp corresponding to the audio, video, or subtitle sample carried in AVBuffer, in microseconds. The value type is int64_t.
2585
2586**System capability**: SystemCapability.Multimedia.Media.CodecBase
2587
2588**Since**: 12
2589
2590
2591### OH_MD_KEY_BUFFER_DURATION
2592
2593```
2594const char* OH_MD_KEY_BUFFER_DURATION
2595```
2596
2597**Description**
2598
2599Pointer to the key that describes the duration corresponding to the audio, video, or subtitle sample carried in AVBuffer, in microseconds. The value type is int64_t.
2600
2601**System capability**: SystemCapability.Multimedia.Media.CodecBase
2602
2603**Since**: 12
2604
2605
2606### OH_MD_KEY_START_TIME
2607
2608```
2609const char* OH_MD_KEY_START_TIME
2610```
2611
2612**Description**
2613
2614Pointer to the key that describes the start time of the first frame in a media file. The value type is int64_t.
2615
2616**System capability**: SystemCapability.Multimedia.Media.CodecBase
2617
2618**Since**: 12
2619
2620### OH_MD_KEY_TRACK_START_TIME
2621
2622```
2623const char* OH_MD_KEY_TRACK_START_TIME
2624```
2625
2626**Description**
2627
2628Pointer to the key that describes the track start time. The value type is int64_t.
2629
2630**System capability**: SystemCapability.Multimedia.Media.CodecBase
2631
2632**Since**: 12
2633
2634
2635### OH_MD_KEY_VIDEO_DECODER_OUTPUT_COLOR_SPACE
2636
2637```
2638const char* OH_MD_KEY_VIDEO_DECODER_OUTPUT_COLOR_SPACE
2639```
2640
2641**Description**
2642
2643Pointer to the key that describes the output color space of the video decoder. The value type is int32_t.
2644
2645The supported value is **OH_COLORSPACE_BT709_LIMIT**. For details, see [OH_NativeBuffer_ColorSpace](../../reference/apis-arkgraphics2d/_o_h___native_buffer.md#oh_nativebuffer_colorspace-1).
2646
2647It is used when [OH_VideoDecoder_Configure](_video_decoder.md#oh_videodecoder_configure) is called.
2648
2649If Color Space Conversion (CSC) is supported and this key is configured, the video decoder automatically transcodes the HDR Vivid video to the BT.709 SDR video.
2650
2651If CSC function not supported, the error code [AV_ERR_VIDEO_UNSUPPORTED_COLOR_SPACE_CONVERSION](_core.md#oh_averrcode-1) is returned when [OH_VideoDecoder_Configure](_video_decoder.md#oh_videodecoder_configure) is called.
2652
2653If the input video is not an HDR Vivid video, the callback function [OH_AVCodecOnError](#oh_avcodeconerror) is invoked to report the error code [AV_ERR_VIDEO_UNSUPPORTED_COLOR_SPACE_CONVERSION](_core.md#oh_averrcode-1).
2654
2655**System capability**: SystemCapability.Multimedia.Media.CodecBase
2656
2657**Since**: 12
2658
2659
2660### OH_MD_KEY_VIDEO_PER_FRAME_IS_LTR
2661
2662```
2663const char* OH_MD_KEY_VIDEO_PER_FRAME_IS_LTR
2664```
2665**Description**
2666
2667Pointer to the key that describes the key that specifies whether the frame corresponding to the stream output from the current OH_AVBuffer is marked as an LTR frame. The value type is int32_t. The value **1** means that the frame is an LTR frame, and **0** means the opposite.
2668
2669This key is optional and is used only for video encoding output rotation.
2670
2671It indicates the attribute of a frame.
2672
2673**System capability**: SystemCapability.Multimedia.Media.CodecBase
2674
2675**Since**: 12
2676
2677
2678### OH_MD_KEY_VIDEO_PER_FRAME_POC
2679
2680```
2681const char* OH_MD_KEY_VIDEO_PER_FRAME_POC
2682```
2683**Description**
2684
2685Pointer to the key that describes the POC of the frame. The value type is int32_t.
2686
2687This key is optional and is used only for video encoding output rotation.
2688
2689It indicates the attribute of a frame.
2690
2691**System capability**: SystemCapability.Multimedia.Media.CodecBase
2692
2693**Since**: 12
2694
2695
2696### OH_MD_KEY_VIDEO_PIC_HEIGHT
2697
2698```
2699const char* OH_MD_KEY_VIDEO_PIC_HEIGHT
2700```
2701
2702**Description**
2703
2704Pointer to the key that describes the height of the video frame. The value type is int32_t.
2705
2706When [OH_VideoDecoder_GetOutputDescription](_video_decoder.md#oh_videodecoder_getoutputdescription) is called during video decoding, the height can be parsed from the returned **OH_AVFormat** instance.
2707
2708When the decoded output stream<!--RP2--><!--RP2End--> changes, the height can be parsed from the **OH_AVForamt** instance returned by [OH_AVCodecOnStreamChanged](#oh_avcodeconstreamchanged).
2709
2710**System capability**: SystemCapability.Multimedia.Media.CodecBase
2711
2712**Since**: 12
2713
2714
2715### OH_MD_KEY_VIDEO_PIC_WIDTH
2716
2717```
2718const char* OH_MD_KEY_VIDEO_PIC_WIDTH
2719```
2720
2721**Description**
2722
2723Pointer to the key that describes the width of the video frame. The value type is int32_t.
2724
2725When [OH_VideoDecoder_GetOutputDescription](_video_decoder.md#oh_videodecoder_getoutputdescription) is called during video decoding, the width can be parsed from the returned **OH_AVFormat** instance.
2726
2727When the decoded output stream<!--RP2--><!--RP2End--> changes, the width can be parsed from the **OH_AVForamt** instance returned by [OH_AVCodecOnStreamChanged](#oh_avcodeconstreamchanged).
2728
2729**System capability**: SystemCapability.Multimedia.Media.CodecBase
2730
2731**Since**: 12
2732
2733
2734### OH_MD_KEY_VIDEO_SLICE_HEIGHT
2735
2736```
2737const char* OH_MD_KEY_VIDEO_SLICE_HEIGHT
2738```
2739**Description**
2740
2741Pointer to the key that describes the height of the video frame. The value type is int32_t.
2742
2743The height is the number of rows that must be offset from the top of the Y plane to the top of the U plane. Essentially, the offset of the U plane is sliceHeight \* stride.
2744
2745The height of the U/V plane can be calculated based on the color format, but it is usually not defined and depends on the device and version.
2746
2747**System capability**: SystemCapability.Multimedia.Media.CodecBase
2748
2749**Since**: 12
2750
2751
2752### OH_MD_KEY_VIDEO_STRIDE
2753
2754```
2755const char* OH_MD_KEY_VIDEO_STRIDE
2756```
2757**Description**
2758
2759Pointer to the key that describes the stride of the video frame. The value type is int32_t.
2760
2761The stride is the difference between the index of the pixel and the index of the pixel right below.
2762
2763For the YUV420 format, the stride corresponds to the Y plane. The stride of the U/V plane can be calculated based on the color format, but it is usually not defined and depends on the device and version.
2764
2765**System capability**: SystemCapability.Multimedia.Media.CodecBase
2766
2767**Since**: 12
2768
2769
2770### OH_MD_KEY_WIDTH
2771
2772```
2773const char* OH_MD_KEY_WIDTH
2774```
2775
2776**Description**
2777
2778Pointer to the key that describes the video width. The value type is int32_t.
2779
2780**System capability**: SystemCapability.Multimedia.Media.CodecBase
2781
2782**Since**: 9
2783
2784
2785### OH_MD_MAX_INPUT_BUFFER_COUNT
2786
2787```
2788const char* OH_MD_MAX_INPUT_BUFFER_COUNT
2789```
2790
2791**Description**
2792
2793Pointer to the key that describes the maximum number of input buffers. The value type is int32_t.
2794
2795**System capability**: SystemCapability.Multimedia.Media.CodecBase
2796
2797**Since**: 10
2798
2799
2800### OH_MD_MAX_OUTPUT_BUFFER_COUNT
2801
2802```
2803const char* OH_MD_MAX_OUTPUT_BUFFER_COUNT
2804```
2805
2806**Description**
2807
2808Pointer to the key that describes the maximum number of output buffers. The value type is int32_t.
2809
2810**System capability**: SystemCapability.Multimedia.Media.CodecBase
2811
2812**Since**: 10
2813
2814
2815### OH_MD_KEY_VIDEO_SAR
2816
2817```
2818const char* OH_MD_KEY_VIDEO_SAR
2819```
2820
2821**Description**
2822
2823Pointer to the key that describes the aspect ratio of the sample. The value type is double.
2824
2825**System capability**: SystemCapability.Multimedia.Media.CodecBase
2826
2827**Since**: 12
2828