[FFmpeg-devel] [PATCH 18/20] lavfi/vf_format: switch to query_func2()
Anton Khirnov
anton at khirnov.net
Fri Oct 4 11:42:28 EEST 2024
---
libavfilter/vf_format.c | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/libavfilter/vf_format.c b/libavfilter/vf_format.c
index da39625fec..9dbb174c42 100644
--- a/libavfilter/vf_format.c
+++ b/libavfilter/vf_format.c
@@ -149,14 +149,16 @@ static av_cold int init(AVFilterContext *ctx)
return 0;
}
-static int query_formats(AVFilterContext *ctx)
+static int query_formats(const AVFilterContext *ctx,
+ AVFilterFormatsConfig **cfg_in,
+ AVFilterFormatsConfig **cfg_out)
{
FormatContext *s = ctx->priv;
int ret;
- if (s->formats && (ret = ff_set_common_formats(ctx, s->formats)) < 0 ||
- s->color_spaces && (ret = ff_set_common_color_spaces(ctx, s->color_spaces)) < 0 ||
- s->color_ranges && (ret = ff_set_common_color_ranges(ctx, s->color_ranges)) < 0)
+ if (s->formats && (ret = ff_set_common_formats2 (ctx, cfg_in, cfg_out, s->formats)) < 0 ||
+ s->color_spaces && (ret = ff_set_common_color_spaces2(ctx, cfg_in, cfg_out, s->color_spaces)) < 0 ||
+ s->color_ranges && (ret = ff_set_common_color_ranges2(ctx, cfg_in, cfg_out, s->color_ranges)) < 0)
return ret;
return 0;
@@ -197,7 +199,7 @@ const AVFilter ff_vf_format = {
FILTER_INPUTS(inputs),
FILTER_OUTPUTS(ff_video_default_filterpad),
- FILTER_QUERY_FUNC(query_formats),
+ FILTER_QUERY_FUNC2(query_formats),
};
#endif /* CONFIG_FORMAT_FILTER */
@@ -217,6 +219,6 @@ const AVFilter ff_vf_noformat = {
FILTER_INPUTS(inputs),
FILTER_OUTPUTS(ff_video_default_filterpad),
- FILTER_QUERY_FUNC(query_formats),
+ FILTER_QUERY_FUNC2(query_formats),
};
#endif /* CONFIG_NOFORMAT_FILTER */
--
2.43.0
More information about the ffmpeg-devel
mailing list