[FFmpeg-devel] [PATCH] Move link_dpad and link_spad macros from avfilter.c to internal.h

Michael Niedermayer michaelni
Mon Sep 27 22:42:22 CEST 2010


On Mon, Sep 27, 2010 at 07:31:13PM +0200, Stefano Sabatini wrote:
> On date Monday 2010-09-27 13:43:08 +0200, Michael Niedermayer encoded:
> > On Mon, Sep 27, 2010 at 03:19:00AM +0200, Stefano Sabatini wrote:
> > > On date Monday 2010-09-27 02:12:03 +0200, Michael Niedermayer encoded:
> > > > On Mon, Sep 27, 2010 at 01:49:35AM +0200, Stefano Sabatini wrote:
> > > [...]
> > > > > I guess the main reason of the current design is to simplify the
> > > > > operation of filter auto-insertion, check avfilter_insert_filter().
> > > > > 
> > > > > Allowing the filter to know the input and output index pads (rather
> > > > > than the corresponding pointers) is convenient, e.g. it allows to
> > > > > directly do:
> > > > > 
> > > > > src->outputs[link->srcpad] = new_lnk;
> > > > > new_lnk->srcpad = link->srcpad;
> > > > > 
> > > > > rather than having to iterate through all the src->outputs in
> > > > > order to find the one which is equal to the pointer pointed by
> > > > > link->srcpad.
> > > > > 
> > > > > for (padidx = 0; i < src->output_count; padidx++)
> > > > >     if (src->output_pads[padidx] == link->srcpad) {
> > > > >         link->srcpad = NULL;
> > > > >         src->outputs[padidx] = new_lnk;
> > > > >         new_lnk->srcpad = src->output_pads[padidx];    
> > > > >         break;
> > > > >     }
> > > > 
> > > >  index == pointer - src->output_pads
> > > 
> > > Updated.
> > [..]
> > > @@ -128,20 +124,22 @@ int avfilter_link(AVFilterContext *src, unsigned srcpad,
> > >  int avfilter_insert_filter(AVFilterLink *link, AVFilterContext *filt,
> > >                             unsigned in, unsigned out)
> > >  {
> > > +    int dstpad_idx = link->dstpad - link->dst->input_pads;
> > 
> > its off topic but i like that name the existing ones should be renamed for
> > consistency and readability as well
> 
> Check in attachment.
>  
> > and patch ok
> 
> Applied.
> -- 
> FFmpeg = Fabulous Friendly Multimedia Pacific Egregious Geisha

>  avfilter.c |   10 +++++-----
>  avfilter.h |    6 +++---
>  2 files changed, 8 insertions(+), 8 deletions(-)
> 7dff125c640fe2af0aa35ff324b54074a6108f3f  0001-Use-longer-and-more-expressive-names-for-the-avfilte.patch
> From 6c8371d2c03f86d3569af4bb4adfecc772f42653 Mon Sep 17 00:00:00 2001
> From: Stefano Sabatini <stefano.sabatini-lala at poste.it>
> Date: Mon, 27 Sep 2010 19:27:10 +0200
> Subject: [PATCH] Use longer and more expressive names for the avfilter_insert_filter()
>  in and out parameters.

should be fine

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

The greatest way to live with honor in this world is to be what we pretend
to be. -- Socrates
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100927/2efd2b92/attachment.pgp>



More information about the ffmpeg-devel mailing list