diff options
author | Mathieu Duponchelle <mathieu@centricular.com> | 2018-05-29 13:03:54 +0200 |
---|---|---|
committer | Jan Schmidt <jan@centricular.com> | 2018-06-28 00:25:00 +1000 |
commit | 6ddf178f579311a476a7ddf56f2f376079ba9f23 (patch) | |
tree | 76a8336a73c964dfa053f3b93e1e63de57886c37 | |
parent | e09a4a3e8071068a31fc46f227caf68082720c68 (diff) | |
download | gstreamer-plugins-bad-6ddf178f579311a476a7ddf56f2f376079ba9f23.tar.gz |
webrtcbin: copy sticky events on our ghostpads
This lets users call gst_pad_get_current_caps on newly-added
pads to easily determine what to plug them into.
We cannot copy sticky events unconditionally in core,
see #719437
https://bugzilla.gnome.org/show_bug.cgi?id=796387
-rw-r--r-- | ext/webrtc/gstwebrtcbin.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/ext/webrtc/gstwebrtcbin.c b/ext/webrtc/gstwebrtcbin.c index a28b9364d..233cb99cb 100644 --- a/ext/webrtc/gstwebrtcbin.c +++ b/ext/webrtc/gstwebrtcbin.c @@ -3289,6 +3289,17 @@ gst_webrtc_bin_get_transceivers (GstWebRTCBin * webrtc) return arr; } +static gboolean +copy_sticky_events (GstPad * pad, GstEvent ** event, gpointer user_data) +{ + GstPad *gpad = GST_PAD_CAST (user_data); + + GST_DEBUG_OBJECT (gpad, "store sticky event %" GST_PTR_FORMAT, *event); + gst_pad_store_sticky_event (gpad, *event); + + return TRUE; +} + /* === rtpbin signal implementations === */ static void @@ -3333,6 +3344,7 @@ on_rtpbin_pad_added (GstElement * rtpbin, GstPad * new_pad, if (webrtc->priv->running) gst_pad_set_active (GST_PAD (pad), TRUE); + gst_pad_sticky_events_foreach (new_pad, copy_sticky_events, pad); gst_element_add_pad (GST_ELEMENT (webrtc), GST_PAD (pad)); _remove_pending_pad (webrtc, pad); |