[gst-devel] Linking/Unlinking elements at runtime

Stefan Kost ensonic at hora-obscura.de
Thu May 31 11:19:16 CEST 2007


have a look at the bottom of gstreamer/docs/random/part-blocking.txt.  
I also have filed:
in which I've started to implement the procedure described in the  
before mentioned text file. It still has some issues (see the comments  
in there).


Quoting Itay Kirshenbaum <ikirsh at gmail.com>:

> Hi,
> I've got the following pipeline in my application:
> source bin -> tee -> sink bin
> Where the source bin is essentially: v4l2src -> mpeg4_encoder
> And the sink bin is: queue -> filesink (with or without a muxer in between)
> The purpose of this app is to have a recorder, that upon receiving a
> command, records a few seconds of video and stops.
> This alone should be pretty simple, however there are a few constraints:
> 1. The main pipeline should always be playing (otherwise i'd just pause and
> play the whole thing each time).
> This is because the source bin can be connected to other sinks through the
> tee.
> 2. The sink bin should always be linked to the tee.
> This is because I'd like to be able to do the recording action from the
> context of the recorder module (sink bin), and not from the context
> of the main application.
> My first idea was starting out with only a queue in the sink bin, and link
> it to the tee.
> When a 'record' command is given, create a filesink, link to the queue, and
> set the sink bin to playing.
> This partly works, but from time to time GStreamer can't complete the state
> change for the sink bin.
> Is there any proper way to do this, under the above constraints?
> Thanks,
> Itay.

More information about the gstreamer-devel mailing list