FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions | Variables
af_aformat.c File Reference

format audio filter More...

#include "libavutil/avstring.h"
#include "libavutil/channel_layout.h"
#include "libavutil/common.h"
#include "libavutil/opt.h"
#include "audio.h"
#include "avfilter.h"
#include "formats.h"
#include "internal.h"

Go to the source code of this file.

Data Structures

struct  AFormatContext
 

Macros

#define OFFSET(x)   offsetof(AFormatContext, x)
 
#define A   AV_OPT_FLAG_AUDIO_PARAM
 
#define F   AV_OPT_FLAG_FILTERING_PARAM
 
#define PARSE_FORMATS(str, type, list, add_to_list, get_fmt, none, desc)
 

Functions

 AVFILTER_DEFINE_CLASS (aformat)
 
static int get_sample_rate (const char *samplerate)
 
static av_cold int init (AVFilterContext *ctx)
 
static int query_formats (AVFilterContext *ctx)
 

Variables

static const AVOption aformat_options []
 
static const AVFilterPad avfilter_af_aformat_inputs []
 
static const AVFilterPad avfilter_af_aformat_outputs []
 
AVFilter ff_af_aformat
 

Detailed Description

format audio filter

Definition in file af_aformat.c.

Macro Definition Documentation

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

Definition at line 48 of file af_aformat.c.

#define A   AV_OPT_FLAG_AUDIO_PARAM

Definition at line 49 of file af_aformat.c.

Definition at line 50 of file af_aformat.c.

#define PARSE_FORMATS (   str,
  type,
  list,
  add_to_list,
  get_fmt,
  none,
  desc 
)
Value:
do { \
char *next, *cur = str, sep; \
if (str && strchr(str, ',')) { \
av_log(ctx, AV_LOG_WARNING, "This syntax is deprecated, use '|' to "\
"separate %s.\n", desc); \
sep = ','; \
} else \
sep = '|'; \
\
while (cur) { \
next = strchr(cur, sep); \
if (next) \
*next++ = 0; \
if ((fmt = get_fmt(cur)) == none) { \
av_log(ctx, AV_LOG_ERROR, "Error parsing " desc ": %s.\n", cur);\
return AVERROR(EINVAL); \
} \
add_to_list(&list, fmt); \
\
cur = next; \
} \
} while (0)

Definition at line 60 of file af_aformat.c.

Referenced by init().

Function Documentation

AVFILTER_DEFINE_CLASS ( aformat  )
static int get_sample_rate ( const char *  samplerate)
static

Definition at line 87 of file af_aformat.c.

Referenced by init().

static av_cold int init ( AVFilterContext ctx)
static

Definition at line 93 of file af_aformat.c.

static int query_formats ( AVFilterContext ctx)
static

Definition at line 108 of file af_aformat.c.

Variable Documentation

const AVOption aformat_options[]
static
Initial value:
= {
{ "sample_fmts", "A comma-separated list of sample formats.", OFFSET(formats_str), AV_OPT_TYPE_STRING, .flags = A|F },
{ "sample_rates", "A comma-separated list of sample rates.", OFFSET(sample_rates_str), AV_OPT_TYPE_STRING, .flags = A|F },
{ "channel_layouts", "A comma-separated list of channel layouts.", OFFSET(channel_layouts_str), AV_OPT_TYPE_STRING, .flags = A|F },
{ NULL }
}

Definition at line 51 of file af_aformat.c.

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

Definition at line 122 of file af_aformat.c.

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

Definition at line 130 of file af_aformat.c.

AVFilter ff_af_aformat
Initial value:
= {
.name = "aformat",
.description = NULL_IF_CONFIG_SMALL("Convert the input audio to one of the specified formats."),
.init = init,
.query_formats = query_formats,
.priv_size = sizeof(AFormatContext),
.priv_class = &aformat_class,
}

Definition at line 138 of file af_aformat.c.