Is gst_element_set_state(pipe, GST_STATE_NULL) needed when destructing and unref a pipeline

Nick_law nicholas at umantec.net
Fri Feb 26 13:24:08 UTC 2021


Afternoon,

I have run into an issue with gstreamer hanging during:

gst_element_set_state(pipeline, GST_STATE_NULL);

I am pretty sure this is due to another process having the filesink location
still open as a fifo.
We use gstreamer to write to a previously created fifo and have found that
if other processes still have the fifo open then when trying to destruct and
unref the pipeline, it hangs.

	if (pipeline != nullptr) {
		gst_element_set_state(pipeline, GST_STATE_NULL);
		gst_object_unref(pipeline);
        }

If I just remove the gst_element_set_state(pipeline, GST_STATE_NULL); 
and only call
gst_object_unref(pipeline);

it doesn't hang and seems to be able to deconstruct and start up new
pipelines without issue.

but every tutorial I read and example code, always sets the element state to
GST_STATE_NULL before unref.

So I'm wondering why and if it's even necessary?

Kind regards
Nick



--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/


More information about the gstreamer-devel mailing list