aboutsummaryrefslogtreecommitdiffstats
path: root/libavfilter/vsrc_testsrc.c
diff options
context:
space:
mode:
authorNiklas Haas <git@haasn.dev>2024-01-31 11:47:30 +0100
committerNiklas Haas <git@haasn.dev>2024-02-06 11:30:10 +0100
commitce81237d638214dd3fd64579805f67028f5bf144 (patch)
treeb1c295366c1290f7759358e30b54cb93c07b8c5c /libavfilter/vsrc_testsrc.c
parent8264f3612c2c6dfff05587175854b62650ac917c (diff)
downloadffmpeg-ce81237d638214dd3fd64579805f67028f5bf144.tar.gz
avfilter: pass link YUV colorspace to ff_draw_init2
This makes all ff_draw_* based filters aware of YUV colorspaces and ranges. Needed for YUVJ removal. Also fixes a bug where e.g. vf_pad would generate a limited range background even after conversion to full-scale grayscale. The FATE changes were a consequence of the aforementioned bugfix - the gray scale files are output as full range (due to conversion by libswscale, which hard-codes gray = full), and appropriately tagged as such, but before this change the padded version incorrectly used a limited range (16) black background for these formats.
Diffstat (limited to 'libavfilter/vsrc_testsrc.c')
-rw-r--r--libavfilter/vsrc_testsrc.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/libavfilter/vsrc_testsrc.c b/libavfilter/vsrc_testsrc.c
index 3b5536badc..73a61bfa45 100644
--- a/libavfilter/vsrc_testsrc.c
+++ b/libavfilter/vsrc_testsrc.c
@@ -263,7 +263,8 @@ static int color_config_props(AVFilterLink *inlink)
TestSourceContext *test = ctx->priv;
int ret;
- ff_draw_init(&test->draw, inlink->format, 0);
+ ff_draw_init2(&test->draw, inlink->format, inlink->colorspace,
+ inlink->color_range, 0);
ff_draw_color(&test->draw, &test->color, test->color_rgba);
test->w = ff_draw_round_to_sub(&test->draw, 0, -1, test->w);
@@ -944,7 +945,8 @@ static int test2_config_props(AVFilterLink *inlink)
AVFilterContext *ctx = inlink->src;
TestSourceContext *s = ctx->priv;
- av_assert0(ff_draw_init(&s->draw, inlink->format, 0) >= 0);
+ av_assert0(ff_draw_init2(&s->draw, inlink->format, inlink->colorspace,
+ inlink->color_range, 0) >= 0);
s->w = ff_draw_round_to_sub(&s->draw, 0, -1, s->w);
s->h = ff_draw_round_to_sub(&s->draw, 1, -1, s->h);
if (av_image_check_size(s->w, s->h, 0, ctx) < 0)
@@ -1964,7 +1966,8 @@ static int colorchart_config_props(AVFilterLink *inlink)
AVFilterContext *ctx = inlink->src;
TestSourceContext *s = ctx->priv;
- av_assert0(ff_draw_init(&s->draw, inlink->format, 0) >= 0);
+ av_assert0(ff_draw_init2(&s->draw, inlink->format, inlink->colorspace,
+ inlink->color_range, 0) >= 0);
if (av_image_check_size(s->w, s->h, 0, ctx) < 0)
return AVERROR(EINVAL);
return config_props(inlink);