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