[FFmpeg-devel] [PATCH 12/16] lavfi/src_avsynctest: switch to query_func2()
Anton Khirnov
anton at khirnov.net
Tue Oct 1 13:54:17 EEST 2024
---
libavfilter/src_avsynctest.c | 26 +++++++++++++-------------
1 file changed, 13 insertions(+), 13 deletions(-)
diff --git a/libavfilter/src_avsynctest.c b/libavfilter/src_avsynctest.c
index f78cdd1dec..c46281c72b 100644
--- a/libavfilter/src_avsynctest.c
+++ b/libavfilter/src_avsynctest.c
@@ -93,39 +93,39 @@ static const AVOption avsynctest_options[] = {
AVFILTER_DEFINE_CLASS(avsynctest);
-static av_cold int query_formats(AVFilterContext *ctx)
+static av_cold int query_formats(const AVFilterContext *ctx,
+ AVFilterFormatsConfig **cfg_in,
+ AVFilterFormatsConfig **cfg_out)
{
- AVSyncTestContext *s = ctx->priv;
- AVFilterChannelLayouts *chlayout = NULL;
+ const AVSyncTestContext *s = ctx->priv;
int sample_rates[] = { s->sample_rate, -1 };
static const enum AVSampleFormat sample_fmts[] = {
AV_SAMPLE_FMT_S32, AV_SAMPLE_FMT_NONE
};
+ static const AVChannelLayout layouts[] = {
+ AV_CHANNEL_LAYOUT_MONO,
+ { .nb_channels = 0 },
+ };
AVFilterFormats *formats;
int ret;
formats = ff_make_format_list(sample_fmts);
if (!formats)
return AVERROR(ENOMEM);
- if ((ret = ff_formats_ref(formats, &ctx->outputs[0]->incfg.formats)) < 0)
+ if ((ret = ff_formats_ref(formats, &cfg_out[0]->formats)) < 0)
return ret;
formats = ff_draw_supported_pixel_formats(0);
if (!formats)
return AVERROR(ENOMEM);
- if ((ret = ff_formats_ref(formats, &ctx->outputs[1]->incfg.formats)) < 0)
+ if ((ret = ff_formats_ref(formats, &cfg_out[1]->formats)) < 0)
return ret;
- if ((ret = ff_add_channel_layout(&chlayout, &(AVChannelLayout)AV_CHANNEL_LAYOUT_MONO)) < 0)
- return ret;
- ret = ff_set_common_channel_layouts(ctx, chlayout);
+ ret = ff_set_common_channel_layouts_from_list2(ctx, cfg_in, cfg_out, layouts);
if (ret < 0)
return ret;
- formats = ff_make_format_list(sample_rates);
- if (!formats)
- return AVERROR(ENOMEM);
- return ff_set_common_samplerates(ctx, formats);
+ return ff_set_common_samplerates_from_list2(ctx, cfg_in, cfg_out, sample_rates);
}
static av_cold int aconfig_props(AVFilterLink *outlink)
@@ -404,6 +404,6 @@ const AVFilter ff_avsrc_avsynctest = {
.inputs = NULL,
.activate = activate,
FILTER_OUTPUTS(avsynctest_outputs),
- FILTER_QUERY_FUNC(query_formats),
+ FILTER_QUERY_FUNC2(query_formats),
.process_command = ff_filter_process_command,
};
--
2.43.0
More information about the ffmpeg-devel
mailing list