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

Thibault Saunier tsaunier at gnome.org
Fri Feb 26 13:27:02 UTC 2021


Hello,

It is necessary to set the pipeline state to NULL before destroying it, it
is an API requirement.

- Thibault

On Fri, Feb 26, 2021 at 10:24 AM Nick_law <nicholas at umantec.net> wrote:

> 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/
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20210226/f13c24e8/attachment.htm>


More information about the gstreamer-devel mailing list