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 query_formats (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 238 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.

◆ query_formats()

static int query_formats ( AVFilterContext ctx)
static

Definition at line 157 of file af_chorus.c.

◆ config_output()

static int config_output ( AVFilterLink outlink)
static

Definition at line 186 of file af_chorus.c.

◆ filter_frame()

static int filter_frame ( AVFilterLink inlink,
AVFrame frame 
)
static

Definition at line 240 of file af_chorus.c.

Referenced by request_frame().

◆ request_frame()

static int request_frame ( AVFilterLink outlink)
static

Definition at line 293 of file af_chorus.c.

◆ uninit()

static av_cold void uninit ( AVFilterContext ctx)
static

Definition at line 325 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,
},
{ NULL }
}

Definition at line 353 of file af_chorus.c.

◆ chorus_outputs

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

Definition at line 362 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."),
.query_formats = query_formats,
.priv_size = sizeof(ChorusContext),
.priv_class = &chorus_class,
.init = init,
}

Definition at line 372 of file af_chorus.c.

filter_frame
static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
Definition: af_chorus.c:240
uninit
static av_cold void uninit(AVFilterContext *ctx)
Definition: af_chorus.c:325
query_formats
static int query_formats(AVFilterContext *ctx)
Definition: af_chorus.c:157
inputs
these buffered frames must be flushed immediately if a new input produces new the filter must not call request_frame to get more It must just process the frame or queue it The task of requesting more frames is left to the filter s request_frame method or the application If a filter has several inputs
Definition: filter_design.txt:243
AVMEDIA_TYPE_AUDIO
@ AVMEDIA_TYPE_AUDIO
Definition: avutil.h:202
outputs
static const AVFilterPad outputs[]
Definition: af_acontrast.c:203
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:186
chorus_inputs
static const AVFilterPad chorus_inputs[]
Definition: af_chorus.c:353
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:117
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:362
request_frame
static int request_frame(AVFilterLink *outlink)
Definition: af_chorus.c:293
init
static av_cold int init(AVFilterContext *ctx)
Definition: af_chorus.c:106
AV_OPT_TYPE_STRING
@ AV_OPT_TYPE_STRING
Definition: opt.h:229