Dynamic pipelines & gst_element_sync_state_with_parent() usage

Paddy pat.blanchon at gmail.com
Tue Jan 8 01:55:09 PST 2013


Hi All,

I'm using gstreamer-0.10.

I'm debugging some strange behaviour in my audio/video recording pipeline
which saves to files in 30sec chunks & I've come across something that I
need clearing up. 

When I create the new mux/filesink to record to I follow the accepted wisdom
of:
1) create bin
2) add bin to parent
3) sync bin with parent using gst_element_sync_state_with_parent()
4) link bin to parent
5) unblock blocked pads

The manual for  gst_element_sync_state_with_parent()
<http://gstreamer.freedesktop.org/data/doc/gstreamer/0.10.36/gstreamer/html/GstElement.html#gst-element-sync-state-with-parent>  
states:
"Returns : TRUE, if the element's state could be synced to the parent's
state. MT safe."

however looking at the code, it returns TRUE if the call to
gst_element_set_state() does not return GST_STATE_CHANGE_FAILURE; AFAIK
should the state change be asynchronous then there is no guarantee that the
element is synced when TRUE is returned.

So my question is:
Do I need to wait for the state change to complete before linking (by
creating a gst_element_really_sync_state_with_parent() function, say) ?
or
Is there some unwritten rule deep down in the code that makes the above a
non-issue, & the child is synced with the parent before the link ?

Cheers,

Paddy





--
View this message in context: http://gstreamer-devel.966125.n4.nabble.com/Dynamic-pipelines-gst-element-sync-state-with-parent-usage-tp4657809.html
Sent from the GStreamer-devel mailing list archive at Nabble.com.


More information about the gstreamer-devel mailing list