32#define CONTEXT ASetRateContext
33#define FLAGS AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
35#define OPT_GENERIC(name, field, def, min, max, descr, type, deffield, ...) \
36 { name, descr, offsetof(CONTEXT, field), AV_OPT_TYPE_ ## type, \
37 { .deffield = def }, min, max, FLAGS, __VA_ARGS__ }
39#define OPT_INT(name, field, def, min, max, descr, ...) \
40 OPT_GENERIC(name, field, def, min, max, descr, INT, i64, __VA_ARGS__)
43 OPT_INT(
"sample_rate", sample_rate, 44100, 1, INT_MAX,
"set the sample rate",),
44 OPT_INT(
"r", sample_rate, 44100, 1, INT_MAX,
"set the sample rate",),
58 &cfg_in[0]->samplerates)) < 0)
62 &cfg_out[0]->samplerates);
73 if (intb.
num == 1 && intb.
den == inrate) {
115 .p.name =
"asetrate",
117 "altering the data."),
118 .p.priv_class = &asetrate_class,
static int query_formats(const AVFilterContext *ctx, AVFilterFormatsConfig **cfg_in, AVFilterFormatsConfig **cfg_out)
static const AVFilterPad asetrate_inputs[]
static const AVOption asetrate_options[]
static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
const FFFilter ff_af_asetrate
static av_cold int query_formats(const AVFilterContext *ctx, AVFilterFormatsConfig **cfg_in, AVFilterFormatsConfig **cfg_out)
#define OPT_INT(name, field, def, min, max, descr,...)
static const AVFilterPad asetrate_outputs[]
static av_cold int config_props(AVFilterLink *outlink)
static AVFormatContext * ctx
int ff_filter_frame(AVFilterLink *link, AVFrame *frame)
Send a frame of data to the next filter.
Main libavfilter public API header.
static const int sample_rates[]
static int filter_frame(DBEDecodeContext *s, AVFrame *frame)
#define AVFILTER_FLAG_METADATA_ONLY
The filter is a "metadata" filter - it does not modify the frame data in any way.
#define AV_LOG_WARNING
Something somehow does not look correct.
static double av_q2d(AVRational a)
Convert an AVRational to a double.
int64_t av_rescale(int64_t a, int64_t b, int64_t c)
Rescale a 64-bit integer with rounding to nearest.
#define FILTER_INPUTS(array)
#define FILTER_OUTPUTS(array)
#define AVFILTER_DEFINE_CLASS(fname)
#define FILTER_QUERY_FUNC2(func)
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
static int config_props(AVBitStreamFilterLink *link)
Describe the class of an AVClass context structure.
A link between two filters.
AVFilterContext * src
source filter
AVRational time_base
Define the time base used by the PTS of the frames/samples which will pass through this link.
int sample_rate
samples per second
AVFilterContext * dst
dest filter
A filter pad used for either input or output.
This structure describes decoded (raw) audio or video data.
Rational number (pair of numerator and denominator).