aboutsummaryrefslogtreecommitdiff
path: root/media/sctp/sctp_transport_factory.cc
diff options
context:
space:
mode:
Diffstat (limited to 'media/sctp/sctp_transport_factory.cc')
-rw-r--r--media/sctp/sctp_transport_factory.cc18
1 files changed, 17 insertions, 1 deletions
diff --git a/media/sctp/sctp_transport_factory.cc b/media/sctp/sctp_transport_factory.cc
index 40480e797a..5097d423d9 100644
--- a/media/sctp/sctp_transport_factory.cc
+++ b/media/sctp/sctp_transport_factory.cc
@@ -12,6 +12,12 @@
#include "rtc_base/system/unused.h"
+#ifdef WEBRTC_HAVE_DCSCTP
+#include "media/sctp/dcsctp_transport.h" // nogncheck
+#include "system_wrappers/include/clock.h" // nogncheck
+#include "system_wrappers/include/field_trial.h" // nogncheck
+#endif
+
#ifdef WEBRTC_HAVE_USRSCTP
#include "media/sctp/usrsctp_transport.h" // nogncheck
#endif
@@ -19,14 +25,24 @@
namespace cricket {
SctpTransportFactory::SctpTransportFactory(rtc::Thread* network_thread)
- : network_thread_(network_thread) {
+ : network_thread_(network_thread), use_dcsctp_("Enabled", false) {
RTC_UNUSED(network_thread_);
+#ifdef WEBRTC_HAVE_DCSCTP
+ webrtc::ParseFieldTrial({&use_dcsctp_}, webrtc::field_trial::FindFullName(
+ "WebRTC-DataChannel-Dcsctp"));
+#endif
}
std::unique_ptr<SctpTransportInternal>
SctpTransportFactory::CreateSctpTransport(
rtc::PacketTransportInternal* transport) {
std::unique_ptr<SctpTransportInternal> result;
+#ifdef WEBRTC_HAVE_DCSCTP
+ if (use_dcsctp_.Get()) {
+ result = std::unique_ptr<SctpTransportInternal>(new webrtc::DcSctpTransport(
+ network_thread_, transport, webrtc::Clock::GetRealTimeClock()));
+ }
+#endif
#ifdef WEBRTC_HAVE_USRSCTP
if (!result) {
result = std::unique_ptr<SctpTransportInternal>(