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