Intelligent Assistant
Chat with our virtual assistant to get answers promptly.
The file declares the native APIs used to query the codec capability.
File to include: <multimedia/player_framework/native_avcapability.h>
Library: libnative_media_codecbase.so
System capability: SystemCapability.Multimedia.Media.CodecBase
Since: 10
Related module: AVCapability
| Name | typedef Keyword | Description |
|---|---|---|
| OH_AVRange | OH_AVRange | Describes the value range, which contains the minimum value and maximum value. |
| OH_AVCapability | OH_AVCapability | Describes a native object for the OH_AVCapability interface. |
| Name | typedef Keyword | Description |
|---|---|---|
| OH_AVCodecCategory | OH_AVCodecCategory | Enumerates the codec categories. |
| OH_AVCodecType | OH_AVCodecType | Codec type. |
| OH_AVCapabilityFeature | OH_AVCapabilityFeature | Enumerates the optional features that can be used in specific codec scenarios. |
enum OH_AVCodecCategory
Description
Enumerates the codec categories.
System capability: SystemCapability.Multimedia.Media.CodecBase
Since: 10
| Value | Description |
|---|---|
| HARDWARE = 0 | Hardware codec. |
| SOFTWARE | Software codec. |
enum OH_AVCodecType
Description
Codec type.
Since: 24
| Value | Description |
|---|---|
| OH_AVCODEC_TYPE_VIDEO_ENCODER = 0 | Video encoder. Since: 24 |
| OH_AVCODEC_TYPE_VIDEO_DECODER = 1 | Video decoder. Since: 24 |
| OH_AVCODEC_TYPE_AUDIO_ENCODER = 2 | Audio encoder. Since: 24 |
| OH_AVCODEC_TYPE_AUDIO_DECODER = 3 | Audio decoder. Since: 24 |
enum OH_AVCapabilityFeature
Description
Enumerates the optional features that can be used in specific codec scenarios.
System capability: SystemCapability.Multimedia.Media.CodecBase
Since: 12
| Value | Description |
|---|---|
| VIDEO_ENCODER_TEMPORAL_SCALABILITY = 0 | Temporal scalability feature, which is available only in video encoding scenarios. |
| VIDEO_ENCODER_LONG_TERM_REFERENCE = 1 | Long-term reference frame feature, which is available only in video encoding scenarios. |
| VIDEO_LOW_LATENCY = 2 | Low latency feature, which is available only in video decoding scenarios. |
| VIDEO_ENCODER_B_FRAME = 7 | B-frame encoding feature, which is available only in video encoding scenarios. Since: 20 |
| VIDEO_DECODER_OUTPUT_IN_DECODING_ORDER = 8 | Decoding-order frame output feature, which is available only in video decoding scenarios. Since: 26.0.0 |
| VIDEO_ENCODER_PREPROC_DOWNSAMPLING = 9 | Downsampling feature before video encoding, which is available only for video encoders. This capability can be enabled only when the encoder is created through the OH_VideoEncoder_CreatePrimaryWithPreproc or OH_VideoEncoder_CreateSecondaryFromPrimary API. Since: 26.0.0 |
| VIDEO_ENCODER_PREPROC_CROP = 10 | Cropping feature before video encoding, which is available only for video encoders. This capability can be enabled only when the encoder is created through the OH_VideoEncoder_CreatePrimaryWithPreproc or OH_VideoEncoder_CreateSecondaryFromPrimary API. Since: 26.0.0 |
OH_AVCapability *OH_AVCodec_GetCapability(const char *mime, bool isEncoder)
Description
Obtains the codec capability recommended by the system.
System capability: SystemCapability.Multimedia.Media.CodecBase
Since: 10
Parameters
| Name | Description |
|---|---|
| const char *mime | Pointer to a string that describes the MIME type. For details, see AVCODEC_MIME_TYPE variables. |
| bool isEncoder | Whether the instance is an encoder. The value true means an encoder and false means a decoder. |
Returns
| Type | Description |
|---|---|
| OH_AVCapability * | Pointer to the codec capability instance. If no existing codec matches, NULL is returned. |
OH_AVCapability *OH_AVCodec_GetCapabilityByCategory(const char *mime, bool isEncoder, OH_AVCodecCategory category)
Description
Obtains the codec capability by category, which can be a hardware codec or software codec.
System capability: SystemCapability.Multimedia.Media.CodecBase
Since: 10
Parameters
| Name | Description |
|---|---|
| const char *mime | Pointer to a string that describes the MIME type. For details, see AVCODEC_MIME_TYPE variables. |
| bool isEncoder | Whether the instance is an encoder. The value true means an encoder and false means a decoder. |
| OH_AVCodecCategory category | Codec category. |
Returns
| Type | Description |
|---|---|
| OH_AVCapability * | Pointer to the codec capability instance. If no existing codec matches, NULL is returned. |
OH_AVCapability **OH_AVCodec_GetCapabilityList(OH_AVCodecType codecType, uint32_t *count)
Description
Obtains the list of capabilities for the specified codec type. This function retrieves all matching codec capabilities supported by the system based on the provided codec type.
The memory for the codec capability list is globally maintained by the underlying system. Callers do not need to manage its lifecycle and must not manually allocate or free this memory.
Since: 24
Parameters
| Name | Description |
|---|---|
| OH_AVCodecType codecType | Codec type to be queried. |
| uint32_t *count | Pointer to a uint32_t variable for storing the number of matched codec capabilities. |
Returns
| Type | Description |
|---|---|
| OH_AVCapability ** | If a match is found, a pointer to an array of OH_AVCapability instances is returned. If no matching codec is found or an error occurs, NULL is returned. |
bool OH_AVCapability_IsHardware(OH_AVCapability *capability)
Description
Checks whether a codec capability instance describes a hardware codec.
System capability: SystemCapability.Multimedia.Media.CodecBase
Since: 10
Parameters
| Name | Description |
|---|---|
| OH_AVCapability *capability | Pointer to the codec capability. |
Returns
| Type | Description |
|---|---|
| bool | Check result for whether the codec capability instance describes a hardware codec. true if it describes a hardware codec, false otherwise. |
bool OH_AVCapability_IsSecure(OH_AVCapability *capability)
Description
Checks whether the capability instance describes a DRM decoder.
Since: 24
Parameters
| Name | Description |
|---|---|
| OH_AVCapability *capability | Pointer to the codec capability. |
Returns
| Type | Description |
|---|---|
| bool | If the capability instance describes a DRM decoder, true is returned. If the capability instance does not describe a DRM decoder, false is returned. |
const char *OH_AVCapability_GetName(OH_AVCapability *capability)
Description
Obtains the corresponding codec name.
System capability: SystemCapability.Multimedia.Media.CodecBase
Since: 10
Parameters
| Name | Description |
|---|---|
| OH_AVCapability *capability | Pointer to the codec capability. |
Returns
| Type | Description |
|---|---|
| const char * | Codec name string. |
const char *OH_AVCapability_GetMimeType(OH_AVCapability *capability)
Description
Obtains the MIME type of the codec.
Since: 24
Parameters
| Name | Description |
|---|---|
| OH_AVCapability *capability | Pointer to the codec capability. |
Returns
| Type | Description |
|---|---|
| const char * | String indicating the MIME type of the codec. |
bool OH_AVCapability_CheckMimeType(OH_AVCapability *capability, const char *mimeType)
Description
Checks whether the MIME type of the codec matches the specified MIME type.
Since: 24
Parameters
| Name | Description |
|---|---|
| OH_AVCapability *capability | Pointer to the codec capability. |
| const char *mimeType | Target MIME type string to be checked. |
Returns
| Type | Description |
|---|---|
| bool | If the MIME types match, true is returned. Otherwise, false is returned. |
int32_t OH_AVCapability_GetMaxSupportedInstances(OH_AVCapability *capability)
Description
Obtains the maximum number of codec instances supported by a codec.
System capability: SystemCapability.Multimedia.Media.CodecBase
Since: 10
Parameters
| Name | Description |
|---|---|
| OH_AVCapability *capability | Pointer to the codec capability. |
Returns
| Type | Description |
|---|---|
| int32_t | Maximum number of codec instances supported. |
OH_AVErrCode OH_AVCapability_GetEncoderBitrateRange(OH_AVCapability *capability, OH_AVRange *bitrateRange)
Description
Obtains the bit rate range supported by an encoder.
System capability: SystemCapability.Multimedia.Media.CodecBase
Since: 10
Parameters
| Name | Description |
|---|---|
| OH_AVCapability *capability | Pointer to the encoder capability. If a pointer to the decoder capability is provided, undefined behavior occurs. |
| OH_AVRange *bitrateRange | Pointer to the bit rate range supported. |
Returns
| Type | Description |
|---|---|
| OH_AVErrCode | AV_ERR_OK: The operation is successful. AV_ERR_INVALID_VAL: The capability instance is invalid or the pointer to the bit rate range is null. |
bool OH_AVCapability_IsEncoderBitrateModeSupported(OH_AVCapability *capability, OH_BitrateMode bitrateMode)
Description
Checks whether an encoder supports a specific bit rate mode.
System capability: SystemCapability.Multimedia.Media.CodecBase
Since: 10
Parameters
| Name | Description |
|---|---|
| OH_AVCapability *capability | Pointer to the encoder capability. If a pointer to the decoder capability is provided, undefined behavior occurs. |
| OH_BitrateMode bitrateMode | Bit rate mode. |
Returns
| Type | Description |
|---|---|
| bool | Check result for the support of the bit rate mode. true if supported, false otherwise. |
OH_AVErrCode OH_AVCapability_GetEncoderQualityRange(OH_AVCapability *capability, OH_AVRange *qualityRange)
Description
Obtains the quality range supported by an encoder.
System capability: SystemCapability.Multimedia.Media.CodecBase
Since: 10
Parameters
| Name | Description |
|---|---|
| OH_AVCapability *capability | Pointer to the encoder capability. If a pointer to the decoder capability is provided, undefined behavior occurs. |
| OH_AVRange *qualityRange | Pointer to the quality range supported. |
Returns
| Type | Description |
|---|---|
| OH_AVErrCode | AV_ERR_OK: The operation is successful. AV_ERR_INVALID_VAL: The capability instance is invalid or the pointer to the quality range is null. |
OH_AVErrCode OH_AVCapability_GetEncoderComplexityRange(OH_AVCapability *capability, OH_AVRange *complexityRange)
Description
Obtains the complexity range supported by an encoder.
System capability: SystemCapability.Multimedia.Media.CodecBase
Since: 10
Parameters
| Name | Description |
|---|---|
| OH_AVCapability *capability | Pointer to the encoder capability. If a pointer to the decoder capability is provided, undefined behavior occurs. |
| OH_AVRange *complexityRange | Pointer to the complexity range supported. |
Returns
| Type | Description |
|---|---|
| OH_AVErrCode | AV_ERR_OK: The operation is successful. AV_ERR_INVALID_VAL: The capability instance is invalid or the pointer to the complexity range is null. |
OH_AVErrCode OH_AVCapability_GetAudioSupportedSampleRates(OH_AVCapability *capability, const int32_t **sampleRates, uint32_t *sampleRateNum)
Description
Obtains the sample rates supported by an audio codec.
System capability: SystemCapability.Multimedia.Media.CodecBase
Since: 10
Parameters
| Name | Description |
|---|---|
| OH_AVCapability *capability | Pointer to the audio codec capability. If a pointer to the video codec capability is provided, undefined behavior occurs. |
| const int32_t **sampleRates | Double pointer to the sample rate array. |
| uint32_t *sampleRateNum | Pointer to the number of elements in the array. |
Returns
| Type | Description |
|---|---|
| OH_AVErrCode | AV_ERR_OK: The operation is successful. AV_ERR_INVALID_VAL: The capability instance is invalid, the pointer to the sample rate array is null, or the pointer to the number of elements in the array is null. AV_ERR_UNKNOWN: An unknown error occurs. AV_ERR_NO_MEMORY: Internal memory allocation failed. |
OH_AVErrCode OH_AVCapability_GetAudioSupportedSampleRateRanges(OH_AVCapability *capability, OH_AVRange **sampleRateRanges, uint32_t *rangesNum)
Description
Obtains the sample rate ranges supported by an audio codec.
System capability: SystemCapability.Multimedia.Media.CodecBase
Since: 20
Parameters
| Name | Description |
|---|---|
| OH_AVCapability *capability | Pointer to the audio codec capability. If a pointer to the video codec capability is provided, undefined behavior occurs. |
| OH_AVRange **sampleRateRanges | Double pointer to the sample rate range array. |
| uint32_t *rangesNum | Pointer to the number of elements in the array. |
Returns
| Type | Description |
|---|---|
| OH_AVErrCode | AV_ERR_OK: The operation is successful. AV_ERR_INVALID_VAL: The capability instance is invalid, the pointer to the sample rate range array is null, or the pointer to the number of elements in the array is null. AV_ERR_UNKNOWN: An unknown error occurs. AV_ERR_NO_MEMORY: Internal memory allocation failed. |
OH_AVErrCode OH_AVCapability_GetAudioChannelCountRange(OH_AVCapability *capability, OH_AVRange *channelCountRange)
Description
Obtains the count range of audio channels supported by an audio codec.
System capability: SystemCapability.Multimedia.Media.CodecBase
Since: 10
Parameters
| Name | Description |
|---|---|
| OH_AVCapability *capability | Pointer to the audio codec capability. If a pointer to the video codec capability is provided, undefined behavior occurs. |
| OH_AVRange *channelCountRange | Pointer to the count range of audio channels supported. |
Returns
| Type | Description |
|---|---|
| OH_AVErrCode | AV_ERR_OK: The operation is successful. AV_ERR_INVALID_VAL: The capability instance is invalid or the pointer to the count range of audio channels is null. |
OH_AVErrCode OH_AVCapability_GetVideoWidthAlignment(OH_AVCapability *capability, int32_t *widthAlignment)
Description
Obtains the video width alignment supported by a video codec.
System capability: SystemCapability.Multimedia.Media.CodecBase
Since: 10
Parameters
| Name | Description |
|---|---|
| OH_AVCapability *capability | Pointer to the video codec capability. If a pointer to the audio codec capability is provided, undefined behavior occurs. |
| int32_t *widthAlignment | Pointer to the video width alignment supported. |
Returns
| Type | Description |
|---|---|
| OH_AVErrCode | AV_ERR_OK: The operation is successful. AV_ERR_INVALID_VAL: The capability instance is invalid or the pointer to the video width alignment is null. |
OH_AVErrCode OH_AVCapability_GetVideoHeightAlignment(OH_AVCapability *capability, int32_t *heightAlignment)
Description
Obtains the video height alignment supported by a video codec.
System capability: SystemCapability.Multimedia.Media.CodecBase
Since: 10
Parameters
| Name | Description |
|---|---|
| OH_AVCapability *capability | Pointer to the video codec capability. If a pointer to the audio codec capability is provided, undefined behavior occurs. |
| int32_t *heightAlignment | Pointer to the video height alignment supported. |
Returns
| Type | Description |
|---|---|
| OH_AVErrCode | AV_ERR_OK: The operation is successful. AV_ERR_INVALID_VAL: The capability instance is invalid or the pointer to the video height alignment is null. |
OH_AVErrCode OH_AVCapability_GetVideoWidthRangeForHeight(OH_AVCapability *capability, int32_t height, OH_AVRange *widthRange)
Description
Obtains the video width range supported by a video codec based on a given height.
System capability: SystemCapability.Multimedia.Media.CodecBase
Since: 10
Parameters
| Name | Description |
|---|---|
| OH_AVCapability *capability | Pointer to the video codec capability. If a pointer to the audio codec capability is provided, undefined behavior occurs. |
| int32_t height | Number of vertical video pixels. |
| OH_AVRange *widthRange | Pointer to the video width range supported. |
Returns
| Type | Description |
|---|---|
| OH_AVErrCode | AV_ERR_OK: The operation is successful. AV_ERR_INVALID_VAL: The capability instance is invalid, the height is not within the supported height range obtained through OH_AVCapability_GetVideoHeightRange, or the pointer to the width range is null. |
OH_AVErrCode OH_AVCapability_GetVideoHeightRangeForWidth(OH_AVCapability *capability, int32_t width, OH_AVRange *heightRange)
Description
Obtains the video height range supported by a video codec based on a given width.
System capability: SystemCapability.Multimedia.Media.CodecBase
Since: 10
Parameters
| Name | Description |
|---|---|
| OH_AVCapability *capability | Pointer to the video codec capability. If a pointer to the audio codec capability is provided, undefined behavior occurs. |
| int32_t width | Number of horizontal video pixels. |
| OH_AVRange *heightRange | Pointer to the video height range supported. |
Returns
| Type | Description |
|---|---|
| OH_AVErrCode | AV_ERR_OK: The operation is successful. AV_ERR_INVALID_VAL: The capability instance is invalid, the width is not within the supported width range obtained through OH_AVCapability_GetVideoWidthRange, or the pointer to the height range is null. |
OH_AVErrCode OH_AVCapability_GetVideoWidthRange(OH_AVCapability *capability, OH_AVRange *widthRange)
Description
Obtains the video width range supported by a video codec.
System capability: SystemCapability.Multimedia.Media.CodecBase
Since: 10
Parameters
| Name | Description |
|---|---|
| OH_AVCapability *capability | Pointer to the video codec capability. If a pointer to the audio codec capability is provided, undefined behavior occurs. |
| OH_AVRange *widthRange | Pointer to the video width range supported. |
Returns
| Type | Description |
|---|---|
| OH_AVErrCode | AV_ERR_OK: The operation is successful. AV_ERR_INVALID_VAL: The capability instance is invalid or the pointer to the video width range is null. |
OH_AVErrCode OH_AVCapability_GetVideoHeightRange(OH_AVCapability *capability, OH_AVRange *heightRange)
Description
Obtains the video height range supported by a video codec.
System capability: SystemCapability.Multimedia.Media.CodecBase
Since: 10
Parameters
| Name | Description |
|---|---|
| OH_AVCapability *capability | Pointer to the video codec capability. If a pointer to the audio codec capability is provided, undefined behavior occurs. |
| OH_AVRange *heightRange | Pointer to the video height range supported. |
Returns
| Type | Description |
|---|---|
| OH_AVErrCode | AV_ERR_OK: The operation is successful. AV_ERR_INVALID_VAL: The capability instance is invalid or the pointer to the video height range is null. |
bool OH_AVCapability_IsVideoSizeSupported(OH_AVCapability *capability, int32_t width, int32_t height)
Description
Checks whether a video codec supports a specific video size.
System capability: SystemCapability.Multimedia.Media.CodecBase
Since: 10
Parameters
| Name | Description |
|---|---|
| OH_AVCapability *capability | Pointer to the video codec capability. If a pointer to the audio codec capability is provided, undefined behavior occurs. |
| int32_t width | Number of horizontal video pixels. |
| int32_t height | Number of vertical video pixels. |
Returns
| Type | Description |
|---|---|
| bool | Check result for the support of the video size. true if supported, false otherwise. |
OH_AVErrCode OH_AVCapability_GetVideoFrameRateRange(OH_AVCapability *capability, OH_AVRange *frameRateRange)
Description
Obtains the video frame rate range supported by a video codec.
System capability: SystemCapability.Multimedia.Media.CodecBase
Since: 10
Parameters
| Name | Description |
|---|---|
| OH_AVCapability *capability | Pointer to the video codec capability. If a pointer to the audio codec capability is provided, undefined behavior occurs. |
| OH_AVRange *frameRateRange | Pointer to the video frame rate range supported. |
Returns
| Type | Description |
|---|---|
| OH_AVErrCode | AV_ERR_OK: The operation is successful. AV_ERR_INVALID_VAL: The capability instance is invalid or the pointer to the video frame rate range is null. |
OH_AVErrCode OH_AVCapability_GetVideoFrameRateRangeForSize(OH_AVCapability *capability, int32_t width, int32_t height, OH_AVRange *frameRateRange)
Description
Obtains the video frame rate range supported by a video codec based on a given video size.
System capability: SystemCapability.Multimedia.Media.CodecBase
Since: 10
Parameters
| Name | Description |
|---|---|
| OH_AVCapability *capability | Pointer to the video codec capability. If a pointer to the audio codec capability is provided, undefined behavior occurs. |
| int32_t width | Number of horizontal video pixels. |
| int32_t height | Number of vertical video pixels. |
| OH_AVRange *frameRateRange | Pointer to the video frame rate range supported. |
Returns
| Type | Description |
|---|---|
| OH_AVErrCode | AV_ERR_OK: The operation is successful. AV_ERR_INVALID_VAL: The capability instance is invalid, the combination of the width and height is not supported, or the pointer to the frame rate range is null. |
bool OH_AVCapability_AreVideoSizeAndFrameRateSupported(OH_AVCapability *capability, int32_t width, int32_t height, int32_t frameRate)
Description
Checks whether a video codec supports the combination of a video size and frame rate.
System capability: SystemCapability.Multimedia.Media.CodecBase
Since: 10
Parameters
| Name | Description |
|---|---|
| OH_AVCapability *capability | Pointer to the video codec capability. If a pointer to the audio codec capability is provided, undefined behavior occurs. |
| int32_t width | Number of horizontal video pixels. |
| int32_t height | Number of vertical video pixels. |
| int32_t frameRate | Number of frames per second. |
Returns
| Type | Description |
|---|---|
| bool | Check result for the support of the combination of the video size and frame rate. true if supported, false otherwise. |
OH_AVErrCode OH_AVCapability_GetVideoSupportedPixelFormats(OH_AVCapability *capability, const int32_t **pixelFormats, uint32_t *pixelFormatNum)
Description
Obtains the video pixel formats supported by a video codec.
System capability: SystemCapability.Multimedia.Media.CodecBase
Since: 10
Parameters
| Name | Description |
|---|---|
| OH_AVCapability *capability | Pointer to the video codec capability. If a pointer to the audio codec capability is provided, undefined behavior occurs. |
| const int32_t **pixelFormats | Output Parameter. Pointer to an array of video pixel formats. For details, see OH_AVPixelFormat. |
| uint32_t *pixelFormatNum | Pointer to the number of elements in the array. |
Returns
| Type | Description |
|---|---|
| OH_AVErrCode | AV_ERR_OK: The operation is successful. AV_ERR_INVALID_VAL: The capability instance is invalid, the pointer to the video pixel format array is null, or the pointer to the number of elements in the array is null. AV_ERR_UNKNOWN: An unknown error occurs. AV_ERR_NO_MEMORY: Internal memory allocation failed. |
OH_AVErrCode OH_AVCapability_GetVideoSupportedNativeBufferFormats(OH_AVCapability *capability, const OH_NativeBuffer_Format **nativeBufferFormats, uint32_t *nativeBufferFormatNum)
Description
Obtains the OH_NativeBuffer formats supported by a video codec. This function provides the OH_NativeBuffer formats that can be processed by a video codec. For details, see OH_NativeBuffer_Format.
System capability: SystemCapability.Multimedia.Media.CodecBase
Since: 22
Parameters
| Name | Description |
|---|---|
| OH_AVCapability *capability | Pointer to the video codec capability. |
| const OH_NativeBuffer_Format **nativeBufferFormats | Double pointer to the OH_NativeBuffer_Format array. |
| uint32_t *nativeBufferFormatNum | Pointer to the number of elements in the array. |
Returns
| Type | Description |
|---|---|
| OH_AVErrCode | AV_ERR_OK: The operation is successful. AV_ERR_INVALID_VAL: The capability instance is invalid, the capability instance is an audio codec capability, the pointer to the OH_NativeBuffer_Format array is nullptr, or the pointer to the number of elements in the array is nullptr. AV_ERR_UNKNOWN: An unknown error occurs. AV_ERR_NO_MEMORY: Internal memory allocation failed. |
OH_AVErrCode OH_AVCapability_GetSupportedProfiles(OH_AVCapability *capability, const int32_t **profiles, uint32_t *profileNum)
Description
Obtains the profiles supported by a codec.
System capability: SystemCapability.Multimedia.Media.CodecBase
Since: 10
Parameters
| Name | Description |
|---|---|
| OH_AVCapability *capability | Pointer to the codec capability. |
| const int32_t **profiles | Output Parameter. Pointer to the profile array. For example, for H.264 profiles, see OH_AVCProfile. |
| uint32_t *profileNum | Pointer to the number of profiles in the array. |
Returns
| Type | Description |
|---|---|
| OH_AVErrCode | AV_ERR_OK: The operation is successful. AV_ERR_INVALID_VAL: The capability instance is invalid, the pointer to the profile array is null, or the pointer to the number of elements in the array is null. AV_ERR_UNKNOWN: An unknown error occurs. AV_ERR_NO_MEMORY: Internal memory allocation failed. |
OH_AVErrCode OH_AVCapability_GetSupportedLevelsForProfile(OH_AVCapability *capability, int32_t profile, const int32_t **levels, uint32_t *levelNum)
Description
Obtains the codec levels supported by a profile.
System capability: SystemCapability.Multimedia.Media.CodecBase
Since: 10
Parameters
| Name | Description |
|---|---|
| OH_AVCapability *capability | Pointer to the codec capability. |
| int32_t profile | Codec profile. |
| const int32_t **levels | Output Parameter. Pointer to the level array. For example, for H.264 levels, see OH_AVCLevel. |
| uint32_t *levelNum | Pointer to the number of elements in the array. |
Returns
| Type | Description |
|---|---|
| OH_AVErrCode | AV_ERR_OK: The operation is successful. AV_ERR_INVALID_VAL: The capability instance is invalid, the level is not in the supported level array obtained through OH_AVCapability_GetSupportedProfiles, the pointer to the level array is null, or the pointer to the number of elements in the array is null. AV_ERR_UNKNOWN: An unknown error occurs. AV_ERR_NO_MEMORY: Internal memory allocation failed. |
bool OH_AVCapability_AreProfileAndLevelSupported(OH_AVCapability *capability, int32_t profile, int32_t level)
Description
Checks whether a codec supports the combination of a profile and level.
System capability: SystemCapability.Multimedia.Media.CodecBase
Since: 10
Parameters
| Name | Description |
|---|---|
| OH_AVCapability *capability | Pointer to the codec capability. |
| int32_t profile | Codec profile. |
| int32_t level | Level of the codec. |
Returns
| Type | Description |
|---|---|
| bool | Check result for the support of the combination of the profile and level. true if supported, false otherwise. |
bool OH_AVCapability_IsFeatureSupported(OH_AVCapability *capability, OH_AVCapabilityFeature feature)
Description
Checks whether a codec supports a feature.
System capability: SystemCapability.Multimedia.Media.CodecBase
Since: 12
Parameters
| Name | Description |
|---|---|
| OH_AVCapability *capability | Pointer to the codec capability. |
| OH_AVCapabilityFeature feature | Codec feature. |
Returns
| Type | Description |
|---|---|
| bool | Check result for the feature. true if supported, false otherwise. |
OH_AVFormat *OH_AVCapability_GetFeatureProperties(OH_AVCapability *capability, OH_AVCapabilityFeature feature)
Description
Obtains the properties of a feature. You must manually release the OH_AVFormat instance in the return value.
System capability: SystemCapability.Multimedia.Media.CodecBase
Since: 12
Parameters
| Name | Description |
|---|---|
| OH_AVCapability *capability | Pointer to the codec capability. |
| OH_AVCapabilityFeature feature | Codec feature. |
Returns
| Type | Description |
|---|---|
| OH_AVFormat * | Pointer to an OH_AVFormat instance. |