59 nb_samples =
FFMIN(
s->nb_samples,
s->nb_taps -
s->pts);
60 if (nb_samples <= 0) {
68 dst = (
float *)
frame->extended_data[0];
69 for (
int n = 0; n < nb_samples; n++) {
74 for (
int ch = 1; ch <
frame->ch_layout.nb_channels; ch++)
75 memcpy(
frame->extended_data[ch],
dst,
sizeof(*
dst) * nb_samples);
111 s->nb_taps =
s->delay * 8 + 1;
124#define AF AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
125#define OFFSET(x) offsetof(AFDelaySrcContext, x)
132 {
"nb_samples",
"set the number of samples per requested frame",
OFFSET(nb_samples),
AV_OPT_TYPE_INT, {.i64=1024}, 1, INT_MAX,
AF },
133 {
"n",
"set the number of samples per requested frame",
OFFSET(nb_samples),
AV_OPT_TYPE_INT, {.i64=1024}, 1, INT_MAX,
AF },
144 .p.name =
"afdelaysrc",
146 .p.priv_class = &afdelaysrc_class,
uint8_t ptrdiff_t const uint8_t ptrdiff_t int intptr_t intptr_t int int16_t * dst
static enum AVSampleFormat sample_fmts[]
static int query_formats(const AVFilterContext *ctx, AVFilterFormatsConfig **cfg_in, AVFilterFormatsConfig **cfg_out)
const FFFilter ff_asrc_afdelaysrc
static float sincf(float x)
static const AVOption afdelaysrc_options[]
static int query_formats(const AVFilterContext *ctx, AVFilterFormatsConfig **cfg_in, AVFilterFormatsConfig **cfg_out)
static const AVFilterPad afdelaysrc_outputs[]
static int activate(AVFilterContext *ctx)
static int config_output(AVFilterLink *outlink)
AVFrame * ff_get_audio_buffer(AVFilterLink *link, int nb_samples)
Request an audio samples buffer with a specific set of permissions.
int ff_filter_frame(AVFilterLink *link, AVFrame *frame)
Send a frame of data to the next filter.
int ff_outlink_frame_wanted(AVFilterLink *link)
Test if a frame is wanted on an output link.
Main libavfilter public API header.
Public libavutil channel layout APIs header.
static const int sample_rates[]
@ AV_OPT_TYPE_INT
Underlying C type is int.
@ AV_OPT_TYPE_CHLAYOUT
Underlying C type is AVChannelLayout.
@ AV_OPT_TYPE_DOUBLE
Underlying C type is double.
#define AVERROR_EOF
End of file.
AVSampleFormat
Audio sample formats.
@ AV_SAMPLE_FMT_FLTP
float, planar
static int activate(AVBitStreamFilterContext *ctx)
static int config_output(AVBitStreamFilterLink *outlink)
#define FILTER_OUTPUTS(array)
static void ff_outlink_set_status(AVFilterLink *link, int status, int64_t pts)
Set the status field of a link from the source filter.
#define FFERROR_NOT_READY
Filters implementation helper functions and internal structures.
#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.
An AVChannelLayout holds information about the channel layout of audio data.
Describe the class of an AVClass context structure.
A link between two filters.
AVFilterContext * src
source filter
int sample_rate
samples per second
A filter pad used for either input or output.
This structure describes decoded (raw) audio or video data.
static AVFormatContext * ctx