gst_element_set_state failure and bus messages

Carlos Rafael Giani dv at pseudoterminal.org
Tue Jul 29 02:50:38 PDT 2014


Hello,

I saw something strange the other day with state changes with GStreamer 
1.2.0. During a test, I intentionally used filesrc with an invalid 
filename. As expected, the state change from READY to PAUSED failed. As 
part of the cleanup operation that followed, I called 
gst_element_set_state() again, this time setting the pipeline to the 
NULL state. This returned GST_STATE_CHANGE_SUCCESS , so the state change 
finished immediately. Perhaps the pipeline is automatically set to NULL 
if a state change fails?

Either way, I also noticed that the bus watch did not get any kind of 
message that the state was changed to NULL. This caused problems, 
because some final cleanup operations rely on seeing a state change to 
NULL in the bus watch.

Is this some kind of exception? If state change fails, it is implicitely 
set to NULL, and no state change messages will occur? Or perhaps this is 
just a bug? I will test with a newer GStreamer version today.
Also, if a state change finishes immediately (that is, returns 
GST_STATE_CHANGE_SUCCESS instead of GST_STATE_CHANGE_ASYNC), will it 
still produce bus watch statechange messages?

cheers


More information about the gstreamer-devel mailing list