webrtcbin: Remove a connecting webrtcbin from running pipeline

Eric Timmons eric at timmons.dev
Tue Jan 25 18:11:23 UTC 2022

I've got an application where we're streaming video to multiple clients using WebRTC. Our video goes into a tee element and then each WebRTC branch of the tee has a queue, rtph264pay, and webrtcbin element. Dynamically adding new branches to this pipeline works great. Dynamically removing branches as clients go away works, but only if the both the SDP and ICE negotiations have finished.

We can't figure out how to remove a branch where an offer has been sent, but no answer received. Currently, we disconnect the branch from the tee, set the states of every element in the branch to NULL, and then remove them from the pipeline. If negotiations have not finished, then setting any element's state to NULL blocks indefinitely.

We've additionally tried sending an EOS through the branch after disconnecting from the tee, but the EOS doesn't ever seem to leave the queue.

I've attached an example using the Python bindings. This hangs on Line 107 in both 1.18.4 and current main branch.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: remove-webrtcbin.py
Type: text/x-python
Size: 4103 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20220125/299e1a3b/attachment.py>

More information about the gstreamer-devel mailing list