[gst-devel] Dynamically adding and removing branches of a tee...

Wim Taymans wim.taymans at gmail.com
Thu Aug 27 12:58:33 CEST 2009


On Thu, 2009-08-27 at 03:42 -0700, karma wrote:
> Hi,
> 
> Then how to REMOVE elements from a tee dynamically? 
> e.g. how to remove recording_branch from tee dynamically?

Try in this order:

pad block the tee srcpad
in the pad block, wake up the main thread to perform this:
unlink the tee srcpad
Set the elements after the srcpad to READY/NULL
release the tee srcpad
unblock tee srcpad

Wim


> 
> Thanks a lot
> 
> sincerely, karma
> 
> 
> joh-4 wrote:
> > 
> > Try below:
> > 
> > gst_element_set_state( recording_branch, GST_STATE_PAUSED );
> > gst_bin_add( GST_BIN(pipeline), recording_branch );
> > gst_element_link( tee, recording_branch );
> > gst_element_set_state( recording_branch, GST_STATE_PLAYING );
> > 
> > You may also want to move the first line to before and after element link
> > line.
> > 
> > Justin
> > 
> > 
> > 
> > On Mon, Jul 20, 2009 at 5:02 AM, machinegodzilla
> > <machinegodzilla at gmail.com>wrote:
> > 
> >>
> >> Hi,
> >>
> >> Is it possible to add or remove elements to/from a tee dynamically?
> >>
> >> My pipeline looks like that:
> >>
> >>                 /  [ queue | decodebin | autovideosink ]
> >> (playing_branch)
> >> filesrc | tee
> >>                 \  [ queue | filesink ]
> >> (recording_branch)
> >>
> >> When I start the pipeline only the playing_branch is connected. After a
> >> while I connect the recording_branch in the following way:
> >>
> >> gst_bin_add( GST_BIN(pipeline), recording_branch );
> >> gst_element_link( tee, recording_branch );
> >> gst_element_set_state( recording_branch, GST_STATE_PLAYING );
> >>
> >> This, however, results only in a 0 bytes file being created and nothing
> >> else.
> >>
> >> Is there anything missing here, or is this approach wrong?
> >> --
> >> View this message in context:
> >> http://www.nabble.com/Dynamically-adding-and-removing-branches-of-a-tee...-tp24568543p24568543.html
> >> Sent from the GStreamer-devel mailing list archive at Nabble.com.
> >>
> >>
> >>
> >> ------------------------------------------------------------------------------
> >> Enter the BlackBerry Developer Challenge
> >> This is your chance to win up to $100,000 in prizes! For a limited time,
> >> vendors submitting new applications to BlackBerry App World(TM) will have
> >> the opportunity to enter the BlackBerry Developer Challenge. See full
> >> prize
> >> details at: http://p.sf.net/sfu/Challenge
> >> _______________________________________________
> >> gstreamer-devel mailing list
> >> gstreamer-devel at lists.sourceforge.net
> >> https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
> >>
> > 
> > ------------------------------------------------------------------------------
> > Enter the BlackBerry Developer Challenge  
> > This is your chance to win up to $100,000 in prizes! For a limited time, 
> > vendors submitting new applications to BlackBerry App World(TM) will have
> > the opportunity to enter the BlackBerry Developer Challenge. See full
> > prize  
> > details at: http://p.sf.net/sfu/Challenge
> > _______________________________________________
> > gstreamer-devel mailing list
> > gstreamer-devel at lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
> > 
> > 
> 





More information about the gstreamer-devel mailing list