webrtcbin: Check data channel transport for notifying 'ice-gathering-state' 64/272164/10 accepted/tizen/unified/20220318.020352 submit/tizen/20220317.011210
authorSangchul Lee <sc11.lee@samsung.com>
Thu, 10 Mar 2022 08:17:53 +0000 (17:17 +0900)
committerSangchul Lee <sc11.lee@samsung.com>
Wed, 16 Mar 2022 01:07:36 +0000 (10:07 +0900)
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 <sc11.lee@samsung.com>
packaging/gstreamer.spec
subprojects/gst-plugins-bad/ext/webrtc/gstwebrtcbin.c

index 11c366a..9d9e7b9 100644 (file)
@@ -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
index e88ae7b..72627fc 100644 (file)
@@ -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. */