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

Unified Diff: webrtc/api/webrtcsession.cc

Issue 2626023005: Revert of Refactoring of RTCP options in BaseChannel. (Closed)
Patch Set: 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
« no previous file with comments | « webrtc/api/webrtcsession.h ('k') | webrtc/pc/channel.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/api/webrtcsession.cc
diff --git a/webrtc/api/webrtcsession.cc b/webrtc/api/webrtcsession.cc
index 30a0a7c25ef955e9d2c9cc3f20e4a4ff8ccd0f09..aa172cef3719155f8080e5139dc1f3dc08cf41d4 100644
--- a/webrtc/api/webrtcsession.cc
+++ b/webrtc/api/webrtcsession.cc
@@ -1787,6 +1787,7 @@
const std::string* bundle_transport) {
bool require_rtcp_mux =
rtcp_mux_policy_ == PeerConnectionInterface::kRtcpMuxPolicyRequire;
+ bool create_rtcp_transport_channel = !require_rtcp_mux;
std::string transport_name =
bundle_transport ? *bundle_transport : content->name;
@@ -1795,7 +1796,7 @@
transport_controller_->CreateTransportChannel(
transport_name, cricket::ICE_CANDIDATE_COMPONENT_RTP);
cricket::TransportChannel* rtcp_transport = nullptr;
- if (!require_rtcp_mux) {
+ if (create_rtcp_transport_channel) {
rtcp_transport = transport_controller_->CreateTransportChannel(
transport_name, cricket::ICE_CANDIDATE_COMPONENT_RTCP);
}
@@ -1803,13 +1804,18 @@
voice_channel_.reset(channel_manager_->CreateVoiceChannel(
media_controller_, rtp_transport, rtcp_transport,
transport_controller_->signaling_thread(), content->name,
- bundle_transport, require_rtcp_mux, SrtpRequired(), audio_options_));
+ bundle_transport, create_rtcp_transport_channel, SrtpRequired(),
+ audio_options_));
if (!voice_channel_) {
return false;
}
- voice_channel_->SignalRtcpMuxFullyActive.connect(
- this, &WebRtcSession::DestroyRtcpTransport_n);
+ voice_channel_->SignalDestroyRtcpTransport.connect(
+ this, &WebRtcSession::OnDestroyRtcpTransport_n);
+ if (require_rtcp_mux) {
+ voice_channel_->ActivateRtcpMux();
+ }
+
voice_channel_->SignalDtlsSrtpSetupFailure.connect(
this, &WebRtcSession::OnDtlsSrtpSetupFailure);
@@ -1823,6 +1829,7 @@
const std::string* bundle_transport) {
bool require_rtcp_mux =
rtcp_mux_policy_ == PeerConnectionInterface::kRtcpMuxPolicyRequire;
+ bool create_rtcp_transport_channel = !require_rtcp_mux;
std::string transport_name =
bundle_transport ? *bundle_transport : content->name;
@@ -1831,7 +1838,7 @@
transport_controller_->CreateTransportChannel(
transport_name, cricket::ICE_CANDIDATE_COMPONENT_RTP);
cricket::TransportChannel* rtcp_transport = nullptr;
- if (!require_rtcp_mux) {
+ if (create_rtcp_transport_channel) {
rtcp_transport = transport_controller_->CreateTransportChannel(
transport_name, cricket::ICE_CANDIDATE_COMPONENT_RTCP);
}
@@ -1839,14 +1846,18 @@
video_channel_.reset(channel_manager_->CreateVideoChannel(
media_controller_, rtp_transport, rtcp_transport,
transport_controller_->signaling_thread(), content->name,
- bundle_transport, require_rtcp_mux, SrtpRequired(), video_options_));
+ bundle_transport, create_rtcp_transport_channel, SrtpRequired(),
+ video_options_));
if (!video_channel_) {
return false;
}
- video_channel_->SignalRtcpMuxFullyActive.connect(
- this, &WebRtcSession::DestroyRtcpTransport_n);
+ video_channel_->SignalDestroyRtcpTransport.connect(
+ this, &WebRtcSession::OnDestroyRtcpTransport_n);
+ if (require_rtcp_mux) {
+ video_channel_->ActivateRtcpMux();
+ }
video_channel_->SignalDtlsSrtpSetupFailure.connect(
this, &WebRtcSession::OnDtlsSrtpSetupFailure);
@@ -1883,6 +1894,7 @@
} else {
bool require_rtcp_mux =
rtcp_mux_policy_ == PeerConnectionInterface::kRtcpMuxPolicyRequire;
+ bool create_rtcp_transport_channel = !sctp && !require_rtcp_mux;
std::string transport_name =
bundle_transport ? *bundle_transport : content->name;
@@ -1890,7 +1902,7 @@
transport_controller_->CreateTransportChannel(
transport_name, cricket::ICE_CANDIDATE_COMPONENT_RTP);
cricket::TransportChannel* rtcp_transport = nullptr;
- if (!require_rtcp_mux) {
+ if (create_rtcp_transport_channel) {
rtcp_transport = transport_controller_->CreateTransportChannel(
transport_name, cricket::ICE_CANDIDATE_COMPONENT_RTCP);
}
@@ -1898,14 +1910,18 @@
rtp_data_channel_.reset(channel_manager_->CreateRtpDataChannel(
media_controller_, rtp_transport, rtcp_transport,
transport_controller_->signaling_thread(), content->name,
- bundle_transport, require_rtcp_mux, SrtpRequired()));
+ bundle_transport, create_rtcp_transport_channel, SrtpRequired()));
if (!rtp_data_channel_) {
return false;
}
- rtp_data_channel_->SignalRtcpMuxFullyActive.connect(
- this, &WebRtcSession::DestroyRtcpTransport_n);
+ rtp_data_channel_->SignalDestroyRtcpTransport.connect(
+ this, &WebRtcSession::OnDestroyRtcpTransport_n);
+
+ if (require_rtcp_mux) {
+ rtp_data_channel_->ActivateRtcpMux();
+ }
rtp_data_channel_->SignalDtlsSrtpSetupFailure.connect(
this, &WebRtcSession::OnDtlsSrtpSetupFailure);
rtp_data_channel_->SignalSentPacket.connect(this,
@@ -2373,7 +2389,8 @@
transport_controller_.get(), transport_name, component));
}
-void WebRtcSession::DestroyRtcpTransport_n(const std::string& transport_name) {
+void WebRtcSession::OnDestroyRtcpTransport_n(
+ const std::string& transport_name) {
ASSERT(network_thread()->IsCurrent());
transport_controller_->DestroyTransportChannel_n(
transport_name, cricket::ICE_CANDIDATE_COMPONENT_RTCP);
« no previous file with comments | « webrtc/api/webrtcsession.h ('k') | webrtc/pc/channel.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698