g_object_get (channel, "ready-state", &ready_state, NULL);
+#ifdef TIZEN_FEATURE_WEBRTC_MODIFICATION
+ GST_TRACE_OBJECT (webrtc,
+ "%" GST_PTR_FORMAT " ready-state %u", channel, ready_state);
+#endif
if (ready_state == GST_WEBRTC_DATA_CHANNEL_STATE_OPEN) {
gboolean found;
}
g_ptr_array_add (webrtc->priv->data_channels, gst_object_ref (channel));
+#ifdef TIZEN_FEATURE_WEBRTC_MODIFICATION
+ webrtc->priv->data_channels_opened++;
+#endif
DC_UNLOCK (webrtc);
gst_webrtc_bin_update_sctp_priority (webrtc);
channel);
} else if (ready_state == GST_WEBRTC_DATA_CHANNEL_STATE_CLOSED) {
gboolean found;
+#ifdef TIZEN_FEATURE_WEBRTC_MODIFICATION
+ int i;
+#endif
DC_LOCK (webrtc);
+#ifdef TIZEN_FEATURE_WEBRTC_MODIFICATION
+ for (i = 0; i < webrtc->priv->data_channels->len; i++)
+ if (g_ptr_array_index (webrtc->priv->data_channels, i) == channel)
+ webrtc->priv->data_channels_closed++;
+
+#endif
found = g_ptr_array_remove (webrtc->priv->pending_data_channels, channel)
|| g_ptr_array_remove (webrtc->priv->data_channels, channel);
* "remote-timestamp" G_TYPE_DOUBLE remote timestamp the statistics were sent by the remote
*
*/
+#ifdef TIZEN_FEATURE_WEBRTC_MODIFICATION
+ /**
+ * RTCPeerConnectionStats supported fields (https://w3c.github.io/webrtc-stats/#pcstats-dict*)
+ *
+ * "data-channels-opened" G_TYPE_UINT number of unique data channels that have entered the 'open' state
+ * "data-channels-closed" G_TYPE_UINT number of unique data channels that have left the 'open' state
+ *
+ */
+#endif
gst_webrtc_bin_signals[GET_STATS_SIGNAL] =
g_signal_new_class_handler ("get-stats",
G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
/* list of data channels we've received a sctp stream for but no data
* channel protocol for */
GPtrArray *pending_data_channels;
+#ifdef TIZEN_FEATURE_WEBRTC_MODIFICATION
+ guint data_channels_opened;
+ guint data_channels_closed;
+#endif
/* dc_lock protects data_channels and pending_data_channels */
/* lock ordering is pc_lock first, then dc_lock */
GMutex dc_lock;
{
GstStructure *s = gst_structure_new_empty ("unused");
+#ifdef TIZEN_FEATURE_WEBRTC_MODIFICATION
+ /* FIXME: 'data-channels-requested/accepted' should be updated */
+ gst_structure_set (s, "data-channels-opened", G_TYPE_UINT,
+ webrtc->priv->data_channels_opened, "data-channels-closed", G_TYPE_UINT,
+ webrtc->priv->data_channels_closed, NULL);
+#else
/* FIXME: datachannel */
gst_structure_set (s, "data-channels-opened", G_TYPE_UINT, 0,
"data-channels-closed", G_TYPE_UINT, 0, "data-channels-requested",
G_TYPE_UINT, 0, "data-channels-accepted", G_TYPE_UINT, 0, NULL);
+#endif
return s;
}
if (gst_app_src_push_buffer (GST_APP_SRC (channel->appsrc),
buffer) == GST_FLOW_OK) {
channel->opened = TRUE;
+#ifdef TIZEN_FEATURE_WEBRTC_MODIFICATION
+ channel->webrtcbin->priv->data_channels_opened++;
+#endif
_channel_enqueue_task (channel, (ChannelTask) _emit_on_open, NULL, NULL);
} else {
GError *error = NULL;