[FFmpeg-devel] [RFC] libavfilter audio framework - split patches
Michael Niedermayer
michaelni
Sun Jul 11 16:47:21 CEST 2010
On Sun, Jul 11, 2010 at 06:58:15AM -0700, S.N. Hemanth Meenakshisundaram wrote:
> S.N. Hemanth Meenakshisundaram wrote:
>>
>> I am sending out the working lavfi audio patches in the order Stefano
>> requested for easy committing.
>
> This has avfilter.c changes. Extra debug logs, nit fixes and fixed the code
> for avfilter_get_samples_ref in case of insufficient permissions.
> avfilter.c | 80 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> 1 file changed, 80 insertions(+)
> f7a14f4c3e438f73480a2d034f869a48d0554881 avfilter.c.diff
> diff --git a/libavfilter/avfilter.c b/libavfilter/avfilter.c
> index 38ca3b1..6d265aa 100644
> --- a/libavfilter/avfilter.c
> +++ b/libavfilter/avfilter.c
> @@ -60,6 +60,22 @@ void avfilter_unref_pic(AVFilterPicRef *ref)
> av_free(ref);
> }
>
> +AVFilterSamplesRef *avfilter_ref_samples(AVFilterSamplesRef *ref, int pmask)
> +{
> + AVFilterSamplesRef *ret = av_malloc(sizeof(AVFilterSamplesRef));
> + *ret = *ref;
> + ret->perms &= pmask;
> + ret->buffer->refcount++;
> + return ret;
> +}
duplicate of avfilter_ref_pic()
> +
> +void avfilter_unref_samples(AVFilterSamplesRef *ref)
> +{
> + if (!(--ref->buffer->refcount))
> + ref->buffer->free(ref->buffer);
> + av_free(ref);
> +}
duplicate of avfilter_unref_pic()
> +
> void avfilter_insert_pad(unsigned idx, unsigned *count, size_t padidx_off,
> AVFilterPad **pads, AVFilterLink ***links,
> AVFilterPad *newpad)
> @@ -97,7 +113,9 @@ int avfilter_link(AVFilterContext *src, unsigned srcpad,
> link->dst = dst;
> link->srcpad = srcpad;
> link->dstpad = dstpad;
> + link->type = src->output_pads[srcpad].type;
> link->format = PIX_FMT_NONE;
> + link->aformat = SAMPLE_FMT_NONE;
>
> return 0;
> }
> @@ -210,6 +228,20 @@ AVFilterPicRef *avfilter_get_video_buffer(AVFilterLink *link, int perms, int w,
> return ret;
> }
>
> +AVFilterSamplesRef *avfilter_get_samples_ref(AVFilterLink *link, int perms, int size,
> + int64_t channel_layout, enum SampleFormat sample_fmt, int planar)
> +{
> + AVFilterSamplesRef *ret = NULL;
> +
> + if (link_dpad(link).get_samples_ref)
> + ret = link_dpad(link).get_samples_ref(link, perms, size, channel_layout, sample_fmt, planar);
> +
> + if (!ret)
> + ret = avfilter_default_get_samples_ref(link, perms, size, channel_layout, sample_fmt, planar);
> +
> + return ret;
> +}
duplicate of avfilter_get_video_buffer()
> +
> int avfilter_request_frame(AVFilterLink *link)
> {
> DPRINTF_START(NULL, request_frame); dprintf_link(NULL, link, 1);
> @@ -221,6 +253,14 @@ int avfilter_request_frame(AVFilterLink *link)
> else return -1;
> }
>
> +int avfilter_request_samples(AVFilterLink *link)
> +{
> + if (link_spad(link).request_samples)
> + return link_spad(link).request_samples(link);
> + else if (link->src->inputs[0])
> + return avfilter_request_samples(link->src->inputs[0]);
> + else return AVERROR(EINVAL);
> +}
> int avfilter_poll_frame(AVFilterLink *link)
> {
> int i, min=INT_MAX;
duplicate avfilter_request_frame()
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
No snowflake in an avalanche ever feels responsible. -- Voltaire
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100711/ea9f4fde/attachment.pgp>
More information about the ffmpeg-devel
mailing list