FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions | Variables
af_adelay.c File Reference
#include "libavutil/avstring.h"
#include "libavutil/opt.h"
#include "libavutil/samplefmt.h"
#include "avfilter.h"
#include "audio.h"
#include "internal.h"

Go to the source code of this file.

Data Structures

struct  ChanDelay
 
struct  AudioDelayContext
 

Macros

#define OFFSET(x)   offsetof(AudioDelayContext, x)
 
#define A   AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
 
#define DELAY(name, type, fill)
 

Functions

 AVFILTER_DEFINE_CLASS (adelay)
 
static int query_formats (AVFilterContext *ctx)
 
static int config_input (AVFilterLink *inlink)
 
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 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 48 of file af_adelay.c.

Definition at line 49 of file af_adelay.c.

#define DELAY (   name,
  type,
  fill 
)
Value:
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; \
} \
} \
}
uint8_t
#define FFMIN(a, b)
Definition: common.h:81
AVS_Value src
Definition: avisynth_c.h:482
GLint GLenum type
Definition: opengl_enc.c:105
if(ret< 0)
Definition: vf_mcdeint.c:280
int len
const char * name
Definition: opengl_enc.c:103

Definition at line 89 of file af_adelay.c.

Function Documentation

AVFILTER_DEFINE_CLASS ( adelay  )
static int query_formats ( AVFilterContext ctx)
static

Definition at line 58 of file af_adelay.c.

static int config_input ( AVFilterLink inlink)
static

Definition at line 124 of file af_adelay.c.

static int filter_frame ( AVFilterLink inlink,
AVFrame frame 
)
static

Definition at line 184 of file af_adelay.c.

Referenced by request_frame().

static int request_frame ( AVFilterLink outlink)
static

Definition at line 215 of file af_adelay.c.

static av_cold void uninit ( AVFilterContext ctx)
static

Definition at line 246 of file af_adelay.c.

Variable Documentation

const AVOption adelay_options[]
static
Initial value:
= {
{ "delays", "set list of delays for each channel", OFFSET(delays), AV_OPT_TYPE_STRING, {.str=NULL}, 0, 0, A },
{ NULL }
}
#define NULL
Definition: coverity.c:32
#define OFFSET(x)
Definition: af_adelay.c:48
#define A
Definition: af_adelay.c:49

Definition at line 51 of file af_adelay.c.

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

Definition at line 256 of file af_adelay.c.

const AVFilterPad adelay_outputs[]
static
Initial value:
= {
{
.name = "default",
.request_frame = request_frame,
},
{ NULL }
}
#define NULL
Definition: coverity.c:32
static int request_frame(AVFilterLink *outlink)
Definition: af_adelay.c:215

Definition at line 266 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 const AVFilterPad outputs[]
Definition: af_ashowinfo.c:248
static av_cold void uninit(AVFilterContext *ctx)
Definition: af_adelay.c:246
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:175
static int query_formats(AVFilterContext *ctx)
Definition: af_adelay.c:58
static const AVFilterPad inputs[]
Definition: af_ashowinfo.c:239
#define AVFILTER_FLAG_SUPPORT_TIMELINE_INTERNAL
Same as AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC, except that the filter will have its filter_frame() c...
Definition: avfilter.h:459
static int flags
Definition: cpu.c:47
static const AVFilterPad adelay_inputs[]
Definition: af_adelay.c:256
static const AVFilterPad adelay_outputs[]
Definition: af_adelay.c:266

Definition at line 275 of file af_adelay.c.