harmony 鸿蒙CodecBase

2025-06-12 浏览 (1)

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

Media Codec Formats

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

NameDescription
OH_AVCODEC_MIMETYPE_AUDIO_AACMIME type of the AAC audio codec.
OH_AVCODEC_MIMETYPE_AUDIO_FLACMIME type of the Free Lossless Audio Codec (FLAC) audio codec.
OH_AVCODEC_MIMETYPE_AUDIO_OPUSMIME type of the Opus audio codec. (This specification is not available yet.)
OH_AVCODEC_MIMETYPE_AUDIO_G711MUMIME type of the G.711 mu-law audio codec.
OH_AVCODEC_MIMETYPE_AUDIO_RAWMIME type of raw audio streams.
OH_AVCODEC_MIMETYPE_AUDIO_VORBISMIME type of the Vorbis audio decoder.
OH_AVCODEC_MIMETYPE_AUDIO_MPEGMIME type of the MP3 audio decoder.
OH_AVCODEC_MIMETYPE_AUDIO_VIVIDMIME type of the Audio Vivid audio decoder. (This specification is not available yet.)
OH_AVCODEC_MIMETYPE_AUDIO_AMR_NBMIME type of the AMR-NB audio decoder.
OH_AVCODEC_MIMETYPE_AUDIO_AMR_WBMIME type of the AMR-WB audio decoder.
OH_AVCODEC_MIMETYPE_AUDIO_APEMIME type of the APE audio decoder.
OH_AVCODEC_MIMETYPE_VIDEO_VVCMIME type of the VVC (H.266) video codec.
OH_AVCODEC_MIMETYPE_VIDEO_HEVCMIME type of the HEVC (H.265) video codec.
OH_AVCODEC_MIMETYPE_VIDEO_AVCMIME type of the AVC (H.264) video codec.
OH_AVCODEC_MIMETYPE_VIDEO_H263MIME type of the H.263 video codec.
OH_AVCODEC_MIMETYPE_VIDEO_MPEG4MIME 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_VIDEO_MPEG4_PART2MIME type of the MPEG4 Part 2 video codec.
OH_AVCODEC_MIMETYPE_VIDEO_MPEG2MIME type of the MPEG2 video codec.
OH_AVCODEC_MIMETYPE_IMAGE_JPGMIME type of the JPG image encoder, which is used only for multiplexing JPG covers.
OH_AVCODEC_MIMETYPE_IMAGE_PNGMIME type of the PNG image encoder, which is used only for multiplexing PNG covers.
OH_AVCODEC_MIMETYPE_IMAGE_BMPMIME type of the BMP image encoder, which is used only for multiplexing BMP covers.
OH_AVCODEC_MIMETYPE_SUBTITLE_WEBVTTMIME type of the WEBVTT subtitle demuxer.
OH_AVCODEC_MIMETYPE_SUBTITLE_SRTMIME type of the SRT subtitle demuxer.

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:

NameDescription
OH_FEATURE_PROPERTY_KEY_VIDEO_ENCODER_MAX_LTR_FRAME_COUNTMaximum 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:

NameDescription
OH_MD_KEY_CODEC_CONFIGCodec-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. (This key is not supported yet for the video codec.)
OH_MD_MAX_INPUT_BUFFER_COUNTMaximum number of input buffers. The value type is int32_t. This key is optional.
OH_MD_MAX_OUTPUT_BUFFER_COUNTMaximum number of output buffers. The value type is int32_t. This key is optional.
OH_MD_KEY_BITRATEBit 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_PROFILEEncoding 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_SIZEMaximum 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.

NameDescription
OH_ED_KEY_TIME_STAMPSurface buffer timestamp. The value is of the int64_t type. This key is optional. (This key is deprecated from API version 14.)
OH_ED_KEY_EOSEnd of stream for the surface buffer. The value type is int32_t. This key is optional. (This key is deprecated from API version 14.)
OH_MD_KEY_WIDTHVideo width. The value type is int32_t.
OH_MD_KEY_HEIGHTVideo height. The value type is int32_t.
OH_MD_KEY_PIXEL_FORMATVideo pixel format. The value type is int32_t. For details, see OH_AVPixelFormat.
OH_MD_KEY_FRAME_RATEVideo frame rate. The value type is double. This key is optional.
OH_MD_KEY_RANGE_FLAGVideo 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_PRIMARIESVideo 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_CHARACTERISTICSVideo 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_COEFFICIENTSVideo 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_STRIDEStride of the video frame. The value type is int32_t. This key is optional.
OH_MD_KEY_VIDEO_SLICE_HEIGHTHeight of the video frame. The value type is int32_t. This key is optional.
OH_MD_KEY_VIDEO_PIC_WIDTHWidth of the video frame. The value type is int32_t. This key is optional.
OH_MD_KEY_VIDEO_PIC_HEIGHTHeight of the video frame. The value type is int32_t. This key is optional.
OH_MD_KEY_VIDEO_ENABLE_LOW_LATENCYEnabled 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_MODEVideo encoding bit rate mode. The value type is int32_t. For details, see OH_BitrateMode. This key is optional.
OH_MD_KEY_QUALITYRequired 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_FRAMERequest for immediate encoding of I-frames. The value type is int32_t. This key is optional.
OH_MD_KEY_I_FRAME_INTERVALKey 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_SCALABILITYEnabled 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_SIZESize 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_MODEReference 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_COUNTNumber 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_LTRWhether 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_LTRPOC 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_LTRWhether 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_POCPOC 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_MAXMaximum Quantization Parameter (QP) allowed by the video encoder. The value type is int32_t. This key is optional and is used only for video encoding.
OH_MD_KEY_VIDEO_ENCODER_QP_MINMinimum QP allowed by the video encoder. The value type is int32_t. This key is optional and is used only for video encoding.
OH_MD_KEY_VIDEO_ENCODER_QP_AVERAGEAverage QP of video frames. The value type is int32_t. This key is optional and is used only for video encoding.
OH_MD_KEY_VIDEO_ENCODER_MSEMean Squared Error (MSE) of video frames. The value type is double. This key is optional and is used only for video encoding.
OH_MD_KEY_VIDEO_ENCODER_REPEAT_PREVIOUS_FRAME_AFTERDuration (in milliseconds) for which the last frame will be resubmitted repeatedly, if no new frame is available after the previous frame is submitted to the encoder. The value type is int32_t. This key is used only in the configuration phase of video encoding in surface mode.
OH_MD_KEY_VIDEO_ENCODER_REPEAT_PREVIOUS_MAX_COUNTMaximum number of times the encoder can repeat encoding the previous frame when no new frame is available. The value type is int32_t. This key takes effect only when OH_MD_KEY_VIDEO_ENCODER_REPEAT_PREVIOUS_FRAME_AFTER is available and is used only in the configuration phase.
OH_MD_KEY_VIDEO_DECODER_OUTPUT_COLOR_SPACEOutput color space of the video decoder. The value type is int32_t. The supported value is OH_COLORSPACE_BT709_LIMIT.
OH_MD_KEY_ROTATIONRotation 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_MODEVideo 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. (This key is deprecated from API version 14.)
OH_MD_KEY_VIDEO_CROP_TOPTop 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_BOTTOMBottom 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_LEFTLeft 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_RIGHTRight 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_DECODER_OUTPUT_ENABLE_VRRWhether the decoder enables the video variable frame rate feature. The value type is int32_t. This key is optional and is used only for video decoding.

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

NameDescription
OH_MD_KEY_AUDIO_SAMPLE_FORMATOriginal audio format. The value type is int32_t. For details, see OH_BitsPerSample.
OH_MD_KEY_AUD_CHANNEL_COUNTNumber of audio channels. The value type is int32_t.
OH_MD_KEY_AUD_SAMPLE_RATEAudio sampling rate. The value type is int32_t.
OH_MD_KEY_AUDIO_COMPRESSION_LEVELAudio 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_LAYOUTRequired 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_SAMPLENumber 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_SBRAAC SBR format. The value type is int32_t. This key applies to AAC encoders. This key is optional.
OH_MD_KEY_COMPLIANCE_LEVELFLAC 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_ADTSAAC 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_HEADERVorbis identification header. The value type is uint8_t*. This key applies only to Vorbis decoders. This key is optional.
OH_MD_KEY_SETUP_HEADERVorbis setup header. The value type is uint8_t*. This key applies only to Vorbis decoders. This key is optional.
OH_MD_KEY_AUDIO_OBJECT_NUMBERNumber 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_METADATAAudio 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.

NameDescription
OH_MD_KEY_VIDEO_IS_HDR_VIVIDWhether 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_TIMEStart 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_TIMEStart time of the track, measured in microseconds. The value type is int64_t. This key is optional.
OH_MD_KEY_TRACK_TYPETrack type in a media file. The value type is int32_t. For details, see OH_MediaType. This key is optional.
OH_MD_KEY_DURATIONDuration in a media file. The value type is int64_t. This key is optional.
OH_MD_KEY_TITLETitle in a media file. The value type is string. This key is optional.
OH_MD_KEY_ARTISTArtist in a media file. The value type is string. This key is optional.
OH_MD_KEY_ALBUMAlbum in a media file. The value type is string. This key is optional.
OH_MD_KEY_ALBUM_ARTISTAlbum artist of the input media. The value type is string. This key is optional.
OH_MD_KEY_DATEDate in a media file, for example, 2024. The value type is string. This key is optional.
OH_MD_KEY_COMMENTComment in a media file. The value type is string. This key is optional.
OH_MD_KEY_GENREGenre in a media file. The value type is string. This key is optional.
OH_MD_KEY_COPYRIGHTCopyright in a media file. The value type is string. This key is optional.
OH_MD_KEY_LANGUAGELanguage in a media file. The value type is string. This key is optional.
OH_MD_KEY_DESCRIPTIONDescription in a media file. The value type is string. This key is optional.
OH_MD_KEY_LYRICSLyrics in a media file. The value type is string. This key is optional.
OH_MD_KEY_TRACK_COUNTNumber of tracks in a media file. The value type is int32_t. This key is optional.
OH_MD_KEY_BUFFER_DURATIONDuration 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_TIMESTAMPDecoding 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_MIMEMIME type of the codec. The value type is string. This key is optional.
OH_MD_KEY_VIDEO_SARAspect ratio of the sample. The value type is double.
OH_MD_KEY_CREATION_TIMEMedia file creation time. The value type is string.

Summary

Files

NameDescription
avcodec_audio_channel_layout.hDeclares the enums used for audio encoding and decoding.
native_avcodec_base.hDeclares the native APIs used for basic audio and video multiplexing, demultiplexing, encoding, and decoding.

Structs

NameDescription
struct OH_AVCodecAsyncCallbackDescribes all the asynchronous callback function pointers of an OH_AVCodec instance. (This function is deprecated in API version 11.)
struct OH_AVCodecCallbackDescribes all the asynchronous callback function pointers of an OH_AVCodec instance.
struct OH_AVDataSourceDescribes a user-defined data source.

Types

NameDescription
typedef struct NativeWindow OHNativeWindowDefines a struct for a native object for the graphics interface.
typedef struct OH_AVCodec OH_AVCodecDefines 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 video stream being decoded or the output video stream that has been encoded changes.
From API version 15, this function pointer is called to report the new stream description when the stream sampling rate, number of audio channels, or audio sampling format changes during audio decoding. The decoding formats that can detect these changes include AAC, FLAC, MP3, and VORBIS.
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_AVCodecAsyncCallbackDefines all the asynchronous callback function pointers of an OH_AVCodec instance. (This function is deprecated in API version 11.)
typedef struct OH_AVCodecCallback OH_AVCodecCallbackDefines 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_AVDataSourceDefines a struct for a user-defined data source.
typedef enum OH_MediaType OH_MediaTypeDefines an enum for the media types.
typedef enum OH_AACProfile OH_AACProfileDefines an enum for the Advanced Audio Coding (AAC) profiles.
typedef enum OH_AVCProfile OH_AVCProfileDefines an enum for the Advanced Video Coding (AVC) profiles.
typedef enum OH_HEVCProfile OH_HEVCProfileDefines an enum for the High Efficiency Video Coding (HEVC) profiles.
typedef enum OH_VVCProfile OH_VVCProfileDefines an enum for the VVC profiles.
typedef enum OH_H263Profile OH_H263ProfileDefines an enum for the H.263 profiles.
typedef enum OH_MPEG2Profile OH_MPEG2ProfileDefines an enum for the MPEG2 profiles.
typedef enum OH_MPEG4Profile OH_MPEG4ProfileDefines an enum for the MPEG4 profiles.
typedef enum OH_AVOutputFormat OH_AVOutputFormatDefines an enum for the output file formats supported by a muxer.
typedef enum OH_AVSeekMode OH_AVSeekModeDefines an enum for the seek modes.
typedef enum OH_ScalingMode OH_ScalingModeDefines an enum for the scaling modes. This enum is used only in surface mode. (This type is deprecated from API version 14.)
typedef enum OH_BitsPerSample OH_BitsPerSampleDefines an enum for the number of audio bits for each coded sample.
typedef enum OH_ColorPrimary OH_ColorPrimaryDefines an enum for the primary colors.
typedef enum OH_TransferCharacteristic OH_TransferCharacteristicDefines an enum for the transfer characteristics.
typedef enum OH_MatrixCoefficient OH_MatrixCoefficientDefines an enum for the matrix coefficients.
typedef enum OH_AVCLevel OH_AVCLevelDefines an enum for the AVC levels.
typedef enum OH_HEVCLevel OH_HEVCLevelDefines an enum for the HEVC levels.
typedef enum OH_VVCLevel OH_VVCLevelDefines an enum for the VVC levels.
typedef enum OH_H263Level OH_H263Level Defines an enum for the H.263 levels.
typedef enum OH_MPEG2Level OH_MPEG2LevelDefines an enum for the MPEG2 levels.
typedef enum OH_MPEG4Level OH_MPEG4LevelDefines an enum for the MPEG4 levels.
typedef enum OH_TemporalGopReferenceMode OH_TemporalGopReferenceModeDefines an enum for the reference modes of temporal image groups.
typedef enum OH_BitrateMode OH_BitrateModeDefines an enum for the bit rate modes of an encoder.

Enums

NameDescription
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,
AAC_PROFILE_HE = 3,
AAC_PROFILE_HE_V2 = 4
}
Enumerates the AAC profiles.
(AAC_PROFILE_HE and AAC_PROFILE_HE_V2 are not available yet.)
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.
(HEVC_PROFILE_MAIN_10_HDR10 and HEVC_PROFILE_MAIN_10_HDR10_PLUS are deprecated since API version 14.)
OH_VVCProfile {
VVC_PROFILE_MAIN_10 = 1,
VVC_PROFILE_MAIN_12 = 2,
VVC_PROFILE_MAIN_12_INTRA = 10,
VVC_PROFILE_MULTI_MAIN_10 = 17,
VVC_PROFILE_MAIN_10_444 = 33,
VVC_PROFILE_MAIN_12_444 = 34,
VVC_PROFILE_MAIN_16_444 = 36,
VVC_PROFILE_MAIN_12_444_INTRA = 42,
VVC_PROFILE_MAIN_16_444_INTRA = 44,
VVC_PROFILE_MULTI_MAIN_10_444 = 49,
VVC_PROFILE_MAIN_10_STILL = 65,
VVC_PROFILE_MAIN_12_STILL = 66,
VVC_PROFILE_MAIN_10_444_STILL = 97,
VVC_PROFILE_MAIN_12_444_STILL = 98,
VVC_PROFILE_MAIN_16_444_STILL = 100
}
Enumerates the VVC profiles.
OH_H263Profile {
H263_PROFILE_BASELINE = 0,
H263_PROFILE_VERSION_1_BACKWARD_COMPATIBILITY = 2
}
Enumerates the H.263 profiles.
OH_MPEG2Profile {
MPEG2_PROFILE_SIMPLE = 0,
MPEG2_PROFILE_MAIN = 1,
MPEG2_PROFILE_SNR = 2,
MPEG2_PROFILE_SPATIAL = 3,
MPEG2_PROFILE_HIGH = 4,
MPEG2_PROFILE_422 = 5
}
Enumerates the MPEG2 profiles.
OH_MPEG4Profile {
MPEG4_PROFILE_SIMPLE = 0,
MPEG4_PROFILE_SIMPLE_SCALABLE = 1,
MPEG4_PROFILE_CORE = 2,
MPEG4_PROFILE_MAIN = 3,
MPEG4_PROFILE_NBIT = 4,
MPEG4_PROFILE_HYBRID = 5,
MPEG4_PROFILE_BASIC_ANIMATED_TEXTURE = 6,
MPEG4_PROFILE_SCALABLE_TEXTURE = 7,
MPEG4_PROFILE_SIMPLE_FA = 8,
MPEG4_PROFILE_ADVANCED_REAL_TIME_SIMPLE = 9,
MPEG4_PROFILE_CORE_SCALABLE = 10,
MPEG4_PROFILE_ADVANCED_CODING_EFFICIENCY = 11,
MPEG4_PROFILE_ADVANCED_CORE = 12,
MPEG4_PROFILE_ADVANCED_SCALABLE_TEXTURE = 13,
MPEG4_PROFILE_ADVANCED_SIMPLE = 17
}
Enumerates the MPEG4 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,
AV_OUTPUT_FORMAT_AAC = 11
}
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. (This enum is deprecated from API version 14.)
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_VVCLevel {
VVC_LEVEL_1 = 16,
VVC_LEVEL_2 = 32,
VVC_LEVEL_21 = 35,
VVC_LEVEL_3 = 48,
VVC_LEVEL_31 = 51,
VVC_LEVEL_4 = 64,
VVC_LEVEL_41 = 67,
VVC_LEVEL_5 = 80,
VVC_LEVEL_51 = 83,
VVC_LEVEL_52 = 86,
VVC_LEVEL_6 = 96,
VVC_LEVEL_61 = 99,
VVC_LEVEL_62 = 102,
VVC_LEVEL_63 = 105,
VVC_LEVEL_155 = 255
}
Enumerates the VVC levels.
OH_H263Level {
H263_LEVEL_10 = 0,
H263_LEVEL_20 = 1,
H263_LEVEL_30 = 2,
H263_LEVEL_40 = 3,
H263_LEVEL_45 = 4,
H263_LEVEL_50 = 5,
H263_LEVEL_60 = 6,
H263_LEVEL_70 = 7
}
Enumerates the H.263 levels.
OH_MPEG2Level {
MPEG2_LEVEL_LL = 0,
MPEG2_LEVEL_ML = 1,
MPEG2_LEVEL_H14 = 2,
MPEG2_LEVEL_HL = 3
}
Enumerates the MPEG2 levels.
OH_MPEG4Level {
MPEG4_LEVEL_0 = 0,
MPEG4_LEVEL_0B = 1,
MPEG4_LEVEL_1 = 2,
MPEG4_LEVEL_2 = 3,
MPEG4_LEVEL_3 = 4,
MPEG4_LEVEL_3B = 5,
MPEG4_LEVEL_4 = 6,
MPEG4_LEVEL_4A = 7,
MPEG4_LEVEL_5 = 8,
MPEG4_LEVEL_6 = 9
}
Enumerates the MPEG4 levels.
OH_TemporalGopReferenceMode {
ADJACENT_REFERENCE = 0,
JUMP_REFERENCE = 1,
UNIFORMLY_SCALED_REFERENCE = 2
}
Enumerates the reference modes of temporal image groups.
OH_BitrateMode {
BITRATE_MODE_CBR = 0,
BITRATE_MODE_VBR = 1,
BITRATE_MODE_CQ = 2 }
Enumerates the bit rate modes of an encoder.

Variables

NameDescription
const char * OH_AVCODEC_MIMETYPE_AUDIO_AACPointer to the key that describes the MIME type of the AAC audio codec.
const char * OH_AVCODEC_MIMETYPE_AUDIO_FLACPointer to the key that describes the MIME type of the Free Lossless Audio Codec (FLAC) audio codec.
const char * OH_AVCODEC_MIMETYPE_AUDIO_OPUSPointer to the key that describes the MIME type of the Opus audio codec. (This specification is not available yet.)
const char * OH_AVCODEC_MIMETYPE_AUDIO_G711MUPointer to the key that describes the MIME type of the G.711 mu-law audio codec.
const char * OH_AVCODEC_MIMETYPE_AUDIO_VORBISPointer to the key that describes the MIME type of the Vorbis audio decoder.
const char * OH_AVCODEC_MIMETYPE_AUDIO_MPEGPointer to the key that describes the MIME type of the MP3 audio decoder.
const char * OH_AVCODEC_MIMETYPE_AUDIO_VIVIDPointer to the key that describes the MIME type of the Audio Vivid audio decoder. (This specification is not available yet.)
const char * OH_AVCODEC_MIMETYPE_AUDIO_AMR_NBPointer to the key that describes the MIME type of the AMR-NB audio decoder.
const char * OH_AVCODEC_MIMETYPE_AUDIO_AMR_WBPointer to the key that describes the MIME type of the AMR-WB audio decoder.
const char * OH_AVCODEC_MIMETYPE_AUDIO_APEPointer to the key that describes the MIME type of the APE audio decoder.
const char * OH_AVCODEC_MIMETYPE_VIDEO_VVCPointer to the key that describes the MIME type of the VVC (H.266) video codec.
const char * OH_AVCODEC_MIMETYPE_VIDEO_HEVCPointer to the key that describes the MIME type of the HEVC (H.265) video codec.
const char * OH_AVCODEC_MIMETYPE_VIDEO_AVCPointer to the key that describes the MIME type of the AVC (H.264) video codec.
const char * OH_AVCODEC_MIMETYPE_VIDEO_H263Pointer to the key that describes the MIME type of the H.263 video codec.
const char * OH_AVCODEC_MIMETYPE_VIDEO_MPEG4Pointer 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_VIDEO_MPEG2Pointer to the key that describes the MIME type of MPEG2 video codec.
const char * OH_AVCODEC_MIMETYPE_VIDEO_MPEG4_PART2Pointer to the key that describes the MIME type of MPEG4 Part 2 video codec.
const char * OH_AVCODEC_MIMETYPE_IMAGE_JPGPointer 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_PNGPointer 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_BMPPointer 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_WEBVTTPointer to the key that describes the MIME type of the WEBVTT subtitle demuxer.
const char * OH_AVCODEC_MIMETYPE_SUBTITLE_SRTPointer to the key that describes the MIME type of the SRT subtitle demuxer.
const char * OH_FEATURE_PROPERTY_KEY_VIDEO_ENCODER_MAX_LTR_FRAME_COUNTPointer 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_CONFIGPointer 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*. (This key is not supported yet for the video codec.)
const char * OH_MD_MAX_INPUT_BUFFER_COUNTPointer to the key that describes the maximum number of input buffers. The value type is int32_t.
const char * OH_MD_MAX_OUTPUT_BUFFER_COUNTPointer to the key that describes the maximum number of output buffers. The value type is int32_t.
const char * OH_MD_KEY_BITRATEPointer to the key that describes the bit rate. The value type is int64_t.
const char * OH_MD_KEY_PROFILEPointer 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_SIZEPointer 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_STAMPPointer to the key that describes the surface buffer timestamp. The value is of the int64_t type. (This variable is deprecated from API version 14.)
const char * OH_ED_KEY_EOSPointer to the key that describes the end of stream for the surface buffer. The value type is int32_t. (This variable is deprecated from API version 14.)
const char * OH_MD_KEY_WIDTHPointer to the key that describes the video width. The value type is int32_t.
const char * OH_MD_KEY_HEIGHTPointer to the key that describes the video height. The value type is int32_t.
const char * OH_MD_KEY_PIXEL_FORMATPointer 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_RATEPointer to the key that describes the video frame rate. The value type is double.
const char * OH_MD_KEY_ROTATIONPointer 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_FLAGPointer 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_PRIMARIESPointer 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_CHARACTERISTICSPointer 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_COEFFICIENTSPointer 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_MODEPointer 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. (This variable is deprecated from API version 14.)
const char * OH_MD_KEY_VIDEO_CROP_TOPPointer 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_BOTTOMPointer 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_LEFTPointer 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_RIGHTPointer 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_DECODER_OUTPUT_ENABLE_VRRPointer to the key that specifies whether the decoder enables the video variable frame rate feature. The value type is int32_t.
const char * OH_MD_KEY_VIDEO_STRIDEPointer to the key that describes the stride of the video frame. The value type is int32_t.
const char * OH_MD_KEY_VIDEO_SLICE_HEIGHTPointer to the key that describes the height of the video frame. The value type is int32_t.
const char * OH_MD_KEY_VIDEO_PIC_WIDTHPointer to the key that describes the width of the video frame. The value type is int32_t.
const char * OH_MD_KEY_VIDEO_PIC_HEIGHTPointer 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_LATENCYPointer 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_MODEPointer to the key that describes the video encoding bit rate mode. The value type is int32_t. For details, see OH_BitrateMode.
const char * OH_MD_KEY_QUALITYPointer 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_FRAMEPointer 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_INTERVALPointer 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_SCALABILITYPointer 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_SIZEPointer 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_MODEPointer 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_COUNTPointer 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_LTRPointer 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_LTRPointer 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_LTRPointer 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_POCPointer 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_MAXPointer 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_MINPointer 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_AVERAGEPointer to the key that describes the average QP of video frames. The value type is int32_t.
const char * OH_MD_KEY_VIDEO_ENCODER_MSEPointer to the key that describes the MSE of video frames. The value type is double.
const char * OH_MD_KEY_VIDEO_ENCODER_REPEAT_PREVIOUS_FRAME_AFTERPointer to the key that specifies the duration (in milliseconds) for which the last frame will be resubmitted repeatedly, if no new frame is available after the previous frame is submitted to the encoder. The value type is int32_t.
const char * OH_MD_KEY_VIDEO_ENCODER_REPEAT_PREVIOUS_MAX_COUNTPointer to the key that describes the maximum number of times the encoder can repeat encoding the previous frame when no new frame is available. The value type is int32_t.
const char * OH_MD_KEY_VIDEO_DECODER_OUTPUT_COLOR_SPACEPointer 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_FORMATPointer 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_COUNTPointer to the key that describes the number of audio channels. The value type is int32_t.
const char * OH_MD_KEY_AUD_SAMPLE_RATEPointer to the key that describes the audio sampling rate. The value type is int32_t.
const char * OH_MD_KEY_AUDIO_COMPRESSION_LEVELPointer 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_LAYOUTPointer 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_SAMPLEPointer 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_SBRPointer 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_LEVELPointer 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_ADTSPointer 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_HEADERPointer 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_HEADERPointer 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_NUMBERPointer 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_METADATAPointer 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_VIVIDPointer 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_TIMEPointer 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_TIMEPointer 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_TYPEPointer 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_DURATIONPointer to the key that describes the duration in a media file. The value type is int64_t.
const char * OH_MD_KEY_TITLEPointer to the key that describes the title in a media file. The value type is string.
const char * OH_MD_KEY_ARTISTPointer to the key that describes the lyrics in a media file. The value type is string.
const char * OH_MD_KEY_ALBUMPointer to the key that describes the album in a media file. The value type is string.
const char * OH_MD_KEY_ALBUM_ARTISTPointer to the key that describes the album artist of the input media. The value type is string.
const char * OH_MD_KEY_DATEPointer to the key that describes the date in a media file, for example, 2024. The value type is string.
const char * OH_MD_KEY_COMMENTPointer to the key that describes the comment in a media file. The value type is string.
const char * OH_MD_KEY_GENREPointer to the key that describes the genre in a media file. The value type is string.
const char * OH_MD_KEY_COPYRIGHTPointer to the key that describes the copyright in a media file. The value type is string.
const char * OH_MD_KEY_LANGUAGEPointer to the key that describes the language in a media file. The value type is string.
const char * OH_MD_KEY_DESCRIPTIONPointer to the key that describes the description in a media file. The value type is string.
const char * OH_MD_KEY_LYRICSPointer to the key that describes the lyrics in a media file. The value type is string.
const char * OH_MD_KEY_TRACK_COUNTPointer 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_DURATIONPointer 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_TIMESTAMPPointer 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_MIMEPointer to the key that describes the MIME type of the codec. The value type is string.
const char * OH_MD_KEY_VIDEO_SARPointer to the key that describes the aspect ratio of the sample. The value type is double.
const char * OH_MD_KEY_CREATION_TIMEPointer to the key that describes the media file creation time. The value type is string.

Type Description

OH_AACProfile

typedef enum OH_AACProfile OH_AACProfile

Description

Defines an enum for the AAC profiles.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 9

OH_AVCLevel

typedef enum OH_AVCLevel OH_AVCLevel

Description

Defines an enum for the AVC levels.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 12

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

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

NameDescription
onErrorCallback used to report a codec operation error. For details, see OH_AVCodecOnError.
onStreamChangedCallback used to report a codec stream change. For details, see OH_AVCodecOnStreamChanged.
onNeedInputDataCallback used to report input data required. For details, see OH_AVCodecOnNeedInputData.
onNeedOutputDataCallback used to report output data generated. For details, see OH_AVCodecOnNewOutputData.

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

NameDescription
onErrorCallback used to report a codec operation error. For details, see OH_AVCodecOnError.
onStreamChangedCallback used to report a codec stream change. For details, see OH_AVCodecOnStreamChanged.
onNeedInputBufferCallback used to report input data required. For details, see OH_AVCodecOnNeedInputBuffer.
onNewOutputBufferCallback used to report output data generated. For details, see OH_AVCodecOnNewOutputBuffer.

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 CaseError Code
Audio encoding/decodingAV_ERR_DRM_DECRYPT_FAILED: DRM decryption failed.
Video encoding/decodingAV_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 decodingAV_ERR_VIDEO_UNSUPPORTED_COLOR_SPACE_CONVERSION: The current input does not support CSC.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 9

Parameters

NameDescription
codecPointer to an OH_AVCodec instance.
errorCodeError code. The returned error codes vary in scenarios. For details, see the table in the function description.
userDataPointer to the data on which the caller depends when executing the callback.

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

NameDescription
codecPointer to an OH_AVCodec instance.
indexIndex of the new input buffer.
bufferPointer to the data to fill in the new input buffer.
userDataPointer to the data on which the caller depends when executing the callback.

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

NameDescription
codecPointer to an OH_AVCodec instance.
indexIndex of the new input buffer.
dataPointer to the data to fill in the new input buffer.
userDataPointer to the data on which the caller depends when executing the callback.

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

NameDescription
codecPointer to an OH_AVCodec instance.
indexIndex of the new output buffer.
bufferPointer to the data filled in the new output buffer.
userDataPointer to the data on which the caller depends when executing the callback.

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

NameDescription
codecPointer to an OH_AVCodec instance.
indexIndex of the new output buffer.
dataPointer to the data filled in the new output buffer.
attrPointer to the description information about the new output buffer. For details, see OH_AVCodecBufferAttr.
userDataPointer to the data on which the caller depends when executing the callback.

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 video stream being decoded or the output video stream that has been encoded changes.
From API version 15, this function pointer is called to report the new stream description when the stream sampling rate, number of audio channels, or audio sampling format changes during audio decoding. The decoding formats that can detect these changes include AAC, FLAC, MP3, and VORBIS.
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

NameDescription
codecPointer to an OH_AVCodec instance.
formatPointer to the description information about the new output stream.
userDataPointer to the data on which the caller depends when executing the callback.

OH_AVCProfile

typedef enum OH_AVCProfile OH_AVCProfile

Description

Defines an enum for the AVC profiles.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 9

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

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

NameDescription
dataBuffer to be filled in.
lengthLength of the data to read.
posOffset from which the data is read.

Returns

Actual length of the data read to the buffer.

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

OH_AVSeekMode

typedef enum OH_AVSeekMode OH_AVSeekMode

Description

Defines an enum for the seek modes.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 10

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

OH_ColorPrimary

typedef enum OH_ColorPrimary OH_ColorPrimary

Description

Defines an enum for the primary colors.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 10

OH_HEVCLevel

typedef enum OH_HEVCLevel OH_HEVCLevel

Description

Defines an enum for the HEVC levels.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 12

OH_HEVCProfile

typedef enum OH_HEVCProfile OH_HEVCProfile

Description

Defines an enum for the HEVC profiles.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 10

OH_MatrixCoefficient

typedef enum OH_MatrixCoefficient OH_MatrixCoefficient

Description

Defines an enum for the matrix coefficients.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 10

OH_MediaType

typedef enum OH_MediaType OH_MediaType

Description

Defines an enum for the media types.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 9

OH_MPEG2Level

typedef enum OH_MPEG2Level OH_MPEG2Level

Description

Defines an enum for the MPEG2 levels.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 17

OH_MPEG2Profile

typedef enum OH_MPEG2Profile OH_MPEG2Profile

Description

Defines an enum for the MPEG2 profiles.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 17

OH_MPEG4Level

typedef enum OH_MPEG4Level OH_MPEG4Level

Description

Defines an enum for the MPEG4 levels.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 17

OH_MPEG4Profile

typedef enum OH_MPEG4Profile OH_MPEG4Profile

Description

Defines an enum for the MPEG4 profiles.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 17

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

Deprecated from: 14

Substitute: OHScalingModeV2

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

OH_VVCLevel

typedef enum OH_VVCLevel OH_VVCLevel

Description

Defines an enum for the VVC levels.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 15

OH_VVCProfile

typedef enum OH_VVCProfile OH_VVCProfile

Description

Defines an enum for the VVC profiles.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 15

OH_H263Level

typedef enum OH_H263Level OH_H263Level

Description

Defines an enum for the H.263 levels.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 17

OH_H263Profile

typedef enum OH_H263Profile OH_H263Profile

Description

Defines an enum for the H.263 profiles.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 17

OH_TransferCharacteristic

typedef enum OH_TransferCharacteristic OH_TransferCharacteristic

Description

Defines an enum for the transfer characteristics.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 10

OH_BitrateMode

typedef enum OH_BitrateMode OH_BitrateMode

Description

Defines an enum for the bit rate modes of an encoder. The key position is changed from API version 14.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 10

OHNativeWindow

typedef struct NativeWindow OHNativeWindow

Description

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

Since: 9

Enum Description

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

ValueDescription
UNKNOWN_CHANNEL_LAYOUTUnknown.
MONOMono layout.
STEREOStereo layout
CH_2POINT12.1 layout.
CH_2_12_1 layout.
SURROUNDSurround layout.
CH_3POINT13.1 layout.
CH_4POINT04.0 layout.
CH_4POINT14.1 layout.
CH_2_22_2 layout.
QUADQuad layout.
CH_5POINT05.0 layout.
CH_5POINT15.1 layout.
CH_5POINT0_BACK5.0 rear layout.
CH_5POINT1_BACK5.1 rear layout.
CH_6POINT06.0 layout.
CH_6POINT0_FRONT6.0 front layout.
HEXAGONALHexagonal layout.
CH_6POINT16.1 layout.
CH_6POINT1_BACK6.1 rear layout.
CH_6POINT1_FRONT6.1 front layout.
CH_7POINT07.0 layout.
CH_7POINT0_FRONT7.0 front layout.
CH_7POINT17.1 layout.
CH_7POINT1_WIDE7.1 wide layout.
CH_7POINT1_WIDE_BACK7.1 rear wide layout.
CH_3POINT1POINT23.1.2 layout.
CH_5POINT1POINT25.1.2 layout.
CH_5POINT1POINT45.1.4 layout.
CH_7POINT1POINT27.1.2 layout.
CH_7POINT1POINT47.1.4 layout.
CH_9POINT1POINT49.1.4 layout.
CH_9POINT1POINT69.1.6 layout.
CH_10POINT210.2 layout.
CH_22POINT222.2 layout.
OCTAGONALOctagonal layout.
HEXADECAGONALHexadecagonal layout.
STEREO_DOWNMIXStereo downmix layout.
HOA_FIRSTHigh-Order Ambisonics (HOA) first-order layout.
HOA_SECONDHOA second-order layout.
HOA_THIRDHOA third-order layout.

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

ValueDescription
FRONT_LEFTFront left channel.
FRONT_RIGHTFront right channel
FRONT_CENTERFront center channel.
LOW_FREQUENCYLow-frequency channel.
BACK_LEFTRear left channel.
BACK_RIGHTRear right channel
FRONT_LEFT_OF_CENTERFront left center channel.
FRONT_RIGHT_OF_CENTERFront right center channel.
BACK_CENTERRear center channel.
SIDE_LEFTLeft channel.
SIDE_RIGHTRight channel.
TOP_CENTERTop center channel.
TOP_FRONT_LEFTTop left front channel.
TOP_FRONT_CENTERTop center front channel.
TOP_FRONT_RIGHTTop right front channel.
TOP_BACK_LEFTTop left rear channel.
TOP_BACK_CENTERTop center rear channel.
TOP_BACK_RIGHTTop right rear channel.
STEREO_LEFTStereo left channel.
STEREO_RIGHTStereo right channel.
WIDE_LEFTWide left channel.
WIDE_RIGHTWide right channel.
SURROUND_DIRECT_LEFTLeft surround channel.
SURROUND_DIRECT_RIGHTRight surround channel.
LOW_FREQUENCY_2Low-frequency channel 2.
TOP_SIDE_LEFTTop left channel.
TOP_SIDE_RIGHTTop right channel.
BOTTOM_FRONT_CENTERBottom center front channel.
BOTTOM_FRONT_LEFTBottom left front channel.
BOTTOM_FRONT_RIGHTBottom right front channel.
AMBISONICS_ACN0Channel 0 for the zero-order stereo.
AMBISONICS_ACN1Channel 1 for the first-order stereo.
AMBISONICS_ACN2Channel 2 for the first-order stereo.
AMBISONICS_ACN3Channel 3 for the first-order stereo.
AMBISONICS_WEquivalent to channel 0 for the zero-order stereo.
AMBISONICS_YEquivalent to channel 1 for the first-order stereo.
AMBISONICS_ZEquivalent to channel 2 for the first-order stereo.
AMBISONICS_XEquivalent to channel 3 for the first-order stereo.
AMBISONICS_ACN4Channel 4 for the second-order stereo.
AMBISONICS_ACN5Channel 5 for the second-order stereo.
AMBISONICS_ACN6Channel 6 for the second-order stereo.
AMBISONICS_ACN7Channel 7 for the second-order stereo.
AMBISONICS_ACN8Channel 8 for the second-order stereo.
AMBISONICS_ACN9Channel 9 for the third-order stereo.
AMBISONICS_ACN10Channel 10 for the third-order stereo.
AMBISONICS_ACN11Channel 11 for the third-order stereo.
AMBISONICS_ACN12Channel 12 for the third-order stereo.
AMBISONICS_ACN13Channel 13 for the third-order stereo.
AMBISONICS_ACN14Channel 14 for the third-order stereo.
AMBISONICS_ACN15Channel 15 for the third-order stereo.

OH_AACProfile

enum OH_AACProfile

Description

Enumerates the AAC profiles.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 9

ValueDescription
AAC_PROFILE_LCAAC profile of the low complexity level.
AAC_PROFILE_HEAAC profile of the high efficiency level. (This specification is not available yet.)
Since: 14
AAC_PROFILE_HE_V2AAC profile of the high efficiency V2 level. (This specification is not available yet.)
Since: 14

OH_AVCLevel

enum OH_AVCLevel

Description

Enumerates the AVC levels.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 12

ValueDescription
AVC_LEVEL_1Level 1.
AVC_LEVEL_1bLevel 1b.
AVC_LEVEL_11Level 1.1.
AVC_LEVEL_12Level 1.2.
AVC_LEVEL_13Level 1.3.
AVC_LEVEL_2Level 2.
AVC_LEVEL_21Level 2.1.
AVC_LEVEL_22Level 2.2.
AVC_LEVEL_3Level 3.
AVC_LEVEL_31Level 3.1.
AVC_LEVEL_32Level 3.2.
AVC_LEVEL_4Level 4.
AVC_LEVEL_41Level 4.1.
AVC_LEVEL_42Level 4.2.
AVC_LEVEL_5Level 5.
AVC_LEVEL_51Level 5.1.
AVC_LEVEL_52Level 5.2.
AVC_LEVEL_6Level 6.
AVC_LEVEL_61Level 6.1.
AVC_LEVEL_62Level 6.2.

OH_AVCProfile

enum OH_AVCProfile

Description

Enumerates the AVC profiles.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 9

ValueDescription
AVC_PROFILE_BASELINEAVC baseline profile.
AVC_PROFILE_HIGHAVC high profile.
AVC_PROFILE_MAINAVC main profile.

OH_AVOutputFormat

enum OH_AVOutputFormat

Description

Enumerates the output file formats supported by a muxer.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 10

ValueDescription
AV_OUTPUT_FORMAT_DEFAULTDefault format, which is MP4.
AV_OUTPUT_FORMAT_MPEG_4MP4.
AV_OUTPUT_FORMAT_M4AM4A.
AV_OUTPUT_FORMAT_AMRAMR.
Since: 12
AV_OUTPUT_FORMAT_MP3MP3.
Since: 12
AV_OUTPUT_FORMAT_WAVWAV.
Since: 12
AV_OUTPUT_FORMAT_AACAAC.
Since: 18

OH_AVSeekMode

enum OH_AVSeekMode

Description

Enumerates the seek modes.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 10

ValueDescription
SEEK_MODE_NEXT_SYNCSeeks 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_SYNCSeeks to the previous I-frame at the specified position.
SEEK_MODE_CLOSEST_SYNCSeeks to the latest I-frame at the specified position.

OH_BitsPerSample

enum OH_BitsPerSample

Description

Enumerates the number of audio bits for each coded sample.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 10

ValueDescription
SAMPLE_U88-bit unsigned integer sampling.
SAMPLE_S16LE16-bit signed integer sampling.
SAMPLE_S24LE24-bit signed integer sampling.
SAMPLE_S32LE32-bit signed integer sampling.
SAMPLE_F32LE32-bit floating-point sampling.
SAMPLE_U8P8-bit unsigned integer plane sampling.
SAMPLE_S16P16-bit signed integer plane sampling.
SAMPLE_S24P24-bit signed integer plane sampling.
SAMPLE_S32P32-bit signed integer plane sampling.
SAMPLE_F32P32-bit floating-point plane sampling.
INVALID_WIDTHInvalid sampling format.

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

ValueDescription
COLOR_PRIMARY_BT709BT.709 color gamut.
COLOR_PRIMARY_UNSPECIFIEDUnspecified color gamut.
COLOR_PRIMARY_BT470_MBT.470 System M color gamut.
COLOR_PRIMARY_BT601_625BT.601 625 color gamut.
COLOR_PRIMARY_BT601_525BT.601 525 color gamut.
COLOR_PRIMARY_SMPTE_ST240SMPTE ST 240 color gamut.
COLOR_PRIMARY_GENERIC_FILMGeneric film color gamut.
COLOR_PRIMARY_BT2020BT.2020 color gamut.
COLOR_PRIMARY_SMPTE_ST428SMPTE ST 428 color gamut.
COLOR_PRIMARY_P3DCIDCI-P3 color gamut.
COLOR_PRIMARY_P3D65P3-D65 color gamut.

OH_HEVCLevel

enum OH_HEVCLevel

Description

Enumerates the HEVC levels.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 12

ValueDescription
HEVC_LEVEL_1Level 1.
HEVC_LEVEL_2Level 2.
HEVC_LEVEL_21Level 2.1.
HEVC_LEVEL_3Level 3.
HEVC_LEVEL_31Level 3.1.
HEVC_LEVEL_4Level 4.
HEVC_LEVEL_41Level 4.1.
HEVC_LEVEL_5Level 5.
HEVC_LEVEL_51Level 5.1.
HEVC_LEVEL_52Level 5.2.
HEVC_LEVEL_6Level 6.
HEVC_LEVEL_61Level 6.1.
HEVC_LEVEL_62Level 6.2.

OH_HEVCProfile

enum OH_HEVCProfile

Description

Enumerates the HEVC profiles.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 10

ValueDescription
HEVC_PROFILE_MAINHEVC profile of the main level.
HEVC_PROFILE_MAIN_10HEVC profile of the 10-bit main level.
HEVC_PROFILE_MAIN_STILLHEVC profile of the main still picture level.
HEVC_PROFILE_MAIN_10_HDR10HEVC profile of the main 10 HDR10 level. (This value is deprecated from API version 14.)
HEVC_PROFILE_MAIN_10_HDR10_PLUSHEVC profile of the main 10 HDR10+ level. (This value is deprecated from API version 14.)

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

ValueDescription
MATRIX_COEFFICIENT_IDENTITYIdentity matrix.
MATRIX_COEFFICIENT_BT709BT.709 conversion matrix.
MATRIX_COEFFICIENT_UNSPECIFIEDUnspecified conversion matrix.
MATRIX_COEFFICIENT_FCCFCC conversion matrix.
MATRIX_COEFFICIENT_BT601_625BT.601 625 conversion matrix.
MATRIX_COEFFICIENT_BT601_525BT.601 525 conversion matrix.
MATRIX_COEFFICIENT_SMPTE_ST240SMPTE ST 240 conversion matrix.
MATRIX_COEFFICIENT_YCGCOYCgCo conversion matrix.
MATRIX_COEFFICIENT_BT2020_NCLBT.2020 NCL conversion matrix.
MATRIX_COEFFICIENT_BT2020_CLBT.2020 CL conversion matrix.
MATRIX_COEFFICIENT_SMPTE_ST2085SMPTE ST 2085 conversion matrix.
MATRIX_COEFFICIENT_CHROMATICITY_NCLChromaticity NCL conversion matrix.
MATRIX_COEFFICIENT_CHROMATICITY_CLChromaticity CL conversion matrix.
MATRIX_COEFFICIENT_ICTCPICTCP conversion matrix.

OH_MediaType

enum OH_MediaType

Description

Enumerates the media types.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 9

ValueDescription
MEDIA_TYPE_AUDAudio track.
MEDIA_TYPE_VIDVideo track.
MEDIA_TYPE_SUBTITILESubtitle track.
Since: 12

OH_MPEG2Level

enum OH_MPEG2Level

Description

Enumerates the MPEG2 levels.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 17

ValueDescription
MPEG2_LEVEL_LLLow level.
MPEG2_LEVEL_MLMain level.
MPEG2_LEVEL_H14High 1440 level.
MPEG2_LEVEL_HLHigh level.

OH_MPEG2Profile

enum OH_MPEG2Profile

Description

Enumerates the MPEG2 profiles.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 17

ValueDescription
MPEG2_PROFILE_SIMPLESimple profile.
MPEG2_PROFILE_MAINMain profile.
MPEG2_PROFILE_SNRSignal-to-Noise Ratio (SNR) scalable profile.
MPEG2_PROFILE_SPATIALSpatial scalable profile.
MPEG2_PROFILE_HIGHHigh profile.
MPEG2_PROFILE_4224:2:2 profile.

OH_MPEG4Level

enum OH_MPEG4Level

Description

Enumerates the MPEG4 levels.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 17

ValueDescription
MPEG4_LEVEL_0Level 0.
MPEG4_LEVEL_0BLevel 0B.
MPEG4_LEVEL_1Level 1.
MPEG4_LEVEL_2Level 2.
MPEG4_LEVEL_3Level 3.
MPEG4_LEVEL_3BLevel 3B.
MPEG4_LEVEL_4Level 4.
MPEG4_LEVEL_4ALevel 4A.
MPEG4_LEVEL_5Level 5.
MPEG4_LEVEL_6Level 6.

OH_MPEG4Profile

enum OH_MPEG4Profile

Description

Enumerates the MPEG4 profiles.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 17

ValueDescription
MPEG4_PROFILE_SIMPLESimple profile.
MPEG4_PROFILE_SIMPLE_SCALABLESimple scalable profile.
MPEG4_PROFILE_CORECore profile.
MPEG4_PROFILE_MAINMain profile.
MPEG4_PROFILE_NBITN-bit profile.
MPEG4_PROFILE_HYBRIDHybrid profile.
MPEG4_PROFILE_BASIC_ANIMATED_TEXTUREBasic animated texture profile.
MPEG4_PROFILE_SCALABLE_TEXTUREScalable texture profile.
MPEG4_PROFILE_SIMPLE_FASimple FA profile.
MPEG4_PROFILE_ADVANCED_REAL_TIME_SIMPLEAdvanced real-time simple profile.
MPEG4_PROFILE_CORE_SCALABLECore scalable profile.
MPEG4_PROFILE_ADVANCED_CODING_EFFICIENCYAdvanced coding efficiency profile.
MPEG4_PROFILE_ADVANCED_COREAdvanced core profile.
MPEG4_PROFILE_ADVANCED_SCALABLE_TEXTUREAdvanced scalable texture profile.
MPEG4_PROFILE_ADVANCED_SIMPLEAdvanced simple profile.

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

Deprecated from: 14

Substitute: OHScalingModeV2.OH_SCALING_MODE_SCALE_TO_WINDOW_V2 OHScalingModeV2.OH_SCALING_MODE_SCALE_CROP_V2

ValueDescription
SCALING_MODE_SCALE_TO_WINDOWScales the image based on the window size.
SCALING_MODE_SCALE_CROPCrops the image based on the window size.

OH_TemporalGopReferenceMode

enum OH_TemporalGopReferenceMode

Description

Enumerates the reference modes of temporal image groups.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 12

ValueDescription
ADJACENT_REFERENCERefers to the nearest short-term reference frame.
JUMP_REFERENCERefers to the latest LTR frame.
UNIFORMLY_SCALED_REFERENCEDrops video frames at the highest level, and evenly distributes the remaining frames. The number of temporal image groups must be a power of 2.

OH_VVCLevel

enum OH_VVCLevel

Description

Enumerates the VVC levels.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 15

ValueDescription
VVC_LEVEL_1Level 1.0.
VVC_LEVEL_2Level 2.0.
VVC_LEVEL_21Level 2.1.
VVC_LEVEL_3Level 3.0.
VVC_LEVEL_31Level 3.1.
VVC_LEVEL_4Level 4.0.
VVC_LEVEL_41Level 4.1.
VVC_LEVEL_5Level 5.0.
VVC_LEVEL_51Level 5.1.
VVC_LEVEL_52Level 5.2.
VVC_LEVEL_6Level 6.0.
VVC_LEVEL_61Level 6.1.
VVC_LEVEL_62Level 6.2.
VVC_LEVEL_63Level 6.3.
VVC_LEVEL_155Level 15.5.

OH_VVCProfile

enum OH_VVCProfile

Description

Enumerates the VVC profiles.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 15

ValueDescription
VVC_PROFILE_MAIN_10VVC profile of the 10-bit main level.
VVC_PROFILE_MAIN_12VVC profile of the 12-bit main level.
VVC_PROFILE_MAIN_12_INTRAVVC profile of the 12-bit intra main level.
VVC_PROFILE_MULTI_MAIN_10VVC profile of the 10-bit main level for multi-layer encoding.
VVC_PROFILE_MAIN_10_444VVC profile of the 10-bit full-sample main level.
VVC_PROFILE_MAIN_12_444VVC profile of the 12-bit full-sample main level.
VVC_PROFILE_MAIN_16_444VVC profile of the 16-bit full-sample main level.
VVC_PROFILE_MAIN_12_444_INTRAVVC profile of the 12-bit full-sample intra main level.
VVC_PROFILE_MAIN_16_444_INTRAVVC profile of the 16-bit full-sample intra main level.
VVC_PROFILE_MULTI_MAIN_10_444VVC profile of the 10-bit full-sample main level for multi-layer encoding.
VVC_PROFILE_MAIN_10_STILLVVC profile of the 10-bit still picture main level.
VVC_PROFILE_MAIN_12_STILLVVC profile of the 12-bit still picture main level.
VVC_PROFILE_MAIN_10_444_STILLVVC profile of the 10-bit full-sample still picture main level.
VVC_PROFILE_MAIN_12_444_STILLVVC profile of the 12-bit full-sample still picture main level.
VVC_PROFILE_MAIN_16_444_STILLVVC profile of the 16-bit full-sample still picture main level.

OH_H263Level

enum OH_H263Level

Description

Enumerates the H.263 levels.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 17

ValueDescription
H263_LEVEL_10Level 10.
H263_LEVEL_20Level 20.
H263_LEVEL_30Level 30.
H263_LEVEL_40Level 40.
H263_LEVEL_45Level 45.
H263_LEVEL_50Level 50.
H263_LEVEL_60Level 60.
H263_LEVEL_70Level 70.

OH_H263Profile

enum OH_H263Profile

Description

Enumerates the H.263 profiles.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 17

ValueDescription
H263_PROFILE_BASELINEBaseline profile.
H263_PROFILE_VERSION_1_BACKWARD_COMPATIBILITYVersion 1 backward compatibility.

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

ValueDescription
TRANSFER_CHARACTERISTIC_BT709BT.709 transfer function.
TRANSFER_CHARACTERISTIC_UNSPECIFIEDUnspecified transfer function.
TRANSFER_CHARACTERISTIC_GAMMA_2_2Gamma 2-2 transfer function.
TRANSFER_CHARACTERISTIC_GAMMA_2_8Gamma 2-8 transfer function.
TRANSFER_CHARACTERISTIC_BT601BT.601 transfer function.
TRANSFER_CHARACTERISTIC_SMPTE_ST240SMPTE ST 240 transfer function.
TRANSFER_CHARACTERISTIC_LINEARLinear transfer function.
TRANSFER_CHARACTERISTIC_LOGLog transfer function.
TRANSFER_CHARACTERISTIC_LOG_SQRTLog SQRT transfer function.
TRANSFER_CHARACTERISTIC_IEC_61966_2_4IEC61966-2.4 transfer function.
TRANSFER_CHARACTERISTIC_BT1361BT.1361 transfer function.
TRANSFER_CHARACTERISTIC_IEC_61966_2_1IEC61966 2.1 transfer function.
TRANSFER_CHARACTERISTIC_BT2020_10BITBT.2020 10-bit transfer function.
TRANSFER_CHARACTERISTIC_BT2020_12BITBT.2020 12-bit transfer function.
TRANSFER_CHARACTERISTIC_PQPQ transfer function.
TRANSFER_CHARACTERISTIC_SMPTE_ST428SMPTE ST.428 transfer function.
TRANSFER_CHARACTERISTIC_HLGHLG transfer function.

OH_BitrateMode

enum OH_BitrateMode

Description

Enumerates the bit rate modes of an encoder.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 10

ValueDescription
BITRATE_MODE_CBRConstant bit rate.
BITRATE_MODE_VBRVariable bit rate. The bit rate is for reference only.
BITRATE_MODE_CQConstant quality.

Variable Description

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

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

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

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

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

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

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

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

OH_AVCODEC_MIMETYPE_AUDIO_RAW

const char* OH_AVCODEC_MIMETYPE_AUDIO_RAW

Description

Pointer to the key that describes the MIME type of raw audio streams.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 18

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

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. (This specification is not available yet.)

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 11

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. (This specification is not available yet.)

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 11

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

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

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

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

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

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

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

OH_AVCODEC_MIMETYPE_VIDEO_H263

const char* OH_AVCODEC_MIMETYPE_VIDEO_H263

Description

Pointer to the key that describes the MIME type of the H.263 video codec.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 17

OH_AVCODEC_MIMETYPE_VIDEO_MPEG2

const char* OH_AVCODEC_MIMETYPE_VIDEO_MPEG2

Description

Pointer to the key that describes the MIME type of MPEG2 video codec.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 17

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

OH_AVCODEC_MIMETYPE_VIDEO_MPEG4_PART2

const char* OH_AVCODEC_MIMETYPE_VIDEO_MPEG4_PART2

Description

Pointer to the key that describes the MIME type of MPEG4 Part 2 video codec.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 17

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

Deprecated from: 14

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.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 9

Deprecated from: 14

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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*. (This key is not supported yet for the video codec.)

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 10

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

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

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

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

OH_MD_KEY_COPYRIGHT

const char* OH_MD_KEY_COPYRIGHT

Description

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

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 10

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

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

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

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

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

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.

This key is used to set the display height of a video frame when Configure is called during video encoding and decoding.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Deprecated from: 14

Substitute: OH_NativeWindow_NativeWindowSetScalingModeV2

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

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

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

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

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

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

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

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

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

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. This key is optional and used only in the configuration phase.

If enabled, the input and output data held by the video encoder or decoder does not exceed the amount required by the codec standard.

If supported by the platform, the video decoder outputs frames in the decoding sequence when low-latency video codec is enabled.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 12

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

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 9

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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.

Before calling OH_VideoDecoder_Start, you must call OH_VideoDecoder_Prepare.

If Color Space Conversion (CSC) is supported and this key is configured, the video decoder automatically transcodes the HDR Vivid video to the specified color space.

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

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

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

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.

The width and height parsed from the OH_AVFormat instance are aligned, which are different from OH_MD_KEY_WIDTH and OH_MD_KEY_HEIGHT set by calling Configure.

For details about the image arrangement and usage examples of width, height, wStride, and hStride, see step 8 in buffer mode in Video Encoding or step 11 in buffer mode in Video Decoding.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 12

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.

The width and height parsed from the OH_AVFormat instance are aligned, which are different from OH_MD_KEY_WIDTH and OH_MD_KEY_HEIGHT set by calling Configure.

For details about the image arrangement and usage examples of width, height, wStride, and hStride, see step 8 in buffer mode in Video Encoding or step 11 in buffer mode in Video Decoding.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 12

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.

For details about the image arrangement and usage examples of width, height, wStride, and hStride, see step 8 in buffer mode in Video Encoding or step 11 in buffer mode in Video Decoding.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 12

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.

For details about the image arrangement and usage examples of width, height, wStride, and hStride, see step 8 in buffer mode in Video Encoding or step 11 in buffer mode in Video Decoding.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 12

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.

This key is used to set the display width of a video frame when Configure is called during video encoding and decoding.

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

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

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

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

OH_MD_KEY_CREATION_TIME

const char* OH_MD_KEY_CREATION_TIME

Description

Pointer to the key that describes the media file creation time. The value type is string. The value must be in the UTC time format complying with ISO 8601. An example time format is 2024-12-28T00:00:00:000000Z.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 14

OH_MD_KEY_VIDEO_DECODER_OUTPUT_ENABLE_VRR

const char* OH_MD_KEY_VIDEO_DECODER_OUTPUT_ENABLE_VRR

Description

Pointer to the key that specifies whether the decoder enables the video variable frame rate feature. The value type is int32_t. The value 1 means that the video variable frame rate feature is enabled, and 0 means the opposite.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 15

OH_MD_KEY_VIDEO_ENCODER_REPEAT_PREVIOUS_FRAME_AFTER

const char* OH_MD_KEY_VIDEO_ENCODER_REPEAT_PREVIOUS_FRAME_AFTER

Description

Pointer to the key that specifies the duration (in milliseconds) for which the last frame will be resubmitted repeatedly, if no new frame is available after the previous frame is submitted to the encoder. The value type is int32_t.

This key is used only in the configuration phase of video encoding in surface mode.

ValueDescription
Less than or equal to 0The request is intercepted in the configuration phase and ERROR AV_ERR_INVALID_VAL is returned.
Greater than 0The last frame will be resubmitted repeatedly in the specified duration, measured in milliseconds.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 18

OH_MD_KEY_VIDEO_ENCODER_REPEAT_PREVIOUS_MAX_COUNT

const char* OH_MD_KEY_VIDEO_ENCODER_REPEAT_PREVIOUS_MAX_COUNT

Description

Pointer to the key that describes the maximum number of times the encoder can repeat encoding the previous frame when no new frame is available. The value type is int32_t.

This key takes effect only when OH_MD_KEY_VIDEO_ENCODER_REPEAT_PREVIOUS_FRAME_AFTER is available and is used only in the configuration phase.

ValueDescription
0The request is intercepted in the configuration phase and ERROR AV_ERR_INVALID_VAL is returned.
Less than 0If no new frame is available, the encoder repeatedly encodes the previous frame until the upper limit of the system is reached.
Greater than 0If no new frame is available, the encoder repeatedly encodes the previous frame until the maximum number specified is reached.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 18

你可能感兴趣的鸿蒙文章

harmony 鸿蒙AVCodec Kit

harmony 鸿蒙AVCapability

harmony 鸿蒙AVDemuxer

harmony 鸿蒙AVMuxer

harmony 鸿蒙AVSource

harmony 鸿蒙AudioCodec

harmony 鸿蒙AudioDecoder

harmony 鸿蒙AudioEncoder

harmony 鸿蒙Core

harmony 鸿蒙DrmSubsample

  • 所属分类: 后端技术
  • 本文标签: 鸿蒙 软件
  • 版权声明: 本文链接 https://seaxiang.com/blog/D5w4TA