harmony 鸿蒙native_avcapability.h

  • 2025-06-12
  • 浏览 (4)

native_avcapability.h

Overview

The native_avcapability.h file declares the native APIs used to query the codec capability.

Library: libnative_media_codecbase.so

Since: 10

Related module: AVCapability

Summary

Structs

Name Description
struct  OH_AVRange Describes the value range, which contains the minimum value and maximum value.

Types

Name Description
typedef struct OH_AVRange OH_AVRange Defines the value range, which contains the minimum value and maximum value.
typedef enum OH_AVCodecCategory OH_AVCodecCategory Defines an enum for codec categories.
typedef enum OH_AVCapabilityFeature OH_AVCapabilityFeature Defines an enum for optional features that can be used in specific codec scenarios.

Enums

Name Description
OH_AVCodecCategory { HARDWARE = 0, SOFTWARE } Enumerates the codec categories.
OH_AVCapabilityFeature {
VIDEO_ENCODER_TEMPORAL_SCALABILITY = 0,
VIDEO_ENCODER_LONG_TERM_REFERENCE = 1,
VIDEO_LOW_LATENCY = 2
}
Enumerates the optional features that can be used in specific codec scenarios.

Functions

Name Description
OH_AVCapability *OH_AVCodec_GetCapability (const char *mime, bool isEncoder) Obtains the codec capability recommended by the system.
OH_AVCapability *OH_AVCodec_GetCapabilityByCategory (const char *mime, bool isEncoder, OH_AVCodecCategory category) Obtains the codec capability by category, which can be a hardware codec or software codec.
bool OH_AVCapability_IsHardware (OH_AVCapability *capability) Checks whether a codec capability instance describes a hardware codec.
const char *OH_AVCapability_GetName (OH_AVCapability *capability) Obtains the codec name.
int32_t OH_AVCapability_GetMaxSupportedInstances (OH_AVCapability *capability) Obtains the maximum number of codec instances supported by a codec.
OH_AVErrCode OH_AVCapability_GetEncoderBitrateRange (OH_AVCapability *capability, OH_AVRange *bitrateRange) Obtains the bit rate range supported by an encoder.
bool OH_AVCapability_IsEncoderBitrateModeSupported (OH_AVCapability *capability, OH_BitrateMode bitrateMode) Checks whether an encoder supports a specific bit rate mode.
OH_AVErrCode OH_AVCapability_GetEncoderQualityRange (OH_AVCapability *capability, OH_AVRange *qualityRange) Obtains the quality range supported by an encoder.
OH_AVErrCode OH_AVCapability_GetEncoderComplexityRange (OH_AVCapability *capability, OH_AVRange *complexityRange) Obtains the complexity range supported by an encoder.
OH_AVErrCode OH_AVCapability_GetAudioSupportedSampleRates (OH_AVCapability *capability, const int32_t **sampleRates, uint32_t *sampleRateNum) Obtains the sample rates supported by an audio codec.
OH_AVErrCode OH_AVCapability_GetAudioChannelCountRange (OH_AVCapability *capability, OH_AVRange *channelCountRange) Obtains the count range of audio channels supported by an audio codec.
OH_AVErrCode OH_AVCapability_GetVideoWidthAlignment (OH_AVCapability *capability, int32_t *widthAlignment) Obtains the video width alignment supported by a video codec.
OH_AVErrCode OH_AVCapability_GetVideoHeightAlignment (OH_AVCapability *capability, int32_t *heightAlignment) Obtains the video height alignment supported by a video codec.
OH_AVErrCode OH_AVCapability_GetVideoWidthRangeForHeight (OH_AVCapability *capability, int32_t height, OH_AVRange *widthRange) Obtains the video width range supported by a video codec based on a given height.
OH_AVErrCode OH_AVCapability_GetVideoHeightRangeForWidth (OH_AVCapability *capability, int32_t width, OH_AVRange *heightRange) Obtains the video height range supported by a video codec based on a given width.
OH_AVErrCode OH_AVCapability_GetVideoWidthRange (OH_AVCapability *capability, OH_AVRange *widthRange) Obtains the video width range supported by a video codec.
OH_AVErrCode OH_AVCapability_GetVideoHeightRange (OH_AVCapability *capability, OH_AVRange *heightRange) Obtains the video height range supported by a video codec.
bool OH_AVCapability_IsVideoSizeSupported (OH_AVCapability *capability, int32_t width, int32_t height) Checks whether a video codec supports a specific video size.
OH_AVErrCode OH_AVCapability_GetVideoFrameRateRange (OH_AVCapability *capability, OH_AVRange *frameRateRange) Obtains the video frame rate range supported by a video codec.
OH_AVErrCode OH_AVCapability_GetVideoFrameRateRangeForSize (OH_AVCapability *capability, int32_t width, int32_t height, OH_AVRange *frameRateRange) Obtains the video frame rate range supported by a video codec based on a given video size.
bool OH_AVCapability_AreVideoSizeAndFrameRateSupported (OH_AVCapability *capability, int32_t width, int32_t height, int32_t frameRate) Checks whether a video codec supports the combination of a video size and frame rate.
OH_AVErrCode OH_AVCapability_GetVideoSupportedPixelFormats (OH_AVCapability *capability, const int32_t **pixelFormats, uint32_t *pixelFormatNum) Obtains the video pixel formats supported by a video codec.
OH_AVErrCode OH_AVCapability_GetSupportedProfiles (OH_AVCapability *capability, const int32_t **profiles, uint32_t *profileNum) Obtains the profiles supported by a codec.
OH_AVErrCode OH_AVCapability_GetSupportedLevelsForProfile (OH_AVCapability *capability, int32_t profile, const int32_t **levels, uint32_t *levelNum) Obtains the codec levels supported by a profile.
bool OH_AVCapability_AreProfileAndLevelSupported (OH_AVCapability *capability, int32_t profile, int32_t level) Checks whether a codec supports the combination of a profile and level.
bool OH_AVCapability_IsFeatureSupported (OH_AVCapability *capability, OH_AVCapabilityFeature feature) Checks whether a codec supports a feature.
OH_AVFormat *OH_AVCapability_GetFeatureProperties (OH_AVCapability *capability, OH_AVCapabilityFeature feature) Obtains the properties of a feature. You must manually release the OH_AVFormat instance in the return value.

你可能感兴趣的鸿蒙文章

harmony 鸿蒙AVCodec Kit

harmony 鸿蒙AVCapability

harmony 鸿蒙AVDemuxer

harmony 鸿蒙AVMuxer

harmony 鸿蒙AVSource

harmony 鸿蒙AudioCodec

harmony 鸿蒙AudioDecoder

harmony 鸿蒙AudioEncoder

harmony 鸿蒙CodecBase

harmony 鸿蒙Core

0  赞