From ca457c072fb8b87849868a814e0def400c2fd25d Mon Sep 17 00:00:00 2001 From: yangxiaoyu Date: Mon, 8 Apr 2024 09:00:43 +0000 Subject: [PATCH] =?UTF-8?q?=E9=87=8D=E6=96=B0=E6=8F=90=E4=BA=A4avcodec=20?= =?UTF-8?q?=E8=83=BD=E5=8A=9B=E7=9B=B8=E5=85=B3api?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: yangxiaoyu --- .../libnative_media_codecbase.ndk.json | 8 ++++ multimedia/av_codec/native_avcapability.h | 39 +++++++++++++++++++ 2 files changed, 47 insertions(+) diff --git a/multimedia/av_codec/codec_base/libnative_media_codecbase.ndk.json b/multimedia/av_codec/codec_base/libnative_media_codecbase.ndk.json index 54a2ea40b46..747c34aa2c4 100644 --- a/multimedia/av_codec/codec_base/libnative_media_codecbase.ndk.json +++ b/multimedia/av_codec/codec_base/libnative_media_codecbase.ndk.json @@ -409,5 +409,13 @@ { "first_introduced": "10", "name": "OH_AVCapability_AreProfileAndLevelSupported" + }, + { + "first_introduced": "12", + "name": "OH_AVCapability_IsFeatureSupported" + }, + { + "first_introduced": "12", + "name": "OH_AVCapability_GetFeatureProperties" } ] diff --git a/multimedia/av_codec/native_avcapability.h b/multimedia/av_codec/native_avcapability.h index 043678aab03..7125730df60 100644 --- a/multimedia/av_codec/native_avcapability.h +++ b/multimedia/av_codec/native_avcapability.h @@ -18,6 +18,7 @@ #include #include "native_averrors.h" +#include "native_avformat.h" #ifdef __cplusplus extern "C" { @@ -59,6 +60,21 @@ typedef enum OH_AVCodecCategory { SOFTWARE } OH_AVCodecCategory; +/** + * @brief The enum of optional features that can be used in specific codec seenarios. + * + * @syscap SystemCapability.Multimedia.Media.CodecBase + * @since 12 + */ +typedef enum OH_AVCapabilityFeature { + /** Feature for codec supports temporal scalability. It is only used in video encoder. */ + VIDEO_ENCODER_TEMPORAL_SCALABILITY = 0, + /** Feature for codec supports long-term reference. It is only used in video encoder. */ + VIDEO_ENCODER_LONG_TERM_REFERENCE = 1, + /** Feature for codec supports low latency. It is used in video encoder and video decoder. */ + VIDEO_LOW_LATENCY = 2, +} OH_AVCapabilityFeature; + /** * @brief Get a system-recommended codec's capability. * @syscap SystemCapability.Multimedia.Media.CodecBase @@ -350,6 +366,29 @@ OH_AVErrCode OH_AVCapability_GetSupportedLevelsForProfile(OH_AVCapability *capab */ bool OH_AVCapability_AreProfileAndLevelSupported(OH_AVCapability *capability, int32_t profile, int32_t level); +/** + * @brief Check if the codec supports the specified feature. + * + * @syscap SystemCapability.Multimedia.Media.CodecBase + * @param capability Codec capability pointer + * @param feature Feature enum, refer to {@link OH_AVCapabilityFeature} for details + * @return Returns true if the feature is supported, false if it is not supported + * @since 12 + */ +bool OH_AVCapability_IsFeatureSupported(OH_AVCapability *capability, OH_AVCapabilityFeature feature); + +/** + * @brief Get the properties of the specified feature. It should be noted that the life cycle of the OH_AVFormat + * instance pointed to by the return value * needs to be manually released by the caller. + * + * @syscap SystemCapability.Multimedia.Media.CodecBase + * @param capability Codec capability pointer + * @param feature Feature enum, refer to {@link OH_AVCapabilityFeature} for details + * @return Returns a pointer to an OH_AVFormat instance + * @since 12 + */ +OH_AVFormat *OH_AVCapability_GetFeatureProperties(OH_AVCapability *capability, OH_AVCapabilityFeature feature); + #ifdef __cplusplus } #endif -- Gitee