Pipeline hangs when removing a bin from pipeline

hyeonsik song hs.song3162 at gmail.com
Thu Nov 4 04:24:20 UTC 2021


Hello.

When removing a bin from a pipeline, the pipeline hangs sometimes like a
deadlock.
I attached an image about the structure of the pipeline and bin.

Raspberry Pi 3B+ (5.10.73-v7)
Qt 5.15.2
GStreamer 1.18.5

I'm using the above environment.

The problem is that the bin is setted to GST_STATE_NULL and removed from
the pipeline to release, but the pipeline hangs after that.

Element filesink changed state from READY to PAUSED.
Element filesink changed state from PAUSED to READY.
Element bin5 changed state from PAUSED to READY.
Element bin5 changed state from READY to NULL.

The state changes of the above elements seem to have been done
successfully, but it hangs and I couldn't see any changes in qmlglsink.
However, the main thread is alive and that occurs OOM because it pushes the
buffer to appsrc continuously.
If I put `block=true` in appsrc, OOM doesn't occur. but the problem is the
same.

I added the GST_PAD_PROBE_TYPE_IDLE probe callback to src pad of the tee to
remove the bin from the pipeline,
In callback, unlink tee's sink pad and get peer pad from avimux's src pad
and send eos event downstream.
(The reason for getting the peer pad from avimux is that interaudiosrc does
not passthrough events to downstream)
And add GST_PAD_PROBE_TYPE_EVENT_DOWNSTREAM probe callback to sink pad of
filesink,
when filesink is received an eos event, it register a `set 'GST_STATE_NULL'
and gst_bin_remove` callback to the Qt event queue. (to avoid race
condition)

I don't know the reason that the pipeline hangs and does not work properly.

Please, Is there any solution for this problem?

Thanks for reading.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20211104/2a1c33c9/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pipeline_summary.png
Type: image/png
Size: 29597 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20211104/2a1c33c9/attachment-0001.png>


More information about the gstreamer-devel mailing list