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

Side by Side Diff: webrtc/pc/channel.cc

Issue 1972493002: Do not create a temporary transport channel when using max-bundle (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 7 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright 2004 The WebRTC project authors. All Rights Reserved. 2 * Copyright 2004 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 transport_name_, cricket::ICE_CANDIDATE_COMPONENT_RTP); 188 transport_name_, cricket::ICE_CANDIDATE_COMPONENT_RTP);
189 } 189 }
190 if (rtcp_transport_channel_) { 190 if (rtcp_transport_channel_) {
191 DisconnectFromTransportChannel(rtcp_transport_channel_); 191 DisconnectFromTransportChannel(rtcp_transport_channel_);
192 transport_controller_->DestroyTransportChannel_w( 192 transport_controller_->DestroyTransportChannel_w(
193 transport_name_, cricket::ICE_CANDIDATE_COMPONENT_RTCP); 193 transport_name_, cricket::ICE_CANDIDATE_COMPONENT_RTCP);
194 } 194 }
195 LOG(LS_INFO) << "Destroyed channel"; 195 LOG(LS_INFO) << "Destroyed channel";
196 } 196 }
197 197
198 bool BaseChannel::Init() { 198 bool BaseChannel::Init(const std::string& transport_name) {
199 if (!SetTransport(content_name())) { 199 if (!SetTransport(transport_name)) {
200 return false; 200 return false;
201 } 201 }
202 202
203 if (!SetDtlsSrtpCryptoSuites(transport_channel(), false)) { 203 if (!SetDtlsSrtpCryptoSuites(transport_channel(), false)) {
204 return false; 204 return false;
205 } 205 }
206 if (rtcp_transport_enabled() && 206 if (rtcp_transport_enabled() &&
207 !SetDtlsSrtpCryptoSuites(rtcp_transport_channel(), true)) { 207 !SetDtlsSrtpCryptoSuites(rtcp_transport_channel(), true)) {
208 return false; 208 return false;
209 } 209 }
(...skipping 1129 matching lines...) Expand 10 before | Expand all | Expand 10 after
1339 1339
1340 VoiceChannel::~VoiceChannel() { 1340 VoiceChannel::~VoiceChannel() {
1341 TRACE_EVENT0("webrtc", "VoiceChannel::~VoiceChannel"); 1341 TRACE_EVENT0("webrtc", "VoiceChannel::~VoiceChannel");
1342 StopAudioMonitor(); 1342 StopAudioMonitor();
1343 StopMediaMonitor(); 1343 StopMediaMonitor();
1344 // this can't be done in the base class, since it calls a virtual 1344 // this can't be done in the base class, since it calls a virtual
1345 DisableMedia_w(); 1345 DisableMedia_w();
1346 Deinit(); 1346 Deinit();
1347 } 1347 }
1348 1348
1349 bool VoiceChannel::Init() { 1349 bool VoiceChannel::Init(const std::string& transport_name) {
1350 if (!BaseChannel::Init()) { 1350 if (!BaseChannel::Init(transport_name)) {
1351 return false; 1351 return false;
1352 } 1352 }
1353 return true; 1353 return true;
1354 } 1354 }
1355 1355
1356 bool VoiceChannel::SetAudioSend(uint32_t ssrc, 1356 bool VoiceChannel::SetAudioSend(uint32_t ssrc,
1357 bool enable, 1357 bool enable,
1358 const AudioOptions* options, 1358 const AudioOptions* options,
1359 AudioSource* source) { 1359 AudioSource* source) {
1360 return InvokeOnWorker(Bind(&VoiceMediaChannel::SetAudioSend, media_channel(), 1360 return InvokeOnWorker(Bind(&VoiceMediaChannel::SetAudioSend, media_channel(),
(...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after
1660 VideoMediaChannel* media_channel, 1660 VideoMediaChannel* media_channel,
1661 TransportController* transport_controller, 1661 TransportController* transport_controller,
1662 const std::string& content_name, 1662 const std::string& content_name,
1663 bool rtcp) 1663 bool rtcp)
1664 : BaseChannel(thread, 1664 : BaseChannel(thread,
1665 media_channel, 1665 media_channel,
1666 transport_controller, 1666 transport_controller,
1667 content_name, 1667 content_name,
1668 rtcp) {} 1668 rtcp) {}
1669 1669
1670 bool VideoChannel::Init() { 1670 bool VideoChannel::Init(const std::string& transport_name) {
1671 if (!BaseChannel::Init()) { 1671 if (!BaseChannel::Init(transport_name)) {
1672 return false; 1672 return false;
1673 } 1673 }
1674 return true; 1674 return true;
1675 } 1675 }
1676 1676
1677 VideoChannel::~VideoChannel() { 1677 VideoChannel::~VideoChannel() {
1678 TRACE_EVENT0("webrtc", "VideoChannel::~VideoChannel"); 1678 TRACE_EVENT0("webrtc", "VideoChannel::~VideoChannel");
1679 StopMediaMonitor(); 1679 StopMediaMonitor();
1680 // this can't be done in the base class, since it calls a virtual 1680 // this can't be done in the base class, since it calls a virtual
1681 DisableMedia_w(); 1681 DisableMedia_w();
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after
1904 1904
1905 DataChannel::~DataChannel() { 1905 DataChannel::~DataChannel() {
1906 TRACE_EVENT0("webrtc", "DataChannel::~DataChannel"); 1906 TRACE_EVENT0("webrtc", "DataChannel::~DataChannel");
1907 StopMediaMonitor(); 1907 StopMediaMonitor();
1908 // this can't be done in the base class, since it calls a virtual 1908 // this can't be done in the base class, since it calls a virtual
1909 DisableMedia_w(); 1909 DisableMedia_w();
1910 1910
1911 Deinit(); 1911 Deinit();
1912 } 1912 }
1913 1913
1914 bool DataChannel::Init() { 1914 bool DataChannel::Init(const std::string& transport_name) {
1915 if (!BaseChannel::Init()) { 1915 if (!BaseChannel::Init(transport_name)) {
1916 return false; 1916 return false;
1917 } 1917 }
1918 media_channel()->SignalDataReceived.connect( 1918 media_channel()->SignalDataReceived.connect(
1919 this, &DataChannel::OnDataReceived); 1919 this, &DataChannel::OnDataReceived);
1920 media_channel()->SignalReadyToSend.connect( 1920 media_channel()->SignalReadyToSend.connect(
1921 this, &DataChannel::OnDataChannelReadyToSend); 1921 this, &DataChannel::OnDataChannelReadyToSend);
1922 media_channel()->SignalStreamClosedRemotely.connect( 1922 media_channel()->SignalStreamClosedRemotely.connect(
1923 this, &DataChannel::OnStreamClosedRemotely); 1923 this, &DataChannel::OnStreamClosedRemotely);
1924 return true; 1924 return true;
1925 } 1925 }
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after
2203 return (data_channel_type_ == DCT_RTP) && BaseChannel::ShouldSetupDtlsSrtp(); 2203 return (data_channel_type_ == DCT_RTP) && BaseChannel::ShouldSetupDtlsSrtp();
2204 } 2204 }
2205 2205
2206 void DataChannel::OnStreamClosedRemotely(uint32_t sid) { 2206 void DataChannel::OnStreamClosedRemotely(uint32_t sid) {
2207 rtc::TypedMessageData<uint32_t>* message = 2207 rtc::TypedMessageData<uint32_t>* message =
2208 new rtc::TypedMessageData<uint32_t>(sid); 2208 new rtc::TypedMessageData<uint32_t>(sid);
2209 signaling_thread()->Post(this, MSG_STREAMCLOSEDREMOTELY, message); 2209 signaling_thread()->Post(this, MSG_STREAMCLOSEDREMOTELY, message);
2210 } 2210 }
2211 2211
2212 } // namespace cricket 2212 } // namespace cricket
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698