FFmpeg
Data Structures | Macros | Functions | Variables
af_aresample.c File Reference
#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 "filters.h"
#include "formats.h"
#include "internal.h"

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 preinit (AVFilterContext *ctx)
 
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 flush_frame (AVFilterLink *outlink, int final, AVFrame **outsamplesref_ret)
 
static int request_frame (AVFilterLink *outlink)
 
static int activate (AVFilterContext *ctx)
 
static const AVClassresample_child_class_iterate (void **iter)
 
static void * resample_child_next (void *obj, void *prev)
 

Variables

static const AVOption options []
 
static const AVClass aresample_class
 
static const AVFilterPad aresample_outputs []
 
const AVFilter ff_af_aresample
 

Detailed Description

resampling audio filter

Definition in file af_aresample.c.

Macro Definition Documentation

◆ OFFSET

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

Definition at line 341 of file af_aresample.c.

◆ FLAGS

Definition at line 342 of file af_aresample.c.

Function Documentation

◆ preinit()

static av_cold int preinit ( AVFilterContext ctx)
static

Definition at line 49 of file af_aresample.c.

◆ uninit()

static av_cold void uninit ( AVFilterContext ctx)
static

Definition at line 61 of file af_aresample.c.

◆ query_formats()

static int query_formats ( AVFilterContext ctx)
static

Definition at line 67 of file af_aresample.c.

◆ config_output()

static int config_output ( AVFilterLink outlink)
static

Definition at line 129 of file af_aresample.c.

◆ filter_frame()

static int filter_frame ( AVFilterLink inlink,
AVFrame insamplesref 
)
static

Definition at line 173 of file af_aresample.c.

Referenced by activate().

◆ flush_frame()

static int flush_frame ( AVFilterLink outlink,
int  final,
AVFrame **  outsamplesref_ret 
)
static

Definition at line 231 of file af_aresample.c.

Referenced by request_frame().

◆ request_frame()

static int request_frame ( AVFilterLink outlink)
static

Definition at line 262 of file af_aresample.c.

Referenced by activate().

◆ activate()

static int activate ( AVFilterContext ctx)
static

Definition at line 306 of file af_aresample.c.

◆ resample_child_class_iterate()

static const AVClass* resample_child_class_iterate ( void **  iter)
static

Definition at line 328 of file af_aresample.c.

◆ resample_child_next()

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

Definition at line 335 of file af_aresample.c.

Variable Documentation

◆ options

const AVOption options[]
static
Initial value:
= {
{"sample_rate", NULL, OFFSET(sample_rate_arg), AV_OPT_TYPE_INT, {.i64=0}, 0, INT_MAX, FLAGS },
{NULL}
}

Definition at line 344 of file af_aresample.c.

◆ aresample_class

const AVClass aresample_class
static
Initial value:
= {
.class_name = "aresample",
.item_name = av_default_item_name,
.option = options,
.child_class_iterate = resample_child_class_iterate,
}

Definition at line 349 of file af_aresample.c.

◆ aresample_outputs

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

Definition at line 358 of file af_aresample.c.

◆ ff_af_aresample

const AVFilter ff_af_aresample
Initial value:
= {
.name = "aresample",
.description = NULL_IF_CONFIG_SMALL("Resample audio data."),
.preinit = preinit,
.activate = activate,
.uninit = uninit,
.priv_size = sizeof(AResampleContext),
.priv_class = &aresample_class,
}

Definition at line 366 of file af_aresample.c.

FLAGS
#define FLAGS
Definition: af_aresample.c:342
FILTER_QUERY_FUNC
#define FILTER_QUERY_FUNC(func)
Definition: internal.h:159
config_output
static int config_output(AVFilterLink *outlink)
Definition: af_aresample.c:129
preinit
static av_cold int preinit(AVFilterContext *ctx)
Definition: af_aresample.c:49
activate
static int activate(AVFilterContext *ctx)
Definition: af_aresample.c:306
options
static const AVOption options[]
Definition: af_aresample.c:344
resample_child_next
static void * resample_child_next(void *obj, void *prev)
Definition: af_aresample.c:335
AVMEDIA_TYPE_AUDIO
@ AVMEDIA_TYPE_AUDIO
Definition: avutil.h:202
resample_child_class_iterate
static const AVClass * resample_child_class_iterate(void **iter)
Definition: af_aresample.c:328
FILTER_INPUTS
#define FILTER_INPUTS(array)
Definition: internal.h:182
LIBAVUTIL_VERSION_INT
#define LIBAVUTIL_VERSION_INT
Definition: version.h:85
NULL
#define NULL
Definition: coverity.c:32
av_default_item_name
const char * av_default_item_name(void *ptr)
Return the context name.
Definition: log.c:237
ff_audio_default_filterpad
const AVFilterPad ff_audio_default_filterpad[1]
An AVFilterPad array whose only entry has name "default" and is of type AVMEDIA_TYPE_AUDIO.
Definition: audio.c:33
uninit
static av_cold void uninit(AVFilterContext *ctx)
Definition: af_aresample.c:61
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:106
AVClass::child_next
void *(* child_next)(void *obj, void *prev)
Return next AVOptions-enabled child or NULL.
Definition: log.h:131
aresample_outputs
static const AVFilterPad aresample_outputs[]
Definition: af_aresample.c:358
AResampleContext
Definition: af_aresample.c:39
aresample_class
static const AVClass aresample_class
Definition: af_aresample.c:349
OFFSET
#define OFFSET(x)
Definition: af_aresample.c:341
AV_OPT_TYPE_INT
@ AV_OPT_TYPE_INT
Definition: opt.h:235
query_formats
static int query_formats(AVFilterContext *ctx)
Definition: af_aresample.c:67
FILTER_OUTPUTS
#define FILTER_OUTPUTS(array)
Definition: internal.h:183