[gst-devel] Dynamically adding a filter to a video pipeline

Christophe Dehais christophe.dehais at gmail.com
Fri Sep 19 12:05:05 CEST 2008


Ok, I found a workaround (see attached).

The idea is to replace the element by a bin made of
colorspace ! filter ! colorspace

which will take care of caps negotiation around the real filter. (Now
that I think of it, there is something similar in Rhythmbox, except
that colorspace is replaced by audioconvert).

That's not really ideal since the pipeline is then encumbered with a
lot of colorspace converters but most of them will probably operate in
passthough mode so the overhead should be low.

The conclusion for me at this point is: if you want to dynamically
replace an element by another, it has to be done in a way that doesn't
require renegotiation of the pads concerned by the broken links.

cheers,
Christophe


On Thu, Sep 18, 2008 at 11:58 AM, Christophe Dehais
<christophe.dehais at gmail.com> wrote:
> Hi everyone!
>
> I have this simple pipeline: videosrc ! identity ! videosink
>
> (videosrc is a bin embedding videotestsrc or v4l2src and colorspace,
> videosink is a bin embedding colorspace and xvimagesink)
>
> I simply want to replace identity by a videofilter (e.g. edgetv),
> while the pipeline is playing.
>
> So I made a little test app (see attachments) and I guess I'm
> following what's described in the design docs here:
> http://webcvs.freedesktop.org/gstreamer/gstreamer/docs/design/part-block.txt?view=markup
>
> except that I'm blocking the src pad synchronously.
>
> It doesn't work because when unblocking back the videosrc source pad,
> a negotiation problem occurs. If I replace 'identity' by
> 'shagadelictv' (which has the same in and out caps as edgetv), it
> works fine.
>
> So my question is two fold:
> 1) do I miss something in the design doc ?
> 2) how can I force the videosrc bin to renegociate with the rest of
> the pipeline ?
>
> thanks for any hints,
> Christophe
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dyn_pipeline.py
Type: application/octet-stream
Size: 3953 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20080919/f0a48912/attachment.obj>


More information about the gstreamer-devel mailing list