webrtcdatachannel: Emit 'on-close' signal when calling 'close' action signal 92/273692/2
authorSangchul Lee <sc11.lee@samsung.com>
Tue, 12 Apr 2022 07:15:15 +0000 (16:15 +0900)
committerSangchul Lee <sc11.lee@samsung.com>
Tue, 12 Apr 2022 10:19:59 +0000 (19:19 +0900)
Previously, peer_closed variable set in _on_sctp_stream_reset() was a condition
to trigger the 'on-close' signal. To emit the 'on-close' signal also when after
calling 'close' action, the condition is removed.

[Version] 1.20.0-15
[Issue Type] Improvement

Change-Id: Ia592f005031490119996ed38ecdada703cf11cc0
Signed-off-by: Sangchul Lee <sc11.lee@samsung.com>
packaging/gstreamer.spec
subprojects/gst-plugins-bad/ext/webrtc/webrtcdatachannel.c
subprojects/gst-plugins-bad/ext/webrtc/webrtcdatachannel.h

index d6e4646..381d9aa 100644 (file)
@@ -59,7 +59,7 @@
 
 Name:           %{_name}
 Version:        1.20.0
-Release:        14
+Release:        15
 Summary:        Streaming-Media Framework Runtime
 License:        LGPL-2.0+
 Group:          Multimedia/Framework
index 033ad47..ffe8a8b 100644 (file)
@@ -284,24 +284,32 @@ 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));
   }
 }
@@ -370,10 +378,12 @@ _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 a0b38a7..13e01da 100644 (file)
@@ -53,7 +53,9 @@ struct _WebRTCDataChannel
   gboolean                          opened;
   gulong                            src_probe;
   GError                           *stored_error;
+#ifndef TIZEN_FEATURE_WEBRTC_MODIFICATION
   gboolean                          peer_closed;
+#endif
 
   gpointer                          _padding[GST_PADDING];
 };