mirror of https://git.ffmpeg.org/ffmpeg.git
lavfi/src_avsynctest: switch to query_func2()
This commit is contained in:
parent
534eef2ace
commit
55c99fb9c4
|
@ -93,39 +93,39 @@ static const AVOption avsynctest_options[] = {
|
||||||
|
|
||||||
AVFILTER_DEFINE_CLASS(avsynctest);
|
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;
|
const AVSyncTestContext *s = ctx->priv;
|
||||||
AVFilterChannelLayouts *chlayout = NULL;
|
|
||||||
int sample_rates[] = { s->sample_rate, -1 };
|
int sample_rates[] = { s->sample_rate, -1 };
|
||||||
static const enum AVSampleFormat sample_fmts[] = {
|
static const enum AVSampleFormat sample_fmts[] = {
|
||||||
AV_SAMPLE_FMT_S32, AV_SAMPLE_FMT_NONE
|
AV_SAMPLE_FMT_S32, AV_SAMPLE_FMT_NONE
|
||||||
};
|
};
|
||||||
|
static const AVChannelLayout layouts[] = {
|
||||||
|
AV_CHANNEL_LAYOUT_MONO,
|
||||||
|
{ .nb_channels = 0 },
|
||||||
|
};
|
||||||
AVFilterFormats *formats;
|
AVFilterFormats *formats;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
formats = ff_make_format_list(sample_fmts);
|
formats = ff_make_format_list(sample_fmts);
|
||||||
if (!formats)
|
if (!formats)
|
||||||
return AVERROR(ENOMEM);
|
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;
|
return ret;
|
||||||
|
|
||||||
formats = ff_draw_supported_pixel_formats(0);
|
formats = ff_draw_supported_pixel_formats(0);
|
||||||
if (!formats)
|
if (!formats)
|
||||||
return AVERROR(ENOMEM);
|
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;
|
return ret;
|
||||||
|
|
||||||
if ((ret = ff_add_channel_layout(&chlayout, &(AVChannelLayout)AV_CHANNEL_LAYOUT_MONO)) < 0)
|
ret = ff_set_common_channel_layouts_from_list2(ctx, cfg_in, cfg_out, layouts);
|
||||||
return ret;
|
|
||||||
ret = ff_set_common_channel_layouts(ctx, chlayout);
|
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
formats = ff_make_format_list(sample_rates);
|
return ff_set_common_samplerates_from_list2(ctx, cfg_in, cfg_out, sample_rates);
|
||||||
if (!formats)
|
|
||||||
return AVERROR(ENOMEM);
|
|
||||||
return ff_set_common_samplerates(ctx, formats);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static av_cold int aconfig_props(AVFilterLink *outlink)
|
static av_cold int aconfig_props(AVFilterLink *outlink)
|
||||||
|
@ -404,6 +404,6 @@ const AVFilter ff_avsrc_avsynctest = {
|
||||||
.inputs = NULL,
|
.inputs = NULL,
|
||||||
.activate = activate,
|
.activate = activate,
|
||||||
FILTER_OUTPUTS(avsynctest_outputs),
|
FILTER_OUTPUTS(avsynctest_outputs),
|
||||||
FILTER_QUERY_FUNC(query_formats),
|
FILTER_QUERY_FUNC2(query_formats),
|
||||||
.process_command = ff_filter_process_command,
|
.process_command = ff_filter_process_command,
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue