diff options
author | Olivier CrĂȘte <olivier.crete@collabora.com> | 2021-06-28 21:13:56 -0400 |
---|---|---|
committer | Olivier CrĂȘte <olivier.crete@collabora.com> | 2021-06-29 00:42:20 -0400 |
commit | e548916d8591c7d0bacfe9ffc4bdbb74dd3db6e8 (patch) | |
tree | 5abcf983649bce82db21c4c193bb0b436141e91d /ext | |
parent | 543fcb93a45d967cf567cb39f1390f4eb697ed8d (diff) | |
download | gstreamer-plugins-bad-e548916d8591c7d0bacfe9ffc4bdbb74dd3db6e8.tar.gz |
webrtc receivebin: Drop serialized queries before receive queue
If they're not dropped, they can be blocked in the queue even if it is
leaky in the case where there is a buffer being pushed downstream. Since
in webrtc, it's unlikely that there will be a special allocator to
receive RTP packets, there is almost no downside to just ignoring the
queries.
Also drop queries if they get caught in the pad probe after the queue.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2363>
Diffstat (limited to 'ext')
-rw-r--r-- | ext/webrtc/transportreceivebin.c | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/ext/webrtc/transportreceivebin.c b/ext/webrtc/transportreceivebin.c index b1e3da061..8f8a44452 100644 --- a/ext/webrtc/transportreceivebin.c +++ b/ext/webrtc/transportreceivebin.c @@ -96,7 +96,7 @@ pad_block (GstPad * pad, GstPadProbeInfo * info, TransportReceiveBin * receive) * them. Sticky events would be forwarded again later once we unblock * and we don't want to forward them here already because that might * cause a spurious GST_FLOW_FLUSHING */ - if (GST_IS_EVENT (info->data)) + if (GST_IS_EVENT (info->data) || GST_IS_QUERY (info->data)) return GST_PAD_PROBE_DROP; /* But block on any actual data-flow so we don't accidentally send that @@ -294,6 +294,18 @@ rtp_queue_overrun (GstElement * queue, TransportReceiveBin * receive) GST_WARNING_OBJECT (receive, "Internal receive queue overrun. Dropping data"); } +static GstPadProbeReturn +drop_serialized_queries (GstPad * pad, GstPadProbeInfo * info, + TransportReceiveBin * receive) +{ + GstQuery *query = GST_PAD_PROBE_INFO_QUERY (info); + + if (GST_QUERY_IS_SERIALIZED (query)) + return GST_PAD_PROBE_DROP; + else + return GST_PAD_PROBE_PASS; +} + static void transport_receive_bin_constructed (GObject * object) { @@ -321,6 +333,11 @@ transport_receive_bin_constructed (GObject * object) g_signal_connect (receive->queue, "overrun", G_CALLBACK (rtp_queue_overrun), receive); + pad = gst_element_get_static_pad (receive->queue, "sink"); + gst_pad_add_probe (pad, GST_PAD_PROBE_TYPE_QUERY_DOWNSTREAM, + (GstPadProbeCallback) drop_serialized_queries, receive, NULL); + gst_object_unref (pad); + gst_bin_add (GST_BIN (receive), GST_ELEMENT (receive->queue)); gst_bin_add (GST_BIN (receive), GST_ELEMENT (capsfilter)); if (!gst_element_link_pads (capsfilter, "src", receive->queue, "sink")) |