Data Structures | Macros | Functions | Variables
af_adelay.c File Reference
#include "libavutil/avstring.h"
#include "libavutil/eval.h"
#include "libavutil/opt.h"
#include "libavutil/samplefmt.h"
#include "avfilter.h"
#include "audio.h"
#include "filters.h"
#include "internal.h"

Go to the source code of this file.

Data Structures

struct  ChanDelay
struct  AudioDelayContext


#define OFFSET(x)   offsetof(AudioDelayContext, x)
#define DELAY(name, type, fill)


static int query_formats (AVFilterContext *ctx)
static int config_input (AVFilterLink *inlink)
static int filter_frame (AVFilterLink *inlink, AVFrame *frame)
static int activate (AVFilterContext *ctx)
static av_cold void uninit (AVFilterContext *ctx)


static const AVOption adelay_options []
static const AVFilterPad adelay_inputs []
static const AVFilterPad adelay_outputs []
AVFilter ff_af_adelay

Macro Definition Documentation

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

Definition at line 53 of file af_adelay.c.

Definition at line 54 of file af_adelay.c.

#define DELAY (   name,
static void delay_channel_## name ##p(ChanDelay *d, int nb_samples, \
const uint8_t *ssrc, uint8_t *ddst) \
{ \
const type *src = (type *)ssrc; \
type *dst = (type *)ddst; \
type *samples = (type *)d->samples; \
while (nb_samples) { \
if (d->delay_index < d->delay) { \
const int len = FFMIN(nb_samples, d->delay - d->delay_index); \
memcpy(&samples[d->delay_index], src, len * sizeof(type)); \
memset(dst, fill, len * sizeof(type)); \
d->delay_index += len; \
src += len; \
dst += len; \
nb_samples -= len; \
} else { \
*dst = samples[d->index]; \
samples[d->index] = *src; \
nb_samples--; \
d->index++; \
src++, dst++; \
d->index = d->index >= d->delay ? 0 : d->index; \
} \
} \
GLint GLenum type
Definition: opengl_enc.c:104
#define src
Definition: vp8dsp.c:255
#define FFMIN(a, b)
Definition: common.h:105
int len
Filter the word “frame” indicates either a video frame or a group of audio samples
const char * name
Definition: opengl_enc.c:102

Definition at line 95 of file af_adelay.c.

Function Documentation

static int query_formats ( AVFilterContext ctx)

Definition at line 64 of file af_adelay.c.

static int config_input ( AVFilterLink inlink)

Definition at line 130 of file af_adelay.c.

static int filter_frame ( AVFilterLink inlink,
AVFrame frame 

Definition at line 215 of file af_adelay.c.

Referenced by activate().

static int activate ( AVFilterContext ctx)

Definition at line 249 of file af_adelay.c.

static av_cold void uninit ( AVFilterContext ctx)

Definition at line 320 of file af_adelay.c.

Variable Documentation

const AVOption adelay_options[]
Initial value:
= {
{ "delays", "set list of delays for each channel", OFFSET(delays), AV_OPT_TYPE_STRING, {.str=NULL}, 0, 0, A },
{ "all", "use last available delay for remained channels", OFFSET(all), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1, A },
{ NULL }
#define NULL
Definition: coverity.c:32
#define OFFSET(x)
Definition: af_adelay.c:53
#define A
Definition: af_adelay.c:54

Definition at line 56 of file af_adelay.c.

const AVFilterPad adelay_inputs[]
Initial value:
= {
.name = "default",
.config_props = config_input,
{ NULL }
#define NULL
Definition: coverity.c:32
static int config_input(AVFilterLink *inlink)
Definition: af_adelay.c:130

Definition at line 331 of file af_adelay.c.

const AVFilterPad adelay_outputs[]
Initial value:
= {
.name = "default",
{ NULL }
#define NULL
Definition: coverity.c:32

Definition at line 340 of file af_adelay.c.

AVFilter ff_af_adelay
Initial value:
= {
.name = "adelay",
.description = NULL_IF_CONFIG_SMALL("Delay one or more audio channels."),
.query_formats = query_formats,
.priv_size = sizeof(AudioDelayContext),
.priv_class = &adelay_class,
static int activate(AVFilterContext *ctx)
Definition: af_adelay.c:249
static av_cold void uninit(AVFilterContext *ctx)
Definition: af_adelay.c:320
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:117
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
static int query_formats(AVFilterContext *ctx)
Definition: af_adelay.c:64
static const AVFilterPad outputs[]
Definition: af_acontrast.c:203
Same as AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC, except that the filter will have its filter_frame() c...
Definition: avfilter.h:134
#define flags(name, subs,...)
Definition: cbs_av1.c:561
static const AVFilterPad adelay_inputs[]
Definition: af_adelay.c:331
static const AVFilterPad adelay_outputs[]
Definition: af_adelay.c:340

Definition at line 348 of file af_adelay.c.