mirror of https://git.ffmpeg.org/ffmpeg.git
lavfi/avf_abitscope: switch to query_func2()
Also, drop redundant calls that also happen implicitly in generic code.
This commit is contained in:
parent
0c2a5890ac
commit
6320301182
|
@ -65,12 +65,11 @@ static const AVOption abitscope_options[] = {
|
||||||
|
|
||||||
AVFILTER_DEFINE_CLASS(abitscope);
|
AVFILTER_DEFINE_CLASS(abitscope);
|
||||||
|
|
||||||
static int query_formats(AVFilterContext *ctx)
|
static int query_formats(const AVFilterContext *ctx,
|
||||||
|
AVFilterFormatsConfig **cfg_in,
|
||||||
|
AVFilterFormatsConfig **cfg_out)
|
||||||
{
|
{
|
||||||
AVFilterFormats *formats = NULL;
|
AVFilterFormats *formats = NULL;
|
||||||
AVFilterChannelLayouts *layouts;
|
|
||||||
AVFilterLink *inlink = ctx->inputs[0];
|
|
||||||
AVFilterLink *outlink = ctx->outputs[0];
|
|
||||||
static const enum AVSampleFormat sample_fmts[] = { AV_SAMPLE_FMT_S16P, AV_SAMPLE_FMT_S32P,
|
static const enum AVSampleFormat sample_fmts[] = { AV_SAMPLE_FMT_S16P, AV_SAMPLE_FMT_S32P,
|
||||||
AV_SAMPLE_FMT_U8P, AV_SAMPLE_FMT_S64P,
|
AV_SAMPLE_FMT_U8P, AV_SAMPLE_FMT_S64P,
|
||||||
AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_DBLP,
|
AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_DBLP,
|
||||||
|
@ -79,21 +78,11 @@ static int query_formats(AVFilterContext *ctx)
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
formats = ff_make_format_list(sample_fmts);
|
formats = ff_make_format_list(sample_fmts);
|
||||||
if ((ret = ff_formats_ref(formats, &inlink->outcfg.formats)) < 0)
|
if ((ret = ff_formats_ref(formats, &cfg_in[0]->formats)) < 0)
|
||||||
return ret;
|
|
||||||
|
|
||||||
layouts = ff_all_channel_counts();
|
|
||||||
if (!layouts)
|
|
||||||
return AVERROR(ENOMEM);
|
|
||||||
if ((ret = ff_channel_layouts_ref(layouts, &inlink->outcfg.channel_layouts)) < 0)
|
|
||||||
return ret;
|
|
||||||
|
|
||||||
formats = ff_all_samplerates();
|
|
||||||
if ((ret = ff_formats_ref(formats, &inlink->outcfg.samplerates)) < 0)
|
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
formats = ff_make_format_list(pix_fmts);
|
formats = ff_make_format_list(pix_fmts);
|
||||||
if ((ret = ff_formats_ref(formats, &outlink->incfg.formats)) < 0)
|
if ((ret = ff_formats_ref(formats, &cfg_out[0]->formats)) < 0)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -322,7 +311,7 @@ const AVFilter ff_avf_abitscope = {
|
||||||
.priv_size = sizeof(AudioBitScopeContext),
|
.priv_size = sizeof(AudioBitScopeContext),
|
||||||
FILTER_INPUTS(inputs),
|
FILTER_INPUTS(inputs),
|
||||||
FILTER_OUTPUTS(outputs),
|
FILTER_OUTPUTS(outputs),
|
||||||
FILTER_QUERY_FUNC(query_formats),
|
FILTER_QUERY_FUNC2(query_formats),
|
||||||
.uninit = uninit,
|
.uninit = uninit,
|
||||||
.activate = activate,
|
.activate = activate,
|
||||||
.priv_class = &abitscope_class,
|
.priv_class = &abitscope_class,
|
||||||
|
|
Loading…
Reference in New Issue