[gst-devel] How can I wait for the pipeline destruction?
wl2776
wl2776 at gmail.com
Wed Apr 21 13:26:53 CEST 2010
Depending on media, my media player destroys previously created playbin2
instance and creates and fills a new pipeline.
This new pipeline uses the previously created videosink, which also was
earlier set in the playbin2, because I want to avoid image flickering during
the pipeline recreation.
I want to be sure that the old playbin2 is destroyed before creating a new
pipeline.
How can I do that?
When I destroy the playbin2 with gst_object_unref(GST_OBJECT(m_player)), I
seem to get one more background thread, doing all this destruction stuff.
Two threads (creation and destruction) finish nearly simultaneously, and the
destruction thread sends my videosink to the NULL state (and probably zeroes
its bus) right after my new pipeline is complete, and the function returns.
I do
gst_object_unref(GST_OBJECT(m_player));
gst_object_unref(GST_OBJECT(m_bus));
bin=(GstElement *)gst_element_get_parent(m_videosink);
if(bin){
rb=gst_bin_remove(GST_BIN(bin),GST_ELEMENT(m_videosink));
}
gst_object_unparent(GST_OBJECT(m_videosink));
before beginning of a new pipeline construction, but this seems to start a
new thread, as I said before, and videosink is removed too late from the
playbin2. And this pipeline sets it to the null state.
Again, how can I get sure, that playbin2 is destroyed and will not bring me
some new (street) magic?
--
View this message in context: http://n4.nabble.com/How-can-I-wait-for-the-pipeline-destruction-tp2018772p2018772.html
Sent from the GStreamer-devel mailing list archive at Nabble.com.
More information about the gstreamer-devel
mailing list