.priv_size = sizeof(AFormatContext),
.inputs = (AVFilterPad[]) {{ .name = "default",
- .type = AVMEDIA_TYPE_AUDIO,
- .filter_samples = ff_null_filter_samples },
+ .type = AVMEDIA_TYPE_AUDIO, },
{ .name = NULL}},
.outputs = (AVFilterPad[]) {{ .name = "default",
.type = AVMEDIA_TYPE_AUDIO},
.inputs = (AVFilterPad[]) {{ .name = "default",
.type = AVMEDIA_TYPE_AUDIO,
- .get_audio_buffer = ff_null_get_audio_buffer,
- .filter_samples = ff_null_filter_samples },
+ .get_audio_buffer = ff_null_get_audio_buffer, },
{ .name = NULL}},
.outputs = (AVFilterPad[]) {{ .name = "default",
return NULL;
}
-void ff_null_filter_samples(AVFilterLink *link, AVFilterBufferRef *samplesref)
+static void default_filter_samples(AVFilterLink *link,
+ AVFilterBufferRef *samplesref)
{
ff_filter_samples(link->dst->outputs[0], samplesref);
}
-/* FIXME: samplesref is same as link->cur_buf. Need to consider removing the redundant parameter. */
-void ff_default_filter_samples(AVFilterLink *inlink, AVFilterBufferRef *samplesref)
-{
- AVFilterLink *outlink = NULL;
-
- if (inlink->dst->nb_outputs)
- outlink = inlink->dst->outputs[0];
-
- if (outlink) {
- outlink->out_buf = ff_default_get_audio_buffer(inlink, AV_PERM_WRITE,
- samplesref->audio->nb_samples);
- outlink->out_buf->pts = samplesref->pts;
- outlink->out_buf->audio->sample_rate = samplesref->audio->sample_rate;
- ff_filter_samples(outlink, avfilter_ref_buffer(outlink->out_buf, ~0));
- avfilter_unref_buffer(outlink->out_buf);
- outlink->out_buf = NULL;
- }
- avfilter_unref_buffer(samplesref);
- inlink->cur_buf = NULL;
-}
-
void ff_filter_samples(AVFilterLink *link, AVFilterBufferRef *samplesref)
{
void (*filter_samples)(AVFilterLink *, AVFilterBufferRef *);
FF_DPRINTF_START(NULL, filter_samples); ff_dlog_link(NULL, link, 1);
if (!(filter_samples = dst->filter_samples))
- filter_samples = ff_default_filter_samples;
+ filter_samples = default_filter_samples;
/* prepare to copy the samples if the buffer has insufficient permissions */
if ((dst->min_perms & samplesref->perms) != dst->min_perms ||
AVFilterBufferRef *ff_get_audio_buffer(AVFilterLink *link, int perms,
int nb_samples);
-/** default handler for filter_samples() for audio inputs */
-void ff_default_filter_samples(AVFilterLink *link, AVFilterBufferRef *samplesref);
-
-/** filter_samples() handler for filters which simply pass audio along */
-void ff_null_filter_samples(AVFilterLink *link, AVFilterBufferRef *samplesref);
-
/**
* Send a buffer of audio samples to the next filter.
*