harmony 鸿蒙native_avcodec_base.h

2023-06-24 浏览 (902)

native_avcodec_base.h

Overview

The native_avcodec_base.h file declares the common structs, character constants, and enums for running OH_AVCodec instances.

Since

9

Related Modules

CodecBase

Summary

Structs

NameDescription
OH_AVCodecBufferAttrDefines the description information about the buffer of an OH_AVCodec instance.
OH_AVCodecAsyncCallbackDefines all the asynchronous callback function pointers of an OH_AVCodec instance.

Types

NameDescription
OH_AVCodecBufferFlagsDefines an enum that enumerates the flags for the buffer of an OH_AVCodec instance.
OH_AVOutputFormatDefines an enum that enumerates the output file formats of a muxer.
OH_AVCodecBufferAttrDefines a struct for the description information about the buffer of an OH_AVCodec instance.
(*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.
(*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.
(*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.
(*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.
OH_AVCodecAsyncCallbackDefines a struct for all the asynchronous callback function pointers of an OH_AVCodec instance.
OH_MediaTypeDefines an enum that enumerates the media types.
OH_AVCProfileDefines an enum that enumerates the Advanced Video Coding (AVC) profiles.
OH_HEVCProfileDefines an enum that enumerates the High Efficiency Video Coding (HEVC) profiles.
OH_AACProfileDefines an enum that enumerates the Advanced Audio Coding (AAC) profiles.
OH_AVSeekModeDefines an enum that enumerates the seek modes.
OH_ColorPrimaryDefines an enum that enumerates the primary colors.
OH_TransferCharacteristicDefines an enum that enumerates the transfer characteristics.
OH_MatrixCoefficientDefines an enum that enumerates the matrix coefficients.
OH_BitsPerSampleDefines an enum that enumerates the number of audio bits for each coded sample.

Enums

NameDescription
OH_AVCodecBufferFlags {
    AVCODEC_BUFFER_FLAGS_NONE = 0,
    AVCODEC_BUFFER_FLAGS_EOS = 1 << 0,
    AVCODEC_BUFFER_FLAGS_SYNC_FRAME = 1 << 1,
    AVCODEC_BUFFER_FLAGS_INCOMPLETE_FRAME = 1 << 2,
    AVCODEC_BUFFER_FLAGS_CODEC_DATA = 1 << 3
}
Enumerates the flags for the buffer of an OH_AVCodec instance.
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_MediaType {
    MEDIA_TYPE_AUD = 0,
    MEDIA_TYPE_VID = 1
}
Enumerates the media types.
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_AACProfile {
    AAC_PROFILE_LC = 0
}
Enumerates the AAC profiles.
OH_AVSeekMode {
    SEEK_MODE_NEXT_SYNC = 0,
    SEEK_MODE_PREVIOUS_SYNC,
    SEEK_MODE_CLOSEST_SYNC
}
Enumerates the seek modes.
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_BitsPerSample {
    SAMPLE_U8 = 0,
    SAMPLE_S16LE = 1,
    SAMPLE_S24LE = 2,
    SAMPLE_S32LE = 3,
    SAMPLE_F32LE = 4,i
    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.

Variables

NameDescription
OH_AVCodecBufferAttr::ptsDefines the display timestamp of the buffer, in microseconds.
OH_AVCodecBufferAttr::sizeDefines the size of data contained in the buffer, in bytes.
OH_AVCodecBufferAttr::offsetDefines the offset of valid data in the buffer.
OH_AVCodecBufferAttr::flagsDefines the flags of the buffer. It is a combination of multiple OH_AVCodecBufferFlags.
OH_AVCodecAsyncCallback::onErrorDefines the callback used to report a codec operation error. For details, see OH_AVCodecOnError.
OH_AVCodecAsyncCallback::onStreamChangedDefines the callback used to report a codec stream change. For details, see OH_AVCodecOnStreamChanged.
OH_AVCodecAsyncCallback::onNeedInputDataDefines the callback used to report input data required. For details, see OH_AVCodecOnNeedInputData.
OH_AVCodecAsyncCallback::onNeedOutputDataDefines the callback used to report output data generated. For details, see OH_AVCodecOnNewOutputData.
*OH_AVCODEC_MIMETYPE_VIDEO_AVCDefines the pointer to the Multipurpose Internet Mail Extension (MIME) type for AVC video codec.
*OH_AVCODEC_MIMETYPE_AUDIO_AACDefines the pointer to the MIME type for AAC audio codec.
*OH_AVCODEC_MIMETYPE_VIDEO_MPEG4Defines the pointer to the MIME type for MPEG4 video codec.
*OH_AVCODEC_MIMETYPE_VIDEO_HEVCDefines the pointer to the MIME type for HEVC video codec.
*OH_AVCODEC_MIMETYPE_AUDIO_MPEGDefines the pointer to the MIME type for MPEG audio codec.
*OH_AVCODEC_MIMETYPE_IMAGE_JPGDefines the pointer to the MIME type for JPG image codec.
*OH_AVCODEC_MIMETYPE_IMAGE_PNGDefines the pointer to the MIME type for PNG image codec.
*OH_AVCODEC_MIMETYPE_IMAGE_BMPDefines the pointer to the MIME type for BMP image codec.
*OH_AVCODEC_MIMETYPE_AUDIO_FLACDefines the pointer to the MIME type for FLAC audio codec.
*OH_AVCODEC_MIMETYPE_AUDIO_VORBISDefines the pointer to the MIME type for VORBIS audio codec.
*OH_ED_KEY_TIME_STAMPDefines the pointer to the timestamp in the extra data of the surface. The value type is int64.
*OH_ED_KEY_EOSDefines the pointer to the end of stream (EOS) in the extra data of the surface. The value type is Boolean.
*OH_MD_KEY_TRACK_TYPEDefines the pointer to a container for storing media descriptions.
*OH_MD_KEY_CODEC_MIMEDefine the pointer to the MIME type of codec. The value is a string.
*OH_MD_KEY_DURATIONDefines the pointer to the duration. The value type is int64_t.
*OH_MD_KEY_BITRATEDefines the pointer to the bit rate. The value type is uint32_t.
*OH_MD_KEY_MAX_INPUT_SIZEDefines the pointer to the maximum input size. The value type is uint32_t.
*OH_MD_KEY_WIDTHDefines the pointer to the video width. The value type is uint32_t.
*OH_MD_KEY_HEIGHTDefines the pointer to the video height. The value type is uint32_t.
*OH_MD_KEY_PIXEL_FORMATDefines the pointer to the video pixel format. The value type is int32_t. For details, see OH_AVPixelFormat.
*OH_MD_KEY_RANGE_FLAGDefines the pointer to the video YUV value range flag. The value type is Boolean.
*OH_MD_KEY_COLOR_PRIMARIESDefines the pointer to the primary color of the video. The value type is int32_t.
*OH_MD_KEY_TRANSFER_CHARACTERISTICSDefines the pointer to the video transfer characteristics. The value type is int32_t.
*OH_MD_KEY_MATRIX_COEFFICIENTSDefines the pointer to the video matrix coefficient. The value type is int32_t.
*OH_MD_KEY_AUDIO_SAMPLE_FORMATDefines the pointer to the original audio format. The value type is uint32_t.
*OH_MD_KEY_FRAME_RATEDefines the pointer to the video frame rate. The value is a double-precision floating point number.
*OH_MD_KEY_VIDEO_ENCODE_BITRATE_MODEDefines the pointer to the video encoding bit rate mode. The value type is int32_t. For details, see OH_VideoEncodeBitrateMode.
*OH_MD_KEY_PROFILEDefines the pointer to the encoding template. The value is a number. For details, see OH_AVCProfile, OH_AACProfile, or CodecBase.
*OH_MD_KEY_AUD_CHANNEL_COUNTDefines the pointer to the number of audio channels. The value type is uint32_t.
*OH_MD_KEY_AUD_SAMPLE_RATEDefines the pointer to the audio sampling rate. The value type is uint32_t.
*OH_MD_KEY_I_FRAME_INTERVALDefines the pointer to the key frame interval, in milliseconds. The value type is int32_t.
*OH_MD_KEY_ROTATIONDefines 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.
*OH_MD_KEY_CODEC_CONFIGDefines the pointer to the codec-specific data. The value type is uint8_t*.
*OH_MD_KEY_REQUEST_I_FRAMEDefines the pointer to the request for immediate encoding of I-frames. The value type is Boolean.
*OH_MD_KEY_QUALITYDefines the pointer to the required encoding quality. The value type is uint32_t. This key applies only to encoders configured in constant quality mode.
*OH_MD_KEY_CHANNEL_LAYOUTDefines the pointer to the required encoding channel layout. The value type is int64_t. This key applies only to encoders.
*OH_MD_KEY_BITS_PER_CODED_SAMPLEDefines the pointer to the number of bits for each coded sample. The value type is uint32_t. This key applies to FLAC encoders.
*OH_MD_KEY_AAC_IS_ADTSDefines the pointer to the AAC format. The value type is uint32_t. This key applies to AAC decoders.
*OH_MD_KEY_SBRDefines the pointer to the AAC SBR format. The value type is uint32_t. This key applies to AAC encoders.
*OH_MD_KEY_COMPLIANCE_LEVELDefines the pointer to the FLAC compliance level. The value type is int32_t.
*OH_MD_KEY_IDENTIFICATION_HEADERDefines the pointer to the VORBIS identification header. The value type is uint8_t*. This key applies only to VORBIS decoders.
*OH_MD_KEY_SETUP_HEADERDefines the pointer to the VORBIS setup header. The value type is uint8_t*. This key applies only to VORBIS decoders.
*OH_MD_KEY_TITLEDefines the pointer to the title of the input media. The value is a string.
*OH_MD_KEY_ARTISTDefines the pointer to the artist of the input media. The value is a string.
*OH_MD_KEY_ALBUMDefines the pointer to the album of the input media. The value is a string.
*OH_MD_KEY_ALBUM_ARTISTDefines the pointer to the album_artist of the input media. The value is a string.
*OH_MD_KEY_DATEDefines the pointer to the date of the input media. The value is a string.
*OH_MD_KEY_COMMENTDefines the pointer to the comment of the input media. The value is a string.
*OH_MD_KEY_GENREDefines the pointer to the genre of the input media. The value is a string.
*OH_MD_KEY_COPYRIGHTDefines the pointer to the copyright of the input media. The value is a string.
*OH_MD_KEY_LANGUAGEDefines the pointer to the language of the input media. The value is a string.
*OH_MD_KEY_DESCRIPTIONDefines the pointer to the description of the input media. The value is a string.
*OH_MD_KEY_LYRICSDefines the pointer to the lyrics of the input media. The value is a string.
*OH_MD_KEY_TRACK_COUNTDefines the pointer to the track count of the input media. The value type is uint32_t.

你可能感兴趣的鸿蒙文章

harmony 鸿蒙Native APIs

harmony 鸿蒙AVCapability

harmony 鸿蒙AVDemuxer

harmony 鸿蒙AVMuxer

harmony 鸿蒙AVScreenCapture

harmony 鸿蒙AVSource

harmony 鸿蒙AudioDecoder

harmony 鸿蒙AudioEncoder

harmony 鸿蒙CodecBase

harmony 鸿蒙Core

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