From 0fbbdc5734bb4b6f13532d2b809fd1d08cabb97c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Olivier=20Cr=C3=AAte?= Date: Thu, 9 Jul 2020 13:42:35 -0400 Subject: [PATCH] rtptransceiver: Store the SSRC of the current stream Part-of: --- ext/webrtc/gstwebrtcbin.c | 8 ++++++++ ext/webrtc/webrtctransceiver.h | 1 + 2 files changed, 9 insertions(+) diff --git a/ext/webrtc/gstwebrtcbin.c b/ext/webrtc/gstwebrtcbin.c index dbe919e53c..79b79d6eae 100644 --- a/ext/webrtc/gstwebrtcbin.c +++ b/ext/webrtc/gstwebrtcbin.c @@ -265,6 +265,14 @@ gst_webrtcbin_sink_event (GstPad * pad, GstObject * parent, GstEvent * event) GST_DEBUG_OBJECT (parent, "On %" GST_PTR_FORMAT " checking negotiation? %u, caps %" GST_PTR_FORMAT, pad, check_negotiation, caps); + + if (check_negotiation) { + WebRTCTransceiver *trans = WEBRTC_TRANSCEIVER (wpad->trans); + const GstStructure *s; + + s = gst_caps_get_structure (caps, 0); + gst_structure_get_uint (s, "ssrc", &trans->current_ssrc); + } } else if (GST_EVENT_TYPE (event) == GST_EVENT_EOS) { check_negotiation = TRUE; } diff --git a/ext/webrtc/webrtctransceiver.h b/ext/webrtc/webrtctransceiver.h index c037304151..f834fd329a 100644 --- a/ext/webrtc/webrtctransceiver.h +++ b/ext/webrtc/webrtctransceiver.h @@ -39,6 +39,7 @@ struct _WebRTCTransceiver TransportStream *stream; GstStructure *local_rtx_ssrc_map; + guint current_ssrc; /* Properties */ GstWebRTCFECType fec_type;