[gst-devel] Problem with GST_STATE_CHANGE_ASYNC

Tim-Philipp Müller t.i.m at zen.co.uk
Sun Dec 13 19:55:58 CET 2009


On Fri, 2009-12-11 at 15:52 -0800, S Boucher wrote:

> I do a gst_element_set_state() on a pipeline, and it returns
>  GST_STATE_CHANGE_ASYNC.
> 
> I then call gst_element_get_state() for that same pipeline to wait for
>  the state change to complete, as per the documentation.  However, the
>  program never returns from gst_element_get_state().
> 
> The pipeline is made up of my own src element, as well as
>  ffmpegcolorspace, panorama, volume, audioconvert, audioresample,
>  autoaudiosink.
> 
> Help on what to look at would be welcome.

In addition to what Thiago said, try replacing gst_element_get_state()
with something like this:

 msg = gst_bus_timed_pop_filtered (bus, 5 * GST_SECOND,
     GST_MESSAGE_ASYNC_DONE | GST_MESSAGE_ERROR);

This will abort and give you an error message instead of hanging forever
if the state change can't be performed (or time out with no message if
it takes too long for some reason).

Cheers
 -Tim






More information about the gstreamer-devel mailing list