<div dir="ltr">Hello.<br><br>When removing a bin from a pipeline, the pipeline hangs sometimes like a deadlock.<br>I attached an image about the structure of the pipeline and bin.<br><br>Raspberry Pi 3B+ (5.10.73-v7)<br>Qt 5.15.2<br>GStreamer 1.18.5<br><br>I'm using the above environment.<br><br>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.<br><br>Element filesink changed state from READY to PAUSED.<br>Element filesink changed state from PAUSED to READY.<br>Element bin5 changed state from PAUSED to READY.<br>Element bin5 changed state from READY to NULL.<br><br>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.<br>However, the main thread is alive and that occurs OOM because it pushes the buffer to appsrc continuously.<br>If I put `block=true` in appsrc, OOM doesn't occur. but the problem is the same.<br><br>I added the GST_PAD_PROBE_TYPE_IDLE probe callback to src pad of the tee to remove the bin from the pipeline,<br>In callback, unlink tee's sink pad and get peer pad from avimux's src pad and send eos event downstream.<br>(The reason for getting the peer pad from avimux is that interaudiosrc does not passthrough events to downstream)<br>And add GST_PAD_PROBE_TYPE_EVENT_DOWNSTREAM probe callback to sink pad of filesink,<br>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)<br><br>I don't know the reason that the pipeline hangs and does not work properly.<br><br>Please, Is there any solution for this problem?<br><br>Thanks for reading.<br></div>