FFmpeg
Data Structures | Macros | Functions | Variables
af_chorus.c File Reference
#include "libavutil/avstring.h"
#include "libavutil/mem.h"
#include "libavutil/opt.h"
#include "audio.h"
#include "avfilter.h"
#include "filters.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 64 of file af_chorus.c.

◆ A

Definition at line 65 of file af_chorus.c.

◆ MOD

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

Definition at line 210 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 79 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 91 of file af_chorus.c.

Referenced by init().

◆ init()

static av_cold int init ( AVFilterContext ctx)
static

Definition at line 107 of file af_chorus.c.

◆ config_output()

static int config_output ( AVFilterLink outlink)
static

Definition at line 158 of file af_chorus.c.

◆ filter_frame()

static int filter_frame ( AVFilterLink inlink,
AVFrame frame 
)
static

Definition at line 212 of file af_chorus.c.

Referenced by request_frame().

◆ request_frame()

static int request_frame ( AVFilterLink outlink)
static

Definition at line 265 of file af_chorus.c.

◆ uninit()

static av_cold void uninit ( AVFilterContext ctx)
static

Definition at line 297 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 67 of file af_chorus.c.

◆ chorus_inputs

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

Definition at line 325 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 333 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 342 of file af_chorus.c.

AV_SAMPLE_FMT_FLTP
@ AV_SAMPLE_FMT_FLTP
float, planar
Definition: samplefmt.h:66
FILTER_INPUTS
#define FILTER_INPUTS(array)
Definition: filters.h:262
filter_frame
static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
Definition: af_chorus.c:212
uninit
static av_cold void uninit(AVFilterContext *ctx)
Definition: af_chorus.c:297
AVMEDIA_TYPE_AUDIO
@ AVMEDIA_TYPE_AUDIO
Definition: avutil.h:202
FILTER_OUTPUTS
#define FILTER_OUTPUTS(array)
Definition: filters.h:263
ChorusContext
Definition: af_chorus.c:40
NULL
#define NULL
Definition: coverity.c:32
config_output
static int config_output(AVFilterLink *outlink)
Definition: af_chorus.c:158
chorus_inputs
static const AVFilterPad chorus_inputs[]
Definition: af_chorus.c:325
FILTER_SINGLE_SAMPLEFMT
#define FILTER_SINGLE_SAMPLEFMT(sample_fmt_)
Definition: filters.h:255
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:94
A
#define A
Definition: af_chorus.c:65
OFFSET
#define OFFSET(x)
Definition: af_chorus.c:64
AV_OPT_TYPE_FLOAT
@ AV_OPT_TYPE_FLOAT
Underlying C type is float.
Definition: opt.h:271
chorus_outputs
static const AVFilterPad chorus_outputs[]
Definition: af_chorus.c:333
request_frame
static int request_frame(AVFilterLink *outlink)
Definition: af_chorus.c:265
init
static av_cold int init(AVFilterContext *ctx)
Definition: af_chorus.c:107
AV_OPT_TYPE_STRING
@ AV_OPT_TYPE_STRING
Underlying C type is a uint8_t* that is either NULL or points to a C string allocated with the av_mal...
Definition: opt.h:276