af_aresample.c File Reference

resampling audio filter More...

#include "libavutil/avstring.h"
#include "libavutil/channel_layout.h"
#include "libavutil/opt.h"
#include "libavutil/samplefmt.h"
#include "libavutil/avassert.h"
#include "libswresample/swresample.h"
#include "avfilter.h"
#include "audio.h"
#include "internal.h"
Include dependency graph for af_aresample.c:

Go to the source code of this file.

Data Structures

struct  AResampleContext
 

Macros

#define OFFSET(x)   offsetof(AResampleContext, x)
 
#define FLAGS   AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
 

Functions

static av_cold int init_dict (AVFilterContext *ctx, AVDictionary **opts)
 
static av_cold void uninit (AVFilterContext *ctx)
 
static int query_formats (AVFilterContext *ctx)
 
static int config_output (AVFilterLink *outlink)
 
static int filter_frame (AVFilterLink *inlink, AVFrame *insamplesref)
 
static int request_frame (AVFilterLink *outlink)
 
static const AVClassresample_child_class_next (const AVClass *prev)
 
static voidresample_child_next (void *obj, void *prev)
 

Variables

static const AVOption options []
 
static const AVClass aresample_class
 
static const AVFilterPad aresample_inputs []
 
static const AVFilterPad aresample_outputs []
 
AVFilter avfilter_af_aresample
 

Detailed Description

resampling audio filter

Definition in file af_aresample.c.

Macro Definition Documentation

Definition at line 266 of file af_aresample.c.

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

Definition at line 265 of file af_aresample.c.

Function Documentation

static int config_output ( AVFilterLink outlink)
static

Definition at line 125 of file af_aresample.c.

static int filter_frame ( AVFilterLink inlink,
AVFrame insamplesref 
)
static

Definition at line 171 of file af_aresample.c.

static av_cold int init_dict ( AVFilterContext ctx,
AVDictionary **  opts 
)
static

Definition at line 46 of file af_aresample.c.

static int query_formats ( AVFilterContext ctx)
static

Definition at line 81 of file af_aresample.c.

static int request_frame ( AVFilterLink outlink)
static

Definition at line 213 of file af_aresample.c.

static const AVClass* resample_child_class_next ( const AVClass prev)
static

Definition at line 254 of file af_aresample.c.

static void* resample_child_next ( void obj,
void prev 
)
static

Definition at line 259 of file af_aresample.c.

static av_cold void uninit ( AVFilterContext ctx)
static

Definition at line 75 of file af_aresample.c.

Variable Documentation

const AVClass aresample_class
static
Initial value:
= {
.class_name = "aresample",
.item_name = av_default_item_name,
.option = options,
.child_class_next = resample_child_class_next,
}
av_default_item_name
static const AVOption options[]
Definition: af_aresample.c:268
void *(* child_next)(void *obj, void *prev)
Return next AVOptions-enabled child or NULL.
Definition: log.h:96
static void * resample_child_next(void *obj, void *prev)
Definition: af_aresample.c:259
LIBAVUTIL_VERSION_INT
Definition: eval.c:55
static const AVClass * resample_child_class_next(const AVClass *prev)
Definition: af_aresample.c:254

Definition at line 273 of file af_aresample.c.

const AVFilterPad aresample_inputs[]
static
Initial value:
= {
{
.name = "default",
.filter_frame = filter_frame,
},
{ NULL },
}
NULL
Definition: eval.c:55
static int filter_frame(AVFilterLink *inlink, AVFrame *insamplesref)
Definition: af_aresample.c:171

Definition at line 282 of file af_aresample.c.

const AVFilterPad aresample_outputs[]
static
Initial value:
= {
{
.name = "default",
.config_props = config_output,
.request_frame = request_frame,
},
{ NULL },
}
NULL
Definition: eval.c:55
static int request_frame(AVFilterLink *outlink)
Definition: af_aresample.c:213
static int config_output(AVFilterLink *outlink)
Definition: af_aresample.c:125

Definition at line 291 of file af_aresample.c.

AVFilter avfilter_af_aresample
Initial value:
= {
.name = "aresample",
.description = NULL_IF_CONFIG_SMALL("Resample audio data."),
.init_dict = init_dict,
.uninit = uninit,
.query_formats = query_formats,
.priv_size = sizeof(AResampleContext),
.priv_class = &aresample_class,
}
static const AVFilterPad aresample_inputs[]
Definition: af_aresample.c:282
static const AVFilterPad outputs[]
Definition: af_ashowinfo.c:117
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
static const AVClass aresample_class
Definition: af_aresample.c:273
static av_cold int init_dict(AVFilterContext *ctx, AVDictionary **opts)
Definition: af_aresample.c:46
static av_cold void uninit(AVFilterContext *ctx)
Definition: af_aresample.c:75
static const AVFilterPad aresample_outputs[]
Definition: af_aresample.c:291
static int query_formats(AVFilterContext *ctx)
Definition: af_aresample.c:81
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 at line 301 of file af_aresample.c.

const AVOption options[]
static
Initial value:
= {
{"sample_rate", NULL, OFFSET(sample_rate_arg), AV_OPT_TYPE_INT, {.i64=0}, 0, INT_MAX, FLAGS },
{NULL}
}
#define FLAGS
Definition: af_aresample.c:266
NULL
Definition: eval.c:55
#define OFFSET(x)
Definition: af_aresample.c:265

Definition at line 268 of file af_aresample.c.