[FFmpeg-devel] [PATCH 1/2] Add split filter.

Stefano Sabatini stefano.sabatini-lala
Wed Aug 4 01:48:31 CEST 2010


On date Wednesday 2010-08-04 03:30:04 +0200, Michael Niedermayer encoded:
> On Tue, Aug 03, 2010 at 09:07:11PM +0200, Stefano Sabatini wrote:
> > On date Tuesday 2010-08-03 18:38:33 +0200, Michael Niedermayer encoded:
> > > On Sat, Jul 31, 2010 at 02:07:12AM +0200, Stefano Sabatini wrote:
> > [...]
> > > > +#include "avfilter.h"
> > > > +
> > > > +static void start_frame(AVFilterLink *inlink, AVFilterPicRef *picref)
> > > > +{
> > > > +    avfilter_start_frame(inlink->dst->outputs[0],
> > > > +                         avfilter_ref_pic(picref, ~AV_PERM_WRITE));
> > > > +    avfilter_start_frame(inlink->dst->outputs[1],
> > > > +                         avfilter_ref_pic(picref, ~AV_PERM_WRITE));
> > > > +}
> > > > +
> > > > +static void end_frame(AVFilterLink *inlink)
> > > > +{
> > > > +    avfilter_end_frame(inlink->dst->outputs[0]);
> > > > +    avfilter_end_frame(inlink->dst->outputs[1]);
> > > > +
> > > > +    avfilter_unref_pic(inlink->cur_pic);
> > > > +}
> > > > +
> > > > +static void draw_slice(AVFilterLink *inlink, int y, int h, int slice_dir)
> > > > +{
> > > > +    avfilter_draw_slice(inlink->dst->outputs[0], y, h, slice_dir);
> > > > +    avfilter_draw_slice(inlink->dst->outputs[1], y, h, slice_dir);
> > > > +}
> > > 
> > > this implementation does have some issues as frames are pushed down both
> > > sides no matter if either is ready.
> > > Its not a problem as such but what iam thinking of is that the filter core
> > > should insert split and fifo filters as needed and not require them to be
> > > manually specified
> > 
> > I cannot understand you, split defines the topology of the filter
> > graph, so I suppose that should be defined by the user.
> > 
> > The filter graph is supposed to be "ready" when it has been inited and
> > configured, then it is a problem of each single filter/sink/source to
> > manage each following operation.
> > 
> > fifo is mainly useful as a testing/debugging device, I cannot find how
> > it may be useful in other contexts.
> 
> a filter graph that splits and merges needs fifos if the time between
> the 2 pathes differ or it will deadlock or not work at all.
> its not reasonable to expect the user to know where he needs to insert a
> fifo filter, the core should do this

Understood, I'll try to have a look at that, regards.
-- 
FFmpeg = Fostering and Fundamentalist Mean Perennial Elastic Geisha



More information about the ffmpeg-devel mailing list