Sending EOS from a probe callback deadlocks the pipeline when playing a non-live source

Eslam Ahmed eslam.ahmed at avidbeam.com
Wed Nov 10 08:24:05 UTC 2021


Hello,

Consider the following pipeline:

filesrc ! typefind ! decodebin ! fakesink

My main goal is to inspect the buffers for a while then finalize the
pipeline so I installed a probe of type GST_PAD_PROBE_TYPE_BUFFER on the
fakesink's sink pad, which after inspecting the buffers for a while emits
an EOS signal down using the pipeline itself then removes the probe.
Problem is the pipeline gets deadlocked on sending this event. Here's gdb
backtrace:
```
#0 __lll_lock_wait (futex=futex at entry=0x555556192e10, private=0) at
lowlevellock.c:52
#1 0x00007ffff732a131 in __GI___pthread_mutex_lock (mutex=0x555556192e10) at
../nptl/pthread_mutex_lock.c:115
#2 0x00007ffff6c4e1dd in () at /lib/x86_64-linux-gnu/libgstbase-1.0.so.0
#3 0x00007ffff7bd74a2 in gst_element_send_event () at
/lib/x86_64-linux-gnu/libgstreamer-1.0.so.0
#4 0x00007ffff7bb452d in () at /lib/x86_64-linux-gnu/libgstreamer-1.0.so.0
#5 0x00007ffff7bd74a2 in gst_element_send_event () at
/lib/x86_64-linux-gnu/libgstreamer-1.0.so.0
#6 0x00007ffff7bb452d in () at /lib/x86_64-linux-gnu/libgstreamer-1.0.so.0
#7 0x00007ffff7bd74a2 in gst_element_send_event () at
/lib/x86_64-linux-gnu/libgstreamer-1.0.so.0
#8 0x00007ffff75219aa in pipeline_manager::send_eos() (this=0x7fffffffd530)
#9 0x00005555556937c5 in (anonymous
namespace)::cb_gather_media_spec(GstPad*, GstPadProbeInfo*, gpointer) (pad=
0x5555560c7120 [GstPad|sink], info=0x7ffff393d650, user_data=0x7fffffffd4d0)
```

The implementation of pipeline_manager::send_eos() is fairly
straightforward just calling `gst_element_send_event(pipeline_.get(),
gst_event_new_eos());`
Surprisingly, I don't get the deadlock when using a live source (rtspsrc
instead of the filesrc)
Is it wrong to send the in-band downstream EOS event from a pad probe
callback? Am I missing something here?

Gstreamer Version: 1.16.2 (installed via apt package manager on Ubuntu
20.04.3 LTS)

Best Regards,
Eslam Ahmed
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20211110/de75880f/attachment-0001.htm>


More information about the gstreamer-devel mailing list