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

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

Issue 1803063004: Reset the BWE when the network changes (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Created 4 years, 9 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
« webrtc/p2p/quic/quictransportchannel.h ('K') | « webrtc/pc/channel.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 328 matching lines...) Expand 10 before | Expand all | Expand 10 after
339 } 339 }
340 } 340 }
341 341
342 void BaseChannel::ConnectToTransportChannel(TransportChannel* tc) { 342 void BaseChannel::ConnectToTransportChannel(TransportChannel* tc) {
343 ASSERT(worker_thread_ == rtc::Thread::Current()); 343 ASSERT(worker_thread_ == rtc::Thread::Current());
344 344
345 tc->SignalWritableState.connect(this, &BaseChannel::OnWritableState); 345 tc->SignalWritableState.connect(this, &BaseChannel::OnWritableState);
346 tc->SignalReadPacket.connect(this, &BaseChannel::OnChannelRead); 346 tc->SignalReadPacket.connect(this, &BaseChannel::OnChannelRead);
347 tc->SignalReadyToSend.connect(this, &BaseChannel::OnReadyToSend); 347 tc->SignalReadyToSend.connect(this, &BaseChannel::OnReadyToSend);
348 tc->SignalDtlsState.connect(this, &BaseChannel::OnDtlsState); 348 tc->SignalDtlsState.connect(this, &BaseChannel::OnDtlsState);
349 tc->SignalNetworkChanged.connect(this, &BaseChannel::OnNetworkChanged);
349 } 350 }
350 351
351 void BaseChannel::DisconnectFromTransportChannel(TransportChannel* tc) { 352 void BaseChannel::DisconnectFromTransportChannel(TransportChannel* tc) {
352 ASSERT(worker_thread_ == rtc::Thread::Current()); 353 ASSERT(worker_thread_ == rtc::Thread::Current());
353 354
354 tc->SignalWritableState.disconnect(this); 355 tc->SignalWritableState.disconnect(this);
355 tc->SignalReadPacket.disconnect(this); 356 tc->SignalReadPacket.disconnect(this);
356 tc->SignalReadyToSend.disconnect(this); 357 tc->SignalReadyToSend.disconnect(this);
357 tc->SignalDtlsState.disconnect(this); 358 tc->SignalDtlsState.disconnect(this);
358 } 359 }
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
497 // Reset the srtp filter if it's not the CONNECTED state. For the CONNECTED 498 // Reset the srtp filter if it's not the CONNECTED state. For the CONNECTED
498 // state, setting up DTLS-SRTP context is deferred to ChannelWritable_w to 499 // state, setting up DTLS-SRTP context is deferred to ChannelWritable_w to
499 // cover other scenarios like the whole channel is writable (not just this 500 // cover other scenarios like the whole channel is writable (not just this
500 // TransportChannel) or when TransportChannel is attached after DTLS is 501 // TransportChannel) or when TransportChannel is attached after DTLS is
501 // negotiated. 502 // negotiated.
502 if (state != DTLS_TRANSPORT_CONNECTED) { 503 if (state != DTLS_TRANSPORT_CONNECTED) {
503 srtp_filter_.ResetParams(); 504 srtp_filter_.ResetParams();
504 } 505 }
505 } 506 }
506 507
508 void BaseChannel::OnNetworkChanged(TransportChannel* channel,
509 int local_network_id,
510 int remote_network_id) {
511 ASSERT(channel == transport_channel_ || channel == rtcp_transport_channel_);
512 media_channel()->OnNetworkChanged(local_network_id, remote_network_id);
513 }
514
507 void BaseChannel::SetReadyToSend(bool rtcp, bool ready) { 515 void BaseChannel::SetReadyToSend(bool rtcp, bool ready) {
508 if (rtcp) { 516 if (rtcp) {
509 rtcp_ready_to_send_ = ready; 517 rtcp_ready_to_send_ = ready;
510 } else { 518 } else {
511 rtp_ready_to_send_ = ready; 519 rtp_ready_to_send_ = ready;
512 } 520 }
513 521
514 if (rtp_ready_to_send_ && 522 if (rtp_ready_to_send_ &&
515 // In the case of rtcp mux |rtcp_transport_channel_| will be null. 523 // In the case of rtcp mux |rtcp_transport_channel_| will be null.
516 (rtcp_ready_to_send_ || !rtcp_transport_channel_)) { 524 (rtcp_ready_to_send_ || !rtcp_transport_channel_)) {
(...skipping 1621 matching lines...) Expand 10 before | Expand all | Expand 10 after
2138 return (data_channel_type_ == DCT_RTP) && BaseChannel::ShouldSetupDtlsSrtp(); 2146 return (data_channel_type_ == DCT_RTP) && BaseChannel::ShouldSetupDtlsSrtp();
2139 } 2147 }
2140 2148
2141 void DataChannel::OnStreamClosedRemotely(uint32_t sid) { 2149 void DataChannel::OnStreamClosedRemotely(uint32_t sid) {
2142 rtc::TypedMessageData<uint32_t>* message = 2150 rtc::TypedMessageData<uint32_t>* message =
2143 new rtc::TypedMessageData<uint32_t>(sid); 2151 new rtc::TypedMessageData<uint32_t>(sid);
2144 signaling_thread()->Post(this, MSG_STREAMCLOSEDREMOTELY, message); 2152 signaling_thread()->Post(this, MSG_STREAMCLOSEDREMOTELY, message);
2145 } 2153 }
2146 2154
2147 } // namespace cricket 2155 } // namespace cricket
OLDNEW
« webrtc/p2p/quic/quictransportchannel.h ('K') | « webrtc/pc/channel.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698