webrtcbin: Expose SCTP Transport
authorJohan Sternerup <johast@axis.com>
Mon, 3 May 2021 08:45:42 +0000 (10:45 +0200)
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Wed, 25 Aug 2021 13:20:22 +0000 (13:20 +0000)
Being able to access the SCTP Transport object from the application
means the application can access the associated DTLS Transport object
and its ICE Transport object. This means we can observe the ICE state
also for a data-channel-only session. The collated
ice-connection-state on webrtcbin only includes the ICE Transport
objects that resides on the RTP transceivers (which is exactly how it
is specified in
https://w3c.github.io/webrtc-pc/#rtciceconnectionstate-enum).

For the consent freshness functionality (RFC 7675) to work the ICE
state must be accessible and consequently the SCTP transport must be
accessible for enabling consent freshness checking for a
data-channel-only session.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2214>

docs/plugins/gst_plugins_cache.json
ext/webrtc/gstwebrtcbin.c

index dd166e4913162623a37a3e3bce7102a33ce013f5..86dd1c5bfa00784990ddba6fa069845bfb1a0749 100644 (file)
                         "type": "GstWebRTCSessionDescription",
                         "writable": false
                     },
+                    "sctp-transport": {
+                        "blurb": "The WebRTC SCTP Transport",
+                        "conditionally-available": false,
+                        "construct": false,
+                        "construct-only": false,
+                        "controllable": false,
+                        "mutable": "null",
+                        "readable": true,
+                        "type": "GstObject",
+                        "writable": false
+                    },
                     "signaling-state": {
                         "blurb": "The signaling state of this element",
                         "conditionally-available": false,
index fdc53f52c0c91b9e5bd0ca294d5d875c415c8f54..c6855fc7f78402564925d632c599dc995201ac46 100644 (file)
@@ -467,7 +467,8 @@ enum
   PROP_BUNDLE_POLICY,
   PROP_ICE_TRANSPORT_POLICY,
   PROP_ICE_AGENT,
-  PROP_LATENCY
+  PROP_LATENCY,
+  PROP_SCTP_TRANSPORT,
 };
 
 static guint gst_webrtc_bin_signals[LAST_SIGNAL] = { 0 };
@@ -6914,6 +6915,9 @@ gst_webrtc_bin_get_property (GObject * object, guint prop_id,
     case PROP_LATENCY:
       g_value_set_uint (value, webrtc->priv->jb_latency);
       break;
+    case PROP_SCTP_TRANSPORT:
+      g_value_set_object (value, webrtc->priv->sctp_transport);
+      break;
     default:
       G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
       break;
@@ -7191,6 +7195,19 @@ gst_webrtc_bin_class_init (GstWebRTCBinClass * klass)
           0, G_MAXUINT, DEFAULT_JB_LATENCY,
           G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
 
+  /**
+   * GstWebRTCBin:sctp-transport:
+   *
+   * The WebRTC SCTP Transport
+   *
+   * Since: 1.20
+   */
+  g_object_class_install_property (gobject_class,
+      PROP_SCTP_TRANSPORT,
+      g_param_spec_object ("sctp-transport", "WebRTC SCTP Transport",
+          "The WebRTC SCTP Transport",
+          GST_TYPE_OBJECT, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
+
   /**
    * GstWebRTCBin::create-offer:
    * @object: the #webrtcbin