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 576beec06879ff360fdd5c62b1d0d5878eeff400..589823ef39cbe49747cc11bc69b4e20a3751516e 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 36996a84d1da1aa63e93a68c83193b57e0ab58ef..645a1e7991277d2b1125ec89bf1b90dfdb95fd85 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 012329d4f1297d7a8f46cf8a65f2b4f413c95b6e..7cb92a41cd9547ba51b7d3b22b750861203d2251 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 a1dd558751d73f408559175b59ff1729b0ab802f..edecfa2a89f3f673d09682def19034e2082bacb9 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