Revert "webrtcdatachannel: Emit 'on-close' signal when calling 'close' action signal" 49/276949/1
authorSangchul Lee <sc11.lee@samsung.com>
Tue, 28 Jun 2022 08:14:13 +0000 (17:14 +0900)
committerSangchul Lee <sc11.lee@samsung.com>
Tue, 28 Jun 2022 08:20:32 +0000 (17:20 +0900)
This reverts commit a6cf067742c1206c073b5e0fe26386a09fda8769.

This patch fixed the issue that only occurred between gst to web API(chromium).
But it ignores a procedure of closing data channel specified in spec.
So, it is reverted.

Change-Id: I69d057af4d22a02a1d25cae358df43d5dc588df3

subprojects/gst-plugins-bad/ext/webrtc/webrtcdatachannel.c
subprojects/gst-plugins-bad/ext/webrtc/webrtcdatachannel.h

index ffe8a8b..033ad47 100644 (file)
@@ -284,32 +284,24 @@ static void
 _transport_closed (WebRTCDataChannel * channel)
 {
   GError *error;
-#ifndef TIZEN_FEATURE_WEBRTC_MODIFICATION
   gboolean both_sides_closed;
-#endif
 
   GST_WEBRTC_DATA_CHANNEL_LOCK (channel);
   error = channel->stored_error;
   channel->stored_error = NULL;
 
-#ifndef TIZEN_FEATURE_WEBRTC_MODIFICATION
   both_sides_closed =
       channel->peer_closed && channel->parent.buffered_amount <= 0;
   if (both_sides_closed || error) {
     channel->peer_closed = FALSE;
   }
-#endif
   GST_WEBRTC_DATA_CHANNEL_UNLOCK (channel);
 
   if (error) {
     gst_webrtc_data_channel_on_error (GST_WEBRTC_DATA_CHANNEL (channel), error);
     g_clear_error (&error);
   }
-#ifdef TIZEN_FEATURE_WEBRTC_MODIFICATION
-  if (channel->parent.buffered_amount <= 0 || error) {
-#else
   if (both_sides_closed || error) {
-#endif
     gst_webrtc_data_channel_on_close (GST_WEBRTC_DATA_CHANNEL (channel));
   }
 }
@@ -378,12 +370,10 @@ _on_sctp_stream_reset (WebRTCSCTPTransport * sctp, guint stream_id,
         "Received channel close for SCTP stream %i label \"%s\"",
         channel->parent.id, channel->parent.label);
 
-#ifndef TIZEN_FEATURE_WEBRTC_MODIFICATION
     GST_WEBRTC_DATA_CHANNEL_LOCK (channel);
     channel->peer_closed = TRUE;
     GST_WEBRTC_DATA_CHANNEL_UNLOCK (channel);
 
-#endif
     _channel_enqueue_task (channel, (ChannelTask) _close_procedure,
         GUINT_TO_POINTER (stream_id), NULL);
   }
index 13e01da..a0b38a7 100644 (file)
@@ -53,9 +53,7 @@ struct _WebRTCDataChannel
   gboolean                          opened;
   gulong                            src_probe;
   GError                           *stored_error;
-#ifndef TIZEN_FEATURE_WEBRTC_MODIFICATION
   gboolean                          peer_closed;
-#endif
 
   gpointer                          _padding[GST_PADDING];
 };