FFmpeg
Data Structures | Macros | Functions | Variables
af_aphaser.c File Reference
#include "libavutil/avassert.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  AudioPhaserContext
 

Macros

#define OFFSET(x)   offsetof(AudioPhaserContext, x)
 
#define FLAGS   AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
 
#define MOD(a, b)   (((a) >= (b)) ? (a) - (b) : (a))
 
#define PHASER_PLANAR(name, type)
 
#define PHASER(name, type)
 

Functions

 AVFILTER_DEFINE_CLASS (aphaser)
 
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 *inbuf)
 
static av_cold void uninit (AVFilterContext *ctx)
 

Variables

static const AVOption aphaser_options []
 
static const AVFilterPad aphaser_inputs []
 
static const AVFilterPad aphaser_outputs []
 
AVFilter ff_af_aphaser
 

Detailed Description

phaser audio filter

Definition in file af_aphaser.c.

Macro Definition Documentation

◆ OFFSET

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

Definition at line 55 of file af_aphaser.c.

◆ FLAGS

Definition at line 56 of file af_aphaser.c.

◆ MOD

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

Definition at line 119 of file af_aphaser.c.

◆ PHASER_PLANAR

#define PHASER_PLANAR (   name,
  type 
)

Definition at line 121 of file af_aphaser.c.

◆ PHASER

#define PHASER (   name,
  type 
)

Definition at line 157 of file af_aphaser.c.

Function Documentation

◆ AVFILTER_DEFINE_CLASS()

AVFILTER_DEFINE_CLASS ( aphaser  )

◆ init()

static av_cold int init ( AVFilterContext ctx)
static

Definition at line 74 of file af_aphaser.c.

◆ query_formats()

static int query_formats ( AVFilterContext ctx)
static

Definition at line 86 of file af_aphaser.c.

◆ config_output()

static int config_output ( AVFilterLink outlink)
static

Definition at line 203 of file af_aphaser.c.

◆ filter_frame()

static int filter_frame ( AVFilterLink inlink,
AVFrame inbuf 
)
static

Definition at line 241 of file af_aphaser.c.

◆ uninit()

static av_cold void uninit ( AVFilterContext ctx)
static

Definition at line 267 of file af_aphaser.c.

Variable Documentation

◆ aphaser_options

const AVOption aphaser_options[]
static
Initial value:
= {
{ "in_gain", "set input gain", OFFSET(in_gain), AV_OPT_TYPE_DOUBLE, {.dbl=.4}, 0, 1, FLAGS },
{ "out_gain", "set output gain", OFFSET(out_gain), AV_OPT_TYPE_DOUBLE, {.dbl=.74}, 0, 1e9, FLAGS },
{ "delay", "set delay in milliseconds", OFFSET(delay), AV_OPT_TYPE_DOUBLE, {.dbl=3.}, 0, 5, FLAGS },
{ "decay", "set decay", OFFSET(decay), AV_OPT_TYPE_DOUBLE, {.dbl=.4}, 0, .99, FLAGS },
{ "speed", "set modulation speed", OFFSET(speed), AV_OPT_TYPE_DOUBLE, {.dbl=.5}, .1, 2, FLAGS },
{ "type", "set modulation type", OFFSET(type), AV_OPT_TYPE_INT, {.i64=WAVE_TRI}, 0, WAVE_NB-1, FLAGS, "type" },
{ "triangular", NULL, 0, AV_OPT_TYPE_CONST, {.i64=WAVE_TRI}, 0, 0, FLAGS, "type" },
{ "t", NULL, 0, AV_OPT_TYPE_CONST, {.i64=WAVE_TRI}, 0, 0, FLAGS, "type" },
{ "sinusoidal", NULL, 0, AV_OPT_TYPE_CONST, {.i64=WAVE_SIN}, 0, 0, FLAGS, "type" },
{ "s", NULL, 0, AV_OPT_TYPE_CONST, {.i64=WAVE_SIN}, 0, 0, FLAGS, "type" },
{ NULL }
}

Definition at line 58 of file af_aphaser.c.

◆ aphaser_inputs

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

Definition at line 275 of file af_aphaser.c.

◆ aphaser_outputs

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

Definition at line 284 of file af_aphaser.c.

◆ ff_af_aphaser

AVFilter ff_af_aphaser
Initial value:
= {
.name = "aphaser",
.description = NULL_IF_CONFIG_SMALL("Add a phasing effect to the audio."),
.query_formats = query_formats,
.priv_size = sizeof(AudioPhaserContext),
.init = init,
.priv_class = &aphaser_class,
}

Definition at line 293 of file af_aphaser.c.

AudioPhaserContext
Definition: af_aphaser.c:33
filter_frame
static int filter_frame(AVFilterLink *inlink, AVFrame *inbuf)
Definition: af_aphaser.c:241
WAVE_TRI
@ WAVE_TRI
Definition: generate_wave_table.h:26
type
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf type
Definition: writing_filters.txt:86
AV_OPT_TYPE_DOUBLE
@ AV_OPT_TYPE_DOUBLE
Definition: opt.h:225
AVMEDIA_TYPE_AUDIO
@ AVMEDIA_TYPE_AUDIO
Definition: avutil.h:202
outputs
static const AVFilterPad outputs[]
Definition: af_acontrast.c:203
WAVE_SIN
@ WAVE_SIN
Definition: generate_wave_table.h:25
NULL
#define NULL
Definition: coverity.c:32
query_formats
static int query_formats(AVFilterContext *ctx)
Definition: af_aphaser.c:86
WAVE_NB
@ WAVE_NB
Definition: generate_wave_table.h:27
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
FLAGS
#define FLAGS
Definition: af_aphaser.c:56
aphaser_outputs
static const AVFilterPad aphaser_outputs[]
Definition: af_aphaser.c:284
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:188
uninit
static av_cold void uninit(AVFilterContext *ctx)
Definition: af_aphaser.c:267
aphaser_inputs
static const AVFilterPad aphaser_inputs[]
Definition: af_aphaser.c:275
AV_OPT_TYPE_INT
@ AV_OPT_TYPE_INT
Definition: opt.h:223
init
static av_cold int init(AVFilterContext *ctx)
Definition: af_aphaser.c:74
OFFSET
#define OFFSET(x)
Definition: af_aphaser.c:55
AV_OPT_TYPE_CONST
@ AV_OPT_TYPE_CONST
Definition: opt.h:232
config_output
static int config_output(AVFilterLink *outlink)
Definition: af_aphaser.c:203