[gst-devel] How can I wait for the pipeline destruction?

Tim-Philipp Müller t.i.m at zen.co.uk
Wed Apr 21 14:04:27 CEST 2010


On Wed, 2010-04-21 at 03:26 -0800, wl2776 wrote:

> 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. 

Downwards state changes should be synchronous, so when
gst_object_unref() finishes, the pipeline and all resources used should
be closed/freed, assuming nothing else holds a ref. If that's not the
case for you, that may be a problem in some proprietary element, if you
have one of those in your pipeline, or some refcount issue somewhere.

However, you could try adding a 'weak' reference (See GObject API
reference), that will call a function of yours when the pipeline object
has really been destroyed. That may not actually help you though if you
have some code somewhere that doesn't block until all resources it uses
have been freed. 

Cheers
 -Tim





More information about the gstreamer-devel mailing list