Allow receive-only use of datagram transport for data channels.
Adds a field trial and configuration parameter to control whether
datagram transport may be used for data channels in a receive-only
manner. By default, if use_datagram_transport_for_data_channels is
enabled, PeerConnection will create a datagram transport and offer its
use for outgoing calls as well as accept incoming offers with compatible
datagram transport parameters.
With this change, a receive_only mode is added for datagram transport
data channels. When receive_only is set, the PeerConnection will not
create or offer datagram transports for outgoing calls, but will accept
incoming calls that offer compatible datagram transport parameters.
Bug: webrtc:9719
Change-Id: I35667bcc408ea4bbc61155898e6d2472dd262711
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/154463
Reviewed-by: Seth Hampson <shampson@webrtc.org>
Commit-Queue: Bjorn Mellem <mellem@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29327}
diff --git a/pc/jsep_transport_controller.h b/pc/jsep_transport_controller.h
index 12bcebc..af3c82c 100644
--- a/pc/jsep_transport_controller.h
+++ b/pc/jsep_transport_controller.h
@@ -120,6 +120,11 @@
// Use datagram transport's implementation of data channels instead of SCTP.
bool use_datagram_transport_for_data_channels = false;
+ // Whether |use_datagram_transport_for_data_channels| applies to outgoing
+ // calls. If true, |use_datagram_transport_for_data_channels| applies only
+ // to incoming calls.
+ bool use_datagram_transport_for_data_channels_receive_only = false;
+
// Optional media transport factory (experimental). If provided it will be
// used to create media_transport (as long as either
// |use_media_transport_for_media| or
@@ -227,10 +232,12 @@
// media transport configuration on the jsep transport controller, as long as
// you did not call 'GetMediaTransport' or 'MaybeCreateJsepTransport'. Once
// Jsep transport is created, you can't change this setting.
- void SetMediaTransportSettings(bool use_media_transport_for_media,
- bool use_media_transport_for_data_channels,
- bool use_datagram_transport,
- bool use_datagram_transport_for_data_channels);
+ void SetMediaTransportSettings(
+ bool use_media_transport_for_media,
+ bool use_media_transport_for_data_channels,
+ bool use_datagram_transport,
+ bool use_datagram_transport_for_data_channels,
+ bool use_datagram_transport_for_data_channels_receive_only);
// If media transport is present enabled and supported,
// when this method is called, it creates a media transport and generates its