CodecBase

Overview

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

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 9

Summary

Files

Name Description
avcodec_audio_channel_layout.h Declares the enums used for audio codec.
native_avcodec_base.h Declare the native APIs used for basic audio and video muxing, demuxing, encoding, and decoding.

Structs

Name Description
struct  OH_AVCodecAsyncCallback Defines all the asynchronous callback function pointers of an OH_AVCodec instance.
struct  OH_AVCodecCallback Defines all the asynchronous callback function pointers of an OH_AVCodec instance.

Types

Name Description
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 output stream changes.
typedef void(* OH_AVCodecOnNeedInputData) (OH_AVCodec *codec, uint32_t index, OH_AVMemory *data, void *userData) Defines the pointer to the function that is called when new input data is required during the running of an OH_AVCodec instance. The function carries a buffer to fill in new input data.
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.
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_AVCodecAsyncCallbackOH_AVCodecAsyncCallback Defines all the asynchronous callback function pointers of an OH_AVCodec instance.
typedef struct OH_AVCodecCallbackOH_AVCodecCallback Defines all the asynchronous callback function pointers of an OH_AVCodec instance.
typedef enum OH_MediaTypeOH_MediaType Defines an enum that enumerates the media types.
typedef enum OH_AACProfileOH_AACProfile Defines an enum that enumerates the Advanced Audio Coding (AAC) profiles.
typedef enum OH_AVCProfileOH_AVCProfile Defines an enum that enumerates the Advanced Video Coding (AVC) profiles.
typedef enum OH_HEVCProfileOH_HEVCProfile Defines an enum that enumerates the High Efficiency Video Coding (HEVC) profiles.
typedef enum OH_AVOutputFormatOH_AVOutputFormat Defines an enum that enumerates the output file formats of a muxer.
typedef enum OH_AVSeekModeOH_AVSeekMode Defines an enum that enumerates the seek modes.
typedef enum OH_ScalingModeOH_ScalingMode Defines an enum that enumerates the scaling modes.
typedef enum OH_BitsPerSampleOH_BitsPerSample Defines an enum that enumerates the number of audio bits for each coded sample.
typedef enum OH_ColorPrimaryOH_ColorPrimary Defines an enum that enumerates the primary colors.
typedef enum OH_TransferCharacteristicOH_TransferCharacteristic Defines an enum that enumerates the transfer characteristics.
typedef enum OH_MatrixCoefficientOH_MatrixCoefficient Defines an enum that enumerates the matrix coefficients.

Enums

Name Description
AudioChannelSet : uint64_t {
FRONT_LEFT = 1ULL << 0U,
FRONT_RIGHT = 1ULL << 1U,
FRONT_CENTER = 1ULL << 2U,
LOW_FREQUENCY = 1ULL << 3U,
BACK_LEFT = 1ULL << 4U,
BACK_RIGHT = 1ULL << 5U,
FRONT_LEFT_OF_CENTER = 1ULL << 6U,
FRONT_RIGHT_OF_CENTER = 1ULL << 7U,
BACK_CENTER = 1ULL << 8U,
SIDE_LEFT = 1ULL << 9U,
SIDE_RIGHT = 1ULL << 10U,
TOP_CENTER = 1ULL << 11U,
TOP_FRONT_LEFT = 1ULL << 12U,
TOP_FRONT_CENTER = 1ULL << 13U,
TOP_FRONT_RIGHT = 1ULL << 14U,
TOP_BACK_LEFT = 1ULL << 15U,
TOP_BACK_CENTER = 1ULL << 16U,
TOP_BACK_RIGHT = 1ULL << 17U,
STEREO_LEFT = 1ULL << 29U,
STEREO_RIGHT = 1ULL << 30U,
WIDE_LEFT = 1ULL << 31U,
WIDE_RIGHT = 1ULL << 32U,
SURROUND_DIRECT_LEFT = 1ULL << 33U,
SURROUND_DIRECT_RIGHT = 1ULL << 34U,
LOW_FREQUENCY_2 = 1ULL << 35U,
TOP_SIDE_LEFT = 1ULL << 36U,
TOP_SIDE_RIGHT = 1ULL << 37U,
BOTTOM_FRONT_CENTER = 1ULL << 38U,
BOTTOM_FRONT_LEFT = 1ULL << 39U,
BOTTOM_FRONT_RIGHT = 1ULL << 40U,
AMBISONICS_ACN0 = 1ULL << 41U,
AMBISONICS_ACN1 = 1ULL << 42U,
AMBISONICS_ACN2 = 1ULL << 43U,
AMBISONICS_ACN3 = 1ULL << 44U,
AMBISONICS_W = AMBISONICS_ACN0,
AMBISONICS_Y = AMBISONICS_ACN1,
AMBISONICS_Z = AMBISONICS_ACN2,
AMBISONICS_X = AMBISONICS_ACN3,
AMBISONICS_ACN4 = 1ULL << 45U,
AMBISONICS_ACN5 = 1ULL << 46U,
AMBISONICS_ACN6 = 1ULL << 47U,
AMBISONICS_ACN7 = 1ULL << 48U,
AMBISONICS_ACN8 = 1ULL << 49U,
AMBISONICS_ACN9 = 1ULL << 50U,
AMBISONICS_ACN10 = 1ULL << 51U,
AMBISONICS_ACN11 = 1ULL << 52U,
AMBISONICS_ACN12 = 1ULL << 53U,
AMBISONICS_ACN13 = 1ULL << 54U,
AMBISONICS_ACN14 = 1ULL << 55U,
AMBISONICS_ACN15 = 1ULL << 56U
}
Enumerates the audio channel sets. Each channel number is mapped to a variable of int64.
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.
OH_MediaType {
MEDIA_TYPE_AUD = 0,
MEDIA_TYPE_VID = 1
}
Enumerates the media types.
OH_AACProfile { AAC_PROFILE_LC = 0 } Enumerates the AAC profiles.
OH_AVCProfile {
AVC_PROFILE_BASELINE = 0,
AVC_PROFILE_HIGH = 4,
AVC_PROFILE_MAIN = 8
}
Enumerates the AVC profiles.
OH_HEVCProfile {
HEVC_PROFILE_MAIN = 0,
HEVC_PROFILE_MAIN_10 = 1,
HEVC_PROFILE_MAIN_STILL = 2,
HEVC_PROFILE_MAIN_10_HDR10 = 3,
HEVC_PROFILE_MAIN_10_HDR10_PLUS = 4
}
Enumerates the HEVC profiles.
OH_AVOutputFormat {
AV_OUTPUT_FORMAT_DEFAULT = 0,
AV_OUTPUT_FORMAT_MPEG_4 = 2,
AV_OUTPUT_FORMAT_M4A = 6
}
Enumerates the output file formats of a muxer.
OH_AVSeekMode {
SEEK_MODE_NEXT_SYNC = 0,
SEEK_MODE_PREVIOUS_SYNC,
SEEK_MODE_CLOSEST_SYNC
}
Enumerates the seek modes.
OH_ScalingMode {
SCALING_MODE_SCALE_TO_WINDOW = 1,
SCALING_MODE_SCALE_CROP = 2
}
Enumerates the scaling modes.
OH_BitsPerSample {
SAMPLE_U8 = 0, SAMPLE_S16LE = 1,
SAMPLE_S24LE = 2, SAMPLE_S32LE = 3,
SAMPLE_F32LE = 4, SAMPLE_U8P = 5,
SAMPLE_S16P = 6, SAMPLE_S24P = 7,
SAMPLE_S32P = 8, SAMPLE_F32P = 9,
INVALID_WIDTH = -1
}
Enumerates the number of audio bits for each coded sample.
OH_ColorPrimary {
COLOR_PRIMARY_BT709 = 1,
COLOR_PRIMARY_UNSPECIFIED = 2,
COLOR_PRIMARY_BT470_M = 4,
COLOR_PRIMARY_BT601_625 = 5,
COLOR_PRIMARY_BT601_525 = 6,
COLOR_PRIMARY_SMPTE_ST240 = 7,
COLOR_PRIMARY_GENERIC_FILM = 8,
COLOR_PRIMARY_BT2020 = 9,
COLOR_PRIMARY_SMPTE_ST428 = 10,
COLOR_PRIMARY_P3DCI = 11,
COLOR_PRIMARY_P3D65 = 12
}
Enumerates the primary colors.
OH_TransferCharacteristic {
TRANSFER_CHARACTERISTIC_BT709 = 1,
TRANSFER_CHARACTERISTIC_UNSPECIFIED = 2,
TRANSFER_CHARACTERISTIC_GAMMA_2_2 = 4,
TRANSFER_CHARACTERISTIC_GAMMA_2_8 = 5,
TRANSFER_CHARACTERISTIC_BT601 = 6,
TRANSFER_CHARACTERISTIC_SMPTE_ST240 = 7,
TRANSFER_CHARACTERISTIC_LINEAR = 8,
TRANSFER_CHARACTERISTIC_LOG = 9,
TRANSFER_CHARACTERISTIC_LOG_SQRT = 10,
TRANSFER_CHARACTERISTIC_IEC_61966_2_4 = 11,
TRANSFER_CHARACTERISTIC_BT1361 = 12,
TRANSFER_CHARACTERISTIC_IEC_61966_2_1 = 13,
TRANSFER_CHARACTERISTIC_BT2020_10BIT = 14,
TRANSFER_CHARACTERISTIC_BT2020_12BIT = 15,
TRANSFER_CHARACTERISTIC_PQ = 16,
TRANSFER_CHARACTERISTIC_SMPTE_ST428 = 17,
TRANSFER_CHARACTERISTIC_HLG = 18
}
Enumerates the transfer characteristics.
OH_MatrixCoefficient {
MATRIX_COEFFICIENT_IDENTITY = 0,
MATRIX_COEFFICIENT_BT709 = 1,
MATRIX_COEFFICIENT_UNSPECIFIED = 2,
MATRIX_COEFFICIENT_FCC = 4,
MATRIX_COEFFICIENT_BT601_625 = 5,
MATRIX_COEFFICIENT_BT601_525 = 6, MATRIX_COEFFICIENT_SMPTE_ST240 = 7,
MATRIX_COEFFICIENT_YCGCO = 8,
MATRIX_COEFFICIENT_BT2020_NCL = 9,
MATRIX_COEFFICIENT_BT2020_CL = 10,
MATRIX_COEFFICIENT_SMPTE_ST2085 = 11,
MATRIX_COEFFICIENT_CHROMATICITY_NCL = 12,
MATRIX_COEFFICIENT_CHROMATICITY_CL = 13,
MATRIX_COEFFICIENT_ICTCP = 14
}
Enumerates the matrix coefficients.

Variables

Name Description
const char * OH_AVCODEC_MIMETYPE_VIDEO_AVC Defines the pointer to the Multipurpose Internet Mail Extension (MIME) type of AVC (H.264) video codec.
const char * OH_AVCODEC_MIMETYPE_AUDIO_AAC Defines the pointer to the MIME type of AAC audio codec.
const char * OH_AVCODEC_MIMETYPE_AUDIO_FLAC Defines the pointer to the MIME type of Free Lossless Audio Codec (FLAC) audio codec.
const char * OH_AVCODEC_MIMETYPE_AUDIO_VORBIS Defines the pointer to the MIME type of Vorbis audio decoder.
const char * OH_AVCODEC_MIMETYPE_AUDIO_MPEG Defines the pointer to the MIME type of MP3 audio decoder.
const char * OH_AVCODEC_MIMETYPE_VIDEO_HEVC Defines the pointer to the MIME type of HEVC (H.265) video codec.
const char * OH_AVCODEC_MIMETYPE_VIDEO_MPEG4 Defines the pointer to the MIME type of MPEG4 video encoder, which is used only for muxing MPEG4 video streams.
const char * OH_AVCODEC_MIMETYPE_IMAGE_JPG Defines the pointer to the MIME type of JPG image encoder, which is used only for muxing JPG covers.
const char * OH_AVCODEC_MIMETYPE_IMAGE_PNG Defines the pointer to the MIME type of PNG image encoder, which is used only for muxing PNG covers.
const char * OH_AVCODEC_MIMETYPE_IMAGE_BMP Defines the pointer to the MIME type of BMP image encoder, which is used only for muxing BMP covers.
const char * OH_AVCODEC_MIMETYPE_AUDIO_VIVID Defines the pointer to the MIME type of Audio Vivid audio decoder. (This specification is not available yet.)
const char * OH_AVCODEC_MIMETYPE_AUDIO_AMR_NB Defines the pointer to the MIME type of AMR-NB audio decoder.
const char * OH_AVCODEC_MIMETYPE_AUDIO_AMR_WB Defines the pointer to the MIME type of AMR-WB audio decoder.
const char * OH_AVCODEC_MIMETYPE_AUDIO_OPUS Defines the pointer to the MIME type of Opus audio codec. (This specification is not available yet.)
const char * OH_AVCODEC_MIMETYPE_AUDIO_G711MU Defines the pointer to the MIME type of G.711 mu-law audio codec.
const char * OH_ED_KEY_TIME_STAMP Defines the pointer to the timestamp in the extra data of the surface. The value type is int64.
const char * OH_ED_KEY_EOS Defines the pointer to the end of stream (EOS) in the extra data of the surface. The value type is Boolean.
const char * OH_MD_KEY_TRACK_TYPE Defines the pointer to the track type. The value type is uint8_t. For details, see OH_MediaType.
const char * OH_MD_KEY_CODEC_MIME Define the pointer to the MIME type of codec. The value type is string.
const char * OH_MD_KEY_DURATION Defines the pointer to the duration. The value type is int64_t.
const char * OH_MD_KEY_BITRATE Defines the pointer to the bit rate. The value type is int64_t.
const char * OH_MD_KEY_MAX_INPUT_SIZE Defines the pointer to the maximum input size. The value type is uint32_t.
const char * OH_MD_KEY_WIDTH Defines the pointer to the video width. The value type is uint32_t.
const char * OH_MD_KEY_HEIGHT Defines the pointer to the video height. The value type is uint32_t.
const char * OH_MD_KEY_PIXEL_FORMAT Defines the pointer to the video pixel format. The value type is int32_t. For details, see OH_AVPixelFormat.
const char * OH_MD_KEY_AUDIO_SAMPLE_FORMAT Defines the pointer to the original audio format. The value type is uint32_t.
const char * OH_MD_KEY_FRAME_RATE Defines the pointer to the video frame rate. The value type is double.
const char * OH_MD_KEY_VIDEO_ENCODE_BITRATE_MODE Defines the pointer to the video encoding bit rate mode. The value type is int32_t. For details, see OH_VideoEncodeBitrateMode.
const char * OH_MD_KEY_PROFILE Defines the pointer to the encoding template. The value type is number. For details, see OH_HEVCProfile and OH_AACProfile.
const char * OH_MD_KEY_AUD_CHANNEL_COUNT Defines the pointer to the number of audio channels. The value type is uint32_t.
const char * OH_MD_KEY_AUD_SAMPLE_RATE Defines the pointer to the audio sampling rate. The value type is uint32_t.
const char * OH_MD_KEY_I_FRAME_INTERVAL Defines the pointer to the key frame interval, in milliseconds. The value type is int32_t.
const char * OH_MD_KEY_ROTATION Defines the pointer to 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.
const char * OH_MD_KEY_RANGE_FLAG Defines the pointer to the video YUV value range flag. The value type is Boolean.
const char * OH_MD_KEY_COLOR_PRIMARIES Defines the pointer to the video primary color. The value type is int32_t. For details, see OH_ColorPrimary.
const char * OH_MD_KEY_TRANSFER_CHARACTERISTICS Defines the pointer to the video transfer characteristics. The value type is int32_t. For details, see OH_TransferCharacteristic.
const char * OH_MD_KEY_MATRIX_COEFFICIENTS Defines the pointer to the video matrix coefficient. The value type is int32_t. For details, see OH_MatrixCoefficient.
const char * OH_MD_KEY_REQUEST_I_FRAME Defines the pointer to the request for immediate encoding of I-frames. The value type is Boolean.
const char * OH_MD_KEY_QUALITY Defines the pointer to the required encoding quality. The value type is uint32_t. This key applies only to encoders configured in constant quality mode.
const char * OH_MD_KEY_CODEC_CONFIG Defines the pointer to the codec-specific data. The value type is uint8_t.
const char * OH_MD_KEY_TITLE Defines the pointer to the title of the input media. The value type is string.
const char * OH_MD_KEY_ARTIST Defines the pointer to the artist of the input media. The value type is string.
const char * OH_MD_KEY_ALBUM Defines the pointer to the album of the input media. The value type is string.
const char * OH_MD_KEY_ALBUM_ARTIST Defines the pointer to the album artist of the input media. The value type is string.
const char * OH_MD_KEY_DATE Defines the pointer to the date of the input media. The value type is string.
const char * OH_MD_KEY_COMMENT Defines the pointer to the comment of the input media. The value type is string.
const char * OH_MD_KEY_GENRE Defines the pointer to the genre of the input media. The value type is string.
const char * OH_MD_KEY_COPYRIGHT Defines the pointer to the copyright of the input media. The value type is string.
const char * OH_MD_KEY_LANGUAGE Defines the pointer to the language of the input media. The value type is string.
const char * OH_MD_KEY_DESCRIPTION Defines the pointer to the description of the input media. The value type is string.
const char * OH_MD_KEY_LYRICS Defines the pointer to the lyrics of the input media. The value type is string.
const char * OH_MD_KEY_TRACK_COUNT Defines the pointer to the track count of the input media. The value type is uint32_t.
const char * OH_MD_KEY_CHANNEL_LAYOUT Defines the pointer to the required encoding channel layout. The value type is int64_t. This key applies only to encoders.
const char * OH_MD_KEY_BITS_PER_CODED_SAMPLE Defines the pointer to the number of bits for each coded sample. The value type is uint32_t. This key applies to FLAC encoders. For details, see OH_BitsPerSample.
const char * OH_MD_KEY_AAC_IS_ADTS Defines the pointer to the AAC format. The value type is uint32_t. This key applies to AAC decoders.
const char * OH_MD_KEY_SBR Defines the pointer to the AAC SBR format. The value type is uint32_t. This key applies to AAC encoders.
const char * OH_MD_KEY_COMPLIANCE_LEVEL Defines the pointer to the FLAC compliance level. The value type is int32_t.
const char * OH_MD_KEY_IDENTIFICATION_HEADER Defines the pointer to the Vorbis identification header. The value type is uint8_t. This key applies only to Vorbis decoders.
const char * OH_MD_KEY_SETUP_HEADER Defines the pointer to the Vorbis setup header. The value type is uint8_t. This key applies only to Vorbis decoders.
const char * OH_MD_KEY_SCALING_MODE Defines the pointer to the video surface scale mode. The value type is int32_t. For details, see OH_ScalingMode.
const char * OH_MD_MAX_INPUT_BUFFER_COUNT Defines the pointer to the maximum number of input buffers. The value type is int32_t.
const char * OH_MD_MAX_OUTPUT_BUFFER_COUNT Defines the pointer to the maximum number of output buffers. The value type is int32_t.
const char * OH_MD_KEY_AUDIO_COMPRESSION_LEVEL Defines the pointer to the audio codec compression level. The value type is uint32_t.
const char * OH_MD_KEY_VIDEO_IS_HDR_VIVID Defines the pointer to indicate whether it is HDR Vivid. The value type is Boolean.
const char * OH_MD_KEY_AUDIO_OBJECT_NUMBER Defines the pointer to the number of audio objects. The value type is int32_t.
const char * OH_MD_KEY_AUDIO_VIVID_METADATA Defines the pointer to the Audio Vivid metadata. The value type is uint8_t.

Type Description

OH_AACProfile

typedef enum OH_AACProfileOH_AACProfile

Description

Defines an enum that enumerates the AAC profiles.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 9

OH_AVCodecAsyncCallback

typedef struct OH_AVCodecAsyncCallbackOH_AVCodecAsyncCallback

Description

Defines a struct for all the asynchronous callback function pointers of an OH_AVCodec instance. To ensure the normal running of OH_AVCodec, you must register the instance of this struct with the OH_AVCodec instance and process the information reported by the callback function.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 9

Deprecated from: 11

Substitute: OH_AVCodecCallback

Parameters

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

OH_AVCodecCallback

typedef struct OH_AVCodecCallbackOH_AVCodecCallback

Description

Defines a struct for all the asynchronous callback function pointers of an OH_AVCodec instance. To ensure the normal running of OH_AVCodec, you must register the instance of this struct with the OH_AVCodec instance and process the information reported by the callback function.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 11

Parameters

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

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.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 9

Parameters

Name Description
codec Pointer to an OH_AVCodec instance.
errorCode Error code.
userData Pointer to user-specific data.

OH_AVCodecOnNeedInputBuffer

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

Description

Defines the pointer to the function that is called when new input data is required during the running of an OH_AVCodec instance. The function carries a buffer to fill in new input data.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 11

Parameters

Name Description
codec Pointer to an OH_AVCodec instance.
index Index of the new input buffer.
buffer Pointer to the data to fill in the new input buffer.
userData Pointer to user-specific data.

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 version: 11

Substitute: OH_AVCodecOnNeedInputBuffer

Parameters

Name Description
codec Pointer to an OH_AVCodec instance.
index Index of the new input buffer.
data Pointer to the data to fill in the new input buffer.
userData Pointer to user-specific data.

OH_AVCodecOnNewOutputBuffer

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

Description

Defines the pointer to the function that is called when new output data is generated during the running of an OH_AVCodec instance. The function carries a buffer filled with new output data.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 11

Parameters

Name Description
codec Pointer to an OH_AVCodec instance.
index Index of the new output buffer.
buffer Pointer to the data filled in the new output buffer.
userData Pointer to user-specific data.

OH_AVCodecOnNewOutputData

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

Description

Defines the pointer to the function that is called when new output data is generated during the running of an OH_AVCodec instance. The function carries a buffer filled with new output data. Note that the lifecycle of the pointer to the OH_AVCodecBufferAttr instance is valid only when the function pointer is being called. Do not access the pointer to the instance after the function pointer is called.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 9

Deprecated from: 11

Substitute: OH_AVCodecOnNewOutputBuffer

Parameters

Name Description
codec Pointer to an OH_AVCodec instance.
index Index of the new output buffer.
data Pointer to the data filled in the new output buffer.
attr Pointer to the description information about the new output buffer. For details, see OH_AVCodecBufferAttr.
userData Pointer to user-specific data.

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 output stream changes. Note that the lifecycle of the pointer to the OH_AVFormat instance is valid only when the function pointer is being called. Do not access the pointer to the instance after the function pointer is called.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 9

Parameters

Name Description
codec Pointer to an OH_AVCodec instance.
format Pointer to the description information about the new output stream.
userData Pointer to user-specific data.

OH_AVCProfile

typedef enum OH_AVCProfileOH_AVCProfile

Description

Defines an enum that enumerates the AVC profiles.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 9

OH_AVOutputFormat

typedef enum OH_AVOutputFormatOH_AVOutputFormat

Description

Defines an enum that enumerates the output file formats of a muxer.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 10

OH_AVSeekMode

typedef enum OH_AVSeekModeOH_AVSeekMode

Description

Defines an enum that enumerates the seek modes.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 10

OH_BitsPerSample

typedef enum OH_BitsPerSampleOH_BitsPerSample

Description

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

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 10

OH_ColorPrimary

typedef enum OH_ColorPrimaryOH_ColorPrimary

Description

Defines an enum that enumerates the primary colors.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 10

OH_HEVCProfile

typedef enum OH_HEVCProfileOH_HEVCProfile

Description

Defines an enum that enumerates the HEVC profiles.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 10

OH_MatrixCoefficient

typedef enum OH_MatrixCoefficientOH_MatrixCoefficient

Description

Defines an enum that enumerates the matrix coefficients.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 10

OH_MediaType

typedef enum OH_MediaTypeOH_MediaType

Description

Defines an enum that enumerates the media types.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 9

OH_ScalingMode

typedef enum OH_ScalingModeOH_ScalingMode

Description

Defines an enum that enumerates the scaling modes.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 10

OH_TransferCharacteristic

typedef enum OH_TransferCharacteristicOH_TransferCharacteristic

Description

Defines an enum that enumerates the transfer characteristics.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 10

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

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

AudioChannelSet

enum AudioChannelSet : uint64_t

Description

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

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 10

Deprecated from: 11. Use OH_AudioChannelSet instead.

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

OH_AACProfile

enum OH_AACProfile

Description

Enumerates the AAC profiles.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 9

Value Description
AAC_PROFILE_LC Low complexity level.

OH_AVCProfile

enum OH_AVCProfile

Description

Enumerates the AVC profiles.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 9

Value Description
AVC_PROFILE_BASELINE Baseline.
AVC_PROFILE_HIGH High.
AVC_PROFILE_MAIN Main.

OH_AVOutputFormat

enum OH_AVOutputFormat

Description

Enumerates the output file formats of a muxer.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 10

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

OH_AVSeekMode

enum OH_AVSeekMode

Description

Enumerates the seek modes.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 10

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

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

OH_ColorPrimary

enum OH_ColorPrimary

Description

Enumerates the primary colors.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 10

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

OH_HEVCProfile

enum OH_HEVCProfile

Description

Enumerates the HEVC profiles.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 10

Value Description
HEVC_PROFILE_MAIN Main.
HEVC_PROFILE_MAIN_10 Main 10.
HEVC_PROFILE_MAIN_STILL Main Still Picture.
HEVC_PROFILE_MAIN_10_HDR10 Main 10 HDR10.
HEVC_PROFILE_MAIN_10_HDR10_PLUS Main 10 HDR10+.

OH_MatrixCoefficient

enum OH_MatrixCoefficient

Description

Enumerates the matrix coefficients.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 10

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

OH_MediaType

enum OH_MediaType

Description

Enumerates the media types.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 9

Value Description
MEDIA_TYPE_AUD Audio track.
MEDIA_TYPE_VID Video track.

OH_ScalingMode

enum OH_ScalingMode

Description

Enumerates the scaling modes.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 10

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

OH_TransferCharacteristic

enum OH_TransferCharacteristic

Description

Enumerates the transfer characteristics.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 10

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

Variable Description

OH_AVCODEC_MIMETYPE_AUDIO_AAC

const char* OH_AVCODEC_MIMETYPE_AUDIO_AAC

Description

Defines the pointer to the MIME type of 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

Defines the pointer to the MIME type of 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

Defines the pointer to the MIME type of 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

Defines the pointer to the MIME type of FLAC audio codec.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 10

OH_AVCODEC_MIMETYPE_AUDIO_G711MU

const char* OH_AVCODEC_MIMETYPE_AUDIO_G711MU

Description

Defines the pointer to the MIME type of G.711 mu-law audio codec.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 11

OH_AVCODEC_MIMETYPE_AUDIO_MPEG

const char* OH_AVCODEC_MIMETYPE_AUDIO_MPEG

Description

Defines the pointer to the MIME type of MP3 audio decoder.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 10

OH_AVCODEC_MIMETYPE_AUDIO_OPUS

const char* OH_AVCODEC_MIMETYPE_AUDIO_OPUS

Description

Defines the pointer to the MIME type of 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

Defines the pointer to the MIME type of 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

Defines the pointer to the MIME type of Vorbis audio decoder.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 10

OH_AVCODEC_MIMETYPE_IMAGE_BMP

const char* OH_AVCODEC_MIMETYPE_IMAGE_BMP

Description

Defines the pointer to the MIME type of BMP image encoder, which is used only for muxing BMP covers.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 10

OH_AVCODEC_MIMETYPE_IMAGE_JPG

const char* OH_AVCODEC_MIMETYPE_IMAGE_JPG

Description

Defines the pointer to the MIME type of JPG image encoder, which is used only for muxing JPG covers.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 10

OH_AVCODEC_MIMETYPE_IMAGE_PNG

const char* OH_AVCODEC_MIMETYPE_IMAGE_PNG

Description

Defines the pointer to the MIME type of PNG image encoder, which is used only for muxing PNG covers.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 10

OH_AVCODEC_MIMETYPE_VIDEO_AVC

const char* OH_AVCODEC_MIMETYPE_VIDEO_AVC

Description

Defines the pointer to the MIME type of 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

Defines the pointer to the MIME type of HEVC (H.265) video codec.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 10

OH_AVCODEC_MIMETYPE_VIDEO_MPEG4

const char* OH_AVCODEC_MIMETYPE_VIDEO_MPEG4

Description

Defines the pointer to the MIME type of MPEG4 video encoder, which is used only for muxing MPEG4 video streams.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 10

Deprecated from: 11

OH_ED_KEY_EOS

const char* OH_ED_KEY_EOS

Description

Defines the pointer to the EOS in the extra data of the surface. The value type is Boolean.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 9

OH_ED_KEY_TIME_STAMP

const char* OH_ED_KEY_TIME_STAMP

Description

Defines the pointer to the timestamp in the extra data of the surface. The value type is int64.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 9

OH_MD_KEY_AAC_IS_ADTS

const char* OH_MD_KEY_AAC_IS_ADTS

Description

Defines the pointer to the AAC format. The value type is uint32_t. This key applies to AAC decoders.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 10

OH_MD_KEY_ALBUM

const char* OH_MD_KEY_ALBUM

Description

Defines the pointer to the album of the input media. 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

Defines the pointer to the album artist of the input media. The value type is string.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 10

OH_MD_KEY_ARTIST

const char* OH_MD_KEY_ARTIST

Description

Defines the pointer to the artist of the input media. 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

Defines the pointer to the number of audio channels. The value type is uint32_t.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 9

OH_MD_KEY_AUD_SAMPLE_RATE

const char* OH_MD_KEY_AUD_SAMPLE_RATE

Description

Defines the pointer to the audio sampling rate. The value type is uint32_t.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 9

OH_MD_KEY_AUDIO_COMPRESSION_LEVEL

const char* OH_MD_KEY_AUDIO_COMPRESSION_LEVEL

Description

Defines the pointer to the audio codec compression level. The value type is uint32_t.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 11

OH_MD_KEY_AUDIO_OBJECT_NUMBER

const char* OH_MD_KEY_AUDIO_OBJECT_NUMBER

Description

Defines the pointer to the number of audio objects. The value type is int32_t.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 11

OH_MD_KEY_AUDIO_SAMPLE_FORMAT

const char* OH_MD_KEY_AUDIO_SAMPLE_FORMAT

Description

Defines the pointer to the original audio format. The value type is uint32_t.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 9

OH_MD_KEY_AUDIO_VIVID_METADATA

const char* OH_MD_KEY_AUDIO_VIVID_METADATA

Description

Defines the pointer to the Audio Vivid metadata. The value type is uint8_t.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 11

OH_MD_KEY_BITRATE

const char* OH_MD_KEY_BITRATE

Description

Defines the pointer to 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

Defines the pointer to the number of bits for each coded sample. The value type is uint32_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

Defines the pointer to the required encoding channel layout. The value type is int64_t. This key applies only to encoders.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 10

OH_MD_KEY_CODEC_CONFIG

const char* OH_MD_KEY_CODEC_CONFIG

Description

Defines the pointer to the codec-specific data. The value type is uint8_t.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 10

OH_MD_KEY_CODEC_MIME

const char* OH_MD_KEY_CODEC_MIME

Description

Define the pointer to the MIME type of 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

Defines the pointer to the video primary color. The value type is int32_t. For details, see OH_ColorPrimary.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 10

OH_MD_KEY_COMMENT

const char* OH_MD_KEY_COMMENT

Description

Defines the pointer to the comment of the input media. 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

Defines the pointer to the FLAC compliance level. The value type is int32_t.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 10

const char* OH_MD_KEY_COPYRIGHT

Description

Defines the pointer to the copyright of the input media. The value type is string.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 10

OH_MD_KEY_DATE

const char* OH_MD_KEY_DATE

Description

Defines the pointer to the date of the input media. The value type is string.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 10

OH_MD_KEY_DESCRIPTION

const char* OH_MD_KEY_DESCRIPTION

Description

Defines the pointer to the description of the input media. The value type is string.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 10

OH_MD_KEY_DURATION

const char* OH_MD_KEY_DURATION

Description

Defines the pointer to the duration. 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

Defines the pointer to the video frame rate. The value type is double.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 9

OH_MD_KEY_GENRE

const char* OH_MD_KEY_GENRE

Description

Defines the pointer to the genre of the input media. The value type is string.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 10

OH_MD_KEY_HEIGHT

const char* OH_MD_KEY_HEIGHT

Description

Defines the pointer to the video height. The value type is uint32_t.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 9

OH_MD_KEY_I_FRAME_INTERVAL

const char* OH_MD_KEY_I_FRAME_INTERVAL

Description

Defines the pointer to the key frame interval, in milliseconds. The value type is int32_t.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 9

OH_MD_KEY_IDENTIFICATION_HEADER

const char* OH_MD_KEY_IDENTIFICATION_HEADER

Description

Defines the pointer to 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

Defines the pointer to the language of the input media. The value type is string.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 10

OH_MD_KEY_LYRICS

const char* OH_MD_KEY_LYRICS

Description

Defines the pointer to the lyrics of the input media. 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

Defines the pointer to the video matrix coefficient. The value type is int32_t. For details, see OH_MatrixCoefficient.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 10

OH_MD_KEY_MAX_INPUT_SIZE

const char* OH_MD_KEY_MAX_INPUT_SIZE

Description

Defines the pointer to the maximum input size. The value type is uint32_t.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 9

OH_MD_KEY_PIXEL_FORMAT

const char* OH_MD_KEY_PIXEL_FORMAT

Description

Defines the pointer to 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

Defines the pointer to the encoding template. The value type is number. For details, see OH_HEVCProfile and OH_AACProfile.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 9

OH_MD_KEY_QUALITY

const char* OH_MD_KEY_QUALITY

Description

Defines the pointer to the required encoding quality. The value type is uint32_t. This key applies only to encoders configured 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

Defines the pointer to the video YUV value range flag. The value type is Boolean.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 10

OH_MD_KEY_REQUEST_I_FRAME

const char* OH_MD_KEY_REQUEST_I_FRAME

Description

Defines the pointer to the request for immediate encoding of I-frames. The value type is Boolean.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 10

OH_MD_KEY_ROTATION

const char* OH_MD_KEY_ROTATION

Description

Defines the pointer to 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.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 9

OH_MD_KEY_SBR

const char* OH_MD_KEY_SBR

Description

Defines the pointer to the AAC SBR format. The value type is uint32_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

Defines the pointer to the video surface scale mode. The value type is int32_t. For details, see OH_ScalingMode.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 10

OH_MD_KEY_SETUP_HEADER

const char* OH_MD_KEY_SETUP_HEADER

Description

Defines the pointer to 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

Defines the pointer to the title of the input media. 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

Defines the pointer to the track count of the input media. The value type is uint32_t.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 10

OH_MD_KEY_TRACK_TYPE

const char* OH_MD_KEY_TRACK_TYPE

Description

Defines the pointer to the track type. The value type is uint8_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

Defines the pointer to the video transfer characteristics. The value type is int32_t. For details, see OH_TransferCharacteristic.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 10

OH_MD_KEY_VIDEO_ENCODE_BITRATE_MODE

const char* OH_MD_KEY_VIDEO_ENCODE_BITRATE_MODE

Description

Defines the pointer to the video encoding bit rate mode. The value type is int32_t. For details, see OH_VideoEncodeBitrateMode.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 9

OH_MD_KEY_VIDEO_IS_HDR_VIVID

const char* OH_MD_KEY_VIDEO_IS_HDR_VIVID

Description

Defines the pointer to indicate whether it is HDR Vivid. The value type is Boolean.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 11

OH_MD_KEY_WIDTH

const char* OH_MD_KEY_WIDTH

Description

Defines the pointer to the video width. The value type is uint32_t.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 9

OH_MD_MAX_INPUT_BUFFER_COUNT

const char* OH_MD_MAX_INPUT_BUFFER_COUNT

Description

Defines the pointer to 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

Defines the pointer to the maximum number of output buffers. The value type is int32_t.

System capability: SystemCapability.Multimedia.Media.CodecBase

Since: 10