FFmpeg  4.0
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, unref_fn, 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

◆ OFFSET

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

Definition at line 48 of file af_aformat.c.

◆ A

#define A   AV_OPT_FLAG_AUDIO_PARAM

Definition at line 49 of file af_aformat.c.

◆ F

Definition at line 50 of file af_aformat.c.

◆ PARSE_FORMATS

#define PARSE_FORMATS (   str,
  type,
  list,
  add_to_list,
  unref_fn,
  get_fmt,
  none,
  desc 
)
Value:
do { \
char *next, *cur = str, sep; \
int ret; \
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) { \
type fmt; \
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); \
} \
if ((ret = add_to_list(&list, fmt)) < 0) { \
unref_fn(&list); \
return ret; \
} \
\
cur = next; \
} \
} while (0)
const char * fmt
Definition: avisynth_c.h:769
#define AV_LOG_WARNING
Something somehow does not look correct.
Definition: log.h:182
const char * desc
Definition: nvenc.c:65
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
Definition: log.h:176
#define AVERROR(e)
Definition: error.h:43
AVFormatContext * ctx
Definition: movenc.c:48
if(ret< 0)
Definition: vf_mcdeint.c:279

Definition at line 60 of file af_aformat.c.

Referenced by init().

Function Documentation

◆ AVFILTER_DEFINE_CLASS()

AVFILTER_DEFINE_CLASS ( aformat  )

◆ get_sample_rate()

static int get_sample_rate ( const char *  samplerate)
static

Definition at line 91 of file af_aformat.c.

Referenced by init().

◆ init()

static av_cold int init ( AVFilterContext ctx)
static

Definition at line 97 of file af_aformat.c.

◆ query_formats()

static int query_formats ( AVFilterContext ctx)
static

Definition at line 112 of file af_aformat.c.

Variable Documentation

◆ aformat_options

const AVOption aformat_options[]
static
Initial value:
= {
{ "sample_fmts", "A '|'-separated list of sample formats.", OFFSET(formats_str), AV_OPT_TYPE_STRING, .flags = A|F },
{ "sample_rates", "A '|'-separated list of sample rates.", OFFSET(sample_rates_str), AV_OPT_TYPE_STRING, .flags = A|F },
{ "channel_layouts", "A '|'-separated list of channel layouts.", OFFSET(channel_layouts_str), AV_OPT_TYPE_STRING, .flags = A|F },
{ NULL }
}
#define NULL
Definition: coverity.c:32
#define F
Definition: af_aformat.c:50
#define A
Definition: af_aformat.c:49
#define OFFSET(x)
Definition: af_aformat.c:48

Definition at line 51 of file af_aformat.c.

◆ avfilter_af_aformat_inputs

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

Definition at line 129 of file af_aformat.c.

◆ avfilter_af_aformat_outputs

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

Definition at line 137 of file af_aformat.c.

◆ ff_af_aformat

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,
}
static const AVFilterPad avfilter_af_aformat_inputs[]
Definition: af_aformat.c:129
static int query_formats(AVFilterContext *ctx)
Definition: af_aformat.c:112
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:186
static av_cold int init(AVFilterContext *ctx)
Definition: af_aformat.c:97
static const AVFilterPad inputs[]
Definition: af_acontrast.c:193
static const AVFilterPad outputs[]
Definition: af_acontrast.c:203
static const AVFilterPad avfilter_af_aformat_outputs[]
Definition: af_aformat.c:137

Definition at line 145 of file af_aformat.c.