Index: webrtc/api/webrtcsession.cc |
diff --git a/webrtc/api/webrtcsession.cc b/webrtc/api/webrtcsession.cc |
index 19f5aa4128aea083feaf5c3065cde77a6e52c3d9..932faa6ceb3a85570cd5b71380b95131acfd80cc 100644 |
--- a/webrtc/api/webrtcsession.cc |
+++ b/webrtc/api/webrtcsession.cc |
@@ -24,6 +24,7 @@ |
#include "webrtc/api/webrtcsessiondescriptionfactory.h" |
#include "webrtc/audio_sink.h" |
#include "webrtc/base/basictypes.h" |
+#include "webrtc/base/bind.h" |
#include "webrtc/base/checks.h" |
#include "webrtc/base/helpers.h" |
#include "webrtc/base/logging.h" |
@@ -1735,6 +1736,13 @@ void WebRtcSession::RemoveUnusedChannels(const SessionDescription* desc) { |
// TODO(mallinath) - Add a correct error code if the channels are not created |
// due to BUNDLE is enabled but rtcp-mux is disabled. |
bool WebRtcSession::CreateChannels(const SessionDescription* desc) { |
+ // TODO(mikescarlett): Allow remote peer to negotiate whether to use QUIC |
+ // or DTLS, so that the connection doesn't fail when the remote peer won't use |
+ // QUIC. Current behavior is to assume either both peers or no peers use QUIC. |
+ if (desc->quic() && !transport_controller_->quic()) { |
+ transport_controller_->set_quic(true); |
Taylor Brandstetter
2016/04/01 23:23:42
This should fail if a transport channel has alread
|
+ data_channel_type_ = cricket::DCT_QUIC; |
+ } |
// Creating the media channels and transport proxies. |
const cricket::ContentInfo* voice = cricket::GetFirstAudioContent(desc); |
if (voice && !voice->rejected && !voice_channel_) { |
@@ -1754,7 +1762,8 @@ bool WebRtcSession::CreateChannels(const SessionDescription* desc) { |
const cricket::ContentInfo* data = cricket::GetFirstDataContent(desc); |
if (data_channel_type_ != cricket::DCT_NONE && |
- data && !data->rejected && !data_channel_) { |
+ data_channel_type_ != cricket::DCT_QUIC && data && !data->rejected && |
+ !data_channel_) { |
if (!CreateDataChannel(data)) { |
LOG(LS_ERROR) << "Failed to create data channel."; |
return false; |
@@ -1825,6 +1834,10 @@ bool WebRtcSession::CreateVideoChannel(const cricket::ContentInfo* content) { |
} |
bool WebRtcSession::CreateDataChannel(const cricket::ContentInfo* content) { |
+ if (data_channel_type_ == cricket::DCT_QUIC) { |
+ transport_controller_->CreateTransportChannel_w(content->name, 0); |
+ return true; |
+ } |
bool sctp = (data_channel_type_ == cricket::DCT_SCTP); |
data_channel_.reset(channel_manager_->CreateDataChannel( |
transport_controller_.get(), content->name, !sctp, data_channel_type_)); |
@@ -2166,4 +2179,8 @@ void WebRtcSession::OnSentPacket_w(cricket::TransportChannel* channel, |
media_controller_->call_w()->OnSentPacket(sent_packet); |
} |
+cricket::QuicTransportChannel* WebRtcSession::quic_transport_channel() const { |
+ return transport_controller_->quic_transport_channel(); |
+} |
pthatcher1
2016/03/30 20:34:49
And does this need the ifdef as well?
|
+ |
} // namespace webrtc |