From 9b25ff90cccd5596f724aff4bb8585219ea8b7d5 Mon Sep 17 00:00:00 2001 From: rchdlee Date: Wed, 21 Aug 2024 14:57:39 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E4=BF=AE=E6=94=B9=E8=AF=B4=E6=98=8E?= =?UTF-8?q?=E3=80=91=20=E6=96=B0=E5=A2=9E=E8=A7=86=E9=A2=91=E5=90=8E?= =?UTF-8?q?=E5=A4=84=E7=90=86=E9=94=99=E8=AF=AF=E7=A0=81&=E7=9B=B8?= =?UTF-8?q?=E5=BA=94=E6=8E=A5=E5=8F=A3=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: rchdlee --- .../codec_base/libnative_media_codecbase.ndk.json | 4 ++++ multimedia/av_codec/native_avcodec_base.h | 14 ++++++++++++++ multimedia/av_codec/native_avcodec_videodecoder.h | 2 ++ multimedia/media_foundation/native_averrors.h | 10 ++++++++++ 4 files changed, 30 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 576beec06..589823ef3 100644 --- a/multimedia/av_codec/codec_base/libnative_media_codecbase.ndk.json +++ b/multimedia/av_codec/codec_base/libnative_media_codecbase.ndk.json @@ -387,6 +387,10 @@ "first_introduced": "12", "name": "OH_MD_KEY_TRACK_START_TIME" }, + { + "first_introduced": "12", + "name": "OH_MD_KEY_VIDEO_DECODER_OUTPUT_COLOR_SPACE" + }, { "first_introduced": "10", "name": "OH_AVCodec_GetCapability" diff --git a/multimedia/av_codec/native_avcodec_base.h b/multimedia/av_codec/native_avcodec_base.h index 36996a84d..645a1e799 100644 --- a/multimedia/av_codec/native_avcodec_base.h +++ b/multimedia/av_codec/native_avcodec_base.h @@ -939,6 +939,20 @@ extern const char *OH_MD_KEY_START_TIME; * @since 12 */ extern const char *OH_MD_KEY_TRACK_START_TIME; +/** + * @brief Key for setting the output color space of video decoder. The value type is int32_t. + * The supported value is {@link OH_COLORSPACE_BT709_LIMIT}, see {@link OH_NativeBuffer_ColorSpace}. It is used in + * {@link OH_VideoDecoder_Configure}. If the color space conversion capability is supported and this key is configured, + * the video decoder will automatically transcode an HDR Vivid video to an SDR video with color space BT709. + * If color space conversion capability is not supported, {@link OH_VideoDecoder_Configure} returns + * {@link AV_ERR_VIDEO_UNSUPPORTED_COLOR_SPACE_CONVERSION}. + * If the input video is not an HDR vivid video, an error {@link AV_ERR_VIDEO_UNSUPPORTED_COLOR_SPACE_CONVERSION} will + * be reported by callback function {@link OH_AVCodecOnError}. + * + * @syscap SystemCapability.Multimedia.Media.CodecBase + * @since 12 + */ +extern const char *OH_MD_KEY_VIDEO_DECODER_OUTPUT_COLOR_SPACE; /** * @brief Media type. diff --git a/multimedia/av_codec/native_avcodec_videodecoder.h b/multimedia/av_codec/native_avcodec_videodecoder.h index 012329d4f..7cb92a41c 100644 --- a/multimedia/av_codec/native_avcodec_videodecoder.h +++ b/multimedia/av_codec/native_avcodec_videodecoder.h @@ -146,6 +146,8 @@ OH_AVErrCode OH_VideoDecoder_SetSurface(OH_AVCodec *codec, OHNativeWindow *windo * {@link AV_ERR_UNKNOWN}, unknown error. * {@link AV_ERR_SERVICE_DIED}, avcodec service is died. * {@link AV_ERR_INVALID_STATE}, this interface was called in invalid state, must be called before Prepare. + * {@link AV_ERR_UNSUPPORT}, unsupported features. + * {@link AV_ERR_VIDEO_UNSUPPORTED_COLOR_SPACE_CONVERSION}, video unsupported color space conversion. * @since 9 */ OH_AVErrCode OH_VideoDecoder_Configure(OH_AVCodec *codec, OH_AVFormat *format); diff --git a/multimedia/media_foundation/native_averrors.h b/multimedia/media_foundation/native_averrors.h index a1dd55875..edecfa2a8 100644 --- a/multimedia/media_foundation/native_averrors.h +++ b/multimedia/media_foundation/native_averrors.h @@ -97,6 +97,16 @@ typedef enum OH_AVErrCode { * @since 12 */ AV_ERR_DRM_DECRYPT_FAILED = 201, + /** + * @error video error base. + * @since 12 + */ + AV_ERR_VIDEO_BASE = 300, + /** + * @error video unsupported color space conversion. + * @since 12 + */ + AV_ERR_VIDEO_UNSUPPORTED_COLOR_SPACE_CONVERSION = 301, } OH_AVErrCode; #ifdef __cplusplus -- Gitee