avutil/hwcontext_videotoolbox: silence warning for RGB

Hardware frames with RGB colorspace will not have a YCbCrMatrixKey.
Currently, it will spam the console with warning if rgb frame is
uploaded.

Signed-off-by: Gnattu OC <gnattuoc@me.com>
Reviewed-by: Marvin Scholz <epirat07@gmail.com>
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
This commit is contained in:
gnattu 2024-08-10 14:13:39 +08:00 committed by Zhao Zhili
parent 42a40538f3
commit a1976e963f

View File

@ -576,7 +576,7 @@ static int vt_pixbuf_set_colorspace(void *log_ctx,
colormatrix, kCVAttachmentMode_ShouldPropagate); colormatrix, kCVAttachmentMode_ShouldPropagate);
else { else {
CVBufferRemoveAttachment(pixbuf, kCVImageBufferYCbCrMatrixKey); CVBufferRemoveAttachment(pixbuf, kCVImageBufferYCbCrMatrixKey);
if (src->colorspace != AVCOL_SPC_UNSPECIFIED) if (src->colorspace != AVCOL_SPC_UNSPECIFIED && src->colorspace != AVCOL_SPC_RGB)
av_log(log_ctx, AV_LOG_WARNING, av_log(log_ctx, AV_LOG_WARNING,
"Color space %s is not supported.\n", "Color space %s is not supported.\n",
av_color_space_name(src->colorspace)); av_color_space_name(src->colorspace));