From 62dd7ed5dfecdb09aae41d311ffadd2dd5b7d5b5 Mon Sep 17 00:00:00 2001 From: Sangchul Lee Date: Thu, 10 Mar 2022 17:17:53 +0900 Subject: [PATCH] webrtcbin: Check data channel transport for notifying 'ice-gathering-state' Previously, it did not care about data channel's. It is fixed by adding some conditions. [Version] 1.20.0-9 [Issue Type] Bug fix Change-Id: If1fd8047c1a944ccbe65c13b1cda7c0e34a7bec7 Signed-off-by: Sangchul Lee --- packaging/gstreamer.spec | 2 +- .../gst-plugins-bad/ext/webrtc/gstwebrtcbin.c | 25 +++++++++++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/packaging/gstreamer.spec b/packaging/gstreamer.spec index 11c366a9a1..9d9e7b9b18 100644 --- a/packaging/gstreamer.spec +++ b/packaging/gstreamer.spec @@ -59,7 +59,7 @@ Name: %{_name} Version: 1.20.0 -Release: 8 +Release: 9 Summary: Streaming-Media Framework Runtime License: LGPL-2.0+ Group: Multimedia/Framework diff --git a/subprojects/gst-plugins-bad/ext/webrtc/gstwebrtcbin.c b/subprojects/gst-plugins-bad/ext/webrtc/gstwebrtcbin.c index e88ae7b8fd..72627fc92c 100644 --- a/subprojects/gst-plugins-bad/ext/webrtc/gstwebrtcbin.c +++ b/subprojects/gst-plugins-bad/ext/webrtc/gstwebrtcbin.c @@ -1112,7 +1112,15 @@ _collate_ice_gathering_states (GstWebRTCBin * webrtc) { #define STATE(val) GST_WEBRTC_ICE_GATHERING_STATE_ ## val GstWebRTCICEGatheringState any_state = 0; +#ifdef TIZEN_FEATURE_WEBRTC_MODIFICATION + GstWebRTCICEGatheringState ice_state; + GstWebRTCDTLSTransport *dtls_transport; + GstWebRTCICETransport *transport; + gboolean all_completed = webrtc->priv->transceivers->len > 0 || + webrtc->priv->data_channel_transport; +#else gboolean all_completed = webrtc->priv->transceivers->len > 0; +#endif int i; for (i = 0; i < webrtc->priv->transceivers->len; i++) { @@ -1120,9 +1128,11 @@ _collate_ice_gathering_states (GstWebRTCBin * webrtc) g_ptr_array_index (webrtc->priv->transceivers, i); WebRTCTransceiver *trans = WEBRTC_TRANSCEIVER (rtp_trans); TransportStream *stream = trans->stream; +#ifndef TIZEN_FEATURE_WEBRTC_MODIFICATION GstWebRTCDTLSTransport *dtls_transport; GstWebRTCICETransport *transport; GstWebRTCICEGatheringState ice_state; +#endif if (rtp_trans->stopped || stream == NULL) { GST_TRACE_OBJECT (webrtc, "transceiver %p stopped or unassociated", @@ -1153,6 +1163,21 @@ _collate_ice_gathering_states (GstWebRTCBin * webrtc) all_completed = FALSE; } +#ifdef TIZEN_FEATURE_WEBRTC_MODIFICATION + /* check data channel transport gathering state */ + if (all_completed && webrtc->priv->data_channel_transport) { + if ((dtls_transport = webrtc->priv->data_channel_transport->transport)) { + transport = dtls_transport->transport; + g_object_get (transport, "gathering-state", &ice_state, NULL); + GST_TRACE_OBJECT (webrtc, + "data channel transport %p gathering state: 0x%x", dtls_transport, + ice_state); + any_state |= (1 << ice_state); + if (ice_state != STATE (COMPLETE)) + all_completed = FALSE; + } + } +#endif GST_TRACE_OBJECT (webrtc, "ICE gathering state: 0x%x", any_state); /* Any of the RTCIceTransport s are in the gathering state. */ -- 2.34.1