From a836bd476635c5911f95ff8b38dbf7878a2ecc32 Mon Sep 17 00:00:00 2001 From: Matthew Waters Date: Thu, 13 May 2021 21:11:30 +1000 Subject: [PATCH] webrtcbin: advertise harder the rtcp-mux-only requirement And ignore rtcp ICE candidates Part-of: --- ext/webrtc/gstwebrtcbin.c | 2 ++ ext/webrtc/gstwebrtcice.c | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/ext/webrtc/gstwebrtcbin.c b/ext/webrtc/gstwebrtcbin.c index a23e240548..07b3734918 100644 --- a/ext/webrtc/gstwebrtcbin.c +++ b/ext/webrtc/gstwebrtcbin.c @@ -3227,6 +3227,8 @@ _create_offer_task (GstWebRTCBin * webrtc, const GstStructure * options, if (sdp_media_from_transceiver (webrtc, &media, trans, media_idx, bundled_mids, 0, bundle_ufrag, bundle_pwd, reserved_pts, all_mids, error)) { + /* as per JSEP, a=rtcp-mux-only is only added for new streams */ + gst_sdp_media_add_attribute (&media, "rtcp-mux-only", ""); gst_sdp_message_add_media (ret, &media); media_idx++; } else { diff --git a/ext/webrtc/gstwebrtcice.c b/ext/webrtc/gstwebrtcice.c index 886856cc91..84c4e07266 100644 --- a/ext/webrtc/gstwebrtcice.c +++ b/ext/webrtc/gstwebrtcice.c @@ -691,6 +691,13 @@ gst_webrtc_ice_add_candidate (GstWebRTCICE * ice, GstWebRTCICEStream * stream, } } + if (cand->component_id == 2) { + /* we only support rtcp-mux so rtcp candidates are useless for us */ + GST_INFO_OBJECT (ice, "Dropping RTCP candidate %s", candidate); + nice_candidate_free (cand); + return; + } + candidates = g_slist_append (candidates, cand); nice_agent_set_remote_candidates (ice->priv->nice_agent, item->nice_stream_id,