diff mbox series

[FFmpeg-devel,v3,7/8] avfilter/vf_scale: tag output color space

Message ID 20231031145450.94975-7-ffmpeg@haasn.xyz
State New
Headers show
Series [FFmpeg-devel,v3,1/8] swscale: fix sws_setColorspaceDetails after sws_init_context | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Niklas Haas Oct. 31, 2023, 2:54 p.m. UTC
From: Niklas Haas <git@haasn.dev>

When using vf_scale to force a specific output color space, also tag
this on the AVFrame. (Mirroring existing logic for output range)
---
 libavfilter/vf_scale.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Michael Niedermayer Nov. 4, 2023, 8:37 p.m. UTC | #1
On Tue, Oct 31, 2023 at 03:54:49PM +0100, Niklas Haas wrote:
> From: Niklas Haas <git@haasn.dev>
> 
> When using vf_scale to force a specific output color space, also tag
> this on the AVFrame. (Mirroring existing logic for output range)
> ---
>  libavfilter/vf_scale.c | 3 +++
>  1 file changed, 3 insertions(+)

LGTM

thx

[...]
diff mbox series

Patch

diff --git a/libavfilter/vf_scale.c b/libavfilter/vf_scale.c
index fb8e6a2b76..3ec080693c 100644
--- a/libavfilter/vf_scale.c
+++ b/libavfilter/vf_scale.c
@@ -857,6 +857,9 @@  scale:
                                      brightness, contrast, saturation);
 
         out->color_range = out_full ? AVCOL_RANGE_JPEG : AVCOL_RANGE_MPEG;
+        if (scale->out_color_matrix >= 0 &&
+            scale->out_color_matrix != AVCOL_SPC_UNSPECIFIED)
+            out->colorspace = scale->out_color_matrix;
     }
 
     av_reduce(&out->sample_aspect_ratio.num, &out->sample_aspect_ratio.den,