From: Sebastian Dröge Date: Sun, 12 Jan 2020 15:04:22 +0000 (+0200) Subject: webrtcbin: Add handling of unspecified peer-connection-state situation X-Git-Tag: 1.19.3~507^2~2400 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2798a80ebeb1b9667ef73f28454cd206ca0796be;p=platform%2Fupstream%2Fgstreamer.git webrtcbin: Add handling of unspecified peer-connection-state situation For us it can happen that the DTLS transports are still in the process of connecting while the ICE transport is already completed. This situation is not specified in the spec but conceptually that means it is still in the process of connecting. Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/issues/758 --- diff --git a/ext/webrtc/gstwebrtcbin.c b/ext/webrtc/gstwebrtcbin.c index 11cff80..134f85e 100644 --- a/ext/webrtc/gstwebrtcbin.c +++ b/ext/webrtc/gstwebrtcbin.c @@ -1115,6 +1115,15 @@ _collate_peer_connection_states (GstWebRTCBin * webrtc) return STATE (CONNECTED); } + /* FIXME: Unspecified state that happens for us */ + if ((dtls_all_new_connecting_or_checking + || dtls_all_connected_completed_or_closed) + && (ice_all_new_connecting_or_checking + || ice_all_connected_completed_or_closed)) { + GST_TRACE_OBJECT (webrtc, "returning connecting"); + return STATE (CONNECTING); + } + GST_FIXME_OBJECT (webrtc, "Undefined situation detected, returning old state"); return webrtc->peer_connection_state;