48 #define OFFSET(x) offsetof(AFormatContext, x)
49 #define A AV_OPT_FLAG_AUDIO_PARAM
53 {
"channel_layouts",
"A comma-separated list of channel layouts.",
OFFSET(channel_layouts_str),
AV_OPT_TYPE_STRING, .flags =
A },
64 #define PARSE_FORMATS(str, type, list, add_to_list, get_fmt, none, desc) \
66 char *next, *cur = str; \
69 next = strchr(cur, ','); \
73 if ((fmt = get_fmt(cur)) == none) { \
74 av_log(ctx, AV_LOG_ERROR, "Error parsing " desc ": %s.\n", cur);\
75 ret = AVERROR(EINVAL); \
78 add_to_list(&list, fmt); \
86 int ret = strtol(samplerate,
NULL, 0);
153 .description =
NULL_IF_CONFIG_SMALL(
"Convert the input audio to one of the specified formats."),
158 .
inputs = avfilter_af_aformat_inputs,
159 .
outputs = avfilter_af_aformat_outputs,
static const AVFilterPad outputs[]
void av_opt_set_defaults(void *s)
Set the values of all AVOption fields to their default values.
int av_set_options_string(void *ctx, const char *opts, const char *key_val_sep, const char *pairs_sep)
Parse the key/value pairs list in opts.
AVFilterFormats * sample_rates
const char * name
Pad name.
const char * class_name
The name of the class; usually it is the same name as the context structure type to which the AVClass...
A filter pad used for either input or output.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
void * priv
private data for use by the filter
void av_log(void *avcl, int level, const char *fmt,...)
AVFilterFormats * formats
audio channel layout utility functions
Describe the class of an AVClass context structure.
static const AVFilterPad inputs[]
const char * name
filter name
char * channel_layouts_str
void av_opt_free(void *obj)
Free all string and binary options in obj.
common internal and external API header
AVFilterChannelLayouts * channel_layouts
AVSampleFormat
Audio Sample Formats.
uint64_t av_get_channel_layout(const char *name)
Return a channel layout id that matches name, or 0 if no match is found.
enum AVSampleFormat av_get_sample_fmt(const char *name)
Return a sample format corresponding to name, or AV_SAMPLE_FMT_NONE on error.