[FFmpeg-devel] [PATCH 3/4] Factorize dilate and smooth end frame common code.

Stefano Sabatini stefano.sabatini-lala
Sun Sep 12 20:17:41 CEST 2010


On date Sunday 2010-09-12 12:51:18 +0200, Michael Niedermayer encoded:
> On Sat, Sep 11, 2010 at 03:59:24PM +0200, Stefano Sabatini wrote:
> > ---
> >  libavfilter/vf_libopencv.c |   63 +++++++++++++++++++++++---------------------
> >  1 files changed, 33 insertions(+), 30 deletions(-)
> > 
> > diff --git a/libavfilter/vf_libopencv.c b/libavfilter/vf_libopencv.c
> > index 6c535f0..b0b80d0 100644
> > --- a/libavfilter/vf_libopencv.c
> > +++ b/libavfilter/vf_libopencv.c
> > @@ -63,6 +63,25 @@ static int query_formats(AVFilterContext *ctx)
> >  
> >  static void null_draw_slice(AVFilterLink *link, int y, int h, int slice_dir) { }
> >  
> > +static void ocv_end_frame(AVFilterLink *inlink, void filter_fn(void *, IplImage *, IplImage *))
> 
> imho we need a table, one entry for each filter, filter_fn goes in that table
> and a pointer to the table entry in the context

What about this design:

OCVContext
    init function
    deinit function
    filter function
    OCVEffectContext
?

Then we can have a table which maps filter name => init+deinit+filter
functions.

ocv_init() would read the table and fill the init and filter function,
and call the init function.

Anyway I'll try to implement this design once we have at least one
opencv filter (e.g. ocv_smooth) already committed.

Regards.
-- 
FFmpeg = Foolish Faithful Mean Philosofic Elected Gadget



More information about the ffmpeg-devel mailing list