how to create a simple "on/off" element in the pipeline ?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

how to create a simple "on/off" element in the pipeline ?

greenender

Following pipeline is equivalent to mine:
gst-launch filesrc location=foobar.mp3 ! decodebin ! tee name=a a. ! queue ! audioconvert ! audioresample ! autoaudiosink a. ! queue ! fakesink

Short summary: I have a mp3 player, which sends the data to tee element. Tee element copies the data to two audio sinks. So instead of stereo sound, I have 2x stereo sound.

I would like to ocasionally switch off/on data flow to one of the two audiosinks. This should be doable independent of the pipeline state (could be PAUSED, READY, PLAYING - does not matter).

Which existing element could I add between <queue> and <audio sink>, to be able to turn on / turn off data flow to audiosink?? Is there an element like Identity (http://www.gstreamer.net/data/doc/gstreamer/0.10.3/gstreamer-plugins/html/gstreamer-plugins-identity.html), but with additional feature of stopping the data flow?


------------------------------------------------------------------------------
Download new Adobe(R) Flash(R) Builder(TM) 4
The new Adobe(R) Flex(R) 4 and Flash(R) Builder(TM) 4 (formerly
Flex(R) Builder(TM)) enable the development of rich applications that run
across multiple browsers and platforms. Download your free trials today!
http://p.sf.net/sfu/adobe-dev2dev
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: how to create a simple "on/off" element in the pipeline ?

Tim-Philipp Müller-2
On Tue, 2010-10-19 at 17:11 +0200, Wiktor Lisowicz wrote:

> I would like to ocasionally switch off/on data flow to one of the two
> audiosinks. This should be doable independent of the pipeline state
> (could be PAUSED, READY, PLAYING - does not matter).
>
> Which existing element could I add between <queue> and <audio sink>,
> to be able to turn on / turn off data flow to audiosink?? Is there an
> element like Identity
> (http://www.gstreamer.net/data/doc/gstreamer/0.10.3/gstreamer-plugins/html/gstreamer-plugins-identity.html), but with additional feature of stopping the data flow?

You could use identity drop-probability=1.0, or the 'valve' element from
gst-plugins-bad (to be moved to core, -base or good soon hopefully). You
would probably also want to set the "async" property of the actual
audiosink element to false then.

Cheers
 -Tim


------------------------------------------------------------------------------
Download new Adobe(R) Flash(R) Builder(TM) 4
The new Adobe(R) Flex(R) 4 and Flash(R) Builder(TM) 4 (formerly
Flex(R) Builder(TM)) enable the development of rich applications that run
across multiple browsers and platforms. Download your free trials today!
http://p.sf.net/sfu/adobe-dev2dev
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel