What happens to just-requested tee srcpad in PLAYING pipeline?

Sebastian Dröge sebastian at centricular.com
Sat Jan 11 06:22:18 PST 2014


On Sa, 2014-01-11 at 16:10 +0200, Andrey Utkin wrote:

> > From what I guess from your description there are two problems here:
> > a) loosing state and b) flushing sinks
> >
> > Loosing state can happen here if you add a sink to your PLAYING pipeline
> > that is not in PLAYING state itself yet. Try to sync the newly added
> > elements' state to your pipeline state.
> > gst_element_sync_state_with_parent() can be useful for this for example.
> 
> Interesting, thanks.
> Would gst_element_set_state (pipeline, GST_STATE_PLAYING) differ in effect?

Not really, unless the parent is in PAUSED or READY obviously.

> > Flushing sinks can happen if you actually did not properly block
> > pipeline branch where you remove the sink. You need to block an srcpad
> > upstream of the sink and upstream of the part of the pipeline you want
> > to remove with BLOCK|IDLE and at least DATA_DOWNSTREAM. And have all
> > these probe callbacks return GST_PROBE_OK, not PASS, not REMOVE. And
> > then from one of these callbacks (or after one has triggered then in
> > another thread) shut down the pipeline part you want to remove.
> > For this first unlink the srcpad with the downstream pad, (then do any
> > EOS logic or not) then remove elements from the bin, then set states to
> > NULL and unref all the elements.
> 
> Removing from bin before setting state to NULL seems to make sense,
> but as far as i remember removing element in non-NULL state from bin
> raises warning which says you have to set it to NULL first. So is it
> still OK to do as you have said?

Yes, but you must make sure that the bin owns the last reference to the
element. You must set the element to NULL before losing the last
reference. Note that gst_bin_add() steals your reference, so a
gst_bin_remove() afterwards will get rid of the last reference (because
only the bin owns one). Just get another one :)

-- 
Sebastian Dröge, Centricular Ltd - http://www.centricular.com
Expertise, Straight from the Source
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 949 bytes
Desc: This is a digitally signed message part
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20140111/8925750c/attachment.pgp>


More information about the gstreamer-devel mailing list