diff mbox series

[FFmpeg-devel] avutil/hwcontext_videotoolbox: silence warning for RGB

Message ID 20240810061339.58428-1-gnattuoc@me.com
State New
Headers show
Series [FFmpeg-devel] avutil/hwcontext_videotoolbox: silence warning for RGB | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished

Commit Message

Gnattu OC Aug. 10, 2024, 6:13 a.m. UTC
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>
---
 libavutil/hwcontext_videotoolbox.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Marvin Scholz Aug. 10, 2024, 9:52 a.m. UTC | #1
On 10 Aug 2024, at 8:13, gnattu via ffmpeg-devel wrote:

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

Thanks, LGTM

>
> Signed-off-by: Gnattu OC <gnattuoc@me.com>
> ---
>  libavutil/hwcontext_videotoolbox.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/libavutil/hwcontext_videotoolbox.c b/libavutil/hwcontext_videotoolbox.c
> index 80eaab64f08..122a61d5e78 100644
> --- a/libavutil/hwcontext_videotoolbox.c
> +++ b/libavutil/hwcontext_videotoolbox.c
> @@ -576,7 +576,7 @@ static int vt_pixbuf_set_colorspace(void *log_ctx,
>              colormatrix, kCVAttachmentMode_ShouldPropagate);
>      else {
>          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,
>                  "Color space %s is not supported.\n",
>                  av_color_space_name(src->colorspace));
> -- 
> 2.39.3 (Apple Git-146)
>
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
Zhao Zhili Aug. 15, 2024, 12:13 p.m. UTC | #2
> On Aug 10, 2024, at 17:52, epirat07@gmail.com wrote:
> 
> On 10 Aug 2024, at 8:13, gnattu via ffmpeg-devel wrote:
> 
>> Hardware frames with RGB colorspace will not have a YCbCrMatrixKey.
>> Currently, it will spam the console with warning if rgb frame is
>> uploaded.
> 
> Thanks, LGTM

Applied. Thanks for the patch and review.

> 
>> 
>> Signed-off-by: Gnattu OC <gnattuoc@me.com>
>> ---
>> libavutil/hwcontext_videotoolbox.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>> 
>> diff --git a/libavutil/hwcontext_videotoolbox.c b/libavutil/hwcontext_videotoolbox.c
>> index 80eaab64f08..122a61d5e78 100644
>> --- a/libavutil/hwcontext_videotoolbox.c
>> +++ b/libavutil/hwcontext_videotoolbox.c
>> @@ -576,7 +576,7 @@ static int vt_pixbuf_set_colorspace(void *log_ctx,
>>             colormatrix, kCVAttachmentMode_ShouldPropagate);
>>     else {
>>         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,
>>                 "Color space %s is not supported.\n",
>>                 av_color_space_name(src->colorspace));
>> -- 
>> 2.39.3 (Apple Git-146)
>> 
>> _______________________________________________
>> ffmpeg-devel mailing list
>> ffmpeg-devel@ffmpeg.org
>> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>> 
>> To unsubscribe, visit link above, or email
>> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> 
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
diff mbox series

Patch

diff --git a/libavutil/hwcontext_videotoolbox.c b/libavutil/hwcontext_videotoolbox.c
index 80eaab64f08..122a61d5e78 100644
--- a/libavutil/hwcontext_videotoolbox.c
+++ b/libavutil/hwcontext_videotoolbox.c
@@ -576,7 +576,7 @@  static int vt_pixbuf_set_colorspace(void *log_ctx,
             colormatrix, kCVAttachmentMode_ShouldPropagate);
     else {
         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,
                 "Color space %s is not supported.\n",
                 av_color_space_name(src->colorspace));