Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(139)

Unified Diff: webrtc/api/webrtcsession.cc

Issue 2606123002: Remove the dependency of TransportChannel and TransportChannelImpl. (Closed)
Patch Set: Fix the format. Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: webrtc/api/webrtcsession.cc
diff --git a/webrtc/api/webrtcsession.cc b/webrtc/api/webrtcsession.cc
index a0c72c853ec6a54a4e92e052ec4e15e1c560b634..3b82a633dcad19c7515d860e2ae0a008fb5e3c3d 100644
--- a/webrtc/api/webrtcsession.cc
+++ b/webrtc/api/webrtcsession.cc
@@ -35,7 +35,6 @@
#include "webrtc/media/base/videocapturer.h"
#include "webrtc/media/sctp/sctptransportinternal.h"
#include "webrtc/p2p/base/portallocator.h"
-#include "webrtc/p2p/base/transportchannel.h"
#include "webrtc/pc/channel.h"
#include "webrtc/pc/channelmanager.h"
#include "webrtc/pc/mediasession.h"
@@ -1082,17 +1081,17 @@ bool WebRtcSession::EnableBundle(const cricket::ContentGroup& bundle) {
return true;
}
- cricket::TransportChannel* rtp_transport =
- transport_controller_->CreateTransportChannel(
+ cricket::DtlsTransportInternal* rtp_dtls_transport =
+ transport_controller_->CreateDtlsTransport(
transport_name, cricket::ICE_CANDIDATE_COMPONENT_RTP);
- bool need_rtcp = (ch->rtcp_transport() != nullptr);
- cricket::TransportChannel* rtcp_transport = nullptr;
+ bool need_rtcp = (ch->rtcp_dtls_transport() != nullptr);
+ cricket::DtlsTransportInternal* rtcp_dtls_transport = nullptr;
if (need_rtcp) {
- rtcp_transport = transport_controller_->CreateTransportChannel_n(
+ rtcp_dtls_transport = transport_controller_->CreateDtlsTransport_n(
transport_name, cricket::ICE_CANDIDATE_COMPONENT_RTCP);
}
- if (!ch->SetTransport(rtp_transport, rtcp_transport)) {
+ if (!ch->SetTransports(rtp_dtls_transport, rtcp_dtls_transport)) {
LOG(LS_WARNING) << "Failed to enable BUNDLE for " << ch->content_name();
return false;
}
@@ -1791,17 +1790,17 @@ bool WebRtcSession::CreateVoiceChannel(const cricket::ContentInfo* content,
std::string transport_name =
bundle_transport ? *bundle_transport : content->name;
- cricket::TransportChannel* rtp_transport =
- transport_controller_->CreateTransportChannel(
+ cricket::DtlsTransportInternal* rtp_dtls_transport =
+ transport_controller_->CreateDtlsTransport(
transport_name, cricket::ICE_CANDIDATE_COMPONENT_RTP);
- cricket::TransportChannel* rtcp_transport = nullptr;
+ cricket::DtlsTransportInternal* rtcp_dtls_transport = nullptr;
if (!require_rtcp_mux) {
- rtcp_transport = transport_controller_->CreateTransportChannel(
+ rtcp_dtls_transport = transport_controller_->CreateDtlsTransport(
transport_name, cricket::ICE_CANDIDATE_COMPONENT_RTCP);
}
voice_channel_.reset(channel_manager_->CreateVoiceChannel(
- media_controller_, rtp_transport, rtcp_transport,
+ media_controller_, rtp_dtls_transport, rtcp_dtls_transport,
transport_controller_->signaling_thread(), content->name,
bundle_transport, require_rtcp_mux, SrtpRequired(), audio_options_));
if (!voice_channel_) {
@@ -1827,17 +1826,17 @@ bool WebRtcSession::CreateVideoChannel(const cricket::ContentInfo* content,
std::string transport_name =
bundle_transport ? *bundle_transport : content->name;
- cricket::TransportChannel* rtp_transport =
- transport_controller_->CreateTransportChannel(
+ cricket::DtlsTransportInternal* rtp_dtls_transport =
+ transport_controller_->CreateDtlsTransport(
transport_name, cricket::ICE_CANDIDATE_COMPONENT_RTP);
- cricket::TransportChannel* rtcp_transport = nullptr;
+ cricket::DtlsTransportInternal* rtcp_dtls_transport = nullptr;
if (!require_rtcp_mux) {
- rtcp_transport = transport_controller_->CreateTransportChannel(
+ rtcp_dtls_transport = transport_controller_->CreateDtlsTransport(
transport_name, cricket::ICE_CANDIDATE_COMPONENT_RTCP);
}
video_channel_.reset(channel_manager_->CreateVideoChannel(
- media_controller_, rtp_transport, rtcp_transport,
+ media_controller_, rtp_dtls_transport, rtcp_dtls_transport,
transport_controller_->signaling_thread(), content->name,
bundle_transport, require_rtcp_mux, SrtpRequired(), video_options_));
@@ -1863,7 +1862,7 @@ bool WebRtcSession::CreateDataChannel(const cricket::ContentInfo* content,
#ifdef HAVE_QUIC
if (data_channel_type_ == cricket::DCT_QUIC) {
RTC_DCHECK(transport_controller_->quic());
- quic_data_transport_->SetTransport(transport_name);
+ quic_data_transport_->SetTransports(transport_name);
return true;
}
#endif // HAVE_QUIC
@@ -1886,17 +1885,17 @@ bool WebRtcSession::CreateDataChannel(const cricket::ContentInfo* content,
std::string transport_name =
bundle_transport ? *bundle_transport : content->name;
- cricket::TransportChannel* rtp_transport =
- transport_controller_->CreateTransportChannel(
+ cricket::DtlsTransportInternal* rtp_dtls_transport =
+ transport_controller_->CreateDtlsTransport(
transport_name, cricket::ICE_CANDIDATE_COMPONENT_RTP);
- cricket::TransportChannel* rtcp_transport = nullptr;
+ cricket::DtlsTransportInternal* rtcp_dtls_transport = nullptr;
if (!require_rtcp_mux) {
- rtcp_transport = transport_controller_->CreateTransportChannel(
+ rtcp_dtls_transport = transport_controller_->CreateDtlsTransport(
transport_name, cricket::ICE_CANDIDATE_COMPONENT_RTCP);
}
rtp_data_channel_.reset(channel_manager_->CreateRtpDataChannel(
- media_controller_, rtp_transport, rtcp_transport,
+ media_controller_, rtp_dtls_transport, rtcp_dtls_transport,
transport_controller_->signaling_thread(), content->name,
bundle_transport, require_rtcp_mux, SrtpRequired()));
@@ -1943,8 +1942,8 @@ bool WebRtcSession::CreateSctpTransport_n(const std::string& content_name,
const std::string& transport_name) {
RTC_DCHECK(network_thread_->IsCurrent());
RTC_DCHECK(sctp_factory_);
- cricket::TransportChannel* tc =
- transport_controller_->CreateTransportChannel_n(
+ cricket::DtlsTransportInternal* tc =
+ transport_controller_->CreateDtlsTransport_n(
transport_name, cricket::ICE_CANDIDATE_COMPONENT_RTP);
sctp_transport_ = sctp_factory_->CreateSctpTransport(tc);
RTC_DCHECK(sctp_transport_);
@@ -1966,11 +1965,11 @@ void WebRtcSession::ChangeSctpTransport_n(const std::string& transport_name) {
RTC_DCHECK(sctp_transport_name_);
std::string old_sctp_transport_name = *sctp_transport_name_;
sctp_transport_name_ = rtc::Optional<std::string>(transport_name);
- cricket::TransportChannel* tc =
- transport_controller_->CreateTransportChannel_n(
+ cricket::DtlsTransportInternal* tc =
+ transport_controller_->CreateDtlsTransport_n(
transport_name, cricket::ICE_CANDIDATE_COMPONENT_RTP);
sctp_transport_->SetTransportChannel(tc);
- transport_controller_->DestroyTransportChannel_n(
+ transport_controller_->DestroyDtlsTransport_n(
old_sctp_transport_name, cricket::ICE_CANDIDATE_COMPONENT_RTP);
}
@@ -2369,22 +2368,22 @@ void WebRtcSession::DestroyTransport(const std::string& transport_name,
int component) {
network_thread_->Invoke<void>(
RTC_FROM_HERE,
- rtc::Bind(&cricket::TransportController::DestroyTransportChannel_n,
+ rtc::Bind(&cricket::TransportController::DestroyDtlsTransport_n,
transport_controller_.get(), transport_name, component));
}
void WebRtcSession::DestroyRtcpTransport_n(const std::string& transport_name) {
RTC_DCHECK(network_thread()->IsCurrent());
- transport_controller_->DestroyTransportChannel_n(
+ transport_controller_->DestroyDtlsTransport_n(
transport_name, cricket::ICE_CANDIDATE_COMPONENT_RTCP);
}
void WebRtcSession::DestroyVideoChannel() {
SignalVideoChannelDestroyed();
- RTC_DCHECK(video_channel_->rtp_transport());
+ RTC_DCHECK(video_channel_->rtp_dtls_transport());
std::string transport_name;
- transport_name = video_channel_->rtp_transport()->transport_name();
- bool need_to_delete_rtcp = (video_channel_->rtcp_transport() != nullptr);
+ transport_name = video_channel_->rtp_dtls_transport()->transport_name();
+ bool need_to_delete_rtcp = (video_channel_->rtcp_dtls_transport() != nullptr);
channel_manager_->DestroyVideoChannel(video_channel_.release());
DestroyTransport(transport_name, cricket::ICE_CANDIDATE_COMPONENT_RTP);
if (need_to_delete_rtcp) {
@@ -2394,10 +2393,10 @@ void WebRtcSession::DestroyVideoChannel() {
void WebRtcSession::DestroyVoiceChannel() {
SignalVoiceChannelDestroyed();
- RTC_DCHECK(voice_channel_->rtp_transport());
+ RTC_DCHECK(voice_channel_->rtp_dtls_transport());
std::string transport_name;
- transport_name = voice_channel_->rtp_transport()->transport_name();
- bool need_to_delete_rtcp = (voice_channel_->rtcp_transport() != nullptr);
+ transport_name = voice_channel_->rtp_dtls_transport()->transport_name();
+ bool need_to_delete_rtcp = (voice_channel_->rtcp_dtls_transport() != nullptr);
channel_manager_->DestroyVoiceChannel(voice_channel_.release());
DestroyTransport(transport_name, cricket::ICE_CANDIDATE_COMPONENT_RTP);
if (need_to_delete_rtcp) {
@@ -2407,10 +2406,11 @@ void WebRtcSession::DestroyVoiceChannel() {
void WebRtcSession::DestroyDataChannel() {
SignalDataChannelDestroyed();
- RTC_DCHECK(rtp_data_channel_->rtp_transport());
+ RTC_DCHECK(rtp_data_channel_->rtp_dtls_transport());
std::string transport_name;
- transport_name = rtp_data_channel_->rtp_transport()->transport_name();
- bool need_to_delete_rtcp = (rtp_data_channel_->rtcp_transport() != nullptr);
+ transport_name = rtp_data_channel_->rtp_dtls_transport()->transport_name();
+ bool need_to_delete_rtcp =
+ (rtp_data_channel_->rtcp_dtls_transport() != nullptr);
channel_manager_->DestroyRtpDataChannel(rtp_data_channel_.release());
DestroyTransport(transport_name, cricket::ICE_CANDIDATE_COMPONENT_RTP);
if (need_to_delete_rtcp) {

Powered by Google App Engine
This is Rietveld 408576698