You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-15 14:13:16 +02:00
avfilter/af_agate: compile agate only when requested.
Signed-off-by: Paul B Mahol <onemda@gmail.com>
This commit is contained in:
@@ -79,35 +79,6 @@ static const AVOption options[] = {
|
|||||||
{ NULL }
|
{ NULL }
|
||||||
};
|
};
|
||||||
|
|
||||||
#define agate_options options
|
|
||||||
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)
|
|
||||||
return ret;
|
|
||||||
ret = ff_set_common_formats(ctx, formats);
|
|
||||||
if (ret < 0)
|
|
||||||
return ret;
|
|
||||||
|
|
||||||
layouts = ff_all_channel_counts();
|
|
||||||
if (!layouts)
|
|
||||||
return AVERROR(ENOMEM);
|
|
||||||
ret = ff_set_common_channel_layouts(ctx, layouts);
|
|
||||||
if (ret < 0)
|
|
||||||
return ret;
|
|
||||||
|
|
||||||
formats = ff_all_samplerates();
|
|
||||||
if (!formats)
|
|
||||||
return AVERROR(ENOMEM);
|
|
||||||
|
|
||||||
return ff_set_common_samplerates(ctx, formats);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int agate_config_input(AVFilterLink *inlink)
|
static int agate_config_input(AVFilterLink *inlink)
|
||||||
{
|
{
|
||||||
AVFilterContext *ctx = inlink->dst;
|
AVFilterContext *ctx = inlink->dst;
|
||||||
@@ -197,6 +168,37 @@ static void gate(AudioGateContext *s,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if CONFIG_AGATE_FILTER
|
||||||
|
|
||||||
|
#define agate_options options
|
||||||
|
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)
|
||||||
|
return ret;
|
||||||
|
ret = ff_set_common_formats(ctx, formats);
|
||||||
|
if (ret < 0)
|
||||||
|
return ret;
|
||||||
|
|
||||||
|
layouts = ff_all_channel_counts();
|
||||||
|
if (!layouts)
|
||||||
|
return AVERROR(ENOMEM);
|
||||||
|
ret = ff_set_common_channel_layouts(ctx, layouts);
|
||||||
|
if (ret < 0)
|
||||||
|
return ret;
|
||||||
|
|
||||||
|
formats = ff_all_samplerates();
|
||||||
|
if (!formats)
|
||||||
|
return AVERROR(ENOMEM);
|
||||||
|
|
||||||
|
return ff_set_common_samplerates(ctx, formats);
|
||||||
|
}
|
||||||
|
|
||||||
static int filter_frame(AVFilterLink *inlink, AVFrame *in)
|
static int filter_frame(AVFilterLink *inlink, AVFrame *in)
|
||||||
{
|
{
|
||||||
const double *src = (const double *)in->data[0];
|
const double *src = (const double *)in->data[0];
|
||||||
@@ -254,6 +256,8 @@ AVFilter ff_af_agate = {
|
|||||||
.outputs = outputs,
|
.outputs = outputs,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#endif /* CONFIG_AGATE_FILTER */
|
||||||
|
|
||||||
#if CONFIG_SIDECHAINGATE_FILTER
|
#if CONFIG_SIDECHAINGATE_FILTER
|
||||||
|
|
||||||
#define sidechaingate_options options
|
#define sidechaingate_options options
|
||||||
|
Reference in New Issue
Block a user