@@ -246,28 +246,17 @@ static int query_formats(AVFilterContext *ctx)
static const enum AVSampleFormat sample_fmts[] = { AV_SAMPLE_FMT_DBLP, AV_SAMPLE_FMT_NONE };
int64_t chlayouts[] = { eval->chlayout ? eval->chlayout : FF_COUNT2LAYOUT(eval->nb_channels) , -1 };
int sample_rates[] = { eval->sample_rate, -1 };
- AVFilterFormats *formats;
- AVFilterChannelLayouts *layouts;
int ret;
- formats = ff_make_format_list(sample_fmts);
- if (!formats)
- return AVERROR(ENOMEM);
- ret = ff_set_common_formats (ctx, formats);
+ ret = ff_set_common_formats_from_list(ctx, sample_fmts);
if (ret < 0)
return ret;
- layouts = ff_make_format64_list(chlayouts);
- if (!layouts)
- return AVERROR(ENOMEM);
- ret = ff_set_common_channel_layouts(ctx, layouts);
+ ret = ff_set_common_channel_layouts_from_list(ctx, chlayouts);
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_list(ctx, sample_rates);
}
static int request_frame(AVFilterLink *outlink)
@@ -349,7 +338,6 @@ AVFILTER_DEFINE_CLASS(aeval);
static int aeval_query_formats(AVFilterContext *ctx)
{
- AVFilterFormats *formats = NULL;
AVFilterChannelLayouts *layouts;
AVFilterLink *inlink = ctx->inputs[0];
AVFilterLink *outlink = ctx->outputs[0];
@@ -365,8 +353,7 @@ static int aeval_query_formats(AVFilterContext *ctx)
return ret;
if (eval->same_chlayout) {
- layouts = ff_all_channel_counts();
- if ((ret = ff_set_common_channel_layouts(ctx, layouts)) < 0)
+ if ((ret = ff_set_all_channel_counts(ctx)) < 0)
return ret;
} else {
// outlink supports only requested output channel layout
@@ -379,12 +366,10 @@ static int aeval_query_formats(AVFilterContext *ctx)
return ret;
}
- formats = ff_make_format_list(sample_fmts);
- if ((ret = ff_set_common_formats(ctx, formats)) < 0)
+ if ((ret = ff_set_common_formats_from_list(ctx, sample_fmts)) < 0)
return ret;
- formats = ff_all_samplerates();
- return ff_set_common_samplerates(ctx, formats);
+ return ff_set_all_samplerates(ctx);
}
static int aeval_config_output(AVFilterLink *outlink)
@@ -44,8 +44,6 @@ AVFILTER_DEFINE_CLASS(acontrast);
static int query_formats(AVFilterContext *ctx)
{
- AVFilterFormats *formats = NULL;
- AVFilterChannelLayouts *layouts = NULL;
static const enum AVSampleFormat sample_fmts[] = {
AV_SAMPLE_FMT_FLT, AV_SAMPLE_FMT_FLTP,
AV_SAMPLE_FMT_DBL, AV_SAMPLE_FMT_DBLP,
@@ -53,23 +51,15 @@ static int query_formats(AVFilterContext *ctx)
};
int ret;
- formats = ff_make_format_list(sample_fmts);
- if (!formats)
- return AVERROR(ENOMEM);
- ret = ff_set_common_formats(ctx, formats);
+ ret = ff_set_common_formats_from_list(ctx, sample_fmts);
if (ret < 0)
return ret;
- layouts = ff_all_channel_counts();
- if (!layouts)
- return AVERROR(ENOMEM);
-
- ret = ff_set_common_channel_layouts(ctx, layouts);
+ ret = ff_set_all_channel_counts(ctx);
if (ret < 0)
return ret;
- formats = ff_all_samplerates();
- return ff_set_common_samplerates(ctx, formats);
+ return ff_set_all_samplerates(ctx);
}
static void filter_flt(void **d, const void **s,
@@ -305,32 +305,21 @@ static void calc_q_factors(int order, double *q)
static int query_formats(AVFilterContext *ctx)
{
- AVFilterFormats *formats;
- AVFilterChannelLayouts *layouts;
static const enum AVSampleFormat sample_fmts[] = {
AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_DBLP,
AV_SAMPLE_FMT_NONE
};
int ret;
- layouts = ff_all_channel_counts();
- if (!layouts)
- return AVERROR(ENOMEM);
- ret = ff_set_common_channel_layouts(ctx, layouts);
+ ret = ff_set_all_channel_counts(ctx);
if (ret < 0)
return ret;
- formats = ff_make_format_list(sample_fmts);
- if (!formats)
- return AVERROR(ENOMEM);
- ret = ff_set_common_formats(ctx, formats);
+ ret = ff_set_common_formats_from_list(ctx, sample_fmts);
if (ret < 0)
return ret;
- formats = ff_all_samplerates();
- if (!formats)
- return AVERROR(ENOMEM);
- return ff_set_common_samplerates(ctx, formats);
+ return ff_set_all_samplerates(ctx);
}
#define BIQUAD_PROCESS(name, type) \
@@ -265,32 +265,21 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
static int query_formats(AVFilterContext *ctx)
{
- AVFilterFormats *formats;
- AVFilterChannelLayouts *layouts;
static const enum AVSampleFormat sample_fmts[] = {
AV_SAMPLE_FMT_DBL,
AV_SAMPLE_FMT_NONE
};
int ret;
- layouts = ff_all_channel_counts();
- if (!layouts)
- return AVERROR(ENOMEM);
- ret = ff_set_common_channel_layouts(ctx, layouts);
+ ret = ff_set_all_channel_counts(ctx);
if (ret < 0)
return ret;
- formats = ff_make_format_list(sample_fmts);
- if (!formats)
- return AVERROR(ENOMEM);
- ret = ff_set_common_formats(ctx, formats);
+ ret = ff_set_common_formats_from_list(ctx, sample_fmts);
if (ret < 0)
return ret;
- formats = ff_all_samplerates();
- if (!formats)
- return AVERROR(ENOMEM);
- return ff_set_common_samplerates(ctx, formats);
+ return ff_set_all_samplerates(ctx);
}
static av_cold void uninit(AVFilterContext *ctx)
@@ -115,31 +115,21 @@ AVFILTER_DEFINE_CLASS(adeclick);
static int query_formats(AVFilterContext *ctx)
{
- AVFilterFormats *formats = NULL;
- AVFilterChannelLayouts *layouts = NULL;
static const enum AVSampleFormat sample_fmts[] = {
AV_SAMPLE_FMT_DBLP,
AV_SAMPLE_FMT_NONE
};
int ret;
- formats = ff_make_format_list(sample_fmts);
- if (!formats)
- return AVERROR(ENOMEM);
- ret = ff_set_common_formats(ctx, formats);
+ ret = ff_set_common_formats_from_list(ctx, sample_fmts);
if (ret < 0)
return ret;
- layouts = ff_all_channel_counts();
- if (!layouts)
- return AVERROR(ENOMEM);
-
- ret = ff_set_common_channel_layouts(ctx, layouts);
+ ret = ff_set_all_channel_counts(ctx);
if (ret < 0)
return ret;
- formats = ff_all_samplerates();
- return ff_set_common_samplerates(ctx, formats);
+ return ff_set_all_samplerates(ctx);
}
static int config_input(AVFilterLink *inlink)
@@ -63,33 +63,20 @@ AVFILTER_DEFINE_CLASS(adelay);
static int query_formats(AVFilterContext *ctx)
{
- AVFilterChannelLayouts *layouts;
- AVFilterFormats *formats;
static const enum AVSampleFormat sample_fmts[] = {
AV_SAMPLE_FMT_U8P, AV_SAMPLE_FMT_S16P, AV_SAMPLE_FMT_S32P,
AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_DBLP,
AV_SAMPLE_FMT_NONE
};
- int ret;
-
- layouts = ff_all_channel_counts();
- if (!layouts)
- return AVERROR(ENOMEM);
- ret = ff_set_common_channel_layouts(ctx, layouts);
+ int ret = ff_set_all_channel_counts(ctx);
if (ret < 0)
return ret;
- formats = ff_make_format_list(sample_fmts);
- if (!formats)
- return AVERROR(ENOMEM);
- ret = ff_set_common_formats(ctx, formats);
+ ret = ff_set_common_formats_from_list(ctx, sample_fmts);
if (ret < 0)
return ret;
- formats = ff_all_samplerates();
- if (!formats)
- return AVERROR(ENOMEM);
- return ff_set_common_samplerates(ctx, formats);
+ return ff_set_all_samplerates(ctx);
}
#define DELAY(name, type, fill) \
@@ -45,31 +45,19 @@ typedef struct ADenormContext {
static int query_formats(AVFilterContext *ctx)
{
- AVFilterFormats *formats = NULL;
- AVFilterChannelLayouts *layouts = NULL;
static const enum AVSampleFormat sample_fmts[] = {
AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_DBLP,
AV_SAMPLE_FMT_NONE
};
- int ret;
-
- formats = ff_make_format_list(sample_fmts);
- if (!formats)
- return AVERROR(ENOMEM);
- ret = ff_set_common_formats(ctx, formats);
+ int ret = ff_set_common_formats_from_list(ctx, sample_fmts);
if (ret < 0)
return ret;
- layouts = ff_all_channel_counts();
- if (!layouts)
- return AVERROR(ENOMEM);
-
- ret = ff_set_common_channel_layouts(ctx, layouts);
+ ret = ff_set_all_channel_counts(ctx);
if (ret < 0)
return ret;
- formats = ff_all_samplerates();
- return ff_set_common_samplerates(ctx, formats);
+ return ff_set_all_samplerates(ctx);
}
static void dc_denorm_fltp(AVFilterContext *ctx, void *dstp,
@@ -29,8 +29,6 @@ typedef struct ADerivativeContext {
static int query_formats(AVFilterContext *ctx)
{
- AVFilterFormats *formats = NULL;
- AVFilterChannelLayouts *layouts = NULL;
static const enum AVSampleFormat derivative_sample_fmts[] = {
AV_SAMPLE_FMT_S16P, AV_SAMPLE_FMT_FLTP,
AV_SAMPLE_FMT_S32P, AV_SAMPLE_FMT_DBLP,
@@ -40,26 +38,16 @@ static int query_formats(AVFilterContext *ctx)
AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_DBLP,
AV_SAMPLE_FMT_NONE
};
- int ret;
-
- formats = ff_make_format_list(strcmp(ctx->filter->name, "aintegral") ?
- derivative_sample_fmts : integral_sample_fmts);
- if (!formats)
- return AVERROR(ENOMEM);
- ret = ff_set_common_formats(ctx, formats);
+ int ret = ff_set_common_formats_from_list(ctx, strcmp(ctx->filter->name, "aintegral") ?
+ derivative_sample_fmts : integral_sample_fmts);
if (ret < 0)
return ret;
- layouts = ff_all_channel_counts();
- if (!layouts)
- return AVERROR(ENOMEM);
-
- ret = ff_set_common_channel_layouts(ctx, layouts);
+ ret = ff_set_all_channel_counts(ctx);
if (ret < 0)
return ret;
- formats = ff_all_samplerates();
- return ff_set_common_samplerates(ctx, formats);
+ return ff_set_all_samplerates(ctx);
}
#define DERIVATIVE(name, type) \
@@ -154,33 +154,20 @@ static av_cold int init(AVFilterContext *ctx)
static int query_formats(AVFilterContext *ctx)
{
- AVFilterChannelLayouts *layouts;
- AVFilterFormats *formats;
static const enum AVSampleFormat sample_fmts[] = {
AV_SAMPLE_FMT_S16P, AV_SAMPLE_FMT_S32P,
AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_DBLP,
AV_SAMPLE_FMT_NONE
};
- int ret;
-
- layouts = ff_all_channel_counts();
- if (!layouts)
- return AVERROR(ENOMEM);
- ret = ff_set_common_channel_layouts(ctx, layouts);
+ int ret = ff_set_all_channel_counts(ctx);
if (ret < 0)
return ret;
- formats = ff_make_format_list(sample_fmts);
- if (!formats)
- return AVERROR(ENOMEM);
- ret = ff_set_common_formats(ctx, formats);
+ ret = ff_set_common_formats_from_list(ctx, sample_fmts);
if (ret < 0)
return ret;
- formats = ff_all_samplerates();
- if (!formats)
- return AVERROR(ENOMEM);
- return ff_set_common_samplerates(ctx, formats);
+ return ff_set_all_samplerates(ctx);
}
#define MOD(a, b) (((a) >= (b)) ? (a) - (b) : (a))
@@ -153,32 +153,19 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
static int query_formats(AVFilterContext *ctx)
{
- AVFilterChannelLayouts *layouts;
- AVFilterFormats *formats;
static const enum AVSampleFormat sample_fmts[] = {
AV_SAMPLE_FMT_DBLP,
AV_SAMPLE_FMT_NONE
};
- int ret;
-
- layouts = ff_all_channel_counts();
- if (!layouts)
- return AVERROR(ENOMEM);
- ret = ff_set_common_channel_layouts(ctx, layouts);
+ int ret = ff_set_all_channel_counts(ctx);
if (ret < 0)
return ret;
- formats = ff_make_format_list(sample_fmts);
- if (!formats)
- return AVERROR(ENOMEM);
- ret = ff_set_common_formats(ctx, formats);
+ ret = ff_set_common_formats_from_list(ctx, sample_fmts);
if (ret < 0)
return ret;
- formats = ff_all_samplerates();
- if (!formats)
- return AVERROR(ENOMEM);
- return ff_set_common_samplerates(ctx, formats);
+ return ff_set_all_samplerates(ctx);
}
static inline void set_highshelf_rbj(BiquadCoeffs *bq, double freq, double q, double peak, double sr)
@@ -220,32 +220,19 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
static int query_formats(AVFilterContext *ctx)
{
- AVFilterFormats *formats;
- AVFilterChannelLayouts *layouts;
static const enum AVSampleFormat sample_fmts[] = {
AV_SAMPLE_FMT_DBL,
AV_SAMPLE_FMT_NONE
};
- int ret;
-
- layouts = ff_all_channel_counts();
- if (!layouts)
- return AVERROR(ENOMEM);
- ret = ff_set_common_channel_layouts(ctx, layouts);
+ int ret = ff_set_all_channel_counts(ctx);
if (ret < 0)
return ret;
- formats = ff_make_format_list(sample_fmts);
- if (!formats)
- return AVERROR(ENOMEM);
- ret = ff_set_common_formats(ctx, formats);
+ ret = ff_set_common_formats_from_list(ctx, sample_fmts);
if (ret < 0)
return ret;
- formats = ff_all_samplerates();
- if (!formats)
- return AVERROR(ENOMEM);
- return ff_set_common_samplerates(ctx, formats);
+ return ff_set_all_samplerates(ctx);
}
static av_cold void uninit(AVFilterContext *ctx)
@@ -59,8 +59,6 @@ enum CurveType { NONE = -1, TRI, QSIN, ESIN, HSIN, LOG, IPAR, QUA, CUB, SQU, CBR
static int query_formats(AVFilterContext *ctx)
{
- AVFilterFormats *formats;
- AVFilterChannelLayouts *layouts;
static const enum AVSampleFormat sample_fmts[] = {
AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_S16P,
AV_SAMPLE_FMT_S32, AV_SAMPLE_FMT_S32P,
@@ -68,26 +66,15 @@ static int query_formats(AVFilterContext *ctx)
AV_SAMPLE_FMT_DBL, AV_SAMPLE_FMT_DBLP,
AV_SAMPLE_FMT_NONE
};
- int ret;
-
- layouts = ff_all_channel_counts();
- if (!layouts)
- return AVERROR(ENOMEM);
- ret = ff_set_common_channel_layouts(ctx, layouts);
+ int ret = ff_set_all_channel_counts(ctx);
if (ret < 0)
return ret;
- formats = ff_make_format_list(sample_fmts);
- if (!formats)
- return AVERROR(ENOMEM);
- ret = ff_set_common_formats(ctx, formats);
+ ret = ff_set_common_formats_from_list(ctx, sample_fmts);
if (ret < 0)
return ret;
- formats = ff_all_samplerates();
- if (!formats)
- return AVERROR(ENOMEM);
- return ff_set_common_samplerates(ctx, formats);
+ return ff_set_all_samplerates(ctx);
}
static double fade_gain(int curve, int64_t index, int64_t range)
@@ -1349,31 +1349,19 @@ static av_cold void uninit(AVFilterContext *ctx)
static int query_formats(AVFilterContext *ctx)
{
- AVFilterFormats *formats = NULL;
- AVFilterChannelLayouts *layouts = NULL;
static const enum AVSampleFormat sample_fmts[] = {
AV_SAMPLE_FMT_FLTP,
AV_SAMPLE_FMT_NONE
};
- int ret;
-
- formats = ff_make_format_list(sample_fmts);
- if (!formats)
- return AVERROR(ENOMEM);
- ret = ff_set_common_formats(ctx, formats);
+ int ret = ff_set_common_formats_from_list(ctx, sample_fmts);
if (ret < 0)
return ret;
- layouts = ff_all_channel_counts();
- if (!layouts)
- return AVERROR(ENOMEM);
-
- ret = ff_set_common_channel_layouts(ctx, layouts);
+ ret = ff_set_all_channel_counts(ctx);
if (ret < 0)
return ret;
- formats = ff_all_samplerates();
- return ff_set_common_samplerates(ctx, formats);
+ return ff_set_all_samplerates(ctx);
}
static int process_command(AVFilterContext *ctx, const char *cmd, const char *args,
@@ -412,32 +412,19 @@ static int activate(AVFilterContext *ctx)
static int query_formats(AVFilterContext *ctx)
{
- AVFilterFormats *formats;
- AVFilterChannelLayouts *layouts;
static const enum AVSampleFormat sample_fmts[] = {
AV_SAMPLE_FMT_FLTP,
AV_SAMPLE_FMT_NONE
};
- int ret;
-
- layouts = ff_all_channel_counts();
- if (!layouts)
- return AVERROR(ENOMEM);
- ret = ff_set_common_channel_layouts(ctx, layouts);
+ int ret = ff_set_all_channel_counts(ctx);
if (ret < 0)
return ret;
- formats = ff_make_format_list(sample_fmts);
- if (!formats)
- return AVERROR(ENOMEM);
- ret = ff_set_common_formats(ctx, formats);
+ ret = ff_set_common_formats_from_list(ctx, sample_fmts);
if (ret < 0)
return ret;
- formats = ff_all_samplerates();
- if (!formats)
- return AVERROR(ENOMEM);
- return ff_set_common_samplerates(ctx, formats);
+ return ff_set_all_samplerates(ctx);
}
static av_cold void uninit(AVFilterContext *ctx)
@@ -715,8 +715,6 @@ static int activate(AVFilterContext *ctx)
static int query_formats(AVFilterContext *ctx)
{
AudioFIRContext *s = ctx->priv;
- AVFilterFormats *formats;
- AVFilterChannelLayouts *layouts;
static const enum AVSampleFormat sample_fmts[] = {
AV_SAMPLE_FMT_FLTP,
AV_SAMPLE_FMT_NONE
@@ -729,21 +727,18 @@ static int query_formats(AVFilterContext *ctx)
if (s->response) {
AVFilterLink *videolink = ctx->outputs[1];
- formats = ff_make_format_list(pix_fmts);
+ AVFilterFormats *formats = ff_make_format_list(pix_fmts);
if ((ret = ff_formats_ref(formats, &videolink->incfg.formats)) < 0)
return ret;
}
- layouts = ff_all_channel_counts();
- if (!layouts)
- return AVERROR(ENOMEM);
-
if (s->ir_format) {
- ret = ff_set_common_channel_layouts(ctx, layouts);
+ ret = ff_set_all_channel_counts(ctx);
if (ret < 0)
return ret;
} else {
AVFilterChannelLayouts *mono = NULL;
+ AVFilterChannelLayouts *layouts = ff_all_channel_counts();
if ((ret = ff_channel_layouts_ref(layouts, &ctx->inputs[0]->outcfg.channel_layouts)) < 0)
return ret;
@@ -759,12 +754,10 @@ static int query_formats(AVFilterContext *ctx)
}
}
- formats = ff_make_format_list(sample_fmts);
- if ((ret = ff_set_common_formats(ctx, formats)) < 0)
+ if ((ret = ff_set_common_formats_from_list(ctx, sample_fmts)) < 0)
return ret;
- formats = ff_all_samplerates();
- return ff_set_common_samplerates(ctx, formats);
+ return ff_set_all_samplerates(ctx);
}
static int config_output(AVFilterLink *outlink)
@@ -49,32 +49,20 @@ typedef struct AFreqShift {
static int query_formats(AVFilterContext *ctx)
{
- AVFilterFormats *formats = NULL;
- AVFilterChannelLayouts *layouts = NULL;
static const enum AVSampleFormat sample_fmts[] = {
AV_SAMPLE_FMT_FLTP,
AV_SAMPLE_FMT_DBLP,
AV_SAMPLE_FMT_NONE
};
- int ret;
-
- formats = ff_make_format_list(sample_fmts);
- if (!formats)
- return AVERROR(ENOMEM);
- ret = ff_set_common_formats(ctx, formats);
+ int ret = ff_set_common_formats_from_list(ctx, sample_fmts);
if (ret < 0)
return ret;
- layouts = ff_all_channel_counts();
- if (!layouts)
- return AVERROR(ENOMEM);
-
- ret = ff_set_common_channel_layouts(ctx, layouts);
+ ret = ff_set_all_channel_counts(ctx);
if (ret < 0)
return ret;
- formats = ff_all_samplerates();
- return ff_set_common_samplerates(ctx, formats);
+ return ff_set_all_samplerates(ctx);
}
#define PFILTER(name, type, sin, cos, cc) \
@@ -463,31 +463,19 @@ AVFILTER_DEFINE_CLASS(afwtdn);
static int query_formats(AVFilterContext *ctx)
{
- AVFilterFormats *formats = NULL;
- AVFilterChannelLayouts *layouts = NULL;
static const enum AVSampleFormat sample_fmts[] = {
AV_SAMPLE_FMT_DBLP,
AV_SAMPLE_FMT_NONE
};
- int ret;
-
- formats = ff_make_format_list(sample_fmts);
- if (!formats)
- return AVERROR(ENOMEM);
- ret = ff_set_common_formats(ctx, formats);
+ int ret = ff_set_common_formats_from_list(ctx, sample_fmts);
if (ret < 0)
return ret;
- layouts = ff_all_channel_counts();
- if (!layouts)
- return AVERROR(ENOMEM);
-
- ret = ff_set_common_channel_layouts(ctx, layouts);
+ ret = ff_set_all_channel_counts(ctx);
if (ret < 0)
return ret;
- formats = ff_all_samplerates();
- return ff_set_common_samplerates(ctx, formats);
+ return ff_set_all_samplerates(ctx);
}
#define pow2(x) (1U << (x))
@@ -189,7 +189,6 @@ AVFILTER_DEFINE_CLASS(agate);
static int query_formats(AVFilterContext *ctx)
{
AVFilterFormats *formats = NULL;
- AVFilterChannelLayouts *layouts;
int ret;
if ((ret = ff_add_format(&formats, AV_SAMPLE_FMT_DBL)) < 0)
@@ -198,18 +197,11 @@ static int query_formats(AVFilterContext *ctx)
if (ret < 0)
return ret;
- layouts = ff_all_channel_counts();
- if (!layouts)
- return AVERROR(ENOMEM);
- ret = ff_set_common_channel_layouts(ctx, layouts);
+ ret = ff_set_all_channel_counts(ctx);
if (ret < 0)
return ret;
- formats = ff_all_samplerates();
- if (!formats)
- return AVERROR(ENOMEM);
-
- return ff_set_common_samplerates(ctx, formats);
+ return ff_set_all_samplerates(ctx);
}
static int filter_frame(AVFilterLink *inlink, AVFrame *in)
@@ -346,7 +338,6 @@ static int activate(AVFilterContext *ctx)
static int scquery_formats(AVFilterContext *ctx)
{
- AVFilterFormats *formats;
AVFilterChannelLayouts *layouts = NULL;
static const enum AVSampleFormat sample_fmts[] = {
AV_SAMPLE_FMT_DBL,
@@ -371,12 +362,10 @@ static int scquery_formats(AVFilterContext *ctx)
return ret;
}
- formats = ff_make_format_list(sample_fmts);
- if ((ret = ff_set_common_formats(ctx, formats)) < 0)
+ if ((ret = ff_set_common_formats_from_list(ctx, sample_fmts)) < 0)
return ret;
- formats = ff_all_samplerates();
- return ff_set_common_samplerates(ctx, formats);
+ return ff_set_all_samplerates(ctx);
}
static int scconfig_output(AVFilterLink *outlink)
@@ -79,7 +79,6 @@ static int query_formats(AVFilterContext *ctx)
{
AudioIIRContext *s = ctx->priv;
AVFilterFormats *formats;
- AVFilterChannelLayouts *layouts;
enum AVSampleFormat sample_fmts[] = {
AV_SAMPLE_FMT_DBLP,
AV_SAMPLE_FMT_NONE
@@ -98,25 +97,16 @@ static int query_formats(AVFilterContext *ctx)
return ret;
}
- layouts = ff_all_channel_counts();
- if (!layouts)
- return AVERROR(ENOMEM);
- ret = ff_set_common_channel_layouts(ctx, layouts);
+ ret = ff_set_all_channel_counts(ctx);
if (ret < 0)
return ret;
sample_fmts[0] = s->sample_format;
- formats = ff_make_format_list(sample_fmts);
- if (!formats)
- return AVERROR(ENOMEM);
- ret = ff_set_common_formats(ctx, formats);
+ ret = ff_set_common_formats_from_list(ctx, sample_fmts);
if (ret < 0)
return ret;
- formats = ff_all_samplerates();
- if (!formats)
- return AVERROR(ENOMEM);
- return ff_set_common_samplerates(ctx, formats);
+ return ff_set_all_samplerates(ctx);
}
#define IIR_CH(name, type, min, max, need_clipping) \
@@ -278,32 +278,19 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
static int query_formats(AVFilterContext *ctx)
{
- AVFilterFormats *formats;
- AVFilterChannelLayouts *layouts;
static const enum AVSampleFormat sample_fmts[] = {
AV_SAMPLE_FMT_DBL,
AV_SAMPLE_FMT_NONE
};
- int ret;
-
- layouts = ff_all_channel_counts();
- if (!layouts)
- return AVERROR(ENOMEM);
- ret = ff_set_common_channel_layouts(ctx, layouts);
+ int ret = ff_set_all_channel_counts(ctx);
if (ret < 0)
return ret;
- formats = ff_make_format_list(sample_fmts);
- if (!formats)
- return AVERROR(ENOMEM);
- ret = ff_set_common_formats(ctx, formats);
+ ret = ff_set_common_formats_from_list(ctx, sample_fmts);
if (ret < 0)
return ret;
- formats = ff_all_samplerates();
- if (!formats)
- return AVERROR(ENOMEM);
- return ff_set_common_samplerates(ctx, formats);
+ return ff_set_all_samplerates(ctx);
}
static int config_input(AVFilterLink *inlink)
@@ -76,7 +76,6 @@ static int query_formats(AVFilterContext *ctx)
};
AMergeContext *s = ctx->priv;
int64_t inlayout[SWR_CH_MAX], outlayout = 0;
- AVFilterFormats *formats;
AVFilterChannelLayouts *layouts;
int i, ret, overlap = 0, nb_ch = 0;
@@ -129,8 +128,7 @@ static int query_formats(AVFilterContext *ctx)
if ((inlayout[i] >> c) & 1)
*(route[i]++) = out_ch_number++;
}
- formats = ff_make_format_list(packed_sample_fmts);
- if ((ret = ff_set_common_formats(ctx, formats)) < 0)
+ if ((ret = ff_set_common_formats_from_list(ctx, packed_sample_fmts)) < 0)
return ret;
for (i = 0; i < s->nb_inputs; i++) {
layouts = NULL;
@@ -145,7 +143,7 @@ static int query_formats(AVFilterContext *ctx)
if ((ret = ff_channel_layouts_ref(layouts, &ctx->outputs[0]->incfg.channel_layouts)) < 0)
return ret;
- return ff_set_common_samplerates(ctx, ff_all_samplerates());
+ return ff_set_all_samplerates(ctx);
}
static int config_output(AVFilterLink *outlink)
@@ -603,11 +603,11 @@ static int query_formats(AVFilterContext *ctx)
};
int ret;
- if ((ret = ff_set_common_formats(ctx, ff_make_format_list(sample_fmts))) < 0 ||
- (ret = ff_set_common_samplerates(ctx, ff_all_samplerates())) < 0)
+ if ((ret = ff_set_common_formats_from_list(ctx, sample_fmts)) < 0 ||
+ (ret = ff_set_all_samplerates(ctx)) < 0)
return ret;
- return ff_set_common_channel_layouts(ctx, ff_all_channel_counts());
+ return ff_set_all_channel_counts(ctx);
}
static int process_command(AVFilterContext *ctx, const char *cmd, const char *args,
@@ -42,33 +42,20 @@ typedef struct AudioMultiplyContext {
static int query_formats(AVFilterContext *ctx)
{
- AVFilterFormats *formats;
- AVFilterChannelLayouts *layouts;
static const enum AVSampleFormat sample_fmts[] = {
AV_SAMPLE_FMT_FLT, AV_SAMPLE_FMT_FLTP,
AV_SAMPLE_FMT_DBL, AV_SAMPLE_FMT_DBLP,
AV_SAMPLE_FMT_NONE
};
- int ret;
-
- layouts = ff_all_channel_counts();
- if (!layouts)
- return AVERROR(ENOMEM);
- ret = ff_set_common_channel_layouts(ctx, layouts);
+ int ret = ff_set_all_channel_counts(ctx);
if (ret < 0)
return ret;
- formats = ff_make_format_list(sample_fmts);
- if (!formats)
- return AVERROR(ENOMEM);
- ret = ff_set_common_formats(ctx, formats);
+ ret = ff_set_common_formats_from_list(ctx, sample_fmts);
if (ret < 0)
return ret;
- formats = ff_all_samplerates();
- if (!formats)
- return AVERROR(ENOMEM);
- return ff_set_common_samplerates(ctx, formats);
+ return ff_set_all_samplerates(ctx);
}
static int activate(AVFilterContext *ctx)
@@ -95,31 +95,19 @@ AVFILTER_DEFINE_CLASS(anlmdn);
static int query_formats(AVFilterContext *ctx)
{
- AVFilterFormats *formats = NULL;
- AVFilterChannelLayouts *layouts = NULL;
static const enum AVSampleFormat sample_fmts[] = {
AV_SAMPLE_FMT_FLTP,
AV_SAMPLE_FMT_NONE
};
- int ret;
-
- formats = ff_make_format_list(sample_fmts);
- if (!formats)
- return AVERROR(ENOMEM);
- ret = ff_set_common_formats(ctx, formats);
+ int ret = ff_set_common_formats_from_list(ctx, sample_fmts);
if (ret < 0)
return ret;
- layouts = ff_all_channel_counts();
- if (!layouts)
- return AVERROR(ENOMEM);
-
- ret = ff_set_common_channel_layouts(ctx, layouts);
+ ret = ff_set_all_channel_counts(ctx);
if (ret < 0)
return ret;
- formats = ff_all_samplerates();
- return ff_set_common_samplerates(ctx, formats);
+ return ff_set_all_samplerates(ctx);
}
static float compute_distance_ssd_c(const float *f1, const float *f2, ptrdiff_t K)
@@ -78,32 +78,19 @@ AVFILTER_DEFINE_CLASS(anlms);
static int query_formats(AVFilterContext *ctx)
{
- AVFilterFormats *formats;
- AVFilterChannelLayouts *layouts;
static const enum AVSampleFormat sample_fmts[] = {
AV_SAMPLE_FMT_FLTP,
AV_SAMPLE_FMT_NONE
};
- int ret;
-
- layouts = ff_all_channel_counts();
- if (!layouts)
- return AVERROR(ENOMEM);
- ret = ff_set_common_channel_layouts(ctx, layouts);
+ int ret = ff_set_all_channel_counts(ctx);
if (ret < 0)
return ret;
- formats = ff_make_format_list(sample_fmts);
- if (!formats)
- return AVERROR(ENOMEM);
- ret = ff_set_common_formats(ctx, formats);
+ ret = ff_set_common_formats_from_list(ctx, sample_fmts);
if (ret < 0)
return ret;
- formats = ff_all_samplerates();
- if (!formats)
- return AVERROR(ENOMEM);
- return ff_set_common_samplerates(ctx, formats);
+ return ff_set_all_samplerates(ctx);
}
static float fir_sample(AudioNLMSContext *s, float sample, float *delay,
@@ -85,8 +85,6 @@ static av_cold int init(AVFilterContext *ctx)
static int query_formats(AVFilterContext *ctx)
{
- AVFilterFormats *formats;
- AVFilterChannelLayouts *layouts;
static const enum AVSampleFormat sample_fmts[] = {
AV_SAMPLE_FMT_DBL, AV_SAMPLE_FMT_DBLP,
AV_SAMPLE_FMT_FLT, AV_SAMPLE_FMT_FLTP,
@@ -94,26 +92,15 @@ static int query_formats(AVFilterContext *ctx)
AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_S16P,
AV_SAMPLE_FMT_NONE
};
- int ret;
-
- layouts = ff_all_channel_counts();
- if (!layouts)
- return AVERROR(ENOMEM);
- ret = ff_set_common_channel_layouts(ctx, layouts);
+ int ret = ff_set_all_channel_counts(ctx);
if (ret < 0)
return ret;
- formats = ff_make_format_list(sample_fmts);
- if (!formats)
- return AVERROR(ENOMEM);
- ret = ff_set_common_formats(ctx, formats);
+ ret = ff_set_common_formats_from_list(ctx, sample_fmts);
if (ret < 0)
return ret;
- formats = ff_all_samplerates();
- if (!formats)
- return AVERROR(ENOMEM);
- return ff_set_common_samplerates(ctx, formats);
+ return ff_set_all_samplerates(ctx);
}
#define MOD(a, b) (((a) >= (b)) ? (a) - (b) : (a))
@@ -196,8 +196,7 @@ static int query_formats(AVFilterContext *ctx)
(ret = ff_set_common_channel_layouts (ctx , layout )) < 0)
return ret;
- formats = ff_all_samplerates();
- return ff_set_common_samplerates(ctx, formats);
+ return ff_set_all_samplerates(ctx);
}
static int config_input(AVFilterLink *inlink)
@@ -330,33 +330,21 @@ static int rnnoise_model_from_file(FILE *f, RNNModel **rnn)
static int query_formats(AVFilterContext *ctx)
{
- AVFilterFormats *formats = NULL;
- AVFilterChannelLayouts *layouts = NULL;
static const enum AVSampleFormat sample_fmts[] = {
AV_SAMPLE_FMT_FLTP,
AV_SAMPLE_FMT_NONE
};
int ret, sample_rates[] = { 48000, -1 };
- formats = ff_make_format_list(sample_fmts);
- if (!formats)
- return AVERROR(ENOMEM);
- ret = ff_set_common_formats(ctx, formats);
+ ret = ff_set_common_formats_from_list(ctx, sample_fmts);
if (ret < 0)
return ret;
- layouts = ff_all_channel_counts();
- if (!layouts)
- return AVERROR(ENOMEM);
-
- ret = ff_set_common_channel_layouts(ctx, layouts);
+ ret = ff_set_all_channel_counts(ctx);
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_list(ctx, sample_rates);
}
static int config_input(AVFilterLink *inlink)
@@ -84,32 +84,20 @@ AVFILTER_DEFINE_CLASS(asoftclip);
static int query_formats(AVFilterContext *ctx)
{
- AVFilterFormats *formats = NULL;
- AVFilterChannelLayouts *layouts = NULL;
static const enum AVSampleFormat sample_fmts[] = {
AV_SAMPLE_FMT_FLT, AV_SAMPLE_FMT_FLTP,
AV_SAMPLE_FMT_DBL, AV_SAMPLE_FMT_DBLP,
AV_SAMPLE_FMT_NONE
};
- int ret;
-
- formats = ff_make_format_list(sample_fmts);
- if (!formats)
- return AVERROR(ENOMEM);
- ret = ff_set_common_formats(ctx, formats);
+ int ret = ff_set_common_formats_from_list(ctx, sample_fmts);
if (ret < 0)
return ret;
- layouts = ff_all_channel_counts();
- if (!layouts)
- return AVERROR(ENOMEM);
-
- ret = ff_set_common_channel_layouts(ctx, layouts);
+ ret = ff_set_all_channel_counts(ctx);
if (ret < 0)
return ret;
- formats = ff_all_samplerates();
- return ff_set_common_samplerates(ctx, formats);
+ return ff_set_all_samplerates(ctx);
}
static void filter_flt(ASoftClipContext *s,
@@ -133,7 +133,7 @@ static int query_formats(AVFilterContext *ctx)
(ret = ff_set_common_formats (ctx , formats )) < 0 ||
(ret = ff_add_channel_layout (&layout , AV_CH_LAYOUT_MONO )) < 0 ||
(ret = ff_set_common_channel_layouts (ctx , layout )) < 0 ||
- (ret = ff_set_common_samplerates (ctx , ff_make_format_list(sample_rates) )) < 0)
+ (ret = ff_set_common_samplerates_from_list(ctx, sample_rates )) < 0)
return ret;
return 0;
@@ -147,8 +147,6 @@ AVFILTER_DEFINE_CLASS(astats);
static int query_formats(AVFilterContext *ctx)
{
- AVFilterFormats *formats;
- AVFilterChannelLayouts *layouts;
static const enum AVSampleFormat sample_fmts[] = {
AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_S16P,
AV_SAMPLE_FMT_S32, AV_SAMPLE_FMT_S32P,
@@ -157,26 +155,15 @@ static int query_formats(AVFilterContext *ctx)
AV_SAMPLE_FMT_DBL, AV_SAMPLE_FMT_DBLP,
AV_SAMPLE_FMT_NONE
};
- int ret;
-
- layouts = ff_all_channel_counts();
- if (!layouts)
- return AVERROR(ENOMEM);
- ret = ff_set_common_channel_layouts(ctx, layouts);
+ int ret = ff_set_all_channel_counts(ctx);
if (ret < 0)
return ret;
- formats = ff_make_format_list(sample_fmts);
- if (!formats)
- return AVERROR(ENOMEM);
- ret = ff_set_common_formats(ctx, formats);
+ ret = ff_set_common_formats_from_list(ctx, sample_fmts);
if (ret < 0)
return ret;
- formats = ff_all_samplerates();
- if (!formats)
- return AVERROR(ENOMEM);
- return ff_set_common_samplerates(ctx, formats);
+ return ff_set_all_samplerates(ctx);
}
static void reset_stats(AudioStatsContext *s)
@@ -46,31 +46,19 @@ typedef struct ASubBoostContext {
static int query_formats(AVFilterContext *ctx)
{
- AVFilterFormats *formats = NULL;
- AVFilterChannelLayouts *layouts = NULL;
static const enum AVSampleFormat sample_fmts[] = {
AV_SAMPLE_FMT_DBLP,
AV_SAMPLE_FMT_NONE
};
- int ret;
-
- formats = ff_make_format_list(sample_fmts);
- if (!formats)
- return AVERROR(ENOMEM);
- ret = ff_set_common_formats(ctx, formats);
+ int ret = ff_set_common_formats_from_list(ctx, sample_fmts);
if (ret < 0)
return ret;
- layouts = ff_all_channel_counts();
- if (!layouts)
- return AVERROR(ENOMEM);
-
- ret = ff_set_common_channel_layouts(ctx, layouts);
+ ret = ff_set_all_channel_counts(ctx);
if (ret < 0)
return ret;
- formats = ff_all_samplerates();
- return ff_set_common_samplerates(ctx, formats);
+ return ff_set_all_samplerates(ctx);
}
static int get_coeffs(AVFilterContext *ctx)
@@ -51,32 +51,20 @@ typedef struct ASuperCutContext {
static int query_formats(AVFilterContext *ctx)
{
- AVFilterFormats *formats = NULL;
- AVFilterChannelLayouts *layouts = NULL;
static const enum AVSampleFormat sample_fmts[] = {
AV_SAMPLE_FMT_FLTP,
AV_SAMPLE_FMT_DBLP,
AV_SAMPLE_FMT_NONE
};
- int ret;
-
- formats = ff_make_format_list(sample_fmts);
- if (!formats)
- return AVERROR(ENOMEM);
- ret = ff_set_common_formats(ctx, formats);
+ int ret = ff_set_common_formats_from_list(ctx, sample_fmts);
if (ret < 0)
return ret;
- layouts = ff_all_channel_counts();
- if (!layouts)
- return AVERROR(ENOMEM);
-
- ret = ff_set_common_channel_layouts(ctx, layouts);
+ ret = ff_set_all_channel_counts(ctx);
if (ret < 0)
return ret;
- formats = ff_all_samplerates();
- return ff_set_common_samplerates(ctx, formats);
+ return ff_set_all_samplerates(ctx);
}
static void calc_q_factors(int n, double *q)
@@ -995,9 +995,6 @@ static av_cold void uninit(AVFilterContext *ctx)
static int query_formats(AVFilterContext *ctx)
{
- AVFilterChannelLayouts *layouts = NULL;
- AVFilterFormats *formats = NULL;
-
// WSOLA necessitates an internal sliding window ring buffer
// for incoming audio stream.
//
@@ -1012,29 +1009,15 @@ static int query_formats(AVFilterContext *ctx)
AV_SAMPLE_FMT_DBL,
AV_SAMPLE_FMT_NONE
};
- int ret;
-
- layouts = ff_all_channel_counts();
- if (!layouts) {
- return AVERROR(ENOMEM);
- }
- ret = ff_set_common_channel_layouts(ctx, layouts);
+ int ret = ff_set_all_channel_counts(ctx);
if (ret < 0)
return ret;
- formats = ff_make_format_list(sample_fmts);
- if (!formats) {
- return AVERROR(ENOMEM);
- }
- ret = ff_set_common_formats(ctx, formats);
+ ret = ff_set_common_formats_from_list(ctx, sample_fmts);
if (ret < 0)
return ret;
- formats = ff_all_samplerates();
- if (!formats) {
- return AVERROR(ENOMEM);
- }
- return ff_set_common_samplerates(ctx, formats);
+ return ff_set_all_samplerates(ctx);
}
static int config_props(AVFilterLink *inlink)
@@ -48,32 +48,19 @@ typedef struct AudioXCorrelateContext {
static int query_formats(AVFilterContext *ctx)
{
- AVFilterFormats *formats;
- AVFilterChannelLayouts *layouts;
static const enum AVSampleFormat sample_fmts[] = {
AV_SAMPLE_FMT_FLTP,
AV_SAMPLE_FMT_NONE
};
- int ret;
-
- layouts = ff_all_channel_counts();
- if (!layouts)
- return AVERROR(ENOMEM);
- ret = ff_set_common_channel_layouts(ctx, layouts);
+ int ret = ff_set_all_channel_counts(ctx);
if (ret < 0)
return ret;
- formats = ff_make_format_list(sample_fmts);
- if (!formats)
- return AVERROR(ENOMEM);
- ret = ff_set_common_formats(ctx, formats);
+ ret = ff_set_common_formats_from_list(ctx, sample_fmts);
if (ret < 0)
return ret;
- formats = ff_all_samplerates();
- if (!formats)
- return AVERROR(ENOMEM);
- return ff_set_common_samplerates(ctx, formats);
+ return ff_set_all_samplerates(ctx);
}
static float mean_sum(const float *in, int size)
@@ -146,8 +146,6 @@ typedef struct BiquadsContext {
static int query_formats(AVFilterContext *ctx)
{
BiquadsContext *s = ctx->priv;
- AVFilterFormats *formats;
- AVFilterChannelLayouts *layouts;
static const enum AVSampleFormat auto_sample_fmts[] = {
AV_SAMPLE_FMT_S16P,
AV_SAMPLE_FMT_S32P,
@@ -159,46 +157,33 @@ static int query_formats(AVFilterContext *ctx)
AV_SAMPLE_FMT_S16P,
AV_SAMPLE_FMT_NONE
};
- int ret;
-
- layouts = ff_all_channel_counts();
- if (!layouts)
- return AVERROR(ENOMEM);
- ret = ff_set_common_channel_layouts(ctx, layouts);
+ const enum AVSampleFormat *sample_fmts_list = sample_fmts;
+ int ret = ff_set_all_channel_counts(ctx);
if (ret < 0)
return ret;
switch (s->precision) {
case 0:
sample_fmts[0] = AV_SAMPLE_FMT_S16P;
- formats = ff_make_format_list(sample_fmts);
break;
case 1:
sample_fmts[0] = AV_SAMPLE_FMT_S32P;
- formats = ff_make_format_list(sample_fmts);
break;
case 2:
sample_fmts[0] = AV_SAMPLE_FMT_FLTP;
- formats = ff_make_format_list(sample_fmts);
break;
case 3:
sample_fmts[0] = AV_SAMPLE_FMT_DBLP;
- formats = ff_make_format_list(sample_fmts);
break;
default:
- formats = ff_make_format_list(auto_sample_fmts);
+ sample_fmts_list = auto_sample_fmts;
break;
}
- if (!formats)
- return AVERROR(ENOMEM);
- ret = ff_set_common_formats(ctx, formats);
+ ret = ff_set_common_formats_from_list(ctx, sample_fmts_list);
if (ret < 0)
return ret;
- formats = ff_all_samplerates();
- if (!formats)
- return AVERROR(ENOMEM);
- return ff_set_common_samplerates(ctx, formats);
+ return ff_set_all_samplerates(ctx);
}
#define BIQUAD_FILTER(name, type, min, max, need_clipping) \
@@ -92,7 +92,6 @@ static av_cold void uninit(AVFilterContext *ctx)
static int query_formats(AVFilterContext *ctx)
{
- AVFilterFormats *formats = NULL;
AVFilterChannelLayouts *layouts = NULL;
static const enum AVSampleFormat sample_fmts[] = {
@@ -111,17 +110,11 @@ static int query_formats(AVFilterContext *ctx)
if (ret < 0)
return ret;
- formats = ff_make_format_list(sample_fmts);
- if (!formats)
- return AVERROR(ENOMEM);
- ret = ff_set_common_formats(ctx, formats);
+ ret = ff_set_common_formats_from_list(ctx, sample_fmts);
if (ret < 0)
return ret;
- formats = ff_all_samplerates();
- if (!formats)
- return AVERROR(ENOMEM);
- return ff_set_common_samplerates(ctx, formats);
+ return ff_set_all_samplerates(ctx);
}
static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
@@ -284,7 +284,7 @@ static int channelmap_query_formats(AVFilterContext *ctx)
int ret;
if ((ret = ff_set_common_formats (ctx, ff_planar_sample_fmts())) < 0 ||
- (ret = ff_set_common_samplerates (ctx , ff_all_samplerates() )) < 0 ||
+ (ret = ff_set_all_samplerates(ctx )) < 0 ||
(ret = ff_add_channel_layout(&channel_layouts, s->output_layout)) < 0 ||
(ret = ff_channel_layouts_ref(channel_layouts,
&ctx->outputs[0]->incfg.channel_layouts)) < 0)
@@ -113,7 +113,7 @@ static int query_formats(AVFilterContext *ctx)
int i, ret;
if ((ret = ff_set_common_formats(ctx, ff_planar_sample_fmts())) < 0 ||
- (ret = ff_set_common_samplerates(ctx, ff_all_samplerates())) < 0)
+ (ret = ff_set_all_samplerates(ctx)) < 0)
return ret;
if ((ret = ff_add_channel_layout(&in_layouts, s->channel_layout)) < 0 ||
@@ -156,31 +156,18 @@ static av_cold int init(AVFilterContext *ctx)
static int query_formats(AVFilterContext *ctx)
{
- AVFilterFormats *formats;
- AVFilterChannelLayouts *layouts;
static const enum AVSampleFormat sample_fmts[] = {
AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_NONE
};
- int ret;
-
- layouts = ff_all_channel_counts();
- if (!layouts)
- return AVERROR(ENOMEM);
- ret = ff_set_common_channel_layouts(ctx, layouts);
+ int ret = ff_set_all_channel_counts(ctx);
if (ret < 0)
return ret;
- formats = ff_make_format_list(sample_fmts);
- if (!formats)
- return AVERROR(ENOMEM);
- ret = ff_set_common_formats(ctx, formats);
+ ret = ff_set_common_formats_from_list(ctx, sample_fmts);
if (ret < 0)
return ret;
- formats = ff_all_samplerates();
- if (!formats)
- return AVERROR(ENOMEM);
- return ff_set_common_samplerates(ctx, formats);
+ return ff_set_all_samplerates(ctx);
}
static int config_output(AVFilterLink *outlink)
@@ -102,32 +102,19 @@ static av_cold void uninit(AVFilterContext *ctx)
static int query_formats(AVFilterContext *ctx)
{
- AVFilterChannelLayouts *layouts;
- AVFilterFormats *formats;
static const enum AVSampleFormat sample_fmts[] = {
AV_SAMPLE_FMT_DBLP,
AV_SAMPLE_FMT_NONE
};
- int ret;
-
- layouts = ff_all_channel_counts();
- if (!layouts)
- return AVERROR(ENOMEM);
- ret = ff_set_common_channel_layouts(ctx, layouts);
+ int ret = ff_set_all_channel_counts(ctx);
if (ret < 0)
return ret;
- formats = ff_make_format_list(sample_fmts);
- if (!formats)
- return AVERROR(ENOMEM);
- ret = ff_set_common_formats(ctx, formats);
+ ret = ff_set_common_formats_from_list(ctx, sample_fmts);
if (ret < 0)
return ret;
- formats = ff_all_samplerates();
- if (!formats)
- return AVERROR(ENOMEM);
- return ff_set_common_samplerates(ctx, formats);
+ return ff_set_all_samplerates(ctx);
}
static void count_items(char *item_str, int *nb_items)
@@ -65,32 +65,19 @@ AVFILTER_DEFINE_CLASS(compensationdelay);
static int query_formats(AVFilterContext *ctx)
{
- AVFilterChannelLayouts *layouts;
- AVFilterFormats *formats;
static const enum AVSampleFormat sample_fmts[] = {
AV_SAMPLE_FMT_DBLP,
AV_SAMPLE_FMT_NONE
};
- int ret;
-
- layouts = ff_all_channel_counts();
- if (!layouts)
- return AVERROR(ENOMEM);
- ret = ff_set_common_channel_layouts(ctx, layouts);
+ int ret = ff_set_all_channel_counts(ctx);
if (ret < 0)
return ret;
- formats = ff_make_format_list(sample_fmts);
- if (!formats)
- return AVERROR(ENOMEM);
- ret = ff_set_common_formats(ctx, formats);
+ ret = ff_set_common_formats_from_list(ctx, sample_fmts);
if (ret < 0)
return ret;
- formats = ff_all_samplerates();
- if (!formats)
- return AVERROR(ENOMEM);
- return ff_set_common_samplerates(ctx, formats);
+ return ff_set_all_samplerates(ctx);
}
static int config_input(AVFilterLink *inlink)
@@ -48,7 +48,7 @@ static int query_formats(AVFilterContext *ctx)
(ret = ff_set_common_formats (ctx , formats )) < 0 ||
(ret = ff_add_channel_layout (&layout , AV_CH_LAYOUT_STEREO)) < 0 ||
(ret = ff_set_common_channel_layouts (ctx , layout )) < 0 ||
- (ret = ff_set_common_samplerates (ctx , ff_all_samplerates())) < 0)
+ (ret = ff_set_all_samplerates (ctx )) < 0)
return ret;
return 0;
@@ -45,32 +45,20 @@ AVFILTER_DEFINE_CLASS(crystalizer);
static int query_formats(AVFilterContext *ctx)
{
- AVFilterFormats *formats = NULL;
- AVFilterChannelLayouts *layouts = NULL;
static const enum AVSampleFormat sample_fmts[] = {
AV_SAMPLE_FMT_FLT, AV_SAMPLE_FMT_FLTP,
AV_SAMPLE_FMT_DBL, AV_SAMPLE_FMT_DBLP,
AV_SAMPLE_FMT_NONE
};
- int ret;
-
- formats = ff_make_format_list(sample_fmts);
- if (!formats)
- return AVERROR(ENOMEM);
- ret = ff_set_common_formats(ctx, formats);
+ int ret = ff_set_common_formats_from_list(ctx, sample_fmts);
if (ret < 0)
return ret;
- layouts = ff_all_channel_counts();
- if (!layouts)
- return AVERROR(ENOMEM);
-
- ret = ff_set_common_channel_layouts(ctx, layouts);
+ ret = ff_set_all_channel_counts(ctx);
if (ret < 0)
return ret;
- formats = ff_all_samplerates();
- return ff_set_common_samplerates(ctx, formats);
+ return ff_set_all_samplerates(ctx);
}
typedef struct ThreadData {
@@ -54,31 +54,18 @@ static av_cold int init(AVFilterContext *ctx)
static int query_formats(AVFilterContext *ctx)
{
- AVFilterChannelLayouts *layouts;
- AVFilterFormats *formats;
static const enum AVSampleFormat sample_fmts[] = {
AV_SAMPLE_FMT_S32P, AV_SAMPLE_FMT_NONE
};
- int ret;
-
- layouts = ff_all_channel_counts();
- if (!layouts)
- return AVERROR(ENOMEM);
- ret = ff_set_common_channel_layouts(ctx, layouts);
+ int ret = ff_set_all_channel_counts(ctx);
if (ret < 0)
return ret;
- formats = ff_make_format_list(sample_fmts);
- if (!formats)
- return AVERROR(ENOMEM);
- ret = ff_set_common_formats(ctx, formats);
+ ret = ff_set_common_formats_from_list(ctx, sample_fmts);
if (ret < 0)
return ret;
- formats = ff_all_samplerates();
- if (!formats)
- return AVERROR(ENOMEM);
- return ff_set_common_samplerates(ctx, formats);
+ return ff_set_all_samplerates(ctx);
}
static int filter_frame(AVFilterLink *inlink, AVFrame *in)
@@ -70,31 +70,19 @@ AVFILTER_DEFINE_CLASS(deesser);
static int query_formats(AVFilterContext *ctx)
{
- AVFilterFormats *formats = NULL;
- AVFilterChannelLayouts *layouts = NULL;
static const enum AVSampleFormat sample_fmts[] = {
AV_SAMPLE_FMT_DBLP,
AV_SAMPLE_FMT_NONE
};
- int ret;
-
- formats = ff_make_format_list(sample_fmts);
- if (!formats)
- return AVERROR(ENOMEM);
- ret = ff_set_common_formats(ctx, formats);
+ int ret = ff_set_common_formats_from_list(ctx, sample_fmts);
if (ret < 0)
return ret;
- layouts = ff_all_channel_counts();
- if (!layouts)
- return AVERROR(ENOMEM);
-
- ret = ff_set_common_channel_layouts(ctx, layouts);
+ ret = ff_set_all_channel_counts(ctx);
if (ret < 0)
return ret;
- formats = ff_all_samplerates();
- return ff_set_common_samplerates(ctx, formats);
+ return ff_set_all_samplerates(ctx);
}
static int config_input(AVFilterLink *inlink)
@@ -55,32 +55,19 @@ AVFILTER_DEFINE_CLASS(drmeter);
static int query_formats(AVFilterContext *ctx)
{
- AVFilterFormats *formats;
- AVFilterChannelLayouts *layouts;
static const enum AVSampleFormat sample_fmts[] = {
AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_FLT,
AV_SAMPLE_FMT_NONE
};
- int ret;
-
- layouts = ff_all_channel_counts();
- if (!layouts)
- return AVERROR(ENOMEM);
- ret = ff_set_common_channel_layouts(ctx, layouts);
+ int ret = ff_set_all_channel_counts(ctx);
if (ret < 0)
return ret;
- formats = ff_make_format_list(sample_fmts);
- if (!formats)
- return AVERROR(ENOMEM);
- ret = ff_set_common_formats(ctx, formats);
+ ret = ff_set_common_formats_from_list(ctx, sample_fmts);
if (ret < 0)
return ret;
- formats = ff_all_samplerates();
- if (!formats)
- return AVERROR(ENOMEM);
- return ff_set_common_samplerates(ctx, formats);
+ return ff_set_all_samplerates(ctx);
}
static int config_output(AVFilterLink *outlink)
@@ -129,32 +129,19 @@ static av_cold int init(AVFilterContext *ctx)
static int query_formats(AVFilterContext *ctx)
{
- AVFilterFormats *formats;
- AVFilterChannelLayouts *layouts;
static const enum AVSampleFormat sample_fmts[] = {
AV_SAMPLE_FMT_DBLP,
AV_SAMPLE_FMT_NONE
};
- int ret;
-
- layouts = ff_all_channel_counts();
- if (!layouts)
- return AVERROR(ENOMEM);
- ret = ff_set_common_channel_layouts(ctx, layouts);
+ int ret = ff_set_all_channel_counts(ctx);
if (ret < 0)
return ret;
- formats = ff_make_format_list(sample_fmts);
- if (!formats)
- return AVERROR(ENOMEM);
- ret = ff_set_common_formats(ctx, formats);
+ ret = ff_set_common_formats_from_list(ctx, sample_fmts);
if (ret < 0)
return ret;
- formats = ff_all_samplerates();
- if (!formats)
- return AVERROR(ENOMEM);
- return ff_set_common_samplerates(ctx, formats);
+ return ff_set_all_samplerates(ctx);
}
static inline int frame_size(int sample_rate, int frame_len_msec)
@@ -90,7 +90,7 @@ static int query_formats(AVFilterContext *ctx)
(ret = ff_set_common_formats (ctx , formats )) < 0 ||
(ret = ff_add_channel_layout (&layout , AV_CH_LAYOUT_STEREO )) < 0 ||
(ret = ff_set_common_channel_layouts (ctx , layout )) < 0 ||
- (ret = ff_set_common_samplerates (ctx , ff_make_format_list(sample_rates) )) < 0)
+ (ret = ff_set_common_samplerates_from_list(ctx, sample_rates )) < 0)
return ret;
return 0;
@@ -53,8 +53,7 @@ static int query_formats(AVFilterContext *ctx)
(ret = ff_set_common_channel_layouts (ctx , layout )) < 0)
return ret;
- formats = ff_all_samplerates();
- return ff_set_common_samplerates(ctx, formats);
+ return ff_set_all_samplerates(ctx);
}
static int filter_frame(AVFilterLink *inlink, AVFrame *in)
@@ -182,32 +182,19 @@ static av_cold void uninit(AVFilterContext *ctx)
static int query_formats(AVFilterContext *ctx)
{
- AVFilterChannelLayouts *layouts;
- AVFilterFormats *formats;
static const enum AVSampleFormat sample_fmts[] = {
AV_SAMPLE_FMT_FLTP,
AV_SAMPLE_FMT_NONE
};
- int ret;
-
- layouts = ff_all_channel_counts();
- if (!layouts)
- return AVERROR(ENOMEM);
- ret = ff_set_common_channel_layouts(ctx, layouts);
+ int ret = ff_set_all_channel_counts(ctx);
if (ret < 0)
return ret;
- formats = ff_make_format_list(sample_fmts);
- if (!formats)
- return AVERROR(ENOMEM);
- ret = ff_set_common_formats(ctx, formats);
+ ret = ff_set_common_formats_from_list(ctx, sample_fmts);
if (ret < 0)
return ret;
- formats = ff_all_samplerates();
- if (!formats)
- return AVERROR(ENOMEM);
- return ff_set_common_samplerates(ctx, formats);
+ return ff_set_all_samplerates(ctx);
}
static void fast_convolute(FIREqualizerContext *av_restrict s, const float *av_restrict kernel_buf, float *av_restrict conv_buf,
@@ -90,31 +90,18 @@ static av_cold int init(AVFilterContext *ctx)
static int query_formats(AVFilterContext *ctx)
{
- AVFilterChannelLayouts *layouts;
- AVFilterFormats *formats;
static const enum AVSampleFormat sample_fmts[] = {
AV_SAMPLE_FMT_DBLP, AV_SAMPLE_FMT_NONE
};
- int ret;
-
- layouts = ff_all_channel_counts();
- if (!layouts)
- return AVERROR(ENOMEM);
- ret = ff_set_common_channel_layouts(ctx, layouts);
+ int ret = ff_set_all_channel_counts(ctx);
if (ret < 0)
return ret;
- formats = ff_make_format_list(sample_fmts);
- if (!formats)
- return AVERROR(ENOMEM);
- ret = ff_set_common_formats(ctx, formats);
+ ret = ff_set_common_formats_from_list(ctx, sample_fmts);
if (ret < 0)
return ret;
- formats = ff_all_samplerates();
- if (!formats)
- return AVERROR(ENOMEM);
- return ff_set_common_samplerates(ctx, formats);
+ return ff_set_all_samplerates(ctx);
}
static int config_input(AVFilterLink *inlink)
@@ -91,8 +91,7 @@ static int query_formats(AVFilterContext *ctx)
(ret = ff_set_common_channel_layouts (ctx , layout )) < 0)
return ret;
- formats = ff_all_samplerates();
- return ff_set_common_samplerates(ctx, formats);
+ return ff_set_all_samplerates(ctx);
}
static int config_input(AVFilterLink *inlink)
@@ -1648,8 +1648,7 @@ static int query_formats(AVFilterContext *ctx)
if (ret < 0)
return ret;
- return
- ff_set_common_samplerates(ctx, ff_make_format_list(sample_rates) );
+ return ff_set_common_samplerates_from_list(ctx, sample_rates);
}
static av_cold void uninit(AVFilterContext *ctx)
@@ -624,10 +624,7 @@ static int query_formats(AVFilterContext *ctx)
}
}
- formats = ff_all_samplerates();
- if (!formats)
- return AVERROR(ENOMEM);
- return ff_set_common_samplerates(ctx, formats);
+ return ff_set_all_samplerates(ctx);
}
static int config_input(AVFilterLink *inlink)
@@ -238,7 +238,7 @@ static int join_query_formats(AVFilterContext *ctx)
}
if ((ret = ff_set_common_formats(ctx, ff_planar_sample_fmts())) < 0 ||
- (ret = ff_set_common_samplerates(ctx, ff_all_samplerates())) < 0)
+ (ret = ff_set_all_samplerates(ctx)) < 0)
return ret;
return 0;
@@ -657,42 +657,28 @@ static av_cold int init(AVFilterContext *ctx)
static int query_formats(AVFilterContext *ctx)
{
LADSPAContext *s = ctx->priv;
- AVFilterFormats *formats;
AVFilterChannelLayouts *layouts;
static const enum AVSampleFormat sample_fmts[] = {
AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_NONE };
- int ret;
-
- formats = ff_make_format_list(sample_fmts);
- if (!formats)
- return AVERROR(ENOMEM);
- ret = ff_set_common_formats(ctx, formats);
+ int ret = ff_set_common_formats_from_list(ctx, sample_fmts);
if (ret < 0)
return ret;
if (s->nb_inputs) {
- formats = ff_all_samplerates();
- if (!formats)
- return AVERROR(ENOMEM);
-
- ret = ff_set_common_samplerates(ctx, formats);
+ ret = ff_set_all_samplerates(ctx);
if (ret < 0)
return ret;
} else {
int sample_rates[] = { s->sample_rate, -1 };
- ret = ff_set_common_samplerates(ctx, ff_make_format_list(sample_rates));
+ ret = ff_set_common_samplerates_from_list(ctx, sample_rates);
if (ret < 0)
return ret;
}
if (s->nb_inputs == 1 && s->nb_outputs == 1) {
// We will instantiate multiple LADSPA_Handle, one over each channel
- layouts = ff_all_channel_counts();
- if (!layouts)
- return AVERROR(ENOMEM);
-
- ret = ff_set_common_channel_layouts(ctx, layouts);
+ ret = ff_set_all_channel_counts(ctx);
if (ret < 0)
return ret;
} else if (s->nb_inputs == 2 && s->nb_outputs == 2) {
@@ -685,7 +685,6 @@ static int query_formats(AVFilterContext *ctx)
{
LoudNormContext *s = ctx->priv;
AVFilterFormats *formats;
- AVFilterChannelLayouts *layouts;
AVFilterLink *inlink = ctx->inputs[0];
AVFilterLink *outlink = ctx->outputs[0];
static const int input_srate[] = {192000, -1};
@@ -693,19 +692,11 @@ static int query_formats(AVFilterContext *ctx)
AV_SAMPLE_FMT_DBL,
AV_SAMPLE_FMT_NONE
};
- int ret;
-
- layouts = ff_all_channel_counts();
- if (!layouts)
- return AVERROR(ENOMEM);
- ret = ff_set_common_channel_layouts(ctx, layouts);
+ int ret = ff_set_all_channel_counts(ctx);
if (ret < 0)
return ret;
- formats = ff_make_format_list(sample_fmts);
- if (!formats)
- return AVERROR(ENOMEM);
- ret = ff_set_common_formats(ctx, formats);
+ ret = ff_set_common_formats_from_list(ctx, sample_fmts);
if (ret < 0)
return ret;
@@ -476,32 +476,22 @@ static av_cold int init(AVFilterContext *ctx)
static int query_formats(AVFilterContext *ctx)
{
LV2Context *s = ctx->priv;
- AVFilterFormats *formats;
AVFilterChannelLayouts *layouts;
AVFilterLink *outlink = ctx->outputs[0];
static const enum AVSampleFormat sample_fmts[] = {
AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_NONE };
- int ret;
-
- formats = ff_make_format_list(sample_fmts);
- if (!formats)
- return AVERROR(ENOMEM);
- ret = ff_set_common_formats(ctx, formats);
+ int ret = ff_set_common_formats_from_list(ctx, sample_fmts);
if (ret < 0)
return ret;
if (s->nb_inputs) {
- formats = ff_all_samplerates();
- if (!formats)
- return AVERROR(ENOMEM);
-
- ret = ff_set_common_samplerates(ctx, formats);
+ ret = ff_set_all_samplerates(ctx);
if (ret < 0)
return ret;
} else {
int sample_rates[] = { s->sample_rate, -1 };
- ret = ff_set_common_samplerates(ctx, ff_make_format_list(sample_rates));
+ ret = ff_set_common_samplerates_from_list(ctx, sample_rates);
if (ret < 0)
return ret;
}
@@ -124,32 +124,19 @@ static av_cold void uninit(AVFilterContext *ctx)
static int query_formats(AVFilterContext *ctx)
{
- AVFilterChannelLayouts *layouts;
- AVFilterFormats *formats;
static const enum AVSampleFormat sample_fmts[] = {
AV_SAMPLE_FMT_DBLP,
AV_SAMPLE_FMT_NONE
};
- int ret;
-
- layouts = ff_all_channel_counts();
- if (!layouts)
- return AVERROR(ENOMEM);
- ret = ff_set_common_channel_layouts(ctx, layouts);
+ int ret = ff_set_all_channel_counts(ctx);
if (ret < 0)
return ret;
- formats = ff_make_format_list(sample_fmts);
- if (!formats)
- return AVERROR(ENOMEM);
- ret = ff_set_common_formats(ctx, formats);
+ ret = ff_set_common_formats_from_list(ctx, sample_fmts);
if (ret < 0)
return ret;
- formats = ff_all_samplerates();
- if (!formats)
- return AVERROR(ENOMEM);
- return ff_set_common_samplerates(ctx, formats);
+ return ff_set_all_samplerates(ctx);
}
static void count_items(char *item_str, int *nb_items, char delimiter)
@@ -251,7 +251,6 @@ static int query_formats(AVFilterContext *ctx)
PanContext *pan = ctx->priv;
AVFilterLink *inlink = ctx->inputs[0];
AVFilterLink *outlink = ctx->outputs[0];
- AVFilterFormats *formats = NULL;
AVFilterChannelLayouts *layouts;
int ret;
@@ -260,8 +259,7 @@ static int query_formats(AVFilterContext *ctx)
if ((ret = ff_set_common_formats(ctx, ff_all_formats(AVMEDIA_TYPE_AUDIO))) < 0)
return ret;
- formats = ff_all_samplerates();
- if ((ret = ff_set_common_samplerates(ctx, formats)) < 0)
+ if ((ret = ff_set_all_samplerates(ctx)) < 0)
return ret;
// inlink supports any channel layout
@@ -91,32 +91,19 @@ static av_cold void uninit(AVFilterContext *ctx)
static int query_formats(AVFilterContext *ctx)
{
- AVFilterFormats *formats = NULL;
- AVFilterChannelLayouts *layouts = NULL;
static const enum AVSampleFormat sample_fmts[] = {
AV_SAMPLE_FMT_FLTP,
AV_SAMPLE_FMT_NONE,
};
- int ret;
-
- layouts = ff_all_channel_counts();
- if (!layouts)
- return AVERROR(ENOMEM);
- ret = ff_set_common_channel_layouts(ctx, layouts);
+ int ret = ff_set_all_channel_counts(ctx);
if (ret < 0)
return ret;
- formats = ff_make_format_list(sample_fmts);
- if (!formats)
- return AVERROR(ENOMEM);
- ret = ff_set_common_formats(ctx, formats);
+ ret = ff_set_common_formats_from_list(ctx, sample_fmts);
if (ret < 0)
return ret;
- formats = ff_all_samplerates();
- if (!formats)
- return AVERROR(ENOMEM);
- return ff_set_common_samplerates(ctx, formats);
+ return ff_set_all_samplerates(ctx);
}
static int filter_frame(AVFilterLink *inlink, AVFrame *in)
@@ -297,7 +297,6 @@ static int activate(AVFilterContext *ctx)
static int query_formats(AVFilterContext *ctx)
{
- AVFilterFormats *formats;
AVFilterChannelLayouts *layouts = NULL;
static const enum AVSampleFormat sample_fmts[] = {
AV_SAMPLE_FMT_DBL,
@@ -322,12 +321,10 @@ static int query_formats(AVFilterContext *ctx)
return ret;
}
- formats = ff_make_format_list(sample_fmts);
- if ((ret = ff_set_common_formats(ctx, formats)) < 0)
+ if ((ret = ff_set_common_formats_from_list(ctx, sample_fmts)) < 0)
return ret;
- formats = ff_all_samplerates();
- return ff_set_common_samplerates(ctx, formats);
+ return ff_set_all_samplerates(ctx);
}
static int config_output(AVFilterLink *outlink)
@@ -433,32 +430,19 @@ static int acompressor_filter_frame(AVFilterLink *inlink, AVFrame *in)
static int acompressor_query_formats(AVFilterContext *ctx)
{
- AVFilterFormats *formats;
- AVFilterChannelLayouts *layouts;
static const enum AVSampleFormat sample_fmts[] = {
AV_SAMPLE_FMT_DBL,
AV_SAMPLE_FMT_NONE
};
- int ret;
-
- layouts = ff_all_channel_counts();
- if (!layouts)
- return AVERROR(ENOMEM);
- ret = ff_set_common_channel_layouts(ctx, layouts);
+ int ret = ff_set_all_channel_counts(ctx);
if (ret < 0)
return ret;
- formats = ff_make_format_list(sample_fmts);
- if (!formats)
- return AVERROR(ENOMEM);
- ret = ff_set_common_formats(ctx, formats);
+ ret = ff_set_common_formats_from_list(ctx, sample_fmts);
if (ret < 0)
return ret;
- formats = ff_all_samplerates();
- if (!formats)
- return AVERROR(ENOMEM);
- return ff_set_common_samplerates(ctx, formats);
+ return ff_set_all_samplerates(ctx);
}
#define acompressor_options options
@@ -197,7 +197,6 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *insamples)
static int query_formats(AVFilterContext *ctx)
{
- AVFilterFormats *formats = NULL;
AVFilterChannelLayouts *layouts = NULL;
static const enum AVSampleFormat sample_fmts[] = {
AV_SAMPLE_FMT_DBL,
@@ -215,17 +214,11 @@ static int query_formats(AVFilterContext *ctx)
if (ret < 0)
return ret;
- formats = ff_make_format_list(sample_fmts);
- if (!formats)
- return AVERROR(ENOMEM);
- ret = ff_set_common_formats(ctx, formats);
+ ret = ff_set_common_formats_from_list(ctx, sample_fmts);
if (ret < 0)
return ret;
- formats = ff_all_samplerates();
- if (!formats)
- return AVERROR(ENOMEM);
- return ff_set_common_samplerates(ctx, formats);
+ return ff_set_all_samplerates(ctx);
}
static av_cold void uninit(AVFilterContext *ctx)
@@ -889,33 +889,20 @@ static int request_frame(AVFilterLink *outlink)
static int query_formats(AVFilterContext *ctx)
{
- AVFilterFormats *formats = NULL;
- AVFilterChannelLayouts *layouts = NULL;
static const enum AVSampleFormat sample_fmts[] = {
AV_SAMPLE_FMT_FLT, AV_SAMPLE_FMT_FLTP,
AV_SAMPLE_FMT_DBL, AV_SAMPLE_FMT_DBLP,
AV_SAMPLE_FMT_NONE
};
- int ret;
-
- layouts = ff_all_channel_counts();
- if (!layouts)
- return AVERROR(ENOMEM);
- ret = ff_set_common_channel_layouts(ctx, layouts);
+ int ret = ff_set_all_channel_counts(ctx);
if (ret < 0)
return ret;
- formats = ff_make_format_list(sample_fmts);
- if (!formats)
- return AVERROR(ENOMEM);
- ret = ff_set_common_formats(ctx, formats);
+ ret = ff_set_common_formats_from_list(ctx, sample_fmts);
if (ret < 0)
return ret;
- formats = ff_all_samplerates();
- if (!formats)
- return AVERROR(ENOMEM);
- return ff_set_common_samplerates(ctx, formats);
+ return ff_set_all_samplerates(ctx);
}
static av_cold void uninit(AVFilterContext *ctx)
@@ -648,7 +648,6 @@ static int activate(AVFilterContext *ctx)
static int query_formats(AVFilterContext *ctx)
{
struct SOFAlizerContext *s = ctx->priv;
- AVFilterFormats *formats = NULL;
AVFilterChannelLayouts *layouts = NULL;
int ret, sample_rates[] = { 48000, -1 };
static const enum AVSampleFormat sample_fmts[] = {
@@ -656,10 +655,7 @@ static int query_formats(AVFilterContext *ctx)
AV_SAMPLE_FMT_NONE
};
- formats = ff_make_format_list(sample_fmts);
- if (!formats)
- return AVERROR(ENOMEM);
- ret = ff_set_common_formats(ctx, formats);
+ ret = ff_set_common_formats_from_list(ctx, sample_fmts);
if (ret)
return ret;
@@ -681,10 +677,7 @@ static int query_formats(AVFilterContext *ctx)
return ret;
sample_rates[0] = s->sample_rate;
- 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_list(ctx, sample_rates);
}
static int getfilter_float(AVFilterContext *ctx, float x, float y, float z,
@@ -116,32 +116,19 @@ AVFILTER_DEFINE_CLASS(speechnorm);
static int query_formats(AVFilterContext *ctx)
{
- AVFilterFormats *formats;
- AVFilterChannelLayouts *layouts;
static const enum AVSampleFormat sample_fmts[] = {
AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_DBLP,
AV_SAMPLE_FMT_NONE
};
- int ret;
-
- layouts = ff_all_channel_counts();
- if (!layouts)
- return AVERROR(ENOMEM);
- ret = ff_set_common_channel_layouts(ctx, layouts);
+ int ret = ff_set_all_channel_counts(ctx);
if (ret < 0)
return ret;
- formats = ff_make_format_list(sample_fmts);
- if (!formats)
- return AVERROR(ENOMEM);
- ret = ff_set_common_formats(ctx, formats);
+ ret = ff_set_common_formats_from_list(ctx, sample_fmts);
if (ret < 0)
return ret;
- formats = ff_all_samplerates();
- if (!formats)
- return AVERROR(ENOMEM);
- return ff_set_common_samplerates(ctx, formats);
+ return ff_set_all_samplerates(ctx);
}
static int get_pi_samples(PeriodItem *pi, int start, int end, int remain)
@@ -111,8 +111,7 @@ static int query_formats(AVFilterContext *ctx)
(ret = ff_set_common_channel_layouts (ctx , layout )) < 0)
return ret;
- formats = ff_all_samplerates();
- return ff_set_common_samplerates(ctx, formats);
+ return ff_set_all_samplerates(ctx);
}
static int config_input(AVFilterLink *inlink)
@@ -64,8 +64,7 @@ static int query_formats(AVFilterContext *ctx)
(ret = ff_set_common_channel_layouts (ctx , layout )) < 0)
return ret;
- formats = ff_all_samplerates();
- return ff_set_common_samplerates(ctx, formats);
+ return ff_set_all_samplerates(ctx);
}
static int config_input(AVFilterLink *inlink)
@@ -272,27 +272,18 @@ static av_cold int init(AVFilterContext *ctx)
static int query_formats(AVFilterContext *ctx)
{
- AVFilterFormats *formats;
- AVFilterChannelLayouts *layouts;
static const enum AVSampleFormat sample_fmts[] = {
AV_SAMPLE_FMT_FLTP,
AV_SAMPLE_FMT_NONE
};
- int ret;
-
- layouts = ff_all_channel_counts();
- if (!layouts)
- return AVERROR(ENOMEM);
- ret = ff_set_common_channel_layouts(ctx, layouts);
+ int ret = ff_set_all_channel_counts(ctx);
if (ret < 0)
return ret;
- formats = ff_make_format_list(sample_fmts);
- if ((ret = ff_set_common_formats(ctx, formats)) < 0)
+ if ((ret = ff_set_common_formats_from_list(ctx, sample_fmts)) < 0)
return ret;
- formats = ff_all_samplerates();
- return ff_set_common_samplerates(ctx, formats);
+ return ff_set_all_samplerates(ctx);
}
static int config_input(AVFilterLink *inlink)
@@ -188,10 +188,7 @@ static int query_formats(AVFilterContext *ctx)
if (ret)
return ret;
- formats = ff_all_samplerates();
- if (!formats)
- return AVERROR(ENOMEM);
- return ff_set_common_samplerates(ctx, formats);
+ return ff_set_all_samplerates(ctx);
}
static int config_input(AVFilterLink *inlink)
@@ -85,32 +85,19 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
static int query_formats(AVFilterContext *ctx)
{
- AVFilterFormats *formats;
- AVFilterChannelLayouts *layouts;
static const enum AVSampleFormat sample_fmts[] = {
AV_SAMPLE_FMT_DBL,
AV_SAMPLE_FMT_NONE
};
- int ret;
-
- layouts = ff_all_channel_counts();
- if (!layouts)
- return AVERROR(ENOMEM);
- ret = ff_set_common_channel_layouts(ctx, layouts);
+ int ret = ff_set_all_channel_counts(ctx);
if (ret < 0)
return ret;
- formats = ff_make_format_list(sample_fmts);
- if (!formats)
- return AVERROR(ENOMEM);
- ret = ff_set_common_formats(ctx, formats);
+ ret = ff_set_common_formats_from_list(ctx, sample_fmts);
if (ret < 0)
return ret;
- formats = ff_all_samplerates();
- if (!formats)
- return AVERROR(ENOMEM);
- return ff_set_common_samplerates(ctx, formats);
+ return ff_set_all_samplerates(ctx);
}
static av_cold void uninit(AVFilterContext *ctx)
@@ -113,32 +113,19 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
static int query_formats(AVFilterContext *ctx)
{
- AVFilterFormats *formats;
- AVFilterChannelLayouts *layouts;
static const enum AVSampleFormat sample_fmts[] = {
AV_SAMPLE_FMT_DBLP,
AV_SAMPLE_FMT_NONE
};
- int ret;
-
- layouts = ff_all_channel_counts();
- if (!layouts)
- return AVERROR(ENOMEM);
- ret = ff_set_common_channel_layouts(ctx, layouts);
+ int ret = ff_set_all_channel_counts(ctx);
if (ret < 0)
return ret;
- formats = ff_make_format_list(sample_fmts);
- if (!formats)
- return AVERROR(ENOMEM);
- ret = ff_set_common_formats(ctx, formats);
+ ret = ff_set_common_formats_from_list(ctx, sample_fmts);
if (ret < 0)
return ret;
- formats = ff_all_samplerates();
- if (!formats)
- return AVERROR(ENOMEM);
- return ff_set_common_samplerates(ctx, formats);
+ return ff_set_all_samplerates(ctx);
}
static av_cold void uninit(AVFilterContext *ctx)
@@ -132,8 +132,6 @@ static av_cold void uninit(AVFilterContext *ctx)
static int query_formats(AVFilterContext *ctx)
{
VolumeContext *vol = ctx->priv;
- AVFilterFormats *formats = NULL;
- AVFilterChannelLayouts *layouts;
static const enum AVSampleFormat sample_fmts[][7] = {
[PRECISION_FIXED] = {
AV_SAMPLE_FMT_U8,
@@ -155,26 +153,15 @@ static int query_formats(AVFilterContext *ctx)
AV_SAMPLE_FMT_NONE
}
};
- int ret;
-
- layouts = ff_all_channel_counts();
- if (!layouts)
- return AVERROR(ENOMEM);
- ret = ff_set_common_channel_layouts(ctx, layouts);
+ int ret = ff_set_all_channel_counts(ctx);
if (ret < 0)
return ret;
- formats = ff_make_format_list(sample_fmts[vol->precision]);
- if (!formats)
- return AVERROR(ENOMEM);
- ret = ff_set_common_formats(ctx, formats);
+ ret = ff_set_common_formats_from_list(ctx, sample_fmts[vol->precision]);
if (ret < 0)
return ret;
- formats = ff_all_samplerates();
- if (!formats)
- return AVERROR(ENOMEM);
- return ff_set_common_samplerates(ctx, formats);
+ return ff_set_all_samplerates(ctx);
}
static inline void scale_samples_u8(uint8_t *dst, const uint8_t *src,
@@ -40,21 +40,11 @@ static int query_formats(AVFilterContext *ctx)
AV_SAMPLE_FMT_S16P,
AV_SAMPLE_FMT_NONE
};
- AVFilterFormats *formats;
- AVFilterChannelLayouts *layouts;
- int ret;
-
- if (!(formats = ff_make_format_list(sample_fmts)))
- return AVERROR(ENOMEM);
-
- layouts = ff_all_channel_counts();
- if (!layouts)
- return AVERROR(ENOMEM);
- ret = ff_set_common_channel_layouts(ctx, layouts);
+ int ret = ff_set_all_channel_counts(ctx);
if (ret < 0)
return ret;
- return ff_set_common_formats(ctx, formats);
+ return ff_set_common_formats_from_list(ctx, sample_fmts);
}
static int filter_frame(AVFilterLink *inlink, AVFrame *samples)
@@ -134,29 +134,15 @@ static av_cold int query_formats(AVFilterContext *ctx)
AV_SAMPLE_FMT_FLT,
AV_SAMPLE_FMT_NONE
};
-
- AVFilterFormats *formats;
- AVFilterChannelLayouts *layouts;
- int ret;
-
- formats = ff_make_format_list(sample_fmts);
- if (!formats)
- return AVERROR(ENOMEM);
- ret = ff_set_common_formats (ctx, formats);
+ int ret = ff_set_common_formats_from_list(ctx, sample_fmts);
if (ret < 0)
return ret;
- layouts = ff_make_format64_list(chlayouts);
- if (!layouts)
- return AVERROR(ENOMEM);
- ret = ff_set_common_channel_layouts(ctx, layouts);
+ ret = ff_set_common_channel_layouts_from_list(ctx, chlayouts);
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_list(ctx, sample_rates);
}
static int parse_string(char *str, float **items, int *nb_items, int *items_size)
@@ -90,29 +90,15 @@ static av_cold int query_formats(AVFilterContext *ctx)
AV_SAMPLE_FMT_DBL,
AV_SAMPLE_FMT_NONE
};
-
- AVFilterFormats *formats;
- AVFilterChannelLayouts *layouts;
- int ret;
-
- formats = ff_make_format_list(sample_fmts);
- if (!formats)
- return AVERROR(ENOMEM);
- ret = ff_set_common_formats (ctx, formats);
+ int ret = ff_set_common_formats_from_list(ctx, sample_fmts);
if (ret < 0)
return ret;
- layouts = ff_make_format64_list(chlayouts);
- if (!layouts)
- return AVERROR(ENOMEM);
- ret = ff_set_common_channel_layouts(ctx, layouts);
+ ret = ff_set_common_channel_layouts_from_list(ctx, chlayouts);
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_list(ctx, sample_rates);
}
static double white_filter(double white, double *buf, double ha)
@@ -87,10 +87,10 @@ static int query_formats(AVFilterContext *ctx)
int ret;
if ((ret = ff_set_common_formats (ctx, ff_all_formats (AVMEDIA_TYPE_AUDIO))) < 0 ||
- (ret = ff_set_common_samplerates (ctx, ff_make_format_list (sample_rates ))) < 0)
+ (ret = ff_set_common_samplerates_from_list(ctx, sample_rates)) < 0)
return ret;
- return ff_set_common_channel_layouts(ctx, ff_make_format64_list(chlayouts));
+ return ff_set_common_channel_layouts_from_list(ctx, chlayouts);
}
static av_cold int config_props(AVFilterLink *outlink)
@@ -102,29 +102,15 @@ static av_cold int query_formats(AVFilterContext *ctx)
AV_SAMPLE_FMT_FLT,
AV_SAMPLE_FMT_NONE
};
-
- AVFilterFormats *formats;
- AVFilterChannelLayouts *layouts;
- int ret;
-
- formats = ff_make_format_list(sample_fmts);
- if (!formats)
- return AVERROR(ENOMEM);
- ret = ff_set_common_formats (ctx, formats);
+ int ret = ff_set_common_formats_from_list(ctx, sample_fmts);
if (ret < 0)
return ret;
- layouts = ff_make_format64_list(chlayouts);
- if (!layouts)
- return AVERROR(ENOMEM);
- ret = ff_set_common_channel_layouts(ctx, layouts);
+ ret = ff_set_common_channel_layouts_from_list(ctx, chlayouts);
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_list(ctx, sample_rates);
}
static av_cold int config_props(AVFilterLink *outlink)
@@ -74,28 +74,15 @@ static int query_formats(AVFilterContext *ctx)
int sample_rates[] = { s->sample_rate, -1 };
static const enum AVSampleFormat sample_fmts[] = { AV_SAMPLE_FMT_FLT,
AV_SAMPLE_FMT_NONE };
- AVFilterFormats *formats;
- AVFilterChannelLayouts *layouts;
- int ret;
-
- formats = ff_make_format_list(sample_fmts);
- if (!formats)
- return AVERROR(ENOMEM);
- ret = ff_set_common_formats (ctx, formats);
+ int ret = ff_set_common_formats_from_list(ctx, sample_fmts);
if (ret < 0)
return ret;
- layouts = ff_make_format64_list(chlayouts);
- if (!layouts)
- return AVERROR(ENOMEM);
- ret = ff_set_common_channel_layouts(ctx, layouts);
+ ret = ff_set_common_channel_layouts_from_list(ctx, chlayouts);
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_list(ctx, sample_rates);
}
static float bessel_I_0(float x)
@@ -183,28 +183,15 @@ static av_cold int query_formats(AVFilterContext *ctx)
int sample_rates[] = { sine->sample_rate, -1 };
static const enum AVSampleFormat sample_fmts[] = { AV_SAMPLE_FMT_S16,
AV_SAMPLE_FMT_NONE };
- AVFilterFormats *formats;
- AVFilterChannelLayouts *layouts;
- int ret;
-
- formats = ff_make_format_list(sample_fmts);
- if (!formats)
- return AVERROR(ENOMEM);
- ret = ff_set_common_formats (ctx, formats);
+ int ret = ff_set_common_formats_from_list(ctx, sample_fmts);
if (ret < 0)
return ret;
- layouts = ff_make_format64_list(chlayouts);
- if (!layouts)
- return AVERROR(ENOMEM);
- ret = ff_set_common_channel_layouts(ctx, layouts);
+ ret = ff_set_common_channel_layouts_from_list(ctx, chlayouts);
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_list(ctx, sample_rates);
}
static av_cold int config_props(AVFilterLink *outlink)
@@ -362,7 +362,6 @@ static int filter_query_formats(AVFilterContext *ctx)
int ret, i;
AVFilterFormats *formats;
AVFilterChannelLayouts *chlayouts;
- AVFilterFormats *samplerates;
enum AVMediaType type = ctx->inputs && ctx->inputs [0] ? ctx->inputs [0]->type :
ctx->outputs && ctx->outputs[0] ? ctx->outputs[0]->type :
AVMEDIA_TYPE_VIDEO;
@@ -386,8 +385,7 @@ static int filter_query_formats(AVFilterContext *ctx)
if ((ret = ff_set_common_formats(ctx, formats)) < 0)
return ret;
if (type == AVMEDIA_TYPE_AUDIO) {
- samplerates = ff_all_samplerates();
- if ((ret = ff_set_common_samplerates(ctx, samplerates)) < 0)
+ if ((ret = ff_set_all_samplerates(ctx)) < 0)
return ret;
chlayouts = ff_all_channel_layouts();
if ((ret = ff_set_common_channel_layouts(ctx, chlayouts)) < 0)
@@ -149,14 +149,7 @@ const AVFilter ff_vf_reverse = {
static int query_formats(AVFilterContext *ctx)
{
- AVFilterFormats *formats;
- AVFilterChannelLayouts *layouts;
- int ret;
-
- layouts = ff_all_channel_counts();
- if (!layouts)
- return AVERROR(ENOMEM);
- ret = ff_set_common_channel_layouts(ctx, layouts);
+ int ret = ff_set_all_channel_counts(ctx);
if (ret < 0)
return ret;
@@ -164,10 +157,7 @@ static int query_formats(AVFilterContext *ctx)
if (ret < 0)
return ret;
- formats = ff_all_samplerates();
- if (!formats)
- return AVERROR(ENOMEM);
- return ff_set_common_samplerates(ctx, formats);
+ return ff_set_all_samplerates(ctx);
}
static void reverse_samples_planar(AVFrame *out)
@@ -497,7 +497,6 @@ static int query_formats(AVFilterContext *ctx)
if (!select->do_scene_detect) {
return ff_default_query_formats(ctx);
} else {
- int ret;
static const enum AVPixelFormat pix_fmts[] = {
AV_PIX_FMT_RGB24, AV_PIX_FMT_BGR24, AV_PIX_FMT_RGBA,
AV_PIX_FMT_ABGR, AV_PIX_FMT_BGRA, AV_PIX_FMT_GRAY8,
@@ -506,15 +505,8 @@ static int query_formats(AVFilterContext *ctx)
AV_PIX_FMT_YUV420P10,
AV_PIX_FMT_NONE
};
- AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts);
-
- if (!fmts_list)
- return AVERROR(ENOMEM);
- ret = ff_set_common_formats(ctx, fmts_list);
- if (ret < 0)
- return ret;
+ return ff_set_common_formats_from_list(ctx, pix_fmts);
}
- return 0;
}
DEFINE_OPTIONS(select, AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM);
@@ -305,8 +305,7 @@ static av_cold void uninit(AVFilterContext *ctx)
static int query_formats(AVFilterContext *ctx)
{
- AVFilterFormats *formats, *rates = NULL;
- AVFilterChannelLayouts *layouts = NULL;
+ AVFilterFormats *formats;
int ret, i;
for (i = 0; i < ctx->nb_inputs; i++) {
@@ -315,11 +314,9 @@ static int query_formats(AVFilterContext *ctx)
return ret;
if (ctx->inputs[i]->type == AVMEDIA_TYPE_AUDIO) {
- rates = ff_all_samplerates();
- if ((ret = ff_set_common_samplerates(ctx, rates)) < 0)
+ if ((ret = ff_set_all_samplerates(ctx)) < 0)
return ret;
- layouts = ff_all_channel_counts();
- if ((ret = ff_set_common_channel_layouts(ctx, layouts)) < 0)
+ if ((ret = ff_set_all_channel_counts(ctx)) < 0)
return ret;
}
}
@@ -566,6 +566,17 @@ int ff_set_common_channel_layouts(AVFilterContext *ctx,
ff_channel_layouts_ref, ff_channel_layouts_unref);
}
+int ff_set_common_channel_layouts_from_list(AVFilterContext *ctx,
+ const int64_t *fmts)
+{
+ return ff_set_common_channel_layouts(ctx, ff_make_format64_list(fmts));
+}
+
+int ff_set_all_channel_counts(AVFilterContext *ctx)
+{
+ return ff_set_common_channel_layouts(ctx, ff_all_channel_counts());
+}
+
int ff_set_common_samplerates(AVFilterContext *ctx,
AVFilterFormats *samplerates)
{
@@ -573,6 +584,17 @@ int ff_set_common_samplerates(AVFilterContext *ctx,
ff_formats_ref, ff_formats_unref);
}
+int ff_set_common_samplerates_from_list(AVFilterContext *ctx,
+ const int *samplerates)
+{
+ return ff_set_common_samplerates(ctx, ff_make_format_list(samplerates));
+}
+
+int ff_set_all_samplerates(AVFilterContext *ctx)
+{
+ return ff_set_common_samplerates(ctx, ff_all_samplerates());
+}
+
/**
* A helper for query_formats() which sets all links to the same list of
* formats. If there are no links hooked to this filter, the list of formats is
@@ -584,6 +606,12 @@ int ff_set_common_formats(AVFilterContext *ctx, AVFilterFormats *formats)
ff_formats_ref, ff_formats_unref);
}
+int ff_set_common_formats_from_list(AVFilterContext *ctx, const int *fmts)
+{
+ return ff_set_common_formats(ctx, ff_make_format_list(fmts));
+}
+
+
int ff_default_query_formats(AVFilterContext *ctx)
{
int ret;
@@ -595,10 +623,10 @@ int ff_default_query_formats(AVFilterContext *ctx)
if (ret < 0)
return ret;
if (type == AVMEDIA_TYPE_AUDIO) {
- ret = ff_set_common_channel_layouts(ctx, ff_all_channel_counts());
+ ret = ff_set_all_channel_counts(ctx);
if (ret < 0)
return ret;
- ret = ff_set_common_samplerates(ctx, ff_all_samplerates());
+ ret = ff_set_all_samplerates(ctx);
if (ret < 0)
return ret;
}
@@ -164,9 +164,32 @@ AVFilterChannelLayouts *ff_make_format64_list(const int64_t *fmts);
av_warn_unused_result
int ff_set_common_channel_layouts(AVFilterContext *ctx,
AVFilterChannelLayouts *layouts);
+/**
+ * Equivalent to ff_set_common_channel_layouts(ctx, ff_make_format64_list(fmts))
+ */
+av_warn_unused_result
+int ff_set_common_channel_layouts_from_list(AVFilterContext *ctx,
+ const int64_t *fmts);
+/**
+ * Equivalent to ff_set_common_channel_layouts(ctx, ff_all_channel_counts())
+ */
+av_warn_unused_result
+int ff_set_all_channel_counts(AVFilterContext *ctx);
+
av_warn_unused_result
int ff_set_common_samplerates(AVFilterContext *ctx,
AVFilterFormats *samplerates);
+/**
+ * Equivalent to ff_set_common_samplerates(ctx, ff_make_format_list(samplerates))
+ */
+av_warn_unused_result
+int ff_set_common_samplerates_from_list(AVFilterContext *ctx,
+ const int *samplerates);
+/**
+ * Equivalent to ff_set_common_samplerates(ctx, ff_all_samplerates())
+ */
+av_warn_unused_result
+int ff_set_all_samplerates(AVFilterContext *ctx);
/**
* A helper for query_formats() which sets all links to the same list of
@@ -176,6 +199,12 @@ int ff_set_common_samplerates(AVFilterContext *ctx,
av_warn_unused_result
int ff_set_common_formats(AVFilterContext *ctx, AVFilterFormats *formats);
+/**
+ * Equivalent to ff_set_common_formats(ctx, ff_make_format_list(fmts))
+ */
+av_warn_unused_result
+int ff_set_common_formats_from_list(AVFilterContext *ctx, const int *fmts);
+
av_warn_unused_result
int ff_add_channel_layout(AVFilterChannelLayouts **l, uint64_t channel_layout);
@@ -31,13 +31,8 @@ int ff_opencl_filter_query_formats(AVFilterContext *avctx)
AV_PIX_FMT_OPENCL,
AV_PIX_FMT_NONE,
};
- AVFilterFormats *formats;
- formats = ff_make_format_list(pix_fmts);
- if (!formats)
- return AVERROR(ENOMEM);
-
- return ff_set_common_formats(avctx, formats);
+ return ff_set_common_formats_from_list(avctx, pix_fmts);
}
static int opencl_filter_set_device(AVFilterContext *avctx,
@@ -78,10 +78,7 @@ static int query_formats(AVFilterContext *ctx)
AV_PIX_FMT_GBRAP, AV_PIX_FMT_GBRAP10, AV_PIX_FMT_GBRAP12, AV_PIX_FMT_GBRAP16,
AV_PIX_FMT_NONE
};
- AVFilterFormats *formats = ff_make_format_list(pixel_fmts);
- if (!formats)
- return AVERROR(ENOMEM);
- return ff_set_common_formats(ctx, formats);
+ return ff_set_common_formats_from_list(ctx, pixel_fmts);
}
static av_cold int init(AVFilterContext *ctx)
@@ -120,10 +120,7 @@ static int query_formats(AVFilterContext *ctx)
AV_PIX_FMT_GBRAP, AV_PIX_FMT_GBRAP10, AV_PIX_FMT_GBRAP12, AV_PIX_FMT_GBRAP16,
AV_PIX_FMT_NONE
};
- AVFilterFormats *formats = ff_make_format_list(pixel_fmts);
- if (!formats)
- return AVERROR(ENOMEM);
- return ff_set_common_formats(ctx, formats);
+ return ff_set_common_formats_from_list(ctx, pixel_fmts);
}
static av_cold int init(AVFilterContext *ctx)
@@ -246,7 +246,7 @@ static int query_formats(AVFilterContext *ctx)
AV_PIX_FMT_NONE
};
- return ff_set_common_formats(ctx, ff_make_format_list(pix_fmts));
+ return ff_set_common_formats_from_list(ctx, pix_fmts);
}
static int filter_frame(AVFilterLink *inlink, AVFrame *in)
@@ -72,10 +72,7 @@ static int query_formats(AVFilterContext *ctx)
AV_PIX_FMT_NONE,
};
- AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts);
- if (!fmts_list)
- return AVERROR(ENOMEM);
- return ff_set_common_formats(ctx, fmts_list);
+ return ff_set_common_formats_from_list(ctx, pix_fmts);
}
#define SET_META(key, value) \
@@ -89,7 +89,7 @@ static int query_formats(AVFilterContext *ctx)
AV_PIX_FMT_NONE
};
- return ff_set_common_formats(ctx, ff_make_format_list(pix_fmts));
+ return ff_set_common_formats_from_list(ctx, pix_fmts);
}
static int config_params(AVFilterContext *ctx)
@@ -67,10 +67,7 @@ static int query_formats(AVFilterContext *ctx)
AV_PIX_FMT_NONE
};
- AVFilterFormats *formats = ff_make_format_list(pixfmts);
- if (!formats)
- return AVERROR(ENOMEM);
- return ff_set_common_formats(ctx, formats);
+ return ff_set_common_formats_from_list(ctx, pixfmts);
}
static int config_input(AVFilterLink *inlink)
@@ -98,10 +98,7 @@ static int query_formats(AVFilterContext *ctx)
AV_PIX_FMT_NONE
};
- AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts);
- if (!fmts_list)
- return AVERROR(ENOMEM);
- return ff_set_common_formats(ctx, fmts_list);
+ return ff_set_common_formats_from_list(ctx, pix_fmts);
}
static int config_input(AVFilterLink *inlink)
@@ -54,10 +54,7 @@ static int query_formats(AVFilterContext *ctx)
AV_PIX_FMT_NONE
};
- AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts);
- if (!fmts_list)
- return AVERROR(ENOMEM);
- return ff_set_common_formats(ctx, fmts_list);
+ return ff_set_common_formats_from_list(ctx, pix_fmts);
}
#define SET_META(key, format, value) \
@@ -680,10 +680,7 @@ static int query_formats(AVFilterContext *ctx)
AV_PIX_FMT_NONE
};
- AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts);
- if (!fmts_list)
- return AVERROR(ENOMEM);
- return ff_set_common_formats(ctx, fmts_list);
+ return ff_set_common_formats_from_list(ctx, pix_fmts);
}
static av_cold void uninit(AVFilterContext *ctx)
@@ -188,10 +188,7 @@ static int query_formats(AVFilterContext *ctx)
AV_PIX_FMT_NONE
};
- AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts);
- if (!fmts_list)
- return AVERROR(ENOMEM);
- return ff_set_common_formats(ctx, fmts_list);
+ return ff_set_common_formats_from_list(ctx, pix_fmts);
}
static int do_search_boundary(int pos, int plane_boundary, int search_range, int search_step)
@@ -321,11 +321,7 @@ static int query_formats(AVFilterContext *ctx)
AV_PIX_FMT_NONE
};
- AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts);
- if (!fmts_list)
- return AVERROR(ENOMEM);
-
- return ff_set_common_formats(ctx, fmts_list);
+ return ff_set_common_formats_from_list(ctx, pix_fmts);
}
static int config_props(AVFilterLink *link)
@@ -230,13 +230,7 @@ static av_cold int query_formats(AVFilterContext *avctx)
AV_PIX_FMT_NONE
};
- AVFilterFormats *formats = NULL;
-
- formats = ff_make_format_list(pixel_fmts);
- if (!formats)
- return AVERROR(ENOMEM);
-
- return ff_set_common_formats(avctx, formats);
+ return ff_set_common_formats_from_list(avctx, pixel_fmts);
}
static av_cold int config_input(AVFilterLink *inlink)
@@ -331,14 +331,11 @@ static av_cold int query_formats(AVFilterContext *avctx)
AV_PIX_FMT_YUVA420P16, AV_PIX_FMT_YUVA422P16, AV_PIX_FMT_YUVA444P16,
AV_PIX_FMT_NONE
};
+ const enum AVPixelFormat *pix_fmts;
- AVFilterFormats *formats = NULL;
+ pix_fmts = !strcmp(avctx->filter->name, "chromahold") ? hold_pixel_fmts : pixel_fmts;
- formats = ff_make_format_list(!strcmp(avctx->filter->name, "chromahold") ? hold_pixel_fmts : pixel_fmts);
- if (!formats)
- return AVERROR(ENOMEM);
-
- return ff_set_common_formats(avctx, formats);
+ return ff_set_common_formats_from_list(avctx, pix_fmts);
}
static av_cold int config_input(AVFilterLink *inlink)
@@ -74,10 +74,7 @@ static int query_formats(AVFilterContext *ctx)
AV_PIX_FMT_NONE
};
- AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts);
- if (!fmts_list)
- return AVERROR(ENOMEM);
- return ff_set_common_formats(ctx, fmts_list);
+ return ff_set_common_formats_from_list(ctx, pix_fmts);
}
#define SQR(x) ((x)*(x))
@@ -76,17 +76,13 @@ static int query_formats(AVFilterContext *ctx)
AV_PIX_FMT_NONE
};
const enum AVPixelFormat *pix_fmts;
- AVFilterFormats *fmts_list;
if (!strcmp(ctx->filter->name, "rgbashift"))
pix_fmts = rgb_pix_fmts;
else
pix_fmts = yuv_pix_fmts;
- fmts_list = ff_make_format_list(pix_fmts);
- if (!fmts_list)
- return AVERROR(ENOMEM);
- return ff_set_common_formats(ctx, fmts_list);
+ return ff_set_common_formats_from_list(ctx, pix_fmts);
}
#define DEFINE_SMEAR(depth, type, div) \
@@ -83,10 +83,7 @@ static int query_formats(AVFilterContext *ctx)
// TODO: we can probably add way more pixel formats without any other
// changes; anything with 8-bit luma in first plane should be working
static const enum AVPixelFormat pix_fmts[] = {AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE};
- AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts);
- if (!fmts_list)
- return AVERROR(ENOMEM);
- return ff_set_common_formats(ctx, fmts_list);
+ return ff_set_common_formats_from_list(ctx, pix_fmts);
}
static int clip_line(int *sx, int *sy, int *ex, int *ey, int maxx)
@@ -92,10 +92,7 @@ static int query_formats(AVFilterContext *ctx)
AV_PIX_FMT_GBRP16, AV_PIX_FMT_GBRAP16,
AV_PIX_FMT_NONE
};
- AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts);
- if (!fmts_list)
- return AVERROR(ENOMEM);
- return ff_set_common_formats(ctx, fmts_list);
+ return ff_set_common_formats_from_list(ctx, pix_fmts);
}
static float get_component(float v, float l,
@@ -100,10 +100,7 @@ static int query_formats(AVFilterContext *ctx)
AV_PIX_FMT_NONE
};
- AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts);
- if (!fmts_list)
- return AVERROR(ENOMEM);
- return ff_set_common_formats(ctx, fmts_list);
+ return ff_set_common_formats_from_list(ctx, pix_fmts);
}
static float lerpf(float v0, float v1, float f)
@@ -643,7 +643,7 @@ static int query_formats(AVFilterContext *ctx)
AV_PIX_FMT_NONE
};
- return ff_set_common_formats(ctx, ff_make_format_list(pix_fmts));
+ return ff_set_common_formats_from_list(ctx, pix_fmts);
}
static int config_props(AVFilterLink *inlink)
@@ -327,13 +327,7 @@ static av_cold int query_formats(AVFilterContext *ctx)
AV_PIX_FMT_NONE
};
- AVFilterFormats *formats = NULL;
-
- formats = ff_make_format_list(pixel_fmts);
- if (!formats)
- return AVERROR(ENOMEM);
-
- return ff_set_common_formats(ctx, formats);
+ return ff_set_common_formats_from_list(ctx, pixel_fmts);
}
static av_cold int config_input(AVFilterLink *inlink)
@@ -150,13 +150,7 @@ static av_cold int query_formats(AVFilterContext *ctx)
AV_PIX_FMT_NONE
};
- AVFilterFormats *formats = NULL;
-
- formats = ff_make_format_list(pixel_fmts);
- if (!formats)
- return AVERROR(ENOMEM);
-
- return ff_set_common_formats(ctx, formats);
+ return ff_set_common_formats_from_list(ctx, pixel_fmts);
}
static av_cold int config_input(AVFilterLink *inlink)
@@ -232,13 +232,7 @@ static av_cold int query_formats(AVFilterContext *ctx)
AV_PIX_FMT_NONE
};
- AVFilterFormats *formats = NULL;
-
- formats = ff_make_format_list(pixel_fmts);
- if (!formats)
- return AVERROR(ENOMEM);
-
- return ff_set_common_formats(ctx, formats);
+ return ff_set_common_formats_from_list(ctx, pixel_fmts);
}
static av_cold int config_input(AVFilterLink *inlink)
@@ -171,13 +171,7 @@ static av_cold int query_formats(AVFilterContext *avctx)
AV_PIX_FMT_NONE
};
- AVFilterFormats *formats = NULL;
-
- formats = ff_make_format_list(pixel_fmts);
- if (!formats)
- return AVERROR(ENOMEM);
-
- return ff_set_common_formats(avctx, formats);
+ return ff_set_common_formats_from_list(avctx, pixel_fmts);
}
static const AVFilterPad colorkey_inputs[] = {
@@ -87,10 +87,7 @@ static int query_formats(AVFilterContext *ctx)
AV_PIX_FMT_NONE
};
- AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts);
- if (!fmts_list)
- return AVERROR(ENOMEM);
- return ff_set_common_formats(ctx, fmts_list);
+ return ff_set_common_formats_from_list(ctx, pix_fmts);
}
typedef struct ThreadData {
@@ -413,10 +413,7 @@ static int query_formats(AVFilterContext *ctx)
AV_PIX_FMT_UYVY422,
AV_PIX_FMT_NONE
};
- AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts);
- if (!fmts_list)
- return AVERROR(ENOMEM);
- return ff_set_common_formats(ctx, fmts_list);
+ return ff_set_common_formats_from_list(ctx, pix_fmts);
}
static int filter_frame(AVFilterLink *link, AVFrame *in)
@@ -293,13 +293,7 @@ static av_cold int query_formats(AVFilterContext *ctx)
AV_PIX_FMT_NONE
};
- AVFilterFormats *formats = NULL;
-
- formats = ff_make_format_list(pixel_fmts);
- if (!formats)
- return AVERROR(ENOMEM);
-
- return ff_set_common_formats(ctx, formats);
+ return ff_set_common_formats_from_list(ctx, pixel_fmts);
}
static av_cold int config_input(AVFilterLink *inlink)
@@ -100,7 +100,7 @@ static int query_formats(AVFilterContext *ctx)
AV_PIX_FMT_NONE
};
- return ff_set_common_formats(ctx, ff_make_format_list(pix_fmts));
+ return ff_set_common_formats_from_list(ctx, pix_fmts);
}
typedef struct ThreadData {
@@ -95,10 +95,7 @@ static int query_formats(AVFilterContext *ctx)
AV_PIX_FMT_NONE
};
- AVFilterFormats *fmts_list = ff_make_format_list(pixel_fmts_fftfilt);
- if (!fmts_list)
- return AVERROR(ENOMEM);
- return ff_set_common_formats(ctx, fmts_list);
+ return ff_set_common_formats_from_list(ctx, pixel_fmts_fftfilt);
}
static int config_input_main(AVFilterLink *inlink)
@@ -62,7 +62,7 @@ static int query_formats(AVFilterContext *ctx)
AV_PIX_FMT_NONE
};
- return ff_set_common_formats(ctx, ff_make_format_list(pix_fmts));
+ return ff_set_common_formats_from_list(ctx, pix_fmts);
}
static int config_input(AVFilterLink *inlink)
@@ -63,10 +63,7 @@ static int query_formats(AVFilterContext *ctx)
AV_PIX_FMT_NONE
};
- AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts);
- if (!fmts_list)
- return AVERROR(ENOMEM);
- return ff_set_common_formats(ctx, fmts_list);
+ return ff_set_common_formats_from_list(ctx, pix_fmts);
}
static int checkline(void *ctx, const unsigned char *src, int stride, int len, int bpp)
@@ -531,10 +531,7 @@ static int query_formats(AVFilterContext *ctx)
AV_PIX_FMT_GBRP16, AV_PIX_FMT_GBRAP16,
AV_PIX_FMT_NONE
};
- AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts);
- if (!fmts_list)
- return AVERROR(ENOMEM);
- return ff_set_common_formats(ctx, fmts_list);
+ return ff_set_common_formats_from_list(ctx, pix_fmts);
}
static int filter_slice_packed(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
@@ -136,7 +136,7 @@ static int query_formats(AVFilterContext *ctx)
AV_PIX_FMT_NONE
};
- return ff_set_common_formats(ctx, ff_make_format_list(pix_fmts));
+ return ff_set_common_formats_from_list(ctx, pix_fmts);
}
static int config_input(AVFilterLink *inlink)
@@ -661,10 +661,7 @@ static int query_formats(AVFilterContext *ctx)
AV_PIX_FMT_GBRP,
AV_PIX_FMT_NONE
};
- AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts);
- if (!fmts_list)
- return AVERROR(ENOMEM);
- return ff_set_common_formats(ctx, fmts_list);
+ return ff_set_common_formats_from_list(ctx, pix_fmts);
}
typedef struct ThreadData {
@@ -108,11 +108,7 @@ static int query_formats(AVFilterContext *ctx)
AV_PIX_FMT_NONE
};
- AVFilterFormats *fmts_list = ff_make_format_list(s->coupling ? cpix_fmts : pix_fmts);
- if (!fmts_list)
- return AVERROR(ENOMEM);
-
- return ff_set_common_formats(ctx, fmts_list);
+ return ff_set_common_formats_from_list(ctx, s->coupling ? cpix_fmts : pix_fmts);
}
static float frand(int x, int y)
@@ -84,10 +84,7 @@ static int query_formats(AVFilterContext *ctx)
AV_PIX_FMT_GRAY8, AV_PIX_FMT_GRAY9, AV_PIX_FMT_GRAY10, AV_PIX_FMT_GRAY12, AV_PIX_FMT_GRAY14, AV_PIX_FMT_GRAY16,
AV_PIX_FMT_NONE
};
- AVFilterFormats *formats = ff_make_format_list(pixel_fmts);
- if (!formats)
- return AVERROR(ENOMEM);
- return ff_set_common_formats(ctx, formats);
+ return ff_set_common_formats_from_list(ctx, pixel_fmts);
}
#define WEAK_HFILTER(name, type, ldiv) \
@@ -365,10 +365,7 @@ static int query_formats(AVFilterContext *ctx)
AV_PIX_FMT_GRAY16,
AV_PIX_FMT_NONE
};
- AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts);
- if (!fmts_list)
- return AVERROR(ENOMEM);
- return ff_set_common_formats(ctx, fmts_list);
+ return ff_set_common_formats_from_list(ctx, pix_fmts);
}
static int config_output(AVFilterLink *outlink)
@@ -75,10 +75,7 @@ static int query_formats(AVFilterContext *ctx)
AV_PIX_FMT_YUVA420P16, AV_PIX_FMT_YUVA422P16, AV_PIX_FMT_YUVA444P16,
AV_PIX_FMT_NONE
};
- AVFilterFormats *formats = ff_make_format_list(pixel_fmts);
- if (!formats)
- return AVERROR(ENOMEM);
- return ff_set_common_formats(ctx, formats);
+ return ff_set_common_formats_from_list(ctx, pixel_fmts);
}
#define DEFINE_DEDOTCRAWL(name, type, div) \
@@ -115,10 +115,7 @@ static int query_formats(AVFilterContext *ctx)
AV_PIX_FMT_YUVA420P9, AV_PIX_FMT_YUVA420P10, AV_PIX_FMT_YUVA420P16,
AV_PIX_FMT_NONE
};
- AVFilterFormats *formats = ff_make_format_list(pixel_fmts);
- if (!formats)
- return AVERROR(ENOMEM);
- return ff_set_common_formats(ctx, formats);
+ return ff_set_common_formats_from_list(ctx, pixel_fmts);
}
static int deflicker8(AVFilterContext *ctx,
@@ -106,13 +106,8 @@ static int qsvdeint_query_formats(AVFilterContext *ctx)
static const enum AVPixelFormat pixel_formats[] = {
AV_PIX_FMT_QSV, AV_PIX_FMT_NONE,
};
- AVFilterFormats *pix_fmts = ff_make_format_list(pixel_formats);
- int ret;
-
- if ((ret = ff_set_common_formats(ctx, pix_fmts)) < 0)
- return ret;
- return 0;
+ return ff_set_common_formats_from_list(ctx, pixel_formats);
}
static mfxStatus frame_alloc(mfxHDL pthis, mfxFrameAllocRequest *req,
@@ -234,10 +234,7 @@ static int query_formats(AVFilterContext *ctx)
AV_PIX_FMT_YUVA420P, AV_PIX_FMT_GRAY8,
AV_PIX_FMT_NONE
};
- AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts);
- if (!fmts_list)
- return AVERROR(ENOMEM);
- return ff_set_common_formats(ctx, fmts_list);
+ return ff_set_common_formats_from_list(ctx, pix_fmts);
}
static av_cold int init(AVFilterContext *ctx)
@@ -58,15 +58,12 @@ AVFILTER_DEFINE_CLASS(derain);
static int query_formats(AVFilterContext *ctx)
{
- AVFilterFormats *formats;
const enum AVPixelFormat pixel_fmts[] = {
AV_PIX_FMT_RGB24,
AV_PIX_FMT_NONE
};
- formats = ff_make_format_list(pixel_fmts);
-
- return ff_set_common_formats(ctx, formats);
+ return ff_set_common_formats_from_list(ctx, pixel_fmts);
}
static int filter_frame(AVFilterLink *inlink, AVFrame *in)
@@ -379,10 +379,7 @@ static int query_formats(AVFilterContext *ctx)
AV_PIX_FMT_YUV411P, AV_PIX_FMT_YUV440P, AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ422P,
AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUVJ440P, AV_PIX_FMT_NONE
};
- AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts);
- if (!fmts_list)
- return AVERROR(ENOMEM);
- return ff_set_common_formats(ctx, fmts_list);
+ return ff_set_common_formats_from_list(ctx, pix_fmts);
}
static int config_props(AVFilterLink *link)
@@ -125,13 +125,8 @@ static av_cold int query_formats(AVFilterContext *ctx)
AV_PIX_FMT_BGRA,
AV_PIX_FMT_NONE
};
- AVFilterFormats *formats = NULL;
- formats = ff_make_format_list(pixel_fmts);
- if (!formats)
- return AVERROR(ENOMEM);
-
- return ff_set_common_formats(ctx, formats);
+ return ff_set_common_formats_from_list(ctx, pixel_fmts);
}
static const AVFilterPad despill_inputs[] = {
@@ -78,7 +78,7 @@ static int query_formats(AVFilterContext *ctx)
AV_PIX_FMT_GRAY8, AV_PIX_FMT_NONE
};
- return ff_set_common_formats(ctx, ff_make_format_list(pix_fmts));
+ return ff_set_common_formats_from_list(ctx, pix_fmts);
}
static void displace_planar(DisplaceContext *s, const AVFrame *in,
@@ -207,8 +207,7 @@ static int dnn_classify_query_formats(AVFilterContext *context)
AV_PIX_FMT_NV12,
AV_PIX_FMT_NONE
};
- AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts);
- return ff_set_common_formats(context, fmts_list);
+ return ff_set_common_formats_from_list(context, pix_fmts);
}
static int dnn_classify_flush_frame(AVFilterLink *outlink, int64_t pts, int64_t *out_pts)
@@ -350,8 +350,7 @@ static int dnn_detect_query_formats(AVFilterContext *context)
AV_PIX_FMT_NV12,
AV_PIX_FMT_NONE
};
- AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts);
- return ff_set_common_formats(context, fmts_list);
+ return ff_set_common_formats_from_list(context, pix_fmts);
}
static int dnn_detect_filter_frame(AVFilterLink *inlink, AVFrame *in)
@@ -75,8 +75,7 @@ static int query_formats(AVFilterContext *context)
AV_PIX_FMT_NV12,
AV_PIX_FMT_NONE
};
- AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts);
- return ff_set_common_formats(context, fmts_list);
+ return ff_set_common_formats_from_list(context, pix_fmts);
}
#define LOG_FORMAT_CHANNEL_MISMATCH() \
@@ -193,10 +193,7 @@ static int query_formats(AVFilterContext *ctx)
AV_PIX_FMT_YUVA420P, AV_PIX_FMT_YUVA422P, AV_PIX_FMT_YUVA444P,
AV_PIX_FMT_NONE
};
- AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts);
- if (!fmts_list)
- return AVERROR(ENOMEM);
- return ff_set_common_formats(ctx, fmts_list);
+ return ff_set_common_formats_from_list(ctx, pix_fmts);
}
static int config_input(AVFilterLink *inlink)
@@ -101,7 +101,6 @@ static int query_formats(AVFilterContext *ctx)
static const enum AVPixelFormat wires_pix_fmts[] = {AV_PIX_FMT_GRAY8, AV_PIX_FMT_NONE};
static const enum AVPixelFormat canny_pix_fmts[] = {AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV444P, AV_PIX_FMT_GBRP, AV_PIX_FMT_GRAY8, AV_PIX_FMT_NONE};
static const enum AVPixelFormat colormix_pix_fmts[] = {AV_PIX_FMT_GBRP, AV_PIX_FMT_GRAY8, AV_PIX_FMT_NONE};
- AVFilterFormats *fmts_list;
const enum AVPixelFormat *pix_fmts = NULL;
if (edgedetect->mode == MODE_WIRES) {
@@ -113,10 +112,7 @@ static int query_formats(AVFilterContext *ctx)
} else {
av_assert0(0);
}
- fmts_list = ff_make_format_list(pix_fmts);
- if (!fmts_list)
- return AVERROR(ENOMEM);
- return ff_set_common_formats(ctx, fmts_list);
+ return ff_set_common_formats_from_list(ctx, pix_fmts);
}
static int config_props(AVFilterLink *inlink)
@@ -91,10 +91,7 @@ static int query_formats(AVFilterContext *ctx)
AV_PIX_FMT_NONE
};
if (!elbg->pal8) {
- AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts);
- if (!fmts_list)
- return AVERROR(ENOMEM);
- return ff_set_common_formats(ctx, fmts_list);
+ return ff_set_common_formats_from_list(ctx, pix_fmts);
} else {
static const enum AVPixelFormat pal8_fmt[] = {
AV_PIX_FMT_PAL8,
@@ -73,10 +73,7 @@ static int query_formats(AVFilterContext *ctx)
AV_PIX_FMT_NONE
};
- AVFilterFormats *formats = ff_make_format_list(pixfmts);
- if (!formats)
- return AVERROR(ENOMEM);
- return ff_set_common_formats(ctx, formats);
+ return ff_set_common_formats_from_list(ctx, pixfmts);
}
static int config_input(AVFilterLink *inlink)
@@ -228,10 +228,7 @@ static int query_formats(AVFilterContext *ctx)
AV_PIX_FMT_NONE,
};
- AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts);
- if (!fmts_list)
- return AVERROR(ENOMEM);
- return ff_set_common_formats(ctx, fmts_list);
+ return ff_set_common_formats_from_list(ctx, pix_fmts);
}
static int filter_frame(AVFilterLink *inlink, AVFrame *in)
@@ -243,10 +243,7 @@ static int query_formats(AVFilterContext *ctx)
AV_PIX_FMT_YUV444P,
AV_PIX_FMT_NONE
};
- AVFilterFormats *fmts_list = ff_make_format_list(pixel_fmts_eq);
- if (!fmts_list)
- return AVERROR(ENOMEM);
- return ff_set_common_formats(ctx, fmts_list);
+ return ff_set_common_formats_from_list(ctx, pixel_fmts_eq);
}
static int filter_frame(AVFilterLink *inlink, AVFrame *in)
@@ -129,10 +129,7 @@ static int query_formats(AVFilterContext *ctx)
AV_PIX_FMT_NONE
};
- AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts);
- if (!fmts_list)
- return AVERROR(ENOMEM);
- return ff_set_common_formats(ctx, fmts_list);
+ return ff_set_common_formats_from_list(ctx, pix_fmts);
}
static int config_output(AVFilterLink *outlink)
@@ -82,13 +82,7 @@ static av_cold int query_formats(AVFilterContext *ctx)
AV_PIX_FMT_NONE
};
- AVFilterFormats *formats = NULL;
-
- formats = ff_make_format_list(pixel_fmts);
- if (!formats)
- return AVERROR(ENOMEM);
-
- return ff_set_common_formats(ctx, formats);
+ return ff_set_common_formats_from_list(ctx, pixel_fmts);
}
static av_cold int config_input(AVFilterLink *inlink)
@@ -149,22 +149,20 @@ static int query_formats(AVFilterContext *ctx)
AV_PIX_FMT_GBRAP,
AV_PIX_FMT_NONE
};
- AVFilterFormats *fmts_list;
+ const enum AVPixelFormat *pixel_fmts;
if (s->alpha) {
if (s->black_fade)
- fmts_list = ff_make_format_list(pix_fmts_alpha);
+ pixel_fmts = pix_fmts_alpha;
else
- fmts_list = ff_make_format_list(pix_fmts_rgba);
+ pixel_fmts = pix_fmts_rgba;
} else {
if (s->black_fade)
- fmts_list = ff_make_format_list(pix_fmts);
+ pixel_fmts = pix_fmts;
else
- fmts_list = ff_make_format_list(pix_fmts_rgb);
+ pixel_fmts = pix_fmts_rgb;
}
- if (!fmts_list)
- return AVERROR(ENOMEM);
- return ff_set_common_formats(ctx, fmts_list);
+ return ff_set_common_formats_from_list(ctx, pixel_fmts);
}
const static enum AVPixelFormat studio_level_pix_fmts[] = {
@@ -135,10 +135,7 @@ static int query_formats(AVFilterContext *ctx)
AV_PIX_FMT_GBRAP, AV_PIX_FMT_GBRAP10, AV_PIX_FMT_GBRAP12, AV_PIX_FMT_GBRAP16,
AV_PIX_FMT_NONE
};
- AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts);
- if (!fmts_list)
- return AVERROR(ENOMEM);
- return ff_set_common_formats(ctx, fmts_list);
+ return ff_set_common_formats_from_list(ctx, pix_fmts);
}
typedef struct ThreadData {
@@ -404,10 +404,7 @@ static int query_formats(AVFilterContext *ctx)
AV_PIX_FMT_NONE
};
- AVFilterFormats *fmts_list = ff_make_format_list(pixel_fmts_fftfilt);
- if (!fmts_list)
- return AVERROR(ENOMEM);
- return ff_set_common_formats(ctx, fmts_list);
+ return ff_set_common_formats_from_list(ctx, pixel_fmts_fftfilt);
}
static const AVFilterPad fftfilt_inputs[] = {
@@ -78,10 +78,7 @@ static int query_formats(AVFilterContext *ctx)
AV_PIX_FMT_GRAY8, AV_PIX_FMT_GRAY9, AV_PIX_FMT_GRAY10, AV_PIX_FMT_GRAY12, AV_PIX_FMT_GRAY14, AV_PIX_FMT_GRAY16,
AV_PIX_FMT_NONE
};
- AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts);
- if (!fmts_list)
- return AVERROR(ENOMEM);
- return ff_set_common_formats(ctx, fmts_list);
+ return ff_set_common_formats_from_list(ctx, pix_fmts);
}
static void smear_borders8(FillBordersContext *s, AVFrame *frame)
@@ -67,7 +67,7 @@ static int query_formats(AVFilterContext *ctx)
AV_PIX_FMT_NONE
};
- return ff_set_common_formats(ctx, ff_make_format_list(pix_fmts));
+ return ff_set_common_formats_from_list(ctx, pix_fmts);
}
static AVFrame *downscale(AVFrame *in)
@@ -367,13 +367,8 @@ static av_cold int query_formats(AVFilterContext *ctx)
AV_PIX_FMT_YUV444P12, AV_PIX_FMT_YUV444P14, AV_PIX_FMT_YUV444P16, AV_PIX_FMT_YUVA444P16,
AV_PIX_FMT_NONE
};
- AVFilterFormats *formats;
- formats = ff_make_format_list(pixel_fmts);
- if (!formats)
- return AVERROR(ENOMEM);
-
- return ff_set_common_formats(ctx, formats);
+ return ff_set_common_formats_from_list(ctx, pixel_fmts);
}
static av_cold void uninit(AVFilterContext *ctx)
@@ -129,12 +129,8 @@ static av_cold int init(AVFilterContext *ctx)
static int query_formats(AVFilterContext *ctx)
{
FormatContext *s = ctx->priv;
- AVFilterFormats *formats = ff_make_format_list(s->formats);
- if (!formats)
- return AVERROR(ENOMEM);
-
- return ff_set_common_formats(ctx, formats);
+ return ff_set_common_formats_from_list(ctx, s->formats);
}
@@ -82,10 +82,7 @@ static const enum AVPixelFormat formats_supported[] = {
static int query_formats(AVFilterContext *ctx)
{
// this will ensure that formats are the same on all pads
- AVFilterFormats *fmts_list = ff_make_format_list(formats_supported);
- if (!fmts_list)
- return AVERROR(ENOMEM);
- return ff_set_common_formats(ctx, fmts_list);
+ return ff_set_common_formats_from_list(ctx, formats_supported);
}
static av_cold void framepack_uninit(AVFilterContext *ctx)
@@ -231,10 +231,7 @@ static int query_formats(AVFilterContext *ctx)
AV_PIX_FMT_NONE
};
- AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts);
- if (!fmts_list)
- return AVERROR(ENOMEM);
- return ff_set_common_formats(ctx, fmts_list);
+ return ff_set_common_formats_from_list(ctx, pix_fmts);
}
#define BLEND_FRAME_FUNC(nbits) \
@@ -90,10 +90,7 @@ static int query_formats(AVFilterContext *ctx)
AV_PIX_FMT_NONE
};
- AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts);
- if (!fmts_list)
- return AVERROR(ENOMEM);
- return ff_set_common_formats(ctx, fmts_list);
+ return ff_set_common_formats_from_list(ctx, pix_fmts);
}
static int config_input(AVFilterLink *inlink)
@@ -503,10 +503,7 @@ static int query_formats(AVFilterContext *ctx)
AV_PIX_FMT_NONE
};
- AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts);
- if (!fmts_list)
- return AVERROR(ENOMEM);
- return ff_set_common_formats(ctx, fmts_list);
+ return ff_set_common_formats_from_list(ctx, pix_fmts);
}
static int config_input(AVFilterLink *inlink)
@@ -227,7 +227,7 @@ static int query_formats(AVFilterContext *ctx)
AV_PIX_FMT_NONE
};
- return ff_set_common_formats(ctx, ff_make_format_list(pix_fmts));
+ return ff_set_common_formats_from_list(ctx, pix_fmts);
}
void ff_gblur_init(GBlurContext *s)
@@ -335,15 +335,9 @@ static int geq_query_formats(AVFilterContext *ctx)
AV_PIX_FMT_GBRP16, AV_PIX_FMT_GBRAP16,
AV_PIX_FMT_NONE
};
- AVFilterFormats *fmts_list;
+ const enum AVPixelFormat *pix_fmts = geq->is_rgb ? rgb_pix_fmts : yuv_pix_fmts;
- if (geq->is_rgb) {
- fmts_list = ff_make_format_list(rgb_pix_fmts);
- } else
- fmts_list = ff_make_format_list(yuv_pix_fmts);
- if (!fmts_list)
- return AVERROR(ENOMEM);
- return ff_set_common_formats(ctx, fmts_list);
+ return ff_set_common_formats_from_list(ctx, pix_fmts);
}
static int geq_config_props(AVFilterLink *inlink)
@@ -155,10 +155,7 @@ static int query_formats(AVFilterContext *ctx)
AV_PIX_FMT_GBRP,
AV_PIX_FMT_NONE
};
- AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts);
- if (!fmts_list)
- return AVERROR(ENOMEM);
- return ff_set_common_formats(ctx, fmts_list);
+ return ff_set_common_formats_from_list(ctx, pix_fmts);
}
static int config_input(AVFilterLink *inlink)
@@ -150,7 +150,7 @@ static int query_formats(AVFilterContext *ctx)
AV_PIX_FMT_NONE
};
- return ff_set_common_formats(ctx, ff_make_format_list(pix_fmts));
+ return ff_set_common_formats_from_list(ctx, pix_fmts);
}
static int config_input(AVFilterLink *inlink)
@@ -100,10 +100,7 @@ static int query_formats(AVFilterContext *ctx)
AV_PIX_FMT_RGB24, AV_PIX_FMT_BGR24,
AV_PIX_FMT_NONE
};
- AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts);
- if (!fmts_list)
- return AVERROR(ENOMEM);
- return ff_set_common_formats(ctx, fmts_list);
+ return ff_set_common_formats_from_list(ctx, pix_fmts);
}
static int config_input(AVFilterLink *inlink)
@@ -244,10 +244,7 @@ static int query_formats(AVFilterContext *ctx)
AV_PIX_FMT_YUV420P16, AV_PIX_FMT_YUV422P16, AV_PIX_FMT_YUV444P16,
AV_PIX_FMT_NONE
};
- AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts);
- if (!fmts_list)
- return AVERROR(ENOMEM);
- return ff_set_common_formats(ctx, fmts_list);
+ return ff_set_common_formats_from_list(ctx, pix_fmts);
}
static void calc_coefs(AVFilterContext *ctx)
@@ -464,10 +464,7 @@ HQX_FUNC(4)
static int query_formats(AVFilterContext *ctx)
{
static const enum AVPixelFormat pix_fmts[] = {AV_PIX_FMT_RGB32, AV_PIX_FMT_NONE};
- AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts);
- if (!fmts_list)
- return AVERROR(ENOMEM);
- return ff_set_common_formats(ctx, fmts_list);
+ return ff_set_common_formats_from_list(ctx, pix_fmts);
}
static int config_output(AVFilterLink *outlink)
@@ -263,10 +263,7 @@ static int query_formats(AVFilterContext *ctx)
AV_PIX_FMT_YUVA420P10,
AV_PIX_FMT_NONE
};
- AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts);
- if (!fmts_list)
- return AVERROR(ENOMEM);
- return ff_set_common_formats(ctx, fmts_list);
+ return ff_set_common_formats_from_list(ctx, pix_fmts);
}
static int config_props(AVFilterLink *inlink)
@@ -81,7 +81,7 @@ static int query_formats(AVFilterContext *ctx)
AV_PIX_FMT_NONE
};
- return ff_set_common_formats(ctx, ff_make_format_list(pix_fmts));
+ return ff_set_common_formats_from_list(ctx, pix_fmts);
}
static int process_frame(FFFrameSync *fs)
@@ -257,10 +257,7 @@ static int query_formats(AVFilterContext *ctx)
AV_PIX_FMT_NONE
};
- AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts);
- if (!fmts_list)
- return AVERROR(ENOMEM);
- return ff_set_common_formats(ctx, fmts_list);
+ return ff_set_common_formats_from_list(ctx, pix_fmts);
}
static int config_input_ref(AVFilterLink *inlink)
@@ -395,10 +395,7 @@ static int query_formats(AVFilterContext *ctx)
AV_PIX_FMT_YUVA444P,
AV_PIX_FMT_NONE
};
- AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts);
- if (!fmts_list)
- return AVERROR(ENOMEM);
- return ff_set_common_formats(ctx, fmts_list);
+ return ff_set_common_formats_from_list(ctx, pix_fmts);
}
static av_cold int init(AVFilterContext *ctx)
@@ -78,10 +78,7 @@ static int query_formats(AVFilterContext *ctx)
AV_PIX_FMT_NONE
};
- AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts);
- if (!fmts_list)
- return AVERROR(ENOMEM);
- return ff_set_common_formats(ctx, fmts_list);
+ return ff_set_common_formats_from_list(ctx, pix_fmts);
}
static int config_props(AVFilterLink *inlink)
@@ -67,10 +67,7 @@ static int query_formats(AVFilterContext *ctx)
AV_PIX_FMT_GBRP12, AV_PIX_FMT_GBRP14, AV_PIX_FMT_GBRP16,
AV_PIX_FMT_NONE
};
- AVFilterFormats *formats = ff_make_format_list(pixel_fmts);
- if (!formats)
- return AVERROR(ENOMEM);
- return ff_set_common_formats(ctx, formats);
+ return ff_set_common_formats_from_list(ctx, pixel_fmts);
}
typedef struct ThreadData {
@@ -203,10 +203,7 @@ static int query_formats(AVFilterContext *ctx)
AV_PIX_FMT_GBRAP, AV_PIX_FMT_GBRAP10, AV_PIX_FMT_GBRAP12, AV_PIX_FMT_GBRAP16,
AV_PIX_FMT_NONE
};
- AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts);
- if (!fmts_list)
- return AVERROR(ENOMEM);
- return ff_set_common_formats(ctx, fmts_list);
+ return ff_set_common_formats_from_list(ctx, pix_fmts);
}
static av_cold void uninit(AVFilterContext *ctx)
@@ -197,8 +197,7 @@ static int query_formats(AVFilterContext *ctx)
{
// Some of the functions provided by lensfun require pixels in RGB format
static const enum AVPixelFormat fmts[] = {AV_PIX_FMT_RGB24, AV_PIX_FMT_NONE};
- AVFilterFormats *fmts_list = ff_make_format_list(fmts);
- return ff_set_common_formats(ctx, fmts_list);
+ return ff_set_common_formats_from_list(ctx, fmts);
}
static float lanczos_kernel(float x)
@@ -69,10 +69,7 @@ static int query_formats(AVFilterContext *ctx)
static const enum AVPixelFormat pix_fmts[] = {
AV_PIX_FMT_BGR24, AV_PIX_FMT_BGRA, AV_PIX_FMT_GRAY8, AV_PIX_FMT_NONE
};
- AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts);
- if (!fmts_list)
- return AVERROR(ENOMEM);
- return ff_set_common_formats(ctx, fmts_list);
+ return ff_set_common_formats_from_list(ctx, pix_fmts);
}
typedef struct OCVContext {
@@ -256,10 +256,7 @@ static int query_formats(AVFilterContext *ctx)
AV_PIX_FMT_NONE
};
- AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts);
- if (!fmts_list)
- return AVERROR(ENOMEM);
- return ff_set_common_formats(ctx, fmts_list);
+ return ff_set_common_formats_from_list(ctx, pix_fmts);
}
@@ -90,10 +90,7 @@ static int query_formats(AVFilterContext *ctx)
AV_PIX_FMT_NONE
};
- AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts);
- if (!fmts_list)
- return AVERROR(ENOMEM);
- return ff_set_common_formats(ctx, fmts_list);
+ return ff_set_common_formats_from_list(ctx, pix_fmts);
}
static void limiter8(const uint8_t *src, uint8_t *dst,
@@ -154,13 +154,8 @@ static av_cold int query_formats(AVFilterContext *ctx)
AV_PIX_FMT_YUVA444P16, AV_PIX_FMT_YUVA422P16, AV_PIX_FMT_YUVA420P16,
AV_PIX_FMT_NONE
};
- AVFilterFormats *formats;
- formats = ff_make_format_list(pixel_fmts);
- if (!formats)
- return AVERROR(ENOMEM);
-
- return ff_set_common_formats(ctx, formats);
+ return ff_set_common_formats_from_list(ctx, pixel_fmts);
}
static int process_command(AVFilterContext *ctx, const char *cmd, const char *args,
@@ -150,10 +150,7 @@ static int query_formats(AVFilterContext *ctx)
const enum AVPixelFormat *pix_fmts = s->is_rgb ? rgb_pix_fmts :
s->is_yuv ? yuv_pix_fmts :
all_pix_fmts;
- AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts);
- if (!fmts_list)
- return AVERROR(ENOMEM);
- return ff_set_common_formats(ctx, fmts_list);
+ return ff_set_common_formats_from_list(ctx, pix_fmts);
}
/**
@@ -176,7 +176,7 @@ static int query_formats(AVFilterContext *ctx)
int ret;
if (s->tlut2 || !s->odepth)
- return ff_set_common_formats(ctx, ff_make_format_list(all_pix_fmts));
+ return ff_set_common_formats_from_list(ctx, all_pix_fmts);
ret = ff_formats_ref(ff_make_format_list(all_pix_fmts), &ctx->inputs[0]->outcfg.formats);
if (ret < 0)
@@ -1166,10 +1166,7 @@ static int query_formats(AVFilterContext *ctx)
AV_PIX_FMT_GBRPF32, AV_PIX_FMT_GBRAPF32,
AV_PIX_FMT_NONE
};
- AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts);
- if (!fmts_list)
- return AVERROR(ENOMEM);
- return ff_set_common_formats(ctx, fmts_list);
+ return ff_set_common_formats_from_list(ctx, pix_fmts);
}
static int config_input(AVFilterLink *inlink)
@@ -84,7 +84,7 @@ static int query_formats(AVFilterContext *ctx)
AV_PIX_FMT_NONE
};
- return ff_set_common_formats(ctx, ff_make_format_list(pix_fmts));
+ return ff_set_common_formats_from_list(ctx, pix_fmts);
}
static int maskedclamp_slice(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
@@ -61,7 +61,7 @@ static int query_formats(AVFilterContext *ctx)
AV_PIX_FMT_NONE
};
- return ff_set_common_formats(ctx, ff_make_format_list(pix_fmts));
+ return ff_set_common_formats_from_list(ctx, pix_fmts);
}
typedef struct ThreadData {
@@ -87,7 +87,7 @@ static int query_formats(AVFilterContext *ctx)
AV_PIX_FMT_NONE
};
- return ff_set_common_formats(ctx, ff_make_format_list(pix_fmts));
+ return ff_set_common_formats_from_list(ctx, pix_fmts);
}
static void maskedmin8(const uint8_t *src, uint8_t *dst, const uint8_t *f1, const uint8_t *f2, int w)
@@ -79,7 +79,7 @@ static int query_formats(AVFilterContext *ctx)
AV_PIX_FMT_NONE
};
- return ff_set_common_formats(ctx, ff_make_format_list(pix_fmts));
+ return ff_set_common_formats_from_list(ctx, pix_fmts);
}
static void threshold8(const uint8_t *src, const uint8_t *ref, uint8_t *dst, int threshold, int w)
@@ -83,7 +83,7 @@ static int query_formats(AVFilterContext *ctx)
AV_PIX_FMT_NONE
};
- return ff_set_common_formats(ctx, ff_make_format_list(pix_fmts));
+ return ff_set_common_formats_from_list(ctx, pix_fmts);
}
static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
@@ -167,10 +167,7 @@ static int query_formats(AVFilterContext *ctx)
static const enum AVPixelFormat pix_fmts[] = {
AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE
};
- AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts);
- if (!fmts_list)
- return AVERROR(ENOMEM);
- return ff_set_common_formats(ctx, fmts_list);
+ return ff_set_common_formats_from_list(ctx, pix_fmts);
}
static int filter_frame(AVFilterLink *inlink, AVFrame *inpic)
@@ -107,7 +107,7 @@ static int query_formats(AVFilterContext *ctx)
AV_PIX_FMT_NONE
};
- return ff_set_common_formats(ctx, ff_make_format_list(pix_fmts));
+ return ff_set_common_formats_from_list(ctx, pix_fmts);
}
static void check_params(MedianContext *s, AVFilterLink *inlink)
@@ -81,10 +81,7 @@ static int query_formats(AVFilterContext *ctx)
AV_PIX_FMT_NONE
};
- AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts);
- if (!fmts_list)
- return AVERROR(ENOMEM);
- return ff_set_common_formats(ctx, fmts_list);
+ return ff_set_common_formats_from_list(ctx, pix_fmts);
}
static int config_input(AVFilterLink *inlink)
@@ -83,7 +83,7 @@ static int query_formats(AVFilterContext *ctx)
AV_PIX_FMT_NONE
};
- return ff_set_common_formats(ctx, ff_make_format_list(pix_fmts));
+ return ff_set_common_formats_from_list(ctx, pix_fmts);
}
static int process_frame(FFFrameSync *fs)
@@ -249,10 +249,7 @@ static int query_formats(AVFilterContext *ctx)
AV_PIX_FMT_NONE
};
- AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts);
- if (!fmts_list)
- return AVERROR(ENOMEM);
- return ff_set_common_formats(ctx, fmts_list);
+ return ff_set_common_formats_from_list(ctx, pix_fmts);
}
static uint64_t get_sbad(AVMotionEstContext *me_ctx, int x, int y, int x_mv, int y_mv)
@@ -245,13 +245,7 @@ static av_cold int query_formats(AVFilterContext *ctx)
AV_PIX_FMT_NONE
};
- AVFilterFormats *formats = NULL;
-
- formats = ff_make_format_list(pixel_fmts);
- if (!formats)
- return AVERROR(ENOMEM);
-
- return ff_set_common_formats(ctx, formats);
+ return ff_set_common_formats_from_list(ctx, pixel_fmts);
}
static av_cold int config_input(AVFilterLink *inlink)
@@ -178,10 +178,7 @@ static int query_formats(AVFilterContext *ctx)
AV_PIX_FMT_NONE
};
- AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts);
- if (!fmts_list)
- return AVERROR(ENOMEM);
- return ff_set_common_formats(ctx, fmts_list);
+ return ff_set_common_formats_from_list(ctx, pix_fmts);
}
static int config_input(AVFilterLink *inlink)
@@ -73,7 +73,7 @@ static int query_formats(AVFilterContext *ctx)
AV_PIX_FMT_NONE
};
- return ff_set_common_formats(ctx, ff_make_format_list(pix_fmts));
+ return ff_set_common_formats_from_list(ctx, pix_fmts);
}
static void erosion(uint8_t *dst, const uint8_t *p1, int width,
@@ -90,10 +90,7 @@ static int query_formats(AVFilterContext *ctx)
AV_PIX_FMT_NONE
};
- AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts);
- if (!fmts_list)
- return AVERROR(ENOMEM);
- return ff_set_common_formats(ctx, fmts_list);
+ return ff_set_common_formats_from_list(ctx, pix_fmts);
}
/**
@@ -205,10 +205,7 @@ static int query_formats(AVFilterContext *ctx)
AV_PIX_FMT_NONE
};
- AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts);
- if (!fmts_list)
- return AVERROR(ENOMEM);
- return ff_set_common_formats(ctx, fmts_list);
+ return ff_set_common_formats_from_list(ctx, pix_fmts);
}
static float dot_dsp(const NNEDIContext *const s, const float *kernel, const float *input,
@@ -411,10 +411,7 @@ static int query_formats(AVFilterContext *ctx)
// According to filter_design.txt, using ff_set_common_formats() this way
// ensures the pixel formats of the input and output will be the same. That
// saves a bit of effort possibly needing to handle format conversions.
- AVFilterFormats *formats = ff_make_format_list(pixel_fmts);
- if (!formats)
- return AVERROR(ENOMEM);
- return ff_set_common_formats(ctx, formats);
+ return ff_set_common_formats_from_list(ctx, pixel_fmts);
}
// At this point we know the pixel format used for both input and output. We
@@ -87,10 +87,7 @@ static int query_formats(AVFilterContext *ctx)
AV_PIX_FMT_NONE
};
- AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts);
- if (!fmts_list)
- return AVERROR(ENOMEM);
- return ff_set_common_formats(ctx, fmts_list);
+ return ff_set_common_formats_from_list(ctx, pix_fmts);
}
static int filter_frame(AVFilterLink *inlink, AVFrame *in)
@@ -255,7 +255,7 @@ static int query_formats(AVFilterContext *ctx)
overlay_formats = overlay_pix_fmts_gbrp;
break;
case OVERLAY_FORMAT_AUTO:
- return ff_set_common_formats(ctx, ff_make_format_list(alpha_pix_fmts));
+ return ff_set_common_formats_from_list(ctx, alpha_pix_fmts);
default:
av_assert0(0);
}
@@ -423,9 +423,7 @@ static int overlay_cuda_query_formats(AVFilterContext *avctx)
AV_PIX_FMT_CUDA, AV_PIX_FMT_NONE,
};
- AVFilterFormats *pix_fmts = ff_make_format_list(pixel_formats);
-
- return ff_set_common_formats(avctx, pix_fmts);
+ return ff_set_common_formats_from_list(avctx, pixel_formats);
}
/**
@@ -309,10 +309,7 @@ static int query_formats(AVFilterContext *ctx)
AV_PIX_FMT_YUV420P16, AV_PIX_FMT_YUV422P16, AV_PIX_FMT_YUV444P16,
AV_PIX_FMT_NONE
};
- AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts);
- if (!fmts_list)
- return AVERROR(ENOMEM);
- return ff_set_common_formats(ctx, fmts_list);
+ return ff_set_common_formats_from_list(ctx, pix_fmts);
}
static int config_input(AVFilterLink *inlink)
@@ -103,10 +103,7 @@ static int query_formats(AVFilterContext *ctx)
AV_PIX_FMT_GBRP, AV_PIX_FMT_GBRAP, AV_PIX_FMT_GRAY8, AV_PIX_FMT_NONE
};
- AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts);
- if (!fmts_list)
- return AVERROR(ENOMEM);
- return ff_set_common_formats(ctx, fmts_list);
+ return ff_set_common_formats_from_list(ctx, pix_fmts);
}
static inline double get_coeff(double d)
@@ -125,10 +125,7 @@ static int query_formats(AVFilterContext *ctx)
AV_PIX_FMT_NONE
};
- AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts);
- if (!fmts_list)
- return AVERROR(ENOMEM);
- return ff_set_common_formats(ctx, fmts_list);
+ return ff_set_common_formats_from_list(ctx, pix_fmts);
}
static int config_input(AVFilterLink *inlink)
@@ -77,10 +77,7 @@ static int query_formats(AVFilterContext *ctx)
AV_PIX_FMT_BGR24,
AV_PIX_FMT_NONE
};
- AVFilterFormats *formats = ff_make_format_list(pixel_fmts);
- if (!formats)
- return AVERROR(ENOMEM);
- return ff_set_common_formats(ctx, formats);
+ return ff_set_common_formats_from_list(ctx, pixel_fmts);
}
typedef struct ThreadData_convert_frame
@@ -88,10 +88,7 @@ static int pp_query_formats(AVFilterContext *ctx)
AV_PIX_FMT_NONE
};
- AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts);
- if (!fmts_list)
- return AVERROR(ENOMEM);
- return ff_set_common_formats(ctx, fmts_list);
+ return ff_set_common_formats_from_list(ctx, pix_fmts);
}
static int pp_config_props(AVFilterLink *inlink)
@@ -276,10 +276,7 @@ static int query_formats(AVFilterContext *ctx)
AV_PIX_FMT_GRAY8, AV_PIX_FMT_NONE
};
- AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts);
- if (!fmts_list)
- return AVERROR(ENOMEM);
- return ff_set_common_formats(ctx, fmts_list);
+ return ff_set_common_formats_from_list(ctx, pix_fmts);
}
static int config_input(AVFilterLink *inlink)
@@ -86,7 +86,7 @@ static int query_formats(AVFilterContext *ctx)
AV_PIX_FMT_NONE
};
- return ff_set_common_formats(ctx, ff_make_format_list(s->inplace ? alpha_pix_fmts : no_alpha_pix_fmts));
+ return ff_set_common_formats_from_list(ctx, s->inplace ? alpha_pix_fmts : no_alpha_pix_fmts);
}
static void premultiply8(const uint8_t *msrc, const uint8_t *asrc,
@@ -281,10 +281,7 @@ static const enum AVPixelFormat pix_fmts[] = {
static int query_formats(AVFilterContext *ctx)
{
- AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts);
- if (!fmts_list)
- return AVERROR(ENOMEM);
- return ff_set_common_formats(ctx, fmts_list);
+ return ff_set_common_formats_from_list(ctx, pix_fmts);
}
static inline float lerpf(float v0, float v1, float f)
@@ -312,10 +312,7 @@ static int query_formats(AVFilterContext *ctx)
AV_PIX_FMT_NONE
};
- AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts);
- if (!fmts_list)
- return AVERROR(ENOMEM);
- return ff_set_common_formats(ctx, fmts_list);
+ return ff_set_common_formats_from_list(ctx, pix_fmts);
}
static int config_input_ref(AVFilterLink *inlink)
@@ -64,10 +64,7 @@ static int query_formats(AVFilterContext *ctx)
AV_PIX_FMT_NONE
};
- AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts);
- if (!fmts_list)
- return AVERROR(ENOMEM);
- return ff_set_common_formats(ctx, fmts_list);
+ return ff_set_common_formats_from_list(ctx, pix_fmts);
}
#define ABS(a) (((a) ^ ((a) >> 31)) - ((a) >> 31))
@@ -125,10 +125,7 @@ static int query_formats(AVFilterContext *ctx)
AV_PIX_FMT_YUVA420P9, AV_PIX_FMT_YUVA420P10, AV_PIX_FMT_YUVA420P16,
AV_PIX_FMT_NONE
};
- AVFilterFormats *formats = ff_make_format_list(pixel_fmts);
- if (!formats)
- return AVERROR(ENOMEM);
- return ff_set_common_formats(ctx, formats);
+ return ff_set_common_formats_from_list(ctx, pixel_fmts);
}
static int config_filter(AVFilterContext *ctx, int start, int end)
@@ -207,10 +207,7 @@ static int query_formats(AVFilterContext *ctx)
AV_PIX_FMT_YUVJ444P,
AV_PIX_FMT_NONE
};
- AVFilterFormats *fmts_list = ff_make_format_list(pixel_fmts);
- if (!fmts_list)
- return AVERROR(ENOMEM);
- return ff_set_common_formats(ctx, fmts_list);
+ return ff_set_common_formats_from_list(ctx, pixel_fmts);
}
static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
@@ -57,10 +57,7 @@ static int query_formats(AVFilterContext *ctx)
AV_PIX_FMT_NONE
};
- AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts);
- if (!fmts_list)
- return AVERROR(ENOMEM);
- return ff_set_common_formats(ctx, fmts_list);
+ return ff_set_common_formats_from_list(ctx, pix_fmts);
}
#define REMOVE_GRAIN_SORT_AXIS \
@@ -206,10 +206,7 @@ static void convert_mask_to_strength_mask(uint8_t *data, int linesize,
static int query_formats(AVFilterContext *ctx)
{
static const enum AVPixelFormat pix_fmts[] = { AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE };
- AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts);
- if (!fmts_list)
- return AVERROR(ENOMEM);
- return ff_set_common_formats(ctx, fmts_list);
+ return ff_set_common_formats_from_list(ctx, pix_fmts);
}
static int load_mask(uint8_t **mask, int *w, int *h,
@@ -50,10 +50,7 @@ static int query_formats(AVFilterContext *ctx)
AV_PIX_FMT_NONE
};
- AVFilterFormats *fmts_list = ff_make_format_list(pixel_fmts_eq);
- if (!fmts_list)
- return AVERROR(ENOMEM);
- return ff_set_common_formats(ctx, fmts_list);
+ return ff_set_common_formats_from_list(ctx, pixel_fmts_eq);
}
static int config_input(AVFilterLink *inlink)
@@ -157,10 +157,7 @@ static int query_formats(AVFilterContext *ctx)
AV_PIX_FMT_NONE
};
- AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts);
- if (!fmts_list)
- return AVERROR(ENOMEM);
- return ff_set_common_formats(ctx, fmts_list);
+ return ff_set_common_formats_from_list(ctx, pix_fmts);
}
static double get_rotated_w(void *opaque, double angle)
@@ -65,10 +65,7 @@ static int query_formats(AVFilterContext *ctx)
AV_PIX_FMT_YUV411P,
AV_PIX_FMT_NONE
};
- AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts);
- if (!fmts_list)
- return AVERROR(ENOMEM);
- return ff_set_common_formats(ctx, fmts_list);
+ return ff_set_common_formats_from_list(ctx, pix_fmts);
}
#define RADIUS_MIN 0.1
@@ -150,11 +150,8 @@ static int cudascale_query_formats(AVFilterContext *ctx)
static const enum AVPixelFormat pixel_formats[] = {
AV_PIX_FMT_CUDA, AV_PIX_FMT_NONE,
};
- AVFilterFormats *pix_fmts = ff_make_format_list(pixel_formats);
- if (!pix_fmts)
- return AVERROR(ENOMEM);
- return ff_set_common_formats(ctx, pix_fmts);
+ return ff_set_common_formats_from_list(ctx, pixel_formats);
}
static av_cold int init_hwframe_ctx(CUDAScaleContext *s, AVBufferRef *device_ctx, int width, int height)
@@ -148,9 +148,7 @@ static int nppscale_query_formats(AVFilterContext *ctx)
static const enum AVPixelFormat pixel_formats[] = {
AV_PIX_FMT_CUDA, AV_PIX_FMT_NONE,
};
- AVFilterFormats *pix_fmts = ff_make_format_list(pixel_formats);
-
- return ff_set_common_formats(ctx, pix_fmts);
+ return ff_set_common_formats_from_list(ctx, pixel_formats);
}
static int init_stage(NPPScaleStageContext *stage, AVBufferRef *device_ctx)
@@ -160,13 +160,8 @@ static int qsvscale_query_formats(AVFilterContext *ctx)
static const enum AVPixelFormat pixel_formats[] = {
AV_PIX_FMT_QSV, AV_PIX_FMT_NONE,
};
- AVFilterFormats *pix_fmts = ff_make_format_list(pixel_formats);
- int ret;
-
- if ((ret = ff_set_common_formats(ctx, pix_fmts)) < 0)
- return ret;
- return 0;
+ return ff_set_common_formats_from_list(ctx, pixel_formats);
}
static int init_out_pool(AVFilterContext *ctx,
@@ -74,10 +74,7 @@ static int query_formats(AVFilterContext *ctx)
AV_PIX_FMT_NONE
};
- AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts);
- if (!fmts_list)
- return AVERROR(ENOMEM);
- return ff_set_common_formats(ctx, fmts_list);
+ return ff_set_common_formats_from_list(ctx, pix_fmts);
}
static int config_input(AVFilterLink *inlink)
@@ -66,10 +66,7 @@ static int query_formats(AVFilterContext *ctx)
AV_PIX_FMT_NONE
};
- AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts);
- if (!fmts_list)
- return AVERROR(ENOMEM);
- return ff_set_common_formats(ctx, fmts_list);
+ return ff_set_common_formats_from_list(ctx, pix_fmts);
}
typedef struct ThreadData {
@@ -297,10 +297,7 @@ static int query_formats(AVFilterContext *ctx)
AV_PIX_FMT_RGBA64, AV_PIX_FMT_BGRA64,
AV_PIX_FMT_NONE
};
- AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts);
- if (!fmts_list)
- return AVERROR(ENOMEM);
- return ff_set_common_formats(ctx, fmts_list);
+ return ff_set_common_formats_from_list(ctx, pix_fmts);
}
static inline int comp_adjust(int scale, float value, float adjust, float k, int correction_method)
@@ -114,10 +114,7 @@ static int query_formats(AVFilterContext *ctx)
AV_PIX_FMT_NONE
};
- AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts);
- if (!fmts_list)
- return AVERROR(ENOMEM);
- return ff_set_common_formats(ctx, fmts_list);
+ return ff_set_common_formats_from_list(ctx, pix_fmts);
}
#define NN(type, name) \
@@ -68,10 +68,7 @@ static int query_formats(AVFilterContext *ctx)
AV_PIX_FMT_YUV444P12, AV_PIX_FMT_YUV444P14, AV_PIX_FMT_YUV444P16, AV_PIX_FMT_YUVA444P16,
AV_PIX_FMT_NONE
};
- AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts);
- if (!fmts_list)
- return AVERROR(ENOMEM);
- return ff_set_common_formats(ctx, fmts_list);
+ return ff_set_common_formats_from_list(ctx, pix_fmts);
}
static void make_horizontal_map(AVFilterContext *ctx)
@@ -134,10 +134,7 @@ static int query_formats(AVFilterContext *ctx)
AV_PIX_FMT_NONE
};
- AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts);
- if (!fmts_list)
- return AVERROR(ENOMEM);
- return ff_set_common_formats(ctx, fmts_list);
+ return ff_set_common_formats_from_list(ctx, pix_fmts);
}
static AVFrame *alloc_frame(enum AVPixelFormat pixfmt, int w, int h)
@@ -84,7 +84,7 @@ static int query_formats(AVFilterContext *ctx)
AV_PIX_FMT_NONE
};
- return ff_set_common_formats(ctx, ff_make_format_list(pix_fmts));
+ return ff_set_common_formats_from_list(ctx, pix_fmts);
}
static int config_input(AVFilterLink *inlink)
@@ -124,10 +124,7 @@ static int query_formats(AVFilterContext *ctx)
AV_PIX_FMT_NONE
};
- AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts);
- if (!fmts_list)
- return AVERROR(ENOMEM);
- return ff_set_common_formats(ctx, fmts_list);
+ return ff_set_common_formats_from_list(ctx, pix_fmts);
}
static int alloc_sws_context(FilterParam *f, int width, int height, unsigned int flags)
@@ -328,10 +328,7 @@ static int query_formats(AVFilterContext *ctx)
AV_PIX_FMT_NONE
};
- AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts);
- if (!fmts_list)
- return AVERROR(ENOMEM);
- return ff_set_common_formats(ctx, fmts_list);
+ return ff_set_common_formats_from_list(ctx, pix_fmts);
}
static int config_input(AVFilterLink *inlink)
@@ -71,15 +71,8 @@ static int query_formats(AVFilterContext *context)
const enum AVPixelFormat pixel_formats[] = {AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV444P,
AV_PIX_FMT_YUV410P, AV_PIX_FMT_YUV411P, AV_PIX_FMT_GRAY8,
AV_PIX_FMT_NONE};
- AVFilterFormats *formats_list;
- formats_list = ff_make_format_list(pixel_formats);
- if (!formats_list){
- av_log(context, AV_LOG_ERROR, "could not create formats list\n");
- return AVERROR(ENOMEM);
- }
-
- return ff_set_common_formats(context, formats_list);
+ return ff_set_common_formats_from_list(context, pixel_formats);
}
static int config_output(AVFilterLink *outlink)
@@ -434,10 +434,7 @@ static int query_formats(AVFilterContext *ctx)
AV_PIX_FMT_NONE
};
- AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts);
- if (!fmts_list)
- return AVERROR(ENOMEM);
- return ff_set_common_formats(ctx, fmts_list);
+ return ff_set_common_formats_from_list(ctx, pix_fmts);
}
static int config_input_ref(AVFilterLink *inlink)
@@ -283,7 +283,6 @@ static int query_formats(AVFilterContext *ctx)
{
Stereo3DContext *s = ctx->priv;
const enum AVPixelFormat *pix_fmts;
- AVFilterFormats *fmts_list;
switch (s->out.format) {
case ANAGLYPH_GM_COLOR:
@@ -306,10 +305,7 @@ static int query_formats(AVFilterContext *ctx)
pix_fmts = other_pix_fmts;
}
- fmts_list = ff_make_format_list(pix_fmts);
- if (!fmts_list)
- return AVERROR(ENOMEM);
- return ff_set_common_formats(ctx, fmts_list);
+ return ff_set_common_formats_from_list(ctx, pix_fmts);
}
static inline uint8_t ana_convert(const int *coeff, const uint8_t *left, const uint8_t *right)
@@ -255,10 +255,7 @@ static int query_formats(AVFilterContext *ctx)
AV_PIX_FMT_NONE
};
- AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts);
- if (!fmts_list)
- return AVERROR(ENOMEM);
- return ff_set_common_formats(ctx, fmts_list);
+ return ff_set_common_formats_from_list(ctx, pix_fmts);
}
static int config_input(AVFilterLink *inlink)
@@ -67,7 +67,7 @@ static int query_formats(AVFilterContext *ctx)
AV_PIX_FMT_NONE
};
- return ff_set_common_formats(ctx, ff_make_format_list(pix_fmts));
+ return ff_set_common_formats_from_list(ctx, pix_fmts);
}
typedef struct ThreadData {
@@ -262,10 +262,7 @@ static int query_formats(AVFilterContext *ctx)
AV_PIX_FMT_GBRP, AV_PIX_FMT_GBRAP,
AV_PIX_FMT_NONE
};
- AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts);
- if (!fmts_list)
- return AVERROR(ENOMEM);
- return ff_set_common_formats(ctx, fmts_list);
+ return ff_set_common_formats_from_list(ctx, pix_fmts);
}
static const AVFilterPad thumbnail_inputs[] = {
@@ -418,10 +418,7 @@ static int query_formats(AVFilterContext *ctx)
AV_PIX_FMT_CUDA,
AV_PIX_FMT_NONE
};
- AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts);
- if (!fmts_list)
- return AVERROR(ENOMEM);
- return ff_set_common_formats(ctx, fmts_list);
+ return ff_set_common_formats_from_list(ctx, pix_fmts);
}
static const AVFilterPad thumbnail_cuda_inputs[] = {
@@ -103,10 +103,7 @@ static int query_formats(AVFilterContext *ctx)
AV_PIX_FMT_NONE
};
- AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts);
- if (!fmts_list)
- return AVERROR(ENOMEM);
- return ff_set_common_formats(ctx, fmts_list);
+ return ff_set_common_formats_from_list(ctx, pix_fmts);
}
static void lowpass_line_c(uint8_t *dstp, ptrdiff_t width, const uint8_t *srcp,
@@ -93,7 +93,7 @@ static int query_formats(AVFilterContext *ctx)
AV_PIX_FMT_NONE
};
- return ff_set_common_formats(ctx, ff_make_format_list(pix_fmts));
+ return ff_set_common_formats_from_list(ctx, pix_fmts);
}
static void compute_contrast_function(const float *const histograms[256],
@@ -79,7 +79,7 @@ static const enum AVPixelFormat pix_fmts[] = {
static int query_formats(AVFilterContext *ctx)
{
- return ff_set_common_formats(ctx, ff_make_format_list(pix_fmts));
+ return ff_set_common_formats_from_list(ctx, pix_fmts);
}
static av_cold int init(AVFilterContext *ctx)
@@ -117,8 +117,7 @@ static int npptranspose_query_formats(AVFilterContext *ctx)
AV_PIX_FMT_CUDA, AV_PIX_FMT_NONE,
};
- AVFilterFormats *pix_fmts = ff_make_format_list(pixel_formats);
- return ff_set_common_formats(ctx, pix_fmts);
+ return ff_set_common_formats_from_list(ctx, pixel_fmts);
}
static int init_stage(NPPTransposeStageContext *stage, AVBufferRef *device_ctx)
@@ -208,10 +208,7 @@ static int query_formats(AVFilterContext *ctx)
AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUVJ440P, AV_PIX_FMT_NONE
};
- AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts);
- if (!fmts_list)
- return AVERROR(ENOMEM);
- return ff_set_common_formats(ctx, fmts_list);
+ return ff_set_common_formats_from_list(ctx, pix_fmts);
}
static int init_filter_param(AVFilterContext *ctx, UnsharpFilterParam *fp, const char *effect_type, int width)
@@ -305,10 +305,7 @@ static int query_formats(AVFilterContext *ctx)
AV_PIX_FMT_NONE
};
- AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts);
- if (!fmts_list)
- return AVERROR(ENOMEM);
- return ff_set_common_formats(ctx, fmts_list);
+ return ff_set_common_formats_from_list(ctx, pix_fmts);
}
static int config_input(AVFilterLink *inlink)
@@ -247,10 +247,7 @@ static int query_formats(AVFilterContext *ctx)
AV_PIX_FMT_NONE
};
- AVFilterFormats *fmts_list = ff_make_format_list(s->alpha ? alpha_pix_fmts : pix_fmts);
- if (!fmts_list)
- return AVERROR(ENOMEM);
- return ff_set_common_formats(ctx, fmts_list);
+ return ff_set_common_formats_from_list(ctx, s->alpha ? alpha_pix_fmts : pix_fmts);
}
#define DEFINE_REMAP1_LINE(bits, div) \
@@ -132,10 +132,7 @@ static int query_formats(AVFilterContext *ctx)
AV_PIX_FMT_GBRAP, AV_PIX_FMT_GBRAP10, AV_PIX_FMT_GBRAP12, AV_PIX_FMT_GBRAP16,
AV_PIX_FMT_NONE
};
- AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts);
- if (!fmts_list)
- return AVERROR(ENOMEM);
- return ff_set_common_formats(ctx, fmts_list);
+ return ff_set_common_formats_from_list(ctx, pix_fmts);
}
static int config_input(AVFilterLink *inlink)
@@ -309,13 +309,7 @@ static av_cold int query_formats(AVFilterContext *avctx)
AV_PIX_FMT_NONE
};
- AVFilterFormats *formats = NULL;
-
- formats = ff_make_format_list(pixel_fmts);
- if (!formats)
- return AVERROR(ENOMEM);
-
- return ff_set_common_formats(avctx, formats);
+ return ff_set_common_formats_from_list(avctx, pixel_fmts);
}
static av_cold int config_input(AVFilterLink *inlink)
@@ -93,10 +93,7 @@ static int query_formats(AVFilterContext *ctx)
AV_PIX_FMT_NONE
};
- AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts);
- if (!fmts_list)
- return AVERROR(ENOMEM);
- return ff_set_common_formats(ctx, fmts_list);
+ return ff_set_common_formats_from_list(ctx, pix_fmts);
}
static int config_input(AVFilterLink *inlink)
@@ -132,10 +132,7 @@ static int query_formats(AVFilterContext *ctx)
AV_PIX_FMT_NONE
};
- AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts);
- if (!fmts_list)
- return AVERROR(ENOMEM);
- return ff_set_common_formats(ctx, fmts_list);
+ return ff_set_common_formats_from_list(ctx, pix_fmts);
}
@@ -483,10 +483,7 @@ static int query_formats(AVFilterContext *ctx)
AV_PIX_FMT_NONE
};
- AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts);
- if (!fmts_list)
- return AVERROR(ENOMEM);
- return ff_set_common_formats(ctx, fmts_list);
+ return ff_set_common_formats_from_list(ctx, pix_fmts);
}
static int config_input_ref(AVFilterLink *inlink)
@@ -135,10 +135,7 @@ static int query_formats(AVFilterContext *ctx)
AV_PIX_FMT_GRAY8,
AV_PIX_FMT_NONE
};
- AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts);
- if (!fmts_list)
- return AVERROR(ENOMEM);
- return ff_set_common_formats(ctx, fmts_list);
+ return ff_set_common_formats_from_list(ctx, pix_fmts);
}
static double get_natural_factor(const VignetteContext *s, int x, int y)
@@ -101,10 +101,7 @@ static int query_formats(AVFilterContext *ctx)
AV_PIX_FMT_NONE
};
- AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts);
- if (!fmts_list)
- return AVERROR(ENOMEM);
- return ff_set_common_formats(ctx, fmts_list);
+ return ff_set_common_formats_from_list(ctx, pix_fmts);
}
static void filter_simple_low(int32_t *work_line,
@@ -346,10 +346,7 @@ static int query_formats(AVFilterContext *ctx)
AV_PIX_FMT_0RGB32, AV_PIX_FMT_NONE,
};
- AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts);
- if (!fmts_list)
- return AVERROR(ENOMEM);
- return ff_set_common_formats(ctx, fmts_list);
+ return ff_set_common_formats_from_list(ctx, pix_fmts);
}
static int filter_frame(AVFilterLink *inlink, AVFrame *in)
@@ -137,10 +137,7 @@ static int query_formats(AVFilterContext *ctx)
AV_PIX_FMT_NONE
};
- AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts);
- if (!fmts_list)
- return AVERROR(ENOMEM);
- return ff_set_common_formats(ctx, fmts_list);
+ return ff_set_common_formats_from_list(ctx, pix_fmts);
}
static av_cold void uninit(AVFilterContext *ctx)
@@ -86,10 +86,7 @@ static int query_formats(AVFilterContext *ctx)
AV_PIX_FMT_GBRAP, AV_PIX_FMT_GBRAP10, AV_PIX_FMT_GBRAP12, AV_PIX_FMT_GBRAP16,
AV_PIX_FMT_NONE
};
- AVFilterFormats *formats = ff_make_format_list(pixel_fmts);
- if (!formats)
- return AVERROR(ENOMEM);
- return ff_set_common_formats(ctx, formats);
+ return ff_set_common_formats_from_list(ctx, pixel_fmts);
}
static av_cold int init(AVFilterContext *ctx)
@@ -284,10 +284,7 @@ static int query_formats(AVFilterContext *ctx)
AV_PIX_FMT_NONE
};
- AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts);
- if (!fmts_list)
- return AVERROR(ENOMEM);
- return ff_set_common_formats(ctx, fmts_list);
+ return ff_set_common_formats_from_list(ctx, pix_fmts);
}
static int config_output(AVFilterLink *outlink)
@@ -83,7 +83,7 @@ static int query_formats(AVFilterContext *ctx)
AV_PIX_FMT_NONE
};
- return ff_set_common_formats(ctx, ff_make_format_list(pix_fmts));
+ return ff_set_common_formats_from_list(ctx, pix_fmts);
}
typedef struct ThreadData {
@@ -341,10 +341,7 @@ static int query_formats(AVFilterContext *ctx)
AV_PIX_FMT_NONE
};
- AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts);
- if (!fmts_list)
- return AVERROR(ENOMEM);
- return ff_set_common_formats(ctx, fmts_list);
+ return ff_set_common_formats_from_list(ctx, pix_fmts);
}
static av_cold void uninit(AVFilterContext *ctx)
@@ -311,10 +311,7 @@ static int request_frame(AVFilterLink *outlink)
static int query_formats(AVFilterContext *ctx)
{
static const enum AVPixelFormat pix_fmts[] = { AV_PIX_FMT_MONOBLACK, AV_PIX_FMT_NONE };
- AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts);
- if (!fmts_list)
- return AVERROR(ENOMEM);
- return ff_set_common_formats(ctx, fmts_list);
+ return ff_set_common_formats_from_list(ctx, pix_fmts);
}
static const AVFilterPad cellauto_outputs[] = {
@@ -91,10 +91,7 @@ static int query_formats(AVFilterContext *ctx)
AV_PIX_FMT_NONE
};
- AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts);
- if (!fmts_list)
- return AVERROR(ENOMEM);
- return ff_set_common_formats(ctx, fmts_list);
+ return ff_set_common_formats_from_list(ctx, pix_fmts);
}
static uint32_t lerp_color(uint8_t c0[4], uint8_t c1[4], float x)
@@ -416,7 +416,6 @@ static int query_formats(AVFilterContext *ctx)
{
LifeContext *life = ctx->priv;
enum AVPixelFormat pix_fmts[] = { AV_PIX_FMT_NONE, AV_PIX_FMT_NONE };
- AVFilterFormats *fmts_list;
if (life->mold || memcmp(life-> life_color, "\xff\xff\xff", 3)
|| memcmp(life->death_color, "\x00\x00\x00", 3)) {
@@ -427,8 +426,7 @@ static int query_formats(AVFilterContext *ctx)
life->draw = fill_picture_monoblack;
}
- fmts_list = ff_make_format_list(pix_fmts);
- return ff_set_common_formats(ctx, fmts_list);
+ return ff_set_common_formats_from_list(ctx, pix_fmts);
}
static const AVFilterPad life_outputs[] = {
@@ -153,10 +153,7 @@ static int query_formats(AVFilterContext *ctx)
AV_PIX_FMT_NONE
};
- AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts);
- if (!fmts_list)
- return AVERROR(ENOMEM);
- return ff_set_common_formats(ctx, fmts_list);
+ return ff_set_common_formats_from_list(ctx, pix_fmts);
}
static int config_props(AVFilterLink *inlink)
@@ -296,10 +296,7 @@ static int query_formats(AVFilterContext *ctx)
AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE
};
- AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts);
- if (!fmts_list)
- return AVERROR(ENOMEM);
- return ff_set_common_formats(ctx, fmts_list);
+ return ff_set_common_formats_from_list(ctx, pix_fmts);
}
static int request_frame(AVFilterLink *outlink)
@@ -78,10 +78,7 @@ static int query_formats(AVFilterContext *ctx)
AV_PIX_FMT_NONE
};
- AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts);
- if (!fmts_list)
- return AVERROR(ENOMEM);
- return ff_set_common_formats(ctx, fmts_list);
+ return ff_set_common_formats_from_list(ctx, pix_fmts);
}
static int fill_sierpinski(SierpinskiContext *s, int x, int y)
@@ -376,10 +376,7 @@ static int haldclutsrc_query_formats(AVFilterContext *ctx)
AV_PIX_FMT_NONE,
};
- AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts);
- if (!fmts_list)
- return AVERROR(ENOMEM);
- return ff_set_common_formats(ctx, fmts_list);
+ return ff_set_common_formats_from_list(ctx, pix_fmts);
}
static int haldclutsrc_config_props(AVFilterLink *outlink)
@@ -659,10 +656,7 @@ static int test_query_formats(AVFilterContext *ctx)
AV_PIX_FMT_RGB24, AV_PIX_FMT_NONE
};
- AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts);
- if (!fmts_list)
- return AVERROR(ENOMEM);
- return ff_set_common_formats(ctx, fmts_list);
+ return ff_set_common_formats_from_list(ctx, pix_fmts);
}
static const AVFilterPad avfilter_vsrc_testsrc_outputs[] = {
@@ -1097,10 +1091,7 @@ static int rgbtest_query_formats(AVFilterContext *ctx)
AV_PIX_FMT_NONE
};
- AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts);
- if (!fmts_list)
- return AVERROR(ENOMEM);
- return ff_set_common_formats(ctx, fmts_list);
+ return ff_set_common_formats_from_list(ctx, pix_fmts);
}
static int rgbtest_config_props(AVFilterLink *outlink)
@@ -1274,10 +1265,7 @@ static int yuvtest_query_formats(AVFilterContext *ctx)
AV_PIX_FMT_NONE
};
- AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts);
- if (!fmts_list)
- return AVERROR(ENOMEM);
- return ff_set_common_formats(ctx, fmts_list);
+ return ff_set_common_formats_from_list(ctx, pix_fmts);
}
static int yuvtest_config_props(AVFilterLink *outlink)
@@ -1426,10 +1414,7 @@ static int smptebars_query_formats(AVFilterContext *ctx)
AV_PIX_FMT_NONE,
};
- AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts);
- if (!fmts_list)
- return AVERROR(ENOMEM);
- return ff_set_common_formats(ctx, fmts_list);
+ return ff_set_common_formats_from_list(ctx, pix_fmts);
}
static const AVFilterPad smptebars_outputs[] = {
@@ -1759,10 +1744,7 @@ static int allyuv_query_formats(AVFilterContext *ctx)
AV_PIX_FMT_NONE
};
- AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts);
- if (!fmts_list)
- return AVERROR(ENOMEM);
- return ff_set_common_formats(ctx, fmts_list);
+ return ff_set_common_formats_from_list(ctx, pix_fmts);
}
static const AVFilterPad avfilter_vsrc_allyuv_outputs[] = {
@@ -1836,10 +1818,7 @@ static int allrgb_query_formats(AVFilterContext *ctx)
AV_PIX_FMT_RGB24, AV_PIX_FMT_NONE
};
- AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts);
- if (!fmts_list)
- return AVERROR(ENOMEM);
- return ff_set_common_formats(ctx, fmts_list);
+ return ff_set_common_formats_from_list(ctx, pix_fmts);
}
static const AVFilterPad avfilter_vsrc_allrgb_outputs[] = {
@@ -594,11 +594,8 @@ int ff_vk_filter_query_formats(AVFilterContext *avctx)
static const enum AVPixelFormat pixel_formats[] = {
AV_PIX_FMT_VULKAN, AV_PIX_FMT_NONE,
};
- AVFilterFormats *pix_fmts = ff_make_format_list(pixel_formats);
- if (!pix_fmts)
- return AVERROR(ENOMEM);
- return ff_set_common_formats(avctx, pix_fmts);
+ return ff_set_common_formats_from_list(avctx, pixel_formats);
}
static int vulkan_filter_set_device(AVFilterContext *avctx,
Several combinations of functions happen quite often in query_format functions; e.g. ff_set_common_formats(ctx, ff_make_format_list(sample_fmts)) is very common. This commit therefore adds functions that are equivalent to commonly used function combinations in order to reduce code duplication. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> --- libavfilter/aeval.c | 27 +++++------------------ libavfilter/af_acontrast.c | 16 +++----------- libavfilter/af_acrossover.c | 17 +++------------ libavfilter/af_acrusher.c | 17 +++------------ libavfilter/af_adeclick.c | 16 +++----------- libavfilter/af_adelay.c | 19 +++------------- libavfilter/af_adenorm.c | 18 +++------------ libavfilter/af_aderivative.c | 20 ++++------------- libavfilter/af_aecho.c | 19 +++------------- libavfilter/af_aemphasis.c | 19 +++------------- libavfilter/af_aexciter.c | 19 +++------------- libavfilter/af_afade.c | 19 +++------------- libavfilter/af_afftdn.c | 18 +++------------ libavfilter/af_afftfilt.c | 19 +++------------- libavfilter/af_afir.c | 17 +++++---------- libavfilter/af_afreqshift.c | 18 +++------------ libavfilter/af_afwtdn.c | 18 +++------------ libavfilter/af_agate.c | 19 ++++------------ libavfilter/af_aiir.c | 16 +++----------- libavfilter/af_alimiter.c | 19 +++------------- libavfilter/af_amerge.c | 6 ++--- libavfilter/af_amix.c | 6 ++--- libavfilter/af_amultiply.c | 19 +++------------- libavfilter/af_anlmdn.c | 18 +++------------ libavfilter/af_anlms.c | 19 +++------------- libavfilter/af_aphaser.c | 19 +++------------- libavfilter/af_apulsator.c | 3 +-- libavfilter/af_arnndn.c | 18 +++------------ libavfilter/af_asoftclip.c | 18 +++------------ libavfilter/af_asr.c | 2 +- libavfilter/af_astats.c | 19 +++------------- libavfilter/af_asubboost.c | 18 +++------------ libavfilter/af_asupercut.c | 18 +++------------ libavfilter/af_atempo.c | 23 +++----------------- libavfilter/af_axcorrelate.c | 19 +++------------- libavfilter/af_biquads.c | 25 +++++---------------- libavfilter/af_bs2b.c | 11 ++-------- libavfilter/af_channelmap.c | 2 +- libavfilter/af_channelsplit.c | 2 +- libavfilter/af_chorus.c | 19 +++------------- libavfilter/af_compand.c | 19 +++------------- libavfilter/af_compensationdelay.c | 19 +++------------- libavfilter/af_crossfeed.c | 2 +- libavfilter/af_crystalizer.c | 18 +++------------ libavfilter/af_dcshift.c | 19 +++------------- libavfilter/af_deesser.c | 18 +++------------ libavfilter/af_drmeter.c | 19 +++------------- libavfilter/af_dynaudnorm.c | 19 +++------------- libavfilter/af_earwax.c | 2 +- libavfilter/af_extrastereo.c | 3 +-- libavfilter/af_firequalizer.c | 19 +++------------- libavfilter/af_flanger.c | 19 +++------------- libavfilter/af_haas.c | 3 +-- libavfilter/af_hdcd.c | 3 +-- libavfilter/af_headphone.c | 5 +---- libavfilter/af_join.c | 2 +- libavfilter/af_ladspa.c | 22 ++++--------------- libavfilter/af_loudnorm.c | 13 ++--------- libavfilter/af_lv2.c | 16 +++----------- libavfilter/af_mcompand.c | 19 +++------------- libavfilter/af_pan.c | 4 +--- libavfilter/af_rubberband.c | 19 +++------------- libavfilter/af_sidechaincompress.c | 26 +++++----------------- libavfilter/af_silencedetect.c | 11 ++-------- libavfilter/af_silenceremove.c | 19 +++------------- libavfilter/af_sofalizer.c | 11 ++-------- libavfilter/af_speechnorm.c | 19 +++------------- libavfilter/af_stereotools.c | 3 +-- libavfilter/af_stereowiden.c | 3 +-- libavfilter/af_superequalizer.c | 15 +++---------- libavfilter/af_surround.c | 5 +---- libavfilter/af_tremolo.c | 19 +++------------- libavfilter/af_vibrato.c | 19 +++------------- libavfilter/af_volume.c | 19 +++------------- libavfilter/af_volumedetect.c | 14 ++---------- libavfilter/asrc_afirsrc.c | 20 +++-------------- libavfilter/asrc_anoisesrc.c | 20 +++-------------- libavfilter/asrc_anullsrc.c | 4 ++-- libavfilter/asrc_hilbert.c | 20 +++-------------- libavfilter/asrc_sinc.c | 19 +++------------- libavfilter/asrc_sine.c | 19 +++------------- libavfilter/avfiltergraph.c | 4 +--- libavfilter/f_reverse.c | 14 ++---------- libavfilter/f_select.c | 10 +-------- libavfilter/f_streamselect.c | 9 +++----- libavfilter/formats.c | 32 +++++++++++++++++++++++++-- libavfilter/formats.h | 29 +++++++++++++++++++++++++ libavfilter/opencl.c | 7 +----- libavfilter/vf_amplify.c | 5 +---- libavfilter/vf_atadenoise.c | 5 +---- libavfilter/vf_avgblur.c | 2 +- libavfilter/vf_bbox.c | 5 +---- libavfilter/vf_bilateral.c | 2 +- libavfilter/vf_bitplanenoise.c | 5 +---- libavfilter/vf_blackdetect.c | 5 +---- libavfilter/vf_blackframe.c | 5 +---- libavfilter/vf_blend.c | 5 +---- libavfilter/vf_bm3d.c | 5 +---- libavfilter/vf_bwdif.c | 6 +---- libavfilter/vf_cas.c | 8 +------ libavfilter/vf_chromakey.c | 9 +++----- libavfilter/vf_chromanr.c | 5 +---- libavfilter/vf_chromashift.c | 6 +---- libavfilter/vf_codecview.c | 5 +---- libavfilter/vf_colorbalance.c | 5 +---- libavfilter/vf_colorchannelmixer.c | 5 +---- libavfilter/vf_colorconstancy.c | 2 +- libavfilter/vf_colorcontrast.c | 8 +------ libavfilter/vf_colorcorrect.c | 8 +------ libavfilter/vf_colorize.c | 8 +------ libavfilter/vf_colorkey.c | 8 +------ libavfilter/vf_colorlevels.c | 5 +---- libavfilter/vf_colormatrix.c | 5 +---- libavfilter/vf_colortemperature.c | 8 +------ libavfilter/vf_convolution.c | 2 +- libavfilter/vf_convolve.c | 5 +---- libavfilter/vf_cover_rect.c | 2 +- libavfilter/vf_cropdetect.c | 5 +---- libavfilter/vf_curves.c | 5 +---- libavfilter/vf_dblur.c | 2 +- libavfilter/vf_dctdnoiz.c | 5 +---- libavfilter/vf_deband.c | 6 +---- libavfilter/vf_deblock.c | 5 +---- libavfilter/vf_decimate.c | 5 +---- libavfilter/vf_dedot.c | 5 +---- libavfilter/vf_deflicker.c | 5 +---- libavfilter/vf_deinterlace_qsv.c | 7 +----- libavfilter/vf_delogo.c | 5 +---- libavfilter/vf_derain.c | 5 +---- libavfilter/vf_deshake.c | 5 +---- libavfilter/vf_despill.c | 7 +----- libavfilter/vf_displace.c | 2 +- libavfilter/vf_dnn_classify.c | 3 +-- libavfilter/vf_dnn_detect.c | 3 +-- libavfilter/vf_dnn_processing.c | 3 +-- libavfilter/vf_drawbox.c | 5 +---- libavfilter/vf_edgedetect.c | 6 +---- libavfilter/vf_elbg.c | 5 +---- libavfilter/vf_entropy.c | 5 +---- libavfilter/vf_epx.c | 5 +---- libavfilter/vf_eq.c | 5 +---- libavfilter/vf_estdif.c | 5 +---- libavfilter/vf_exposure.c | 8 +------ libavfilter/vf_fade.c | 14 +++++------- libavfilter/vf_fftdnoiz.c | 5 +---- libavfilter/vf_fftfilt.c | 5 +---- libavfilter/vf_fillborders.c | 5 +---- libavfilter/vf_find_rect.c | 2 +- libavfilter/vf_floodfill.c | 7 +----- libavfilter/vf_format.c | 6 +---- libavfilter/vf_framepack.c | 5 +---- libavfilter/vf_framerate.c | 5 +---- libavfilter/vf_freezedetect.c | 5 +---- libavfilter/vf_fspp.c | 5 +---- libavfilter/vf_gblur.c | 2 +- libavfilter/vf_geq.c | 10 ++------- libavfilter/vf_gradfun.c | 5 +---- libavfilter/vf_guided.c | 2 +- libavfilter/vf_histeq.c | 5 +---- libavfilter/vf_hqdn3d.c | 5 +---- libavfilter/vf_hqx.c | 5 +---- libavfilter/vf_hue.c | 5 +---- libavfilter/vf_hysteresis.c | 2 +- libavfilter/vf_identity.c | 5 +---- libavfilter/vf_idet.c | 5 +---- libavfilter/vf_kerndeint.c | 5 +---- libavfilter/vf_lagfun.c | 5 +---- libavfilter/vf_lenscorrection.c | 5 +---- libavfilter/vf_lensfun.c | 3 +-- libavfilter/vf_libopencv.c | 5 +---- libavfilter/vf_libvmaf.c | 5 +---- libavfilter/vf_limiter.c | 5 +---- libavfilter/vf_lumakey.c | 7 +----- libavfilter/vf_lut.c | 5 +---- libavfilter/vf_lut2.c | 2 +- libavfilter/vf_lut3d.c | 5 +---- libavfilter/vf_maskedclamp.c | 2 +- libavfilter/vf_maskedmerge.c | 2 +- libavfilter/vf_maskedminmax.c | 2 +- libavfilter/vf_maskedthreshold.c | 2 +- libavfilter/vf_maskfun.c | 2 +- libavfilter/vf_mcdeint.c | 5 +---- libavfilter/vf_median.c | 2 +- libavfilter/vf_mestimate.c | 5 +---- libavfilter/vf_midequalizer.c | 2 +- libavfilter/vf_minterpolate.c | 5 +---- libavfilter/vf_monochrome.c | 8 +------ libavfilter/vf_mpdecimate.c | 5 +---- libavfilter/vf_neighbor.c | 2 +- libavfilter/vf_nlmeans.c | 5 +---- libavfilter/vf_nnedi.c | 5 +---- libavfilter/vf_normalize.c | 5 +---- libavfilter/vf_ocr.c | 5 +---- libavfilter/vf_overlay.c | 2 +- libavfilter/vf_overlay_cuda.c | 4 +--- libavfilter/vf_owdenoise.c | 5 +---- libavfilter/vf_perspective.c | 5 +---- libavfilter/vf_phase.c | 5 +---- libavfilter/vf_photosensitivity.c | 5 +---- libavfilter/vf_pp.c | 5 +---- libavfilter/vf_pp7.c | 5 +---- libavfilter/vf_premultiply.c | 2 +- libavfilter/vf_pseudocolor.c | 5 +---- libavfilter/vf_psnr.c | 5 +---- libavfilter/vf_pullup.c | 5 +---- libavfilter/vf_readeia608.c | 5 +---- libavfilter/vf_readvitc.c | 5 +---- libavfilter/vf_removegrain.c | 5 +---- libavfilter/vf_removelogo.c | 5 +---- libavfilter/vf_repeatfields.c | 5 +---- libavfilter/vf_rotate.c | 5 +---- libavfilter/vf_sab.c | 5 +---- libavfilter/vf_scale_cuda.c | 5 +---- libavfilter/vf_scale_npp.c | 4 +--- libavfilter/vf_scale_qsv.c | 7 +----- libavfilter/vf_scdet.c | 5 +---- libavfilter/vf_scroll.c | 5 +---- libavfilter/vf_selectivecolor.c | 5 +---- libavfilter/vf_shear.c | 5 +---- libavfilter/vf_shufflepixels.c | 5 +---- libavfilter/vf_signalstats.c | 5 +---- libavfilter/vf_signature.c | 2 +- libavfilter/vf_smartblur.c | 5 +---- libavfilter/vf_spp.c | 5 +---- libavfilter/vf_sr.c | 9 +------- libavfilter/vf_ssim.c | 5 +---- libavfilter/vf_stereo3d.c | 6 +---- libavfilter/vf_super2xsai.c | 5 +---- libavfilter/vf_threshold.c | 2 +- libavfilter/vf_thumbnail.c | 5 +---- libavfilter/vf_thumbnail_cuda.c | 5 +---- libavfilter/vf_tinterlace.c | 5 +---- libavfilter/vf_tmidequalizer.c | 2 +- libavfilter/vf_tonemap.c | 2 +- libavfilter/vf_transpose_npp.c | 3 +-- libavfilter/vf_unsharp.c | 5 +---- libavfilter/vf_uspp.c | 5 +---- libavfilter/vf_v360.c | 5 +---- libavfilter/vf_vaguedenoiser.c | 5 +---- libavfilter/vf_vibrance.c | 8 +------ libavfilter/vf_vidstabdetect.c | 5 +---- libavfilter/vf_vidstabtransform.c | 5 +---- libavfilter/vf_vif.c | 5 +---- libavfilter/vf_vignette.c | 5 +---- libavfilter/vf_w3fdif.c | 5 +---- libavfilter/vf_xbr.c | 5 +---- libavfilter/vf_xfade.c | 5 +---- libavfilter/vf_xmedian.c | 5 +---- libavfilter/vf_yadif.c | 5 +---- libavfilter/vf_yaepblur.c | 2 +- libavfilter/vf_zoompan.c | 5 +---- libavfilter/vsrc_cellauto.c | 5 +---- libavfilter/vsrc_gradients.c | 5 +---- libavfilter/vsrc_life.c | 4 +--- libavfilter/vsrc_mandelbrot.c | 5 +---- libavfilter/vsrc_mptestsrc.c | 5 +---- libavfilter/vsrc_sierpinski.c | 5 +---- libavfilter/vsrc_testsrc.c | 35 ++++++------------------------ libavfilter/vulkan.c | 5 +---- 259 files changed, 470 insertions(+), 1712 deletions(-)