turning parts of pipeline on/off

Tony Houghton h at realh.co.uk
Wed Jun 22 08:11:03 PDT 2011


On Tue, 21 Jun 2011 20:37:28 +0200 (CEST)
Jan Spurný <JSpurny at seznam.cz> wrote:

> I have a simple pipeline (actually it's generated according to
> configuration and much more complicated, but it allways ends up after
> something that gives x-video/raw-yuv, like "decodebin" shown below):
> 
>  souphttpsrc location="someurl" ! decodebin ! my_app_sink
> 
> and I would like to be able to get jpeg snapshots from time to time.
> Since "my_app_sink" needs raw yuv input, I splitted the pipeline with
> tee:
> 
>  souphttpsrc location="someurl" ! decodebin ! tee name=t  !
> my_app_sink t. ! queue ! jpegenc ! my_jpeg_appsink
> 
> or in crude ascii art:
> 
>  souphttpsrc -> decodebin -> tee ----------> my_app_sink
>                               \-> jpegenc -> my_jpeg_appsink
> 
> 
> it works, but "jpegenc" is running all the time, consuming CPU power
> and in "my_jpeg_appsink" I'm just "throwing jpegs away" most of the
> time, since I need the jpeg only once in a while - less than one per
> minute (while my input stream has usualy more than 10fps).
> 
> Now comes my question - is there any way to "turn off" the
> "my_jpeg_appsink" part of the pipeline when I don't need jpegs and
> only turn it on when I need one without disturbing the "my_app_sink"
> part?
> 
> If my description is confusing, please tell me and I'll try again.

Can't you just dynamically add jpegenc and your jpeg_appsink when needed
and remove them immediately after each snapshot? Is that possible
without disturbing my_app_sink ie while the pipeline is in state
PLAYING?

I really hope that is possible because I want to do something sort of
similar with a DVB application, with a dvbbasebin or dvbsrc source.
While one programme is being recorded, a user might want to start
watching the same programme "live", or record or watch another programme
from the same transport stream, and these extra sinks need to be stopped
and started without interrupting any other recording or live
streaming/playback using the same source.



More information about the gstreamer-devel mailing list