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

Stefano Sabatini stefano.sabatini-lala
Tue Aug 3 21:07:11 CEST 2010


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.

Regards.
-- 
FFmpeg = Fundamental and Funny Meaningless Practical Easy Guide



More information about the ffmpeg-devel mailing list