目录

CodecBase

Overview

The CodecBase module provides the variables, attributes, and functions for basic audio and video multiplexing, demultiplexing, encoding, and decoding.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 9

[h2]Media Codec Formats

The table below lists the media codec formats. The type is a constant string.

Name Description
OH_AVCODEC_MIMETYPE_AUDIO_AAC MIME type of the AAC audio codec.
OH_AVCODEC_MIMETYPE_AUDIO_FLAC MIME type of the Free Lossless Audio Codec (FLAC) audio codec.
OH_AVCODEC_MIMETYPE_AUDIO_OPUS MIME type of the Opus audio codec.
OH_AVCODEC_MIMETYPE_AUDIO_G711MU MIME type of the G.711 mu-law audio codec.
OH_AVCODEC_MIMETYPE_AUDIO_VORBIS MIME type of the Vorbis audio decoder.
OH_AVCODEC_MIMETYPE_AUDIO_MPEG MIME type of the MP3 audio decoder.
OH_AVCODEC_MIMETYPE_AUDIO_VIVID MIME type of the Audio Vivid audio decoder.
OH_AVCODEC_MIMETYPE_AUDIO_AMR_NB MIME type of the AMR-NB audio decoder.
OH_AVCODEC_MIMETYPE_AUDIO_AMR_WB MIME type of the AMR-WB audio decoder.
OH_AVCODEC_MIMETYPE_AUDIO_APE MIME type of the APE audio decoder.
OH_AVCODEC_MIMETYPE_VIDEO_VVC MIME type of the VVC (H.266) video codec.
OH_AVCODEC_MIMETYPE_VIDEO_HEVC MIME type of the HEVC (H.265) video codec.
OH_AVCODEC_MIMETYPE_VIDEO_AVC MIME type of the AVC (H.264) video codec.
OH_AVCODEC_MIMETYPE_VIDEO_MPEG4 MIME type of the MPEG4 video encoder, which is used only for multiplexing MPEG4 video streams. (This function is deprecated in API version 11.)
OH_AVCODEC_MIMETYPE_IMAGE_JPG MIME type of the JPG image encoder, which is used only for multiplexing JPG covers.
OH_AVCODEC_MIMETYPE_IMAGE_PNG MIME type of the PNG image encoder, which is used only for multiplexing PNG covers.
OH_AVCODEC_MIMETYPE_IMAGE_BMP MIME type of the BMP image encoder, which is used only for multiplexing BMP covers.
OH_AVCODEC_MIMETYPE_SUBTITLE_WEBVTT MIME type of the WEBVTT subtitle demuxer.
OH_AVCODEC_MIMETYPE_SUBTITLE_SRT MIME type of the SRT subtitle demuxer.

[h2]Media Data Key-Value Pairs

The 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 *.

The OH_AVFormat API is used to configure or query parameters.

Key-value pairs dedicated for capability query:

Name Description
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.

Common key-value pairs of audio and video:

Name Description
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.
OH_MD_MAX_INPUT_BUFFER_COUNT Maximum number of input buffers. The value type is int32_t. This key is optional.
OH_MD_MAX_OUTPUT_BUFFER_COUNT Maximum number of output buffers. The value type is int32_t. This key is optional.
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.
OH_MD_KEY_PROFILE Encoding grading. The value type is int32_t. For details, see OH_AVCProfile, OH_HEVCProfile, and OH_AACProfile. This key is optional.
OH_MD_KEY_MAX_INPUT_SIZE Maximum size of an input stream to decode. The value type is int32_t. This key is optional.

The table below lists the video-dedicated key-value pairs.

Name Description
OH_ED_KEY_TIME_STAMP Surface buffer timestamp. The value is of the int64_t type.
OH_ED_KEY_EOS End of stream for the surface buffer. The value type is int32_t. This key is optional.
OH_MD_KEY_WIDTH Video width. The value type is int32_t.
OH_MD_KEY_HEIGHT Video height. The value type is int32_t.
OH_MD_KEY_PIXEL_FORMAT Video pixel format. The value type is int32_t. For details, see OH_AVPixelFormat.
OH_MD_KEY_FRAME_RATE Video frame rate. The value type is double. This key is optional.
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.
OH_MD_KEY_COLOR_PRIMARIES Video primary color. The value type is int32_t. For details, see OH_ColorPrimary. The video primary color complies with Table 2 in the H.273 standard. This key is optional.
OH_MD_KEY_TRANSFER_CHARACTERISTICS Video transfer characteristics. The value type is int32_t. For details, see OH_TransferCharacteristic. The video transfer characteristics comply with Table 3 in the H.273 standard. This key is optional.
OH_MD_KEY_MATRIX_COEFFICIENTS Video matrix coefficient. The value type is int32_t. For details, see OH_MatrixCoefficient. The video matrix coefficient complies with Table 4 in the H.273 standard. This key is optional.
OH_MD_KEY_VIDEO_STRIDE Stride of the video frame. The value type is int32_t. This key is optional.
OH_MD_KEY_VIDEO_SLICE_HEIGHT Height of the video frame. The value type is int32_t. This key is optional.
OH_MD_KEY_VIDEO_PIC_WIDTH Width of the video frame. The value type is int32_t. This key is optional.
OH_MD_KEY_VIDEO_PIC_HEIGHT Height of the video frame. The value type is int32_t. This key is optional.
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.
OH_MD_KEY_VIDEO_ENCODE_BITRATE_MODE Video encoding bit rate mode. The value type is int32_t. For details, see OH_VideoEncodeBitrateMode. This key is optional.
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.
OH_MD_KEY_REQUEST_I_FRAME Request for immediate encoding of I-frames. The value type is int32_t. This key is optional.
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.
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.
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.
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. This key is valid only when temporal scalability is enabled. This key is optional and used only in the configuration phase of video encoding.
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.
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.
OH_MD_KEY_VIDEO_ENCODER_PER_FRAME_USE_LTR POC number of the LTR frame referenced by the current frame. The value type is int32_t. This key is optional and is used only for video encoding.
OH_MD_KEY_VIDEO_PER_FRAME_IS_LTR Whether the frame corresponding to the stream output from the current OH_AVBuffer is marked as an LTR frame. The value type is int32_t. The value 1 means that the frame is an LTR frame, and 0 means the opposite. This key is optional and is used only for video encoding.
OH_MD_KEY_VIDEO_PER_FRAME_POC POC number of the frame. The value type is int32_t. This key is optional and is used only for video encoding.
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.
OH_MD_KEY_VIDEO_ENCODER_QP_MIN Minimum QP allowed by the video encoder. The value type is int32_t. This key is optional.
OH_MD_KEY_VIDEO_ENCODER_QP_AVERAGE Average QP of video frames. The value type is int32_t. This key is optional.
OH_MD_KEY_VIDEO_ENCODER_MSE Mean Squared Error (MSE) of video frames. The value type is double. This key is optional.
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.
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
OH_MD_KEY_SCALING_MODE Video scaling mode. The value type is int32_t. For details, see 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.
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.
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.
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.
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.

The table below lists the audio-dedicated key-value pairs.

Name Description
OH_MD_KEY_AUDIO_SAMPLE_FORMAT Original audio format. The value type is int32_t. For details, see OH_BitsPerSample.
OH_MD_KEY_AUD_CHANNEL_COUNT Number of audio channels. The value type is int32_t.
OH_MD_KEY_AUD_SAMPLE_RATE Audio sampling rate. The value type is int32_t.
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.
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.
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. This key is optional.
OH_MD_KEY_SBR AAC SBR format. The value type is int32_t. This key applies to AAC encoders. This key is optional.
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.
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.
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.
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.
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.
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.

The table below lists the key-value pairs dedicated for multiplexing and demultiplexing.

Name Description
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 multiplexing and demultiplexing. This key is optional.
OH_MD_KEY_START_TIME Start time of the first frame in a media file, measured in microseconds. The value type is int64_t. This key is optional.
OH_MD_KEY_TRACK_START_TIME Start time of the track, measured in microseconds. The value type is int64_t. This key is optional.
OH_MD_KEY_TRACK_TYPE Track type in a media file. The value type is int32_t. For details, see OH_MediaType. This key is optional.
OH_MD_KEY_DURATION Duration in a media file. The value type is int64_t. This key is optional.
OH_MD_KEY_TITLE Title in a media file. The value type is string. This key is optional.
OH_MD_KEY_ARTIST Artist in a media file. The value type is string. This key is optional.
OH_MD_KEY_ALBUM Album in a media file. The value type is string. This key is optional.
OH_MD_KEY_ALBUM_ARTIST Album artist of the input media. The value type is string. This key is optional.
OH_MD_KEY_DATE Date in a media file, for example, 2024. The value type is string. This key is optional.
OH_MD_KEY_COMMENT Comment in a media file. The value type is string. This key is optional.
OH_MD_KEY_GENRE Genre in a media file. The value type is string. This key is optional.
OH_MD_KEY_COPYRIGHT Copyright in a media file. The value type is string. This key is optional.
OH_MD_KEY_LANGUAGE Language in a media file. The value type is string. This key is optional.
OH_MD_KEY_DESCRIPTION Description in a media file. The value type is string. This key is optional.
OH_MD_KEY_LYRICS Lyrics in a media file. The value type is string. This key is optional.
OH_MD_KEY_TRACK_COUNT Number of tracks in a media file. The value type is int32_t. This key is optional.
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.
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.
OH_MD_KEY_CODEC_MIME MIME type of the codec. The value type is string. This key is optional.
OH_MD_KEY_VIDEO_SAR Aspect ratio of the sample. The value type is double.

Summary

[h2]Files

Name Description
avcodec_audio_channel_layout.h Declares the enums used for audio encoding and decoding.
native_avcodec_base.h Declares the native APIs used for basic audio and video multiplexing, demultiplexing, encoding, and decoding.

[h2]Structs

Name Description
struct OH_AVCodecAsyncCallback Describes all the asynchronous callback function pointers of an OH_AVCodec instance. (This function is deprecated in API version 11.)
struct OH_AVCodecCallback Describes all the asynchronous callback function pointers of an OH_AVCodec instance.
struct OH_AVDataSource Describes a user-defined data source.

[h2]Types

Name Description
typedef struct NativeWindow OHNativeWindow Defines a struct for a native object for the graphics interface.
typedef struct OH_AVCodec OH_AVCodec Defines a struct for a native object for the audio and video codec interface.
typedef void(* OH_AVCodecOnError) (OH_AVCodec *codec, int32_t errorCode, void *userData) Defines the pointer to the function that is called to report error information when an error occurs during the running of an OH_AVCodec instance.
typedef void(* OH_AVCodecOnStreamChanged) (OH_AVCodec *codec, OH_AVFormat *format, void *userData) Defines the pointer to the function that is called to report the new stream description when the resolution of the input stream being decoded or the output stream that has been encoded changes.
typedef void(* OH_AVCodecOnNeedInputData) (OH_AVCodec *codec, uint32_t index, OH_AVMemory *data, void *userData) Defines the pointer to the function that is called when new input data is required during the running of an OH_AVCodec instance. The function carries a buffer to fill in new input data. (This function is deprecated in API version 11.)
typedef void(* OH_AVCodecOnNewOutputData) (OH_AVCodec *codec, uint32_t index, OH_AVMemory *data, OH_AVCodecBufferAttr *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.)
typedef void(* OH_AVCodecOnNeedInputBuffer) (OH_AVCodec *codec, uint32_t index, OH_AVBuffer *buffer, void *userData) Defines the pointer to the function that is called when new input data is required during the running of an OH_AVCodec instance. The function carries a buffer to fill in new input data.
typedef void(* OH_AVCodecOnNewOutputBuffer) (OH_AVCodec *codec, uint32_t index, OH_AVBuffer *buffer, void *userData) Defines the pointer to the function that is called when new output data is generated during the running of an OH_AVCodec instance. The function carries a buffer filled with new output data.
typedef struct OH_AVCodecAsyncCallback OH_AVCodecAsyncCallback Defines all the asynchronous callback function pointers of an OH_AVCodec instance. (This function is deprecated in API version 11.)
typedef struct OH_AVCodecCallback OH_AVCodecCallback Defines all the asynchronous callback function pointers of an OH_AVCodec instance.
typedef int32_t(* 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.
typedef struct OH_AVDataSource OH_AVDataSource Defines a struct for a user-defined data source.
typedef enum OH_MediaType OH_MediaType Defines an enum for the media types.
typedef enum OH_AACProfile OH_AACProfile Defines an enum for the Advanced Audio Coding (AAC) profiles.
typedef enum OH_AVCProfile OH_AVCProfile Defines an enum for the Advanced Video Coding (AVC) profiles.
typedef enum OH_HEVCProfile OH_HEVCProfile Defines an enum for the High Efficiency Video Coding (HEVC) profiles.
typedef enum OH_AVOutputFormat OH_AVOutputFormat Defines an enum for the output file formats supported by a muxer.
typedef enum OH_AVSeekMode OH_AVSeekMode Defines an enum for the seek modes.
typedef enum OH_ScalingMode OH_ScalingMode Defines an enum for the scaling modes. This enum is used only in surface mode.
typedef enum OH_BitsPerSample OH_BitsPerSample Defines an enum for the number of audio bits for each coded sample.
typedef enum OH_ColorPrimary OH_ColorPrimary Defines an enum for the primary colors.
typedef enum OH_TransferCharacteristic OH_TransferCharacteristic Defines an enum for the transfer characteristics.
typedef enum OH_MatrixCoefficient OH_MatrixCoefficient Defines an enum for the matrix coefficients.
typedef enum OH_AVCLevel OH_AVCLevel Defines an enum for the AVC levels.
typedef enum OH_HEVCLevel OH_HEVCLevel Defines an enum for the HEVC levels.
typedef enum OH_TemporalGopReferenceMode OH_TemporalGopReferenceMode Defines an enum for the reference modes of temporal image groups.

[h2]Enums

Name Description

AudioChannelSet : uint64_t {

FRONT_LEFT = 1ULL << 0U,

FRONT_RIGHT = 1ULL << 1U,

FRONT_CENTER = 1ULL << 2U,

LOW_FREQUENCY = 1ULL << 3U,

BACK_LEFT = 1ULL << 4U,

BACK_RIGHT = 1ULL << 5U,

FRONT_LEFT_OF_CENTER = 1ULL << 6U,

FRONT_RIGHT_OF_CENTER = 1ULL << 7U,

BACK_CENTER = 1ULL << 8U,

SIDE_LEFT = 1ULL << 9U,

SIDE_RIGHT = 1ULL << 10U,

TOP_CENTER = 1ULL << 11U,

TOP_FRONT_LEFT = 1ULL << 12U,

TOP_FRONT_CENTER = 1ULL << 13U,

TOP_FRONT_RIGHT = 1ULL << 14U,

TOP_BACK_LEFT = 1ULL << 15U,

TOP_BACK_CENTER = 1ULL << 16U,

TOP_BACK_RIGHT = 1ULL << 17U,

STEREO_LEFT = 1ULL << 29U,

STEREO_RIGHT = 1ULL << 30U,

WIDE_LEFT = 1ULL << 31U,

WIDE_RIGHT = 1ULL << 32U,

SURROUND_DIRECT_LEFT = 1ULL << 33U,

SURROUND_DIRECT_RIGHT = 1ULL << 34U,

LOW_FREQUENCY_2 = 1ULL << 35U,

TOP_SIDE_LEFT = 1ULL << 36U,

TOP_SIDE_RIGHT = 1ULL << 37U,

BOTTOM_FRONT_CENTER = 1ULL << 38U,

BOTTOM_FRONT_LEFT = 1ULL << 39U,

BOTTOM_FRONT_RIGHT = 1ULL << 40U,

AMBISONICS_ACN0 = 1ULL << 41U,

AMBISONICS_ACN1 = 1ULL << 42U,

AMBISONICS_ACN2 = 1ULL << 43U,

AMBISONICS_ACN3 = 1ULL << 44U,

AMBISONICS_W = AMBISONICS_ACN0,

AMBISONICS_Y = AMBISONICS_ACN1,

AMBISONICS_Z = AMBISONICS_ACN2,

AMBISONICS_X = AMBISONICS_ACN3,

AMBISONICS_ACN4 = 1ULL << 45U,

AMBISONICS_ACN5 = 1ULL << 46U,

AMBISONICS_ACN6 = 1ULL << 47U,

AMBISONICS_ACN7 = 1ULL << 48U,

AMBISONICS_ACN8 = 1ULL << 49U,

AMBISONICS_ACN9 = 1ULL << 50U,

AMBISONICS_ACN10 = 1ULL << 51U,

AMBISONICS_ACN11 = 1ULL << 52U,

AMBISONICS_ACN12 = 1ULL << 53U,

AMBISONICS_ACN13 = 1ULL << 54U,

AMBISONICS_ACN14 = 1ULL << 55U,

AMBISONICS_ACN15 = 1ULL << 56U

}

Enumerates the audio channel sets. Each channel number is mapped to a variable of int64_t. (This function is deprecated in API version 11.)

AudioChannelLayout : uint64_t {

UNKNOWN_CHANNEL_LAYOUT = 0,

MONO = (AudioChannelSet::FRONT_CENTER),

STEREO = (AudioChannelSet::FRONT_LEFT | AudioChannelSet::FRONT_RIGHT),

CH_2POINT1 = (STEREO | AudioChannelSet::LOW_FREQUENCY),

CH_2_1 = (STEREO | AudioChannelSet::BACK_CENTER),

SURROUND = (STEREO | AudioChannelSet::FRONT_CENTER),

CH_3POINT1 = (SURROUND | AudioChannelSet::LOW_FREQUENCY),

CH_4POINT0 = (SURROUND | AudioChannelSet::BACK_CENTER),

CH_4POINT1 = (CH_4POINT0 | AudioChannelSet::LOW_FREQUENCY),

CH_2_2 = (STEREO | AudioChannelSet::SIDE_LEFT | AudioChannelSet::SIDE_RIGHT),

QUAD = (STEREO | AudioChannelSet::BACK_LEFT | AudioChannelSet::BACK_RIGHT),

CH_5POINT0 = (SURROUND | AudioChannelSet::SIDE_LEFT | AudioChannelSet::SIDE_RIGHT),

CH_5POINT1 = (CH_5POINT0 | AudioChannelSet::LOW_FREQUENCY),

CH_5POINT0_BACK = (SURROUND | AudioChannelSet::BACK_LEFT | AudioChannelSet::BACK_RIGHT),

CH_5POINT1_BACK = (CH_5POINT0_BACK | AudioChannelSet::LOW_FREQUENCY),

CH_6POINT0 = (CH_5POINT0 | AudioChannelSet::BACK_CENTER),

CH_6POINT0_FRONT = (CH_2_2 | AudioChannelSet::FRONT_LEFT_OF_CENTER | AudioChannelSet::FRONT_RIGHT_OF_CENTER),

HEXAGONAL = (CH_5POINT0_BACK | AudioChannelSet::BACK_CENTER),

CH_6POINT1 = (CH_5POINT1 | AudioChannelSet::BACK_CENTER),

CH_6POINT1_BACK = (CH_5POINT1_BACK | AudioChannelSet::BACK_CENTER),

CH_6POINT1_FRONT = (CH_6POINT0_FRONT | AudioChannelSet::LOW_FREQUENCY),

CH_7POINT0 = (CH_5POINT0 | AudioChannelSet::BACK_LEFT | AudioChannelSet::BACK_RIGHT),

CH_7POINT0_FRONT = (CH_5POINT0 | AudioChannelSet::FRONT_LEFT_OF_CENTER | AudioChannelSet::FRONT_RIGHT_OF_CENTER),

CH_7POINT1 = (CH_5POINT1 | AudioChannelSet::BACK_LEFT | AudioChannelSet::BACK_RIGHT),

CH_7POINT1_WIDE = (CH_5POINT1 | AudioChannelSet::FRONT_LEFT_OF_CENTER | AudioChannelSet::FRONT_RIGHT_OF_CENTER),

CH_7POINT1_WIDE_BACK, CH_3POINT1POINT2 = (CH_3POINT1 | AudioChannelSet::TOP_FRONT_LEFT | AudioChannelSet::TOP_FRONT_RIGHT),

CH_5POINT1POINT2 = (CH_5POINT1 | AudioChannelSet::TOP_SIDE_LEFT | AudioChannelSet::TOP_SIDE_RIGHT),

CH_5POINT1POINT4, CH_7POINT1POINT2 = (CH_7POINT1 | AudioChannelSet::TOP_SIDE_LEFT | AudioChannelSet::TOP_SIDE_RIGHT),

CH_7POINT1POINT4, CH_9POINT1POINT4 = (CH_7POINT1POINT4 | AudioChannelSet::WIDE_LEFT | AudioChannelSet::WIDE_RIGHT),

CH_9POINT1POINT6 = (CH_9POINT1POINT4 | AudioChannelSet::TOP_SIDE_LEFT | AudioChannelSet::TOP_SIDE_RIGHT),

CH_10POINT2, CH_22POINT2, OCTAGONAL = (CH_5POINT0 | AudioChannelSet::BACK_LEFT | AudioChannelSet::BACK_CENTER | AudioChannelSet::BACK_RIGHT),

HEXADECAGONAL, STEREO_DOWNMIX = (AudioChannelSet::STEREO_LEFT | AudioChannelSet::STEREO_RIGHT),

HOA_FIRST,

HOA_SECOND,

HOA_THIRD

}

Enumerates the types of the audio channel sets. The output format of the decoder is represented as the channel type of the codec. (This function is deprecated in API version 11.)

OH_MediaType {

MEDIA_TYPE_AUD = 0,

MEDIA_TYPE_VID = 1,

MEDIA_TYPE_SUBTITILE = 2

}

Enumerates the media types.
OH_AACProfile { AAC_PROFILE_LC = 0 } Enumerates the AAC profiles.

OH_AVCProfile {

AVC_PROFILE_BASELINE = 0,

AVC_PROFILE_HIGH = 4,

AVC_PROFILE_MAIN = 8

}

Enumerates the AVC profiles.

OH_HEVCProfile {

HEVC_PROFILE_MAIN = 0,

HEVC_PROFILE_MAIN_10 = 1,

HEVC_PROFILE_MAIN_STILL = 2,

HEVC_PROFILE_MAIN_10_HDR10 = 3,

HEVC_PROFILE_MAIN_10_HDR10_PLUS = 4

}

Enumerates the HEVC profiles.

OH_AVOutputFormat {

AV_OUTPUT_FORMAT_DEFAULT = 0,

AV_OUTPUT_FORMAT_MPEG_4 = 2,

AV_OUTPUT_FORMAT_M4A = 6,

AV_OUTPUT_FORMAT_AMR = 8,

AV_OUTPUT_FORMAT_MP3 = 9,

AV_OUTPUT_FORMAT_WAV = 10

}

Enumerates the output file formats supported by a muxer.

OH_AVSeekMode {

SEEK_MODE_NEXT_SYNC = 0,

SEEK_MODE_PREVIOUS_SYNC,

SEEK_MODE_CLOSEST_SYNC

}

Enumerates the seek modes.

OH_ScalingMode {

SCALING_MODE_SCALE_TO_WINDOW = 1,

SCALING_MODE_SCALE_CROP = 2

}

Enumerates the scaling modes.

OH_BitsPerSample {

SAMPLE_U8 = 0, SAMPLE_S16LE = 1,

SAMPLE_S24LE = 2, SAMPLE_S32LE = 3,

SAMPLE_F32LE = 4, SAMPLE_U8P = 5,

SAMPLE_S16P = 6, SAMPLE_S24P = 7,

SAMPLE_S32P = 8, SAMPLE_F32P = 9,

INVALID_WIDTH = -1

}

Enumerates the number of audio bits for each coded sample.

OH_ColorPrimary {

COLOR_PRIMARY_BT709 = 1,

COLOR_PRIMARY_UNSPECIFIED = 2,

COLOR_PRIMARY_BT470_M = 4,

COLOR_PRIMARY_BT601_625 = 5,

COLOR_PRIMARY_BT601_525 = 6,

COLOR_PRIMARY_SMPTE_ST240 = 7,

COLOR_PRIMARY_GENERIC_FILM = 8,

COLOR_PRIMARY_BT2020 = 9,

COLOR_PRIMARY_SMPTE_ST428 = 10,

COLOR_PRIMARY_P3DCI = 11,

COLOR_PRIMARY_P3D65 = 12

}

Enumerates the primary colors.

OH_TransferCharacteristic {

TRANSFER_CHARACTERISTIC_BT709 = 1,

TRANSFER_CHARACTERISTIC_UNSPECIFIED = 2,

TRANSFER_CHARACTERISTIC_GAMMA_2_2 = 4,

TRANSFER_CHARACTERISTIC_GAMMA_2_8 = 5,

TRANSFER_CHARACTERISTIC_BT601 = 6,

TRANSFER_CHARACTERISTIC_SMPTE_ST240 = 7,

TRANSFER_CHARACTERISTIC_LINEAR = 8,

TRANSFER_CHARACTERISTIC_LOG = 9,

TRANSFER_CHARACTERISTIC_LOG_SQRT = 10,

TRANSFER_CHARACTERISTIC_IEC_61966_2_4 = 11,

TRANSFER_CHARACTERISTIC_BT1361 = 12,

TRANSFER_CHARACTERISTIC_IEC_61966_2_1 = 13,

TRANSFER_CHARACTERISTIC_BT2020_10BIT = 14,

TRANSFER_CHARACTERISTIC_BT2020_12BIT = 15,

TRANSFER_CHARACTERISTIC_PQ = 16,

TRANSFER_CHARACTERISTIC_SMPTE_ST428 = 17,

TRANSFER_CHARACTERISTIC_HLG = 18

}

Enumerates the transfer characteristics.

OH_MatrixCoefficient {

MATRIX_COEFFICIENT_IDENTITY = 0,

MATRIX_COEFFICIENT_BT709 = 1,

MATRIX_COEFFICIENT_UNSPECIFIED = 2,

MATRIX_COEFFICIENT_FCC = 4,

MATRIX_COEFFICIENT_BT601_625 = 5,

MATRIX_COEFFICIENT_BT601_525 = 6, MATRIX_COEFFICIENT_SMPTE_ST240 = 7,

MATRIX_COEFFICIENT_YCGCO = 8,

MATRIX_COEFFICIENT_BT2020_NCL = 9,

MATRIX_COEFFICIENT_BT2020_CL = 10,

MATRIX_COEFFICIENT_SMPTE_ST2085 = 11,

MATRIX_COEFFICIENT_CHROMATICITY_NCL = 12,

MATRIX_COEFFICIENT_CHROMATICITY_CL = 13,

MATRIX_COEFFICIENT_ICTCP = 14

}

Enumerates the matrix coefficients.

OH_AVCLevel {

AVC_LEVEL_1 = 0,

AVC_LEVEL_1b = 1,

AVC_LEVEL_11 = 2,

AVC_LEVEL_12 = 3,

AVC_LEVEL_13 = 4,

AVC_LEVEL_2 = 5,

AVC_LEVEL_21 = 6,

AVC_LEVEL_22 = 7,

AVC_LEVEL_3 = 8,

AVC_LEVEL_31 = 9,

AVC_LEVEL_32 = 10,

AVC_LEVEL_4 = 11,

AVC_LEVEL_41 = 12,

AVC_LEVEL_42 = 13,

AVC_LEVEL_5 = 14,

AVC_LEVEL_51 = 15,

AVC_LEVEL_52 = 16,

AVC_LEVEL_6 = 17,

AVC_LEVEL_61 = 18,

AVC_LEVEL_62 = 19

}

Enumerates the AVC levels.

OH_HEVCLevel {

HEVC_LEVEL_1 = 0,

HEVC_LEVEL_2 = 1,

HEVC_LEVEL_21 = 2,

HEVC_LEVEL_3 = 3,

HEVC_LEVEL_31 = 4,

HEVC_LEVEL_4 = 5,

HEVC_LEVEL_41 = 6,

HEVC_LEVEL_5 = 7,

HEVC_LEVEL_51 = 8,

HEVC_LEVEL_52 = 9,

HEVC_LEVEL_6 = 10,

HEVC_LEVEL_61 = 11,

HEVC_LEVEL_62 = 12

}

Enumerates the HEVC levels.

OH_TemporalGopReferenceMode {

ADJACENT_REFERENCE = 0,

JUMP_REFERENCE = 1,

UNIFORMLY_SCALED_REFERENCE = 2

}

Enumerates the reference modes of temporal image groups.

[h2]Variables

Name Description
const char * OH_AVCODEC_MIMETYPE_AUDIO_AAC Pointer to the key that describes the MIME type of the AAC audio codec.
const char * OH_AVCODEC_MIMETYPE_AUDIO_FLAC Pointer to the key that describes the MIME type of the Free Lossless Audio Codec (FLAC) audio codec.
const char * OH_AVCODEC_MIMETYPE_AUDIO_OPUS Pointer to the key that describes the MIME type of the Opus audio codec.
const char * OH_AVCODEC_MIMETYPE_AUDIO_G711MU Pointer to the key that describes the MIME type of the G.711 mu-law audio codec.
const char * OH_AVCODEC_MIMETYPE_AUDIO_VORBIS Pointer to the key that describes the MIME type of the Vorbis audio decoder.
const char * OH_AVCODEC_MIMETYPE_AUDIO_MPEG Pointer to the key that describes the MIME type of the MP3 audio decoder.
const char * OH_AVCODEC_MIMETYPE_AUDIO_VIVID Pointer to the key that describes the MIME type of the Audio Vivid audio decoder.
const char * OH_AVCODEC_MIMETYPE_AUDIO_AMR_NB Pointer to the key that describes the MIME type of the AMR-NB audio decoder.
const char * OH_AVCODEC_MIMETYPE_AUDIO_AMR_WB Pointer to the key that describes the MIME type of the AMR-WB audio decoder.
const char * OH_AVCODEC_MIMETYPE_AUDIO_APE Pointer to the key that describes the MIME type of the APE audio decoder.
const char * OH_AVCODEC_MIMETYPE_VIDEO_VVC Pointer to the key that describes the MIME type of the VVC (H.266) video codec.
const char * OH_AVCODEC_MIMETYPE_VIDEO_HEVC Pointer to the key that describes the MIME type of the HEVC (H.265) video codec.
const char * OH_AVCODEC_MIMETYPE_VIDEO_AVC Pointer to the key that describes the MIME type of the AVC (H.264) video codec.
const char * OH_AVCODEC_MIMETYPE_VIDEO_MPEG4 Pointer to the key that describes the MIME type of the MPEG4 video encoder, which is used only for multiplexing MPEG4 video streams. (This function is deprecated in API version 11.)
const char * OH_AVCODEC_MIMETYPE_IMAGE_JPG Pointer to the key that describes the MIME type of the JPG image encoder, which is used only for multiplexing JPG covers.
const char * OH_AVCODEC_MIMETYPE_IMAGE_PNG Pointer to the key that describes the MIME type of the PNG image encoder, which is used only for multiplexing PNG covers.
const char * OH_AVCODEC_MIMETYPE_IMAGE_BMP Pointer to the key that describes the MIME type of the BMP image encoder, which is used only for multiplexing BMP covers.
const char * OH_AVCODEC_MIMETYPE_SUBTITLE_WEBVTT Pointer to the key that describes the MIME type of the WEBVTT subtitle demuxer.
const char * OH_AVCODEC_MIMETYPE_SUBTITLE_SRT Pointer to the key that describes the MIME type of the SRT subtitle demuxer.
const char * 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.
const char * 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*.
const char * OH_MD_MAX_INPUT_BUFFER_COUNT Pointer to the key that describes the maximum number of input buffers. The value type is int32_t.
const char * OH_MD_MAX_OUTPUT_BUFFER_COUNT Pointer to the key that describes the maximum number of output buffers. The value type is int32_t.
const char * OH_MD_KEY_BITRATE Pointer to the key that describes the bit rate. The value type is int64_t.
const char * 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_HEVCProfile, and OH_AACProfile.
const char * 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.
const char * OH_ED_KEY_TIME_STAMP Pointer to the key that describes the surface buffer timestamp. The value is of the int64_t type.
const char * OH_ED_KEY_EOS Pointer to the key that describes the end of stream for the surface buffer. The value type is int32_t.
const char * OH_MD_KEY_WIDTH Pointer to the key that describes the video width. The value type is int32_t.
const char * OH_MD_KEY_HEIGHT Pointer to the key that describes the video height. The value type is int32_t.
const char * 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.
const char * OH_MD_KEY_FRAME_RATE Pointer to the key that describes the video frame rate. The value type is double.
const char * 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.
const char * 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.
const char * 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. The video primary color complies with Table 2 in the H.273 standard.
const char * 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. The video transfer characteristics comply with Table 3 in the H.273 standard.
const char * 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. The video matrix coefficient complies with Table 4 in the H.273 standard.
const char * 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. 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.
const char * 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.
const char * 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.
const char * 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.
const char * 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.
const char * OH_MD_KEY_VIDEO_STRIDE Pointer to the key that describes the stride of the video frame. The value type is int32_t.
const char * OH_MD_KEY_VIDEO_SLICE_HEIGHT Pointer to the key that describes the height of the video frame. The value type is int32_t.
const char * OH_MD_KEY_VIDEO_PIC_WIDTH Pointer to the key that describes the width of the video frame. The value type is int32_t.
const char * OH_MD_KEY_VIDEO_PIC_HEIGHT Pointer to the key that describes the height of the video frame. The value type is int32_t.
const char * 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.
const char * 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.
const char * 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.
const char * 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.
const char * 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.
const char * 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.
const char * 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.
const char * 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. This key is valid only when temporal scalability is enabled.
const char * 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.
const char * 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.
const char * OH_MD_KEY_VIDEO_ENCODER_PER_FRAME_USE_LTR Pointer to the key that describes the POC number of the LTR frame referenced by the current frame. The value type is int32_t. This key is optional and is used only for video encoding.
const char * 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.
const char * OH_MD_KEY_VIDEO_PER_FRAME_POC Pointer to the key that describes the POC number of the frame. The value type is int32_t. This key is optional and is used only for video encoding.
const char * 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.
const char * 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.
const char * 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.
const char * OH_MD_KEY_VIDEO_ENCODER_MSE Pointer to the key that describes the MSE of video frames. The value type is double.
const char * 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.
const char * OH_MD_KEY_AUDIO_SAMPLE_FORMAT Pointer to the key that describes the original audio format. The value type is int32_t. For details, see OH_BitsPerSample.
const char * OH_MD_KEY_AUD_CHANNEL_COUNT Pointer to the key that describes the number of audio channels. The value type is int32_t.
const char * OH_MD_KEY_AUD_SAMPLE_RATE Pointer to the key that describes the audio sampling rate. The value type is int32_t.
const char * 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.
const char * 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.
const char * 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.
const char * 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.
const char * 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.
const char * 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.
const char * 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.
const char * 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.
const char * 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.
const char * 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.
const char * 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 multiplexing and demultiplexing.
const char * OH_MD_KEY_START_TIME Pointer to the key that describes the start time of the first frame in a media file, measured in microseconds. The value type is int64_t.
const char * OH_MD_KEY_TRACK_START_TIME Pointer to the key that describes the start time of the track, measured in microseconds. The value type is int64_t.
const char * 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.
const char * OH_MD_KEY_DURATION Pointer to the key that describes the duration in a media file. The value type is int64_t.
const char * OH_MD_KEY_TITLE Pointer to the key that describes the title in a media file. The value type is string.
const char * OH_MD_KEY_ARTIST Pointer to the key that describes the lyrics in a media file. The value type is string.
const char * OH_MD_KEY_ALBUM Pointer to the key that describes the album in a media file. The value type is string.
const char * OH_MD_KEY_ALBUM_ARTIST Pointer to the key that describes the album artist of the input media. The value type is string.
const char * OH_MD_KEY_DATE Pointer to the key that describes the date in a media file, for example, 2024. The value type is string.
const char * OH_MD_KEY_COMMENT Pointer to the key that describes the comment in a media file. The value type is string.
const char * OH_MD_KEY_GENRE Pointer to the key that describes the genre in a media file. The value type is string.
const char * OH_MD_KEY_COPYRIGHT Pointer to the key that describes the copyright in a media file. The value type is string.
const char * OH_MD_KEY_LANGUAGE Pointer to the key that describes the language in a media file. The value type is string.
const char * OH_MD_KEY_DESCRIPTION Pointer to the key that describes the description in a media file. The value type is string.
const char * OH_MD_KEY_LYRICS Pointer to the key that describes the lyrics in a media file. The value type is string.
const char * 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.
const char * 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.
const char * 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.
const char * OH_MD_KEY_CODEC_MIME Pointer to the key that describes the MIME type of the codec. The value type is string.
const char * OH_MD_KEY_VIDEO_SAR Pointer to the key that describes the aspect ratio of the sample. The value type is double.

Type Description

[h2]OH_AACProfile

typedef enum OH_AACProfile OH_AACProfile

Description

Defines an enum for the AAC profiles.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 9

[h2]OH_AVCLevel

typedef enum OH_AVCLevel OH_AVCLevel

Description

Defines an enum for the AVC levels.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 12

[h2]OH_AVCodec

typedef struct OH_AVCodec OH_AVCodec

Description

Defines a struct for a native object for the audio and video codec interface.

Since: 9

[h2]OH_AVCodecAsyncCallback

typedef struct OH_AVCodecAsyncCallback OH_AVCodecAsyncCallback

Description

Defines 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.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 9

Deprecated from: 11

Substitute: OH_AVCodecCallback

Parameters

Name Description
onError Callback used to report a codec operation error. For details, see OH_AVCodecOnError.
onStreamChanged Callback used to report a codec stream change. For details, see OH_AVCodecOnStreamChanged.
onNeedInputData Callback used to report input data required. For details, see OH_AVCodecOnNeedInputData.
onNeedOutputData Callback used to report output data generated. For details, see OH_AVCodecOnNewOutputData.

[h2]OH_AVCodecCallback

typedef struct OH_AVCodecCallback OH_AVCodecCallback

Description

Defines 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.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 11

Parameters

Name Description
onError Callback used to report a codec operation error. For details, see OH_AVCodecOnError.
onStreamChanged Callback used to report a codec stream change. For details, see OH_AVCodecOnStreamChanged.
onNeedInputBuffer Callback used to report input data required. For details, see OH_AVCodecOnNeedInputBuffer.
onNewOutputBuffer Callback used to report output data generated. For details, see OH_AVCodecOnNewOutputBuffer.

[h2]OH_AVCodecOnError

typedef void(* OH_AVCodecOnError) (OH_AVCodec *codec, int32_t errorCode, void *userData)

Description

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.

Use Case Error Code
Video encoding/decoding

AV_ERROR_NO_MEMORY: System resources are insufficient.

AV_ERROR_UNKNOWN: An unknown error occurs. Analyze the error based on specific logs.

AV_ERR_SERVICE_DIED: The service is dead.

Video decoding AV_ERR_VIDEO_UNSUPPORTED_COLOR_SPACE_CONVERSION: The current input does not support CSC.
Audio encoding/decoding AV_ERR_DRM_DECRYPT_FAILED: DRM decryption failed.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 9

Parameters

Name Description
codec Pointer to an OH_AVCodec instance.
errorCode Error code. The returned error codes vary in scenarios. For details, see the table in the function description.
userData Pointer to the data on which the caller depends when executing the callback.

[h2]OH_AVCodecOnNeedInputBuffer

typedef void(* OH_AVCodecOnNeedInputBuffer) (OH_AVCodec *codec, uint32_t index, OH_AVBuffer *buffer, void *userData)

Description

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.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 11

Parameters

Name Description
codec Pointer to an OH_AVCodec instance.
index Index of the new input buffer.
buffer Pointer to the data to fill in the new input buffer.
userData Pointer to the data on which the caller depends when executing the callback.

[h2]OH_AVCodecOnNeedInputData

typedef void(* OH_AVCodecOnNeedInputData) (OH_AVCodec *codec, uint32_t index, OH_AVMemory *data, void *userData)

Description

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.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 9

Deprecated from: 11

Substitute: OH_AVCodecOnNeedInputBuffer

Parameters

Name Description
codec Pointer to an OH_AVCodec instance.
index Index of the new input buffer.
data Pointer to the data to fill in the new input buffer.
userData Pointer to the data on which the caller depends when executing the callback.

[h2]OH_AVCodecOnNewOutputBuffer

typedef void(* OH_AVCodecOnNewOutputBuffer) (OH_AVCodec *codec, uint32_t index, OH_AVBuffer *buffer, void *userData)

Description

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.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 11

Parameters

Name Description
codec Pointer to an OH_AVCodec instance.
index Index of the new output buffer.
buffer Pointer to the data filled in the new output buffer.
userData Pointer to the data on which the caller depends when executing the callback.

[h2]OH_AVCodecOnNewOutputData

typedef void(* OH_AVCodecOnNewOutputData) (OH_AVCodec *codec, uint32_t index, OH_AVMemory *data, OH_AVCodecBufferAttr *attr, void *userData)

Description

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. 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.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 9

Deprecated from: 11

Substitute: OH_AVCodecOnNewOutputBuffer

Parameters

Name Description
codec Pointer to an OH_AVCodec instance.
index Index of the new output buffer.
data Pointer to the data filled in the new output buffer.
attr Pointer to the description information about the new output buffer. For details, see OH_AVCodecBufferAttr.
userData Pointer to the data on which the caller depends when executing the callback.

[h2]OH_AVCodecOnStreamChanged

typedef void(* OH_AVCodecOnStreamChanged) (OH_AVCodec *codec, OH_AVFormat *format, void *userData)

Description

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. 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.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 9

Parameters

Name Description
codec Pointer to an OH_AVCodec instance.
format Pointer to the description information about the new output stream.
userData Pointer to the data on which the caller depends when executing the callback.

[h2]OH_AVCProfile

typedef enum OH_AVCProfile OH_AVCProfile

Description

Defines an enum for the AVC profiles.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 9

[h2]OH_AVDataSource

typedef struct OH_AVDataSource OH_AVDataSource

Description

Defines a struct for a user-defined data source.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 12

[h2]OH_AVDataSourceReadAt

typedef int32_t(* OH_AVDataSourceReadAt) (OH_AVBuffer *data, int32_t length, int64_t pos)

Description

Defines a function pointer used to provide the capability of obtaining user-defined media data.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 12

Parameters

Name Description
data Buffer to be filled in.
length Length of the data to read.
pos Offset from which the data is read.

Returns

Actual length of the data read to the buffer.

[h2]OH_AVOutputFormat

typedef enum OH_AVOutputFormat OH_AVOutputFormat

Description

Defines an enum for the output file formats supported by a muxer.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 10

[h2]OH_AVSeekMode

typedef enum OH_AVSeekMode OH_AVSeekMode

Description

Defines an enum for the seek modes.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 10

[h2]OH_BitsPerSample

typedef enum OH_BitsPerSample OH_BitsPerSample

Description

Defines an enum for the number of audio bits for each coded sample.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 10

[h2]OH_ColorPrimary

typedef enum OH_ColorPrimary OH_ColorPrimary

Description

Defines an enum for the primary colors.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 10

[h2]OH_HEVCLevel

typedef enum OH_HEVCLevel OH_HEVCLevel

Description

Defines an enum for the HEVC levels.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 12

[h2]OH_HEVCProfile

typedef enum OH_HEVCProfile OH_HEVCProfile

Description

Defines an enum for the HEVC profiles.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 10

[h2]OH_MatrixCoefficient

typedef enum OH_MatrixCoefficient OH_MatrixCoefficient

Description

Defines an enum for the matrix coefficients.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 10

[h2]OH_MediaType

typedef enum OH_MediaType OH_MediaType

Description

Defines an enum for the media types.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 9

[h2]OH_ScalingMode

typedef enum OH_ScalingMode OH_ScalingMode

Description

Defines an enum for the scaling modes. This enum is used only in surface mode.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 10

[h2]OH_TemporalGopReferenceMode

typedef enum OH_TemporalGopReferenceMode OH_TemporalGopReferenceMode

Description

Defines an enum for the reference modes of temporal image groups.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 12

[h2]OH_TransferCharacteristic

typedef enum OH_TransferCharacteristic OH_TransferCharacteristic

Description

Defines an enum for the transfer characteristics.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 10

[h2]OHNativeWindow

typedef struct NativeWindow OHNativeWindow

Description

Defines a struct for a native object for the graphics interface.

Since: 9

Enum Description

[h2]AudioChannelLayout

enum AudioChannelLayout : uint64_t

Description

Enumerates the types of the audio channel sets. The output format of the decoder is represented as the channel type of the codec.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 10

Deprecated from: 11

Substitute: OH_AudioChannelLayout

Value Description
UNKNOWN_CHANNEL_LAYOUT Unknown.
MONO Mono layout.
STEREO Stereo layout
CH_2POINT1 2.1 layout.
CH_2_1 2_1 layout.
SURROUND Surround layout.
CH_3POINT1 3.1 layout.
CH_4POINT0 4.0 layout.
CH_4POINT1 4.1 layout.
CH_2_2 2_2 layout.
QUAD Quad layout.
CH_5POINT0 5.0 layout.
CH_5POINT1 5.1 layout.
CH_5POINT0_BACK 5.0 rear layout.
CH_5POINT1_BACK 5.1 rear layout.
CH_6POINT0 6.0 layout.
CH_6POINT0_FRONT 6.0 front layout.
HEXAGONAL Hexagonal layout.
CH_6POINT1 6.1 layout.
CH_6POINT1_BACK 6.1 rear layout.
CH_6POINT1_FRONT 6.1 front layout.
CH_7POINT0 7.0 layout.
CH_7POINT0_FRONT 7.0 front layout.
CH_7POINT1 7.1 layout.
CH_7POINT1_WIDE 7.1 wide layout.
CH_7POINT1_WIDE_BACK 7.1 rear wide layout.
CH_3POINT1POINT2 3.1.2 layout.
CH_5POINT1POINT2 5.1.2 layout.
CH_5POINT1POINT4 5.1.4 layout.
CH_7POINT1POINT2 7.1.2 layout.
CH_7POINT1POINT4 7.1.4 layout.
CH_9POINT1POINT4 9.1.4 layout.
CH_9POINT1POINT6 9.1.6 layout.
CH_10POINT2 10.2 layout.
CH_22POINT2 22.2 layout.
OCTAGONAL Octagonal layout.
HEXADECAGONAL Hexadecagonal layout.
STEREO_DOWNMIX Stereo downmix layout.
HOA_FIRST High-Order Ambisonics (HOA) first-order layout.
HOA_SECOND HOA second-order layout.
HOA_THIRD HOA third-order layout.

[h2]AudioChannelSet

enum AudioChannelSet : uint64_t

Description

Enumerates the audio channel sets. Each channel number is mapped to a variable of int64_t.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 10

Deprecated from: 11

Substitute: OH_AudioChannelSet

Value Description
FRONT_LEFT Front left channel.
FRONT_RIGHT Front right channel
FRONT_CENTER Front center channel.
LOW_FREQUENCY Low-frequency channel.
BACK_LEFT Rear left channel.
BACK_RIGHT Rear right channel
FRONT_LEFT_OF_CENTER Front left center channel.
FRONT_RIGHT_OF_CENTER Front right center channel.
BACK_CENTER Rear center channel.
SIDE_LEFT Left channel.
SIDE_RIGHT Right channel.
TOP_CENTER Top center channel.
TOP_FRONT_LEFT Top left front channel.
TOP_FRONT_CENTER Top center front channel.
TOP_FRONT_RIGHT Top right front channel.
TOP_BACK_LEFT Top left rear channel.
TOP_BACK_CENTER Top center rear channel.
TOP_BACK_RIGHT Top right rear channel.
STEREO_LEFT Stereo left channel.
STEREO_RIGHT Stereo right channel.
WIDE_LEFT Wide left channel.
WIDE_RIGHT Wide right channel.
SURROUND_DIRECT_LEFT Left surround channel.
SURROUND_DIRECT_RIGHT Right surround channel.
LOW_FREQUENCY_2 Low-frequency channel 2.
TOP_SIDE_LEFT Top left channel.
TOP_SIDE_RIGHT Top right channel.
BOTTOM_FRONT_CENTER Bottom center front channel.
BOTTOM_FRONT_LEFT Bottom left front channel.
BOTTOM_FRONT_RIGHT Bottom right front channel.
AMBISONICS_ACN0 Channel 0 for the zero-order stereo.
AMBISONICS_ACN1 Channel 1 for the first-order stereo.
AMBISONICS_ACN2 Channel 2 for the first-order stereo.
AMBISONICS_ACN3 Channel 3 for the first-order stereo.
AMBISONICS_W Equivalent to channel 0 for the zero-order stereo.
AMBISONICS_Y Equivalent to channel 1 for the first-order stereo.
AMBISONICS_Z Equivalent to channel 2 for the first-order stereo.
AMBISONICS_X Equivalent to channel 3 for the first-order stereo.
AMBISONICS_ACN4 Channel 4 for the second-order stereo.
AMBISONICS_ACN5 Channel 5 for the second-order stereo.
AMBISONICS_ACN6 Channel 6 for the second-order stereo.
AMBISONICS_ACN7 Channel 7 for the second-order stereo.
AMBISONICS_ACN8 Channel 8 for the second-order stereo.
AMBISONICS_ACN9 Channel 9 for the third-order stereo.
AMBISONICS_ACN10 Channel 10 for the third-order stereo.
AMBISONICS_ACN11 Channel 11 for the third-order stereo.
AMBISONICS_ACN12 Channel 12 for the third-order stereo.
AMBISONICS_ACN13 Channel 13 for the third-order stereo.
AMBISONICS_ACN14 Channel 14 for the third-order stereo.
AMBISONICS_ACN15 Channel 15 for the third-order stereo.

[h2]OH_AACProfile

enum OH_AACProfile

Description

Enumerates the AAC profiles.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 9

Value Description
AAC_PROFILE_LC AAC profile of the low complexity level.

[h2]OH_AVCLevel

enum OH_AVCLevel

Description

Enumerates the AVC levels.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 12

Value Description
AVC_LEVEL_1 Level 1.
AVC_LEVEL_1b Level 1b.
AVC_LEVEL_11 Level 1.1.
AVC_LEVEL_12 Level 1.2.
AVC_LEVEL_13 Level 1.3.
AVC_LEVEL_2 Level 2.
AVC_LEVEL_21 Level 2.1.
AVC_LEVEL_22 Level 2.2.
AVC_LEVEL_3 Level 3.
AVC_LEVEL_31 Level 3.1.
AVC_LEVEL_32 Level 3.2.
AVC_LEVEL_4 Level 4.
AVC_LEVEL_41 Level 4.1.
AVC_LEVEL_42 Level 4.2.
AVC_LEVEL_5 Level 5.
AVC_LEVEL_51 Level 5.1.
AVC_LEVEL_52 Level 5.2.
AVC_LEVEL_6 Level 6.
AVC_LEVEL_61 Level 6.1.
AVC_LEVEL_62 Level 6.2.

[h2]OH_AVCProfile

enum OH_AVCProfile

Description

Enumerates the AVC profiles.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 9

Value Description
AVC_PROFILE_BASELINE AVC baseline profile.
AVC_PROFILE_HIGH AVC high profile.
AVC_PROFILE_MAIN AVC main profile.

[h2]OH_AVOutputFormat

enum OH_AVOutputFormat

Description

Enumerates the output file formats supported by a muxer.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 10

Value Description
AV_OUTPUT_FORMAT_DEFAULT Default format, which is MP4.
AV_OUTPUT_FORMAT_MPEG_4 MP4.
AV_OUTPUT_FORMAT_M4A M4A.
AV_OUTPUT_FORMAT_AMR

AMR.

Since: 12

AV_OUTPUT_FORMAT_MP3

MP3.

Since: 12

AV_OUTPUT_FORMAT_WAV

WAV.

Since: 12

[h2]OH_AVSeekMode

enum OH_AVSeekMode

Description

Enumerates the seek modes.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 10

Value Description
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.
SEEK_MODE_PREVIOUS_SYNC Seeks to the previous I-frame at the specified position.
SEEK_MODE_CLOSEST_SYNC Seeks to the latest I-frame at the specified position.

[h2]OH_BitsPerSample

enum OH_BitsPerSample

Description

Enumerates the number of audio bits for each coded sample.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 10

Value Description
SAMPLE_U8 8-bit unsigned integer sampling.
SAMPLE_S16LE 16-bit signed integer sampling.
SAMPLE_S24LE 24-bit signed integer sampling.
SAMPLE_S32LE 32-bit signed integer sampling.
SAMPLE_F32LE 32-bit floating-point sampling.
SAMPLE_U8P 8-bit unsigned integer plane sampling.
SAMPLE_S16P 16-bit signed integer plane sampling.
SAMPLE_S24P 24-bit signed integer plane sampling.
SAMPLE_S32P 32-bit signed integer plane sampling.
SAMPLE_F32P 32-bit floating-point plane sampling.
INVALID_WIDTH Invalid sampling format.

[h2]OH_ColorPrimary

enum OH_ColorPrimary

Description

Enumerates the primary colors. This enum is used for both encoding and decoding.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 10

Value Description
COLOR_PRIMARY_BT709 BT.709 color gamut.
COLOR_PRIMARY_UNSPECIFIED Unspecified color gamut.
COLOR_PRIMARY_BT470_M BT.470 System M color gamut.
COLOR_PRIMARY_BT601_625 BT.601 625 color gamut.
COLOR_PRIMARY_BT601_525 BT.601 525 color gamut.
COLOR_PRIMARY_SMPTE_ST240 SMPTE ST 240 color gamut.
COLOR_PRIMARY_GENERIC_FILM Generic film color gamut.
COLOR_PRIMARY_BT2020 BT.2020 color gamut.
COLOR_PRIMARY_SMPTE_ST428 SMPTE ST 428 color gamut.
COLOR_PRIMARY_P3DCI DCI-P3 color gamut.
COLOR_PRIMARY_P3D65 P3-D65 color gamut.

[h2]OH_HEVCLevel

enum OH_HEVCLevel

Description

Enumerates the HEVC levels.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 12

Value Description
HEVC_LEVEL_1 Level 1.
HEVC_LEVEL_2 Level 2.
HEVC_LEVEL_21 Level 2.1.
HEVC_LEVEL_3 Level 3.
HEVC_LEVEL_31 Level 3.1.
HEVC_LEVEL_4 Level 4.
HEVC_LEVEL_41 Level 4.1.
HEVC_LEVEL_5 Level 5.
HEVC_LEVEL_51 Level 5.1.
HEVC_LEVEL_52 Level 5.2.
HEVC_LEVEL_6 Level 6.
HEVC_LEVEL_61 Level 6.1.
HEVC_LEVEL_62 Level 6.2.

[h2]OH_HEVCProfile

enum OH_HEVCProfile

Description

Enumerates the HEVC profiles.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 10

Value Description
HEVC_PROFILE_MAIN HEVC profile of the main level.
HEVC_PROFILE_MAIN_10 HEVC profile of the 10-bit main level.
HEVC_PROFILE_MAIN_STILL HEVC profile of the main still picture level.
HEVC_PROFILE_MAIN_10_HDR10 HEVC profile of the main 10 HDR10 level.
HEVC_PROFILE_MAIN_10_HDR10_PLUS HEVC profile of the main 10 HDR10+ level.

[h2]OH_MatrixCoefficient

enum OH_MatrixCoefficient

Description

Enumerates the matrix coefficients. This enum is used for both encoding and decoding.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 10

Value Description
MATRIX_COEFFICIENT_IDENTITY Identity matrix.
MATRIX_COEFFICIENT_BT709 BT.709 conversion matrix.
MATRIX_COEFFICIENT_UNSPECIFIED Unspecified conversion matrix.
MATRIX_COEFFICIENT_FCC FCC conversion matrix.
MATRIX_COEFFICIENT_BT601_625 BT.601 625 conversion matrix.
MATRIX_COEFFICIENT_BT601_525 BT.601 525 conversion matrix.
MATRIX_COEFFICIENT_SMPTE_ST240 SMPTE ST 240 conversion matrix.
MATRIX_COEFFICIENT_YCGCO YCgCo conversion matrix.
MATRIX_COEFFICIENT_BT2020_NCL BT.2020 NCL conversion matrix.
MATRIX_COEFFICIENT_BT2020_CL BT.2020 CL conversion matrix.
MATRIX_COEFFICIENT_SMPTE_ST2085 SMPTE ST 2085 conversion matrix.
MATRIX_COEFFICIENT_CHROMATICITY_NCL Chromaticity NCL conversion matrix.
MATRIX_COEFFICIENT_CHROMATICITY_CL Chromaticity CL conversion matrix.
MATRIX_COEFFICIENT_ICTCP ICTCP conversion matrix.

[h2]OH_MediaType

enum OH_MediaType

Description

Enumerates the media types.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 9

Value Description
MEDIA_TYPE_AUD Audio track.
MEDIA_TYPE_VID Video track.
MEDIA_TYPE_SUBTITILE

Subtitle track.

Since: 12

[h2]OH_ScalingMode

enum OH_ScalingMode

Description

Enumerates the scaling modes. This enum is used only in surface mode.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 10

Value Description
SCALING_MODE_SCALE_TO_WINDOW Scales the image based on the window size.
SCALING_MODE_SCALE_CROP Crops the image based on the window size.

[h2]OH_TemporalGopReferenceMode

enum OH_TemporalGopReferenceMode

Description

Enumerates the reference modes of temporal image groups.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 12

Value Description
ADJACENT_REFERENCE Refers to the nearest short-term reference frame.
JUMP_REFERENCE Refers to the latest LTR frame.
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.

[h2]OH_TransferCharacteristic

enum OH_TransferCharacteristic

Description

Enumerates the transfer characteristics. This enum can be used for both encoding and decoding.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 10

Value Description
TRANSFER_CHARACTERISTIC_BT709 BT.709 transfer function.
TRANSFER_CHARACTERISTIC_UNSPECIFIED Unspecified transfer function.
TRANSFER_CHARACTERISTIC_GAMMA_2_2 Gamma 2-2 transfer function.
TRANSFER_CHARACTERISTIC_GAMMA_2_8 Gamma 2-8 transfer function.
TRANSFER_CHARACTERISTIC_BT601 BT.601 transfer function.
TRANSFER_CHARACTERISTIC_SMPTE_ST240 SMPTE ST 240 transfer function.
TRANSFER_CHARACTERISTIC_LINEAR Linear transfer function.
TRANSFER_CHARACTERISTIC_LOG Log transfer function.
TRANSFER_CHARACTERISTIC_LOG_SQRT Log SQRT transfer function.
TRANSFER_CHARACTERISTIC_IEC_61966_2_4 IEC61966-2.4 transfer function.
TRANSFER_CHARACTERISTIC_BT1361 BT.1361 transfer function.
TRANSFER_CHARACTERISTIC_IEC_61966_2_1 IEC61966 2.1 transfer function.
TRANSFER_CHARACTERISTIC_BT2020_10BIT BT.2020 10-bit transfer function.
TRANSFER_CHARACTERISTIC_BT2020_12BIT BT.2020 12-bit transfer function.
TRANSFER_CHARACTERISTIC_PQ PQ transfer function.
TRANSFER_CHARACTERISTIC_SMPTE_ST428 SMPTE ST.428 transfer function.
TRANSFER_CHARACTERISTIC_HLG HLG transfer function.

Variable Description

[h2]OH_AVCODEC_MIMETYPE_SUBTITLE_SRT

const char* OH_AVCODEC_MIMETYPE_SUBTITLE_SRT

Description

Pointer to the key that describes the MIME type of the SRT subtitle demuxer.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 12

[h2]OH_AVCODEC_MIMETYPE_SUBTITLE_WEBVTT

const char* OH_AVCODEC_MIMETYPE_SUBTITLE_WEBVTT

Description

Pointer to the key that describes the MIME type of the WEBVTT subtitle demuxer.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 12

[h2]OH_AVCODEC_MIMETYPE_AUDIO_APE

const char* OH_AVCODEC_MIMETYPE_AUDIO_APE

Description

Pointer to the key that describes the MIME type of the APE audio decoder.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 12

[h2]OH_AVCODEC_MIMETYPE_AUDIO_AAC

const char* OH_AVCODEC_MIMETYPE_AUDIO_AAC

Description

Pointer to the key that describes the MIME type of the AAC audio codec.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 9

[h2]OH_AVCODEC_MIMETYPE_AUDIO_AMR_NB

const char* OH_AVCODEC_MIMETYPE_AUDIO_AMR_NB

Description

Pointer to the key that describes the MIME type of the AMR-NB audio decoder.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 11

[h2]OH_AVCODEC_MIMETYPE_AUDIO_AMR_WB

const char* OH_AVCODEC_MIMETYPE_AUDIO_AMR_WB

Description

Pointer to the key that describes the MIME type of the AMR-WB audio decoder.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 11

[h2]OH_AVCODEC_MIMETYPE_AUDIO_FLAC

const char* OH_AVCODEC_MIMETYPE_AUDIO_FLAC

Description

Pointer to the key that describes the MIME type for FLAC audio codec.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 10

[h2]OH_AVCODEC_MIMETYPE_AUDIO_G711MU

const char* OH_AVCODEC_MIMETYPE_AUDIO_G711MU

Description

Pointer to the key that describes the MIME type of the G.711 mu-law audio codec.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 11

[h2]OH_AVCODEC_MIMETYPE_AUDIO_MPEG

const char* OH_AVCODEC_MIMETYPE_AUDIO_MPEG

Description

Pointer to the key that describes the MIME type of the MP3 audio decoder.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 10

[h2]OH_AVCODEC_MIMETYPE_AUDIO_OPUS

const char* OH_AVCODEC_MIMETYPE_AUDIO_OPUS

Description

Pointer to the key that describes the MIME type of the Opus audio codec.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 11

[h2]OH_AVCODEC_MIMETYPE_AUDIO_VIVID

const char* OH_AVCODEC_MIMETYPE_AUDIO_VIVID

Description

Pointer to the key that describes the MIME type of the Audio Vivid audio decoder.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 11

[h2]OH_AVCODEC_MIMETYPE_AUDIO_VORBIS

const char* OH_AVCODEC_MIMETYPE_AUDIO_VORBIS

Description

Pointer to the key that describes the MIME type of the Vorbis audio decoder.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 10

[h2]OH_AVCODEC_MIMETYPE_IMAGE_BMP

const char* OH_AVCODEC_MIMETYPE_IMAGE_BMP

Description

Pointer to the key that describes the MIME type of the BMP image encoder, which is used only for multiplexing BMP covers.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 10

[h2]OH_AVCODEC_MIMETYPE_IMAGE_JPG

const char* OH_AVCODEC_MIMETYPE_IMAGE_JPG

Description

Pointer to the key that describes the MIME type of the JPG image encoder, which is used only for multiplexing JPG covers.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 10

[h2]OH_AVCODEC_MIMETYPE_IMAGE_PNG

const char* OH_AVCODEC_MIMETYPE_IMAGE_PNG

Description

Pointer to the key that describes the MIME type of the PNG image encoder, which is used only for multiplexing PNG covers.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 10

[h2]OH_AVCODEC_MIMETYPE_VIDEO_AVC

const char* OH_AVCODEC_MIMETYPE_VIDEO_AVC

Description

Pointer to the key that describes the MIME type of the AVC (H.264) video codec.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 9

[h2]OH_AVCODEC_MIMETYPE_VIDEO_HEVC

const char* OH_AVCODEC_MIMETYPE_VIDEO_HEVC

Description

Pointer to the key that describes the MIME type of the HEVC (H.265) video codec.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 10

[h2]OH_AVCODEC_MIMETYPE_VIDEO_VVC

const char* OH_AVCODEC_MIMETYPE_VIDEO_VVC

Description

Pointer to the key that describes the MIME type of the VVC (H.266) video codec.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 12

[h2]OH_AVCODEC_MIMETYPE_VIDEO_MPEG4

const char* OH_AVCODEC_MIMETYPE_VIDEO_MPEG4

Description

Pointer to the key that describes the MIME type of the MPEG4 video encoder, which is used only for multiplexing MPEG4 video streams.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 10

Deprecated from: 11

[h2]OH_ED_KEY_EOS

const char* OH_ED_KEY_EOS

Description

Pointer to the key that describes the end of stream for the surface buffer. The value type is int32_t.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 9

[h2]OH_ED_KEY_TIME_STAMP

const char* OH_ED_KEY_TIME_STAMP

Description

Pointer to the key that describes the surface buffer timestamp. The value is of the int64_t type. The value type is int32_t.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 9

[h2]OH_FEATURE_PROPERTY_KEY_VIDEO_ENCODER_MAX_LTR_FRAME_COUNT

const char* OH_FEATURE_PROPERTY_KEY_VIDEO_ENCODER_MAX_LTR_FRAME_COUNT

Description

Pointer to the key that describes the maximum number of LTR frames obtained during video encoding. The value type is int32_t.

You can use the API OH_AVCapability_GetFeatureProperties and the enum VIDEO_ENCODER_LONG_TERM_REFERENCE to query the maximum number.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 12

[h2]OH_MD_KEY_AAC_IS_ADTS

const char* OH_MD_KEY_AAC_IS_ADTS

Description

Pointer 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.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 10

[h2]OH_MD_KEY_ALBUM

const char* OH_MD_KEY_ALBUM

Description

Pointer to the key that describes the album in a media file. The value type is string.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 10

[h2]OH_MD_KEY_ALBUM_ARTIST

const char* OH_MD_KEY_ALBUM_ARTIST

Description

Pointer to the key that describes the album artist in a media file. The value type is string.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 10

[h2]OH_MD_KEY_ARTIST

const char* OH_MD_KEY_ARTIST

Description

Pointer to the key that describes lyrics in a media file. The value type is string.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 10

[h2]OH_MD_KEY_AUD_CHANNEL_COUNT

const char* OH_MD_KEY_AUD_CHANNEL_COUNT

Description

Pointer to the key that describes the number of audio channels. The value type is int32_t.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 9

[h2]OH_MD_KEY_AUD_SAMPLE_RATE

const char* OH_MD_KEY_AUD_SAMPLE_RATE

Description

Pointer to the key that describes the audio sampling rate. The value type is int32_t.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 9

[h2]OH_MD_KEY_AUDIO_COMPRESSION_LEVEL

const char* OH_MD_KEY_AUDIO_COMPRESSION_LEVEL

Description

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.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 11

[h2]OH_MD_KEY_AUDIO_OBJECT_NUMBER

const char* OH_MD_KEY_AUDIO_OBJECT_NUMBER

Description

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.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 11

[h2]OH_MD_KEY_AUDIO_SAMPLE_FORMAT

const char* OH_MD_KEY_AUDIO_SAMPLE_FORMAT

Description

Pointer to the key that describes the original audio format. The value type is int32_t. For details, see OH_BitsPerSample.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 9

[h2]OH_MD_KEY_AUDIO_VIVID_METADATA

const char* OH_MD_KEY_AUDIO_VIVID_METADATA

Description

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.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 11

[h2]OH_MD_KEY_BITRATE

const char* OH_MD_KEY_BITRATE

Description

Pointer to the key that describes the bit rate. The value type is int64_t.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 9

[h2]OH_MD_KEY_BITS_PER_CODED_SAMPLE

const char* OH_MD_KEY_BITS_PER_CODED_SAMPLE

Description

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.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 10

[h2]OH_MD_KEY_CHANNEL_LAYOUT

const char* OH_MD_KEY_CHANNEL_LAYOUT

Description

Pointer to the key that describes the required encoding channel layout. The value type is int64_t. This key applies only to encoders.

For details, see OH_AudioChannelLayout.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 10

[h2]OH_MD_KEY_CODEC_CONFIG

const char* OH_MD_KEY_CODEC_CONFIG

Description

Pointer 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*.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 10

[h2]OH_MD_KEY_CODEC_MIME

const char* OH_MD_KEY_CODEC_MIME

Description

Pointer to the key that describes the MIME type of the codec. The value type is string.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 9

[h2]OH_MD_KEY_COLOR_PRIMARIES

const char* OH_MD_KEY_COLOR_PRIMARIES

Description

Pointer to the key that describes the video primary color. The value type is int32_t. For details, see OH_ColorPrimary. The video primary color complies with Table 2 in the H.273 standard.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 10

[h2]OH_MD_KEY_COMMENT

const char* OH_MD_KEY_COMMENT

Description

Pointer to the key that describes the comment in a media file. The value type is string.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 10

[h2]OH_MD_KEY_COMPLIANCE_LEVEL

const char* OH_MD_KEY_COMPLIANCE_LEVEL

Description

Pointer to the key that describes the FLAC compliance level. The value type is int32_t. This key is used only for audio encoding.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 10

[h2]OH_MD_KEY_DATE

const char* OH_MD_KEY_DATE

Description

Pointer to the key that describes the date in a media file, for example, 2024. The value type is string.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 10

[h2]OH_MD_KEY_DESCRIPTION

const char* OH_MD_KEY_DESCRIPTION

Description

Pointer to the key that describes the description in a media file. The value type is string.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 10

[h2]OH_MD_KEY_DURATION

const char* OH_MD_KEY_DURATION

Description

Pointer to the key that describes the duration in a media file, in microseconds. The value type is int64_t.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 9

[h2]OH_MD_KEY_FRAME_RATE

const char* OH_MD_KEY_FRAME_RATE

Description

Pointer to the key that describes the video frame rate. The value type is double. The value must be greater than 0.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 9

[h2]OH_MD_KEY_GENRE

const char* OH_MD_KEY_GENRE

Description

Pointer to the key that describes the genre in a media file. The value type is string.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 10

[h2]OH_MD_KEY_HEIGHT

const char* OH_MD_KEY_HEIGHT

Description

Pointer to the key that describes the video height. The value type is int32_t.

For details about the development guide, see step 5 in surface mode or step 4 in buffer mode in Video Encoding.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 9

[h2]OH_MD_KEY_I_FRAME_INTERVAL

const char* OH_MD_KEY_I_FRAME_INTERVAL

Description

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.

A negative value indicates that only the first frame is a key frame, and a zero value indicates that all frames are key frames.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 9

[h2]OH_MD_KEY_IDENTIFICATION_HEADER

const char* OH_MD_KEY_IDENTIFICATION_HEADER

Description

Pointer to the key that describes the Vorbis identification header. The value type is uint8_t. This key applies only to Vorbis decoders.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 10

[h2]OH_MD_KEY_LANGUAGE

const char* OH_MD_KEY_LANGUAGE

Description

Pointer to the key that describes the language in a media file. The value type is string.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 10

[h2]OH_MD_KEY_LYRICS

const char* OH_MD_KEY_LYRICS

Description

Pointer to the key that describes the lyrics in a media file. The value type is string.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 10

[h2]OH_MD_KEY_MATRIX_COEFFICIENTS

const char* OH_MD_KEY_MATRIX_COEFFICIENTS

Description

Pointer to the key that describes the video matrix coefficient. The value type is int32_t. For details, see OH_MatrixCoefficient. The video matrix coefficient complies with Table 4 in the H.273 standard.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 10

[h2]OH_MD_KEY_MAX_INPUT_SIZE

const char* OH_MD_KEY_MAX_INPUT_SIZE

Description

Pointer to the key that describes the maximum size of an input stream to decode. The value type is int32_t.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 9

[h2]OH_MD_KEY_PIXEL_FORMAT

const char* OH_MD_KEY_PIXEL_FORMAT

Description

Pointer to the key that describes the video pixel format. The value type is int32_t. For details, see OH_AVPixelFormat.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 9

[h2]OH_MD_KEY_PROFILE

const char* OH_MD_KEY_PROFILE

Description

Pointer to the key that describes the encoding grading. The value type is int32_t. For details, see OH_AVCProfile, OH_HEVCProfile, and OH_AACProfile.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 9

[h2]OH_MD_KEY_QUALITY

const char* OH_MD_KEY_QUALITY

Description

Pointer 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.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 10

[h2]OH_MD_KEY_RANGE_FLAG

const char* OH_MD_KEY_RANGE_FLAG

Description

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.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 10

[h2]OH_MD_KEY_REQUEST_I_FRAME

const char* OH_MD_KEY_REQUEST_I_FRAME

Description

Pointer 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.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 10

[h2]OH_MD_KEY_ROTATION

const char* OH_MD_KEY_ROTATION

Description

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 in video decoding surface mode.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 9

[h2]OH_MD_KEY_SBR

const char* OH_MD_KEY_SBR

Description

Pointer to the key that describes the AAC SBR format. The value type is int32_t. This key applies to AAC encoders.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 10

[h2]OH_MD_KEY_SCALING_MODE

const char* OH_MD_KEY_SCALING_MODE

Description

Pointer to the key that describes the video scaling mode. The value type is int32_t. For details, see OH_ScalingMode. You are advised to set the scaling mode by calling OH_NativeWindow_NativeWindowSetScalingModeV2. This key is optional and is used only for video decoding in surface mode.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 10

[h2]OH_MD_KEY_SETUP_HEADER

const char* OH_MD_KEY_SETUP_HEADER

Description

Pointer to the key that describes the Vorbis setup header. The value type is uint8_t. This key applies only to Vorbis decoders.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 10

[h2]OH_MD_KEY_TITLE

const char* OH_MD_KEY_TITLE

Description

Pointer to the key that describes the title in a media file. The value type is string.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 10

[h2]OH_MD_KEY_TRACK_COUNT

const char* OH_MD_KEY_TRACK_COUNT

Description

Pointer to the key that describes the number of tracks in a media file. The value type is int32_t.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 10

[h2]OH_MD_KEY_TRACK_TYPE

const char* OH_MD_KEY_TRACK_TYPE

Description

Pointer to the key that describes the track type in a media file. The value type is int32_t. For details, see OH_MediaType.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 9

[h2]OH_MD_KEY_TRANSFER_CHARACTERISTICS

const char* OH_MD_KEY_TRANSFER_CHARACTERISTICS

Description

Pointer to the key that describes the video transfer characteristics. The value type is int32_t. For details, see OH_TransferCharacteristic. The video transfer characteristics comply with Table 3 in the H.273 standard.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 10

[h2]OH_MD_KEY_VIDEO_CROP_BOTTOM

const char* OH_MD_KEY_VIDEO_CROP_BOTTOM

Description

Pointer 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.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 12

[h2]OH_MD_KEY_VIDEO_CROP_LEFT

const char* OH_MD_KEY_VIDEO_CROP_LEFT

Description

Pointer 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.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 12

[h2]OH_MD_KEY_VIDEO_CROP_RIGHT

const char* OH_MD_KEY_VIDEO_CROP_RIGHT

Description

Pointer 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.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 12

[h2]OH_MD_KEY_VIDEO_CROP_TOP

const char* OH_MD_KEY_VIDEO_CROP_TOP

Description

Pointer 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.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 12

[h2]OH_MD_KEY_VIDEO_ENABLE_LOW_LATENCY

const char* OH_MD_KEY_VIDEO_ENABLE_LOW_LATENCY

Description

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.

This key is optional and used only in the configuration phase.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 12

[h2]OH_MD_KEY_VIDEO_ENCODE_BITRATE_MODE

const char* OH_MD_KEY_VIDEO_ENCODE_BITRATE_MODE

Description

Pointer to the key that describes the video encoding bit rate mode. The value type is int32_t. For details, see OH_VideoEncodeBitrateMode.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 9

[h2]OH_MD_KEY_VIDEO_ENCODER_ENABLE_TEMPORAL_SCALABILITY

const char* OH_MD_KEY_VIDEO_ENCODER_ENABLE_TEMPORAL_SCALABILITY

Description

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.

Before using this variable, you can call OH_AVCapability_IsFeatureSupported and use VIDEO_ENCODER_TEMPORAL_SCALABILITY to check whether the video encoder supports temporal scalability.

For details, see Temporally Scalable Video Coding.

This key is optional and used only in the configuration phase of video encoding.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 12

[h2]OH_MD_KEY_VIDEO_ENCODER_LTR_FRAME_COUNT

const char* OH_MD_KEY_VIDEO_ENCODER_LTR_FRAME_COUNT

Description

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.

Before using this key, you can use the API OH_AVCapability_GetFeatureProperties and the enum VIDEO_ENCODER_LONG_TERM_REFERENCE to query the number of supported LTR frames.

This key is optional and used only in the configuration phase of video encoding.

For details, see Temporally Scalable Video Coding.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 12

[h2]OH_MD_KEY_VIDEO_ENCODER_PER_FRAME_MARK_LTR

const char* OH_MD_KEY_VIDEO_ENCODER_PER_FRAME_MARK_LTR

Description

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 takes effect only after the number of LTR frames is configured.

This key is optional and is used only for video encoding input rotation. The configuration takes effect immediately.

For details, see Temporally Scalable Video Coding.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 12

[h2]OH_MD_KEY_VIDEO_ENCODER_PER_FRAME_USE_LTR

const char* OH_MD_KEY_VIDEO_ENCODER_PER_FRAME_USE_LTR

Description

Pointer to the key that describes the POC number of the LTR frame referenced by the current frame. The value type is int32_t.

This key is optional and is used only for video encoding input rotation. The configuration takes effect immediately.

For details, see Temporally Scalable Video Coding.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 12

[h2]OH_MD_KEY_VIDEO_ENCODER_QP_MAX

const char* OH_MD_KEY_VIDEO_ENCODER_QP_MAX

Description

Pointer to the key that describes the maximum QP allowed by the video encoder. The value type is int32_t.

This key is used in the configuration or parameter setting phase or takes effect immediately with the frame.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 12

[h2]OH_MD_KEY_VIDEO_ENCODER_QP_MIN

const char* OH_MD_KEY_VIDEO_ENCODER_QP_MIN

Description

Pointer to the key that describes the minimum QP allowed by the video encoder. The value type is int32_t.

This key is used in the configuration or parameter setting phase or takes effect immediately with the frame.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 12

[h2]OH_MD_KEY_VIDEO_ENCODER_QP_AVERAGE

const char* OH_MD_KEY_VIDEO_ENCODER_QP_AVERAGE

Description

Pointer to the key that describes the average QP of video frames. The value type is int32_t.

Pointer to the key that describes the average QP value of the current frame encoding block. It is output with OH_AVBuffer

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 12

[h2]OH_MD_KEY_VIDEO_ENCODER_MSE

const char* OH_MD_KEY_VIDEO_ENCODER_MSE

Description

Pointer to the key that describes the MSE of video frames. The value type is double.

Pointer to the key that describes the average MSE value of the current frame encoding block. It is output with OH_AVBuffer

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 12

[h2]OH_MD_KEY_VIDEO_ENCODER_TEMPORAL_GOP_REFERENCE_MODE

const char* OH_MD_KEY_VIDEO_ENCODER_TEMPORAL_GOP_REFERENCE_MODE

Description

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. This key is valid only when temporal scalability is enabled.

This key is optional and used only in the configuration phase of video encoding.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 12

[h2]OH_MD_KEY_VIDEO_ENCODER_TEMPORAL_GOP_SIZE

const char* OH_MD_KEY_VIDEO_ENCODER_TEMPORAL_GOP_SIZE

Description

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.

This key is optional and used only in the configuration phase of video encoding.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 12

[h2]OH_MD_KEY_VIDEO_IS_HDR_VIVID

const char* OH_MD_KEY_VIDEO_IS_HDR_VIVID

Description

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 multiplexing and demultiplexing.

The value 1 means the HDR Vivid video track, and 0 means other cases.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 11

[h2]OH_MD_KEY_DECODING_TIMESTAMP

const char* OH_MD_KEY_DECODING_TIMESTAMP

Description

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.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 12

[h2]OH_MD_KEY_BUFFER_DURATION

const char* OH_MD_KEY_BUFFER_DURATION

Description

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.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 12

[h2]OH_MD_KEY_START_TIME

const char* OH_MD_KEY_START_TIME

Description

Pointer to the key that describes the start time of the first frame in a media file, measured in microseconds. The value type is int64_t.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 12

[h2]OH_MD_KEY_TRACK_START_TIME

const char* OH_MD_KEY_TRACK_START_TIME

Description

Pointer to the key that describes the start time of the track, measured in microseconds. The value type is int64_t.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 12

[h2]OH_MD_KEY_VIDEO_DECODER_OUTPUT_COLOR_SPACE

const char* OH_MD_KEY_VIDEO_DECODER_OUTPUT_COLOR_SPACE

Description

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. For details, see OH_NativeBuffer_ColorSpace.

It is used when OH_VideoDecoder_Configure is called.

If 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.

If CSC function not supported, the error code AV_ERR_VIDEO_UNSUPPORTED_COLOR_SPACE_CONVERSION is returned when OH_VideoDecoder_Configure is called.

If the input video is not an HDR Vivid video, the callback function OH_AVCodecOnError is invoked to report the error code AV_ERR_VIDEO_UNSUPPORTED_COLOR_SPACE_CONVERSION.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 12

[h2]OH_MD_KEY_VIDEO_PER_FRAME_IS_LTR

const char* OH_MD_KEY_VIDEO_PER_FRAME_IS_LTR

Description

Pointer 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.

This key is optional and is used only for video encoding output rotation.

It indicates the attribute of a frame.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 12

[h2]OH_MD_KEY_VIDEO_PER_FRAME_POC

const char* OH_MD_KEY_VIDEO_PER_FRAME_POC

Description

Pointer to the key that describes the POC number of the frame. The value type is int32_t.

This key is optional and is used only for video encoding output rotation.

It indicates the attribute of a frame.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 12

[h2]OH_MD_KEY_VIDEO_PIC_HEIGHT

const char* OH_MD_KEY_VIDEO_PIC_HEIGHT

Description

Pointer to the key that describes the height of the video frame. The value type is int32_t.

When OH_VideoDecoder_GetOutputDescription is called during video decoding, the height can be parsed from the returned OH_AVFormat instance.

When the decoded output stream changes, the height can be parsed from the OH_AVForamt instance returned by OH_AVCodecOnStreamChanged.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 12

[h2]OH_MD_KEY_VIDEO_PIC_WIDTH

const char* OH_MD_KEY_VIDEO_PIC_WIDTH

Description

Pointer to the key that describes the width of the video frame. The value type is int32_t.

When OH_VideoDecoder_GetOutputDescription is called during video decoding, the width can be parsed from the returned OH_AVFormat instance.

When the decoded output stream changes, the width can be parsed from the OH_AVForamt instance returned by OH_AVCodecOnStreamChanged.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 12

[h2]OH_MD_KEY_VIDEO_SLICE_HEIGHT

const char* OH_MD_KEY_VIDEO_SLICE_HEIGHT

Description

Pointer to the key that describes the height of the video frame. The value type is int32_t.

The 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.

The 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.

For details, see step 3 in buffer mode in Video Encoding.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 12

[h2]OH_MD_KEY_VIDEO_STRIDE

const char* OH_MD_KEY_VIDEO_STRIDE

Description

Pointer to the key that describes the stride of the video frame. The value type is int32_t.

The stride is the difference between the index of the pixel and the index of the pixel right below.

For 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.

For details, see step 3 in buffer mode in Video Encoding.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 12

[h2]OH_MD_KEY_WIDTH

const char* OH_MD_KEY_WIDTH

Description

Pointer to the key that describes the video width. The value type is int32_t.

For details about the development guide, see step 5 in surface mode or step 4 in buffer mode in Video Encoding.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 9

[h2]OH_MD_MAX_INPUT_BUFFER_COUNT

const char* OH_MD_MAX_INPUT_BUFFER_COUNT

Description

Pointer to the key that describes the maximum number of input buffers. The value type is int32_t.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 10

[h2]OH_MD_MAX_OUTPUT_BUFFER_COUNT

const char* OH_MD_MAX_OUTPUT_BUFFER_COUNT

Description

Pointer to the key that describes the maximum number of output buffers. The value type is int32_t.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 10

[h2]OH_MD_KEY_VIDEO_SAR

const char* OH_MD_KEY_VIDEO_SAR

Description

Pointer to the key that describes the aspect ratio of the sample. The value type is double.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 12