26 #include "libavutil/avstring.h"
27 #include "libavutil/channel_layout.h"
28 #include "libavutil/common.h"
29 #include "libavutil/opt.h"
48 #define OFFSET(x) offsetof(AFormatContext, x)
49 #define A AV_OPT_FLAG_AUDIO_PARAM
50 #define F AV_OPT_FLAG_FILTERING_PARAM
54 {
"channel_layouts",
"A comma-separated list of channel layouts.",
OFFSET(channel_layouts_str),
AV_OPT_TYPE_STRING, .flags =
A|
F },
60 #define PARSE_FORMATS(str, type, list, add_to_list, get_fmt, none, desc) \
62 char *next, *cur = str, sep; \
64 if (str && strchr(str, ',')) { \
65 av_log(ctx, AV_LOG_WARNING, "This syntax is deprecated, use '|' to "\
66 "separate %s.\n", desc); \
73 next = strchr(cur, sep); \
77 if ((fmt = get_fmt(cur)) == none) { \
78 av_log(ctx, AV_LOG_ERROR, "Error parsing " desc ": %s.\n", cur);\
79 return AVERROR(EINVAL); \
81 add_to_list(&list, fmt); \
89 int ret = strtol(samplerate, NULL, 0);
140 .description =
NULL_IF_CONFIG_SMALL(
"Convert the input audio to one of the specified formats."),
144 .priv_class = &aformat_class,
145 .
inputs = avfilter_af_aformat_inputs,
146 .
outputs = avfilter_af_aformat_outputs,
const char * name
Filter name.
void * priv
private data for use by the filter
static const AVFilterPad outputs[]
AVFilterFormats * sample_rates
enum AVSampleFormat av_get_sample_fmt(const char *name)
Return a sample format corresponding to name, or AV_SAMPLE_FMT_NONE on error.
const char * name
Pad name.
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. ...
AVFilterFormats * formats
A list of supported channel layouts.
Main libavfilter public API header.
AVSampleFormat
Audio Sample Formats.
Describe the class of an AVClass context structure.
static const AVFilterPad inputs[]
char * channel_layouts_str
AVFilterChannelLayouts * channel_layouts
#define AVFILTER_DEFINE_CLASS(fname)
uint64_t av_get_channel_layout(const char *name)
Return a channel layout id that matches name, or 0 if no match is found.