From 667bfb93b5153782c8a00111d1e81390511b8350 Mon Sep 17 00:00:00 2001 From: openharmony_ci <120357966@qq.com> Date: Tue, 13 Aug 2024 14:45:34 +0000 Subject: [PATCH] =?UTF-8?q?!1151=20=E3=80=90=E4=BF=AE=E6=94=B9=E8=AF=B4?= =?UTF-8?q?=E6=98=8E=E3=80=91=20=E6=96=B0=E5=A2=9E=E8=A7=86=E9=A2=91?= =?UTF-8?q?=E5=90=8E=E5=A4=84=E7=90=86=E9=94=99=E8=AF=AF=E7=A0=81&?= =?UTF-8?q?=E7=9B=B8=E5=BA=94=E6=8E=A5=E5=8F=A3=E6=B3=A8=E9=87=8A=20Merge?= =?UTF-8?q?=20pull=20request=20!1151=20from=20=E6=9D=8E=E5=BB=BA=E8=B6=85/?= =?UTF-8?q?master?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- multimedia/av_codec/native_avcodec_base.h | 14 ++++++++++++++ multimedia/av_codec/native_avcodec_videodecoder.h | 2 ++ multimedia/media_foundation/native_averrors.h | 10 ++++++++++ 3 files changed, 26 insertions(+) diff --git a/multimedia/av_codec/native_avcodec_base.h b/multimedia/av_codec/native_avcodec_base.h index c5e35031c..af658326a 100644 --- a/multimedia/av_codec/native_avcodec_base.h +++ b/multimedia/av_codec/native_avcodec_base.h @@ -940,6 +940,20 @@ extern const char *OH_MD_KEY_VIDEO_SAR; * @since 12 */ extern const char *OH_MD_KEY_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 c52df2c28..6291412ec 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 cffaba60e..0a2a54d60 100644 --- a/multimedia/media_foundation/native_averrors.h +++ b/multimedia/media_foundation/native_averrors.h @@ -92,6 +92,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