G_DEFINE_TYPE_WITH_CODE (GstWebRTCBin, gst_webrtc_bin, GST_TYPE_BIN,
G_ADD_PRIVATE (GstWebRTCBin)
GST_DEBUG_CATEGORY_INIT (gst_webrtc_bin_debug, "webrtcbin", 0,
- "webrtcbin element");
- );
+ "webrtcbin element"););
static GstPad *_connect_input_stream (GstWebRTCBin * webrtc,
GstWebRTCBinPad * pad);
PROP_STUN_SERVER,
PROP_TURN_SERVER,
PROP_BUNDLE_POLICY,
+ PROP_ICE_TRANSPORT_POLICY,
};
static guint gst_webrtc_bin_signals[LAST_SIGNAL] = { 0 };
webrtc->bundle_policy = g_value_get_enum (value);
}
break;
+ case PROP_ICE_TRANSPORT_POLICY:
+ webrtc->ice_transport_policy = g_value_get_enum (value);
+ g_object_set (webrtc->priv->ice, "force-relay",
+ webrtc->ice_transport_policy ==
+ GST_WEBRTC_ICE_TRANSPORT_POLICY_RELAY ? TRUE : FALSE, NULL);
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
case PROP_BUNDLE_POLICY:
g_value_set_enum (value, webrtc->bundle_policy);
break;
+ case PROP_ICE_TRANSPORT_POLICY:
+ g_value_set_enum (value, webrtc->ice_transport_policy);
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
GST_WEBRTC_BUNDLE_POLICY_NONE,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
+ g_object_class_install_property (gobject_class,
+ PROP_ICE_TRANSPORT_POLICY,
+ g_param_spec_enum ("ice-transport-policy", "ICE Transport Policy",
+ "The policy to apply for ICE transport",
+ GST_TYPE_WEBRTC_ICE_TRANSPORT_POLICY,
+ GST_WEBRTC_ICE_TRANSPORT_POLICY_ALL,
+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
+
/**
* GstWebRTCBin::create-offer:
* @object: the #GstWebRtcBin
GstWebRTCSessionDescription *pending_remote_description;
GstWebRTCBundlePolicy bundle_policy;
+ GstWebRTCICETransportPolicy ice_transport_policy;
GstWebRTCBinPrivate *priv;
};
PROP_TURN_SERVER,
PROP_CONTROLLER,
PROP_AGENT,
+ PROP_FORCE_RELAY,
};
static guint gst_webrtc_ice_signals[LAST_SIGNAL] = { 0 };
#define gst_webrtc_ice_parent_class parent_class
G_DEFINE_TYPE_WITH_CODE (GstWebRTCICE, gst_webrtc_ice,
GST_TYPE_OBJECT, G_ADD_PRIVATE (GstWebRTCICE)
- GST_DEBUG_CATEGORY_INIT (gst_webrtc_ice_debug, "webrtcice", 0, "webrtcice");
- );
+ GST_DEBUG_CATEGORY_INIT (gst_webrtc_ice_debug, "webrtcice", 0,
+ "webrtcice"););
static gboolean
_unlock_pc_thread (GMutex * lock)
g_object_set_property (G_OBJECT (ice->priv->nice_agent),
"controlling-mode", value);
break;
+ case PROP_FORCE_RELAY:
+ g_object_set_property (G_OBJECT (ice->priv->nice_agent),
+ "force-relay", value);
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
case PROP_AGENT:
g_value_set_object (value, ice->priv->nice_agent);
break;
+ case PROP_FORCE_RELAY:
+ g_object_get_property (G_OBJECT (ice->priv->nice_agent),
+ "force-relay", value);
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
"ICE agent in use by this object", NICE_TYPE_AGENT,
G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
+ g_object_class_install_property (gobject_class,
+ PROP_FORCE_RELAY,
+ g_param_spec_boolean ("force-relay", "Force Relay",
+ "Force all traffic to go through a relay.", FALSE,
+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
+
/**
* GstWebRTCICE::on-ice-candidate:
* @object: the #GstWebRtcBin
GST_WEBRTC_BUNDLE_POLICY_MAX_BUNDLE,
} GstWebRTCBundlePolicy;
+/**
+ * GstWebRTCICETransportPolicy:
+ * GST_WEBRTC_ICE_TRANSPORT_POLICY_ALL: all
+ * GST_WEBRTC_ICE_TRANSPORT_POLICY_RELAY: relay
+ *
+ * See https://tools.ietf.org/html/draft-ietf-rtcweb-jsep-24#section-4.1.1
+ * for more information.
+ */
+typedef enum /*<underscore_name=gst_webrtc_ice_transport_policy>*/
+{
+ GST_WEBRTC_ICE_TRANSPORT_POLICY_ALL,
+ GST_WEBRTC_ICE_TRANSPORT_POLICY_RELAY,
+} GstWebRTCICETransportPolicy;
+
#endif /* __GST_WEBRTC_FWD_H__ */