FFmpeg
Data Structures | Macros | Functions | Variables
af_chorus.c File Reference
#include "libavutil/avstring.h"
#include "libavutil/opt.h"
#include "audio.h"
#include "avfilter.h"
#include "internal.h"
#include "generate_wave_table.h"

Go to the source code of this file.

Data Structures

struct  ChorusContext
 

Macros

#define OFFSET(x)   offsetof(ChorusContext, x)
 
#define A   AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
 
#define MOD(a, b)   (((a) >= (b)) ? (a) - (b) : (a))
 

Functions

 AVFILTER_DEFINE_CLASS (chorus)
 
static void count_items (char *item_str, int *nb_items)
 
static void fill_items (char *item_str, int *nb_items, float *items)
 
static av_cold int init (AVFilterContext *ctx)
 
static int config_output (AVFilterLink *outlink)
 
static int filter_frame (AVFilterLink *inlink, AVFrame *frame)
 
static int request_frame (AVFilterLink *outlink)
 
static av_cold void uninit (AVFilterContext *ctx)
 

Variables

static const AVOption chorus_options []
 
static const AVFilterPad chorus_inputs []
 
static const AVFilterPad chorus_outputs []
 
const AVFilter ff_af_chorus
 

Detailed Description

chorus audio filter

Definition in file af_chorus.c.

Macro Definition Documentation

◆ OFFSET

#define OFFSET (   x)    offsetof(ChorusContext, x)

Definition at line 63 of file af_chorus.c.

◆ A

Definition at line 64 of file af_chorus.c.

◆ MOD

#define MOD (   a,
  b 
)    (((a) >= (b)) ? (a) - (b) : (a))

Definition at line 209 of file af_chorus.c.

Function Documentation

◆ AVFILTER_DEFINE_CLASS()

AVFILTER_DEFINE_CLASS ( chorus  )

◆ count_items()

static void count_items ( char *  item_str,
int nb_items 
)
static

Definition at line 78 of file af_chorus.c.

Referenced by init().

◆ fill_items()

static void fill_items ( char *  item_str,
int nb_items,
float items 
)
static

Definition at line 90 of file af_chorus.c.

Referenced by init().

◆ init()

static av_cold int init ( AVFilterContext ctx)
static

Definition at line 106 of file af_chorus.c.

◆ config_output()

static int config_output ( AVFilterLink outlink)
static

Definition at line 157 of file af_chorus.c.

◆ filter_frame()

static int filter_frame ( AVFilterLink inlink,
AVFrame frame 
)
static

Definition at line 211 of file af_chorus.c.

Referenced by request_frame().

◆ request_frame()

static int request_frame ( AVFilterLink outlink)
static

Definition at line 264 of file af_chorus.c.

◆ uninit()

static av_cold void uninit ( AVFilterContext ctx)
static

Definition at line 296 of file af_chorus.c.

Variable Documentation

◆ chorus_options

const AVOption chorus_options[]
static
Initial value:
= {
{ "in_gain", "set input gain", OFFSET(in_gain), AV_OPT_TYPE_FLOAT, {.dbl=.4}, 0, 1, A },
{ "out_gain", "set output gain", OFFSET(out_gain), AV_OPT_TYPE_FLOAT, {.dbl=.4}, 0, 1, A },
{ "delays", "set delays", OFFSET(delays_str), AV_OPT_TYPE_STRING, {.str=NULL}, 0, 0, A },
{ "decays", "set decays", OFFSET(decays_str), AV_OPT_TYPE_STRING, {.str=NULL}, 0, 0, A },
{ "speeds", "set speeds", OFFSET(speeds_str), AV_OPT_TYPE_STRING, {.str=NULL}, 0, 0, A },
{ "depths", "set depths", OFFSET(depths_str), AV_OPT_TYPE_STRING, {.str=NULL}, 0, 0, A },
{ NULL }
}

Definition at line 66 of file af_chorus.c.

◆ chorus_inputs

const AVFilterPad chorus_inputs[]
static
Initial value:
= {
{
.name = "default",
.filter_frame = filter_frame,
},
}

Definition at line 324 of file af_chorus.c.

◆ chorus_outputs

const AVFilterPad chorus_outputs[]
static
Initial value:
= {
{
.name = "default",
.request_frame = request_frame,
.config_props = config_output,
},
}

Definition at line 332 of file af_chorus.c.

◆ ff_af_chorus

const AVFilter ff_af_chorus
Initial value:
= {
.name = "chorus",
.description = NULL_IF_CONFIG_SMALL("Add a chorus effect to the audio."),
.priv_size = sizeof(ChorusContext),
.priv_class = &chorus_class,
.init = init,
}

Definition at line 341 of file af_chorus.c.

AV_SAMPLE_FMT_FLTP
@ AV_SAMPLE_FMT_FLTP
float, planar
Definition: samplefmt.h:66
FILTER_SINGLE_SAMPLEFMT
#define FILTER_SINGLE_SAMPLEFMT(sample_fmt_)
Definition: internal.h:185
filter_frame
static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
Definition: af_chorus.c:211
uninit
static av_cold void uninit(AVFilterContext *ctx)
Definition: af_chorus.c:296
AVMEDIA_TYPE_AUDIO
@ AVMEDIA_TYPE_AUDIO
Definition: avutil.h:202
FILTER_INPUTS
#define FILTER_INPUTS(array)
Definition: internal.h:192
ChorusContext
Definition: af_chorus.c:39
NULL
#define NULL
Definition: coverity.c:32
config_output
static int config_output(AVFilterLink *outlink)
Definition: af_chorus.c:157
chorus_inputs
static const AVFilterPad chorus_inputs[]
Definition: af_chorus.c:324
NULL_IF_CONFIG_SMALL
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Definition: internal.h:106
A
#define A
Definition: af_chorus.c:64
OFFSET
#define OFFSET(x)
Definition: af_chorus.c:63
AV_OPT_TYPE_FLOAT
@ AV_OPT_TYPE_FLOAT
Definition: opt.h:228
chorus_outputs
static const AVFilterPad chorus_outputs[]
Definition: af_chorus.c:332
request_frame
static int request_frame(AVFilterLink *outlink)
Definition: af_chorus.c:264
init
static av_cold int init(AVFilterContext *ctx)
Definition: af_chorus.c:106
FILTER_OUTPUTS
#define FILTER_OUTPUTS(array)
Definition: internal.h:193
AV_OPT_TYPE_STRING
@ AV_OPT_TYPE_STRING
Definition: opt.h:229