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

Side by Side Diff: webrtc/modules/congestion_controller/congestion_controller.cc

Issue 2755553003: Ignore packets sent on old network route when receiving feedback. (Closed)
Patch Set: Comments addressed. Created 3 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
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2012 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 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
214 min_bitrate_bps_ = min_bitrate_bps; 214 min_bitrate_bps_ = min_bitrate_bps;
215 { 215 {
216 rtc::CritScope cs(&bwe_lock_); 216 rtc::CritScope cs(&bwe_lock_);
217 if (start_bitrate_bps > 0) 217 if (start_bitrate_bps > 0)
218 delay_based_bwe_->SetStartBitrate(start_bitrate_bps); 218 delay_based_bwe_->SetStartBitrate(start_bitrate_bps);
219 delay_based_bwe_->SetMinBitrate(min_bitrate_bps_); 219 delay_based_bwe_->SetMinBitrate(min_bitrate_bps_);
220 } 220 }
221 MaybeTriggerOnNetworkChanged(); 221 MaybeTriggerOnNetworkChanged();
222 } 222 }
223 223
224 void CongestionController::ResetBweAndBitrates(int bitrate_bps, 224 // TODO(holmer): Split this up and use SetBweBitrates in combination with
225 int min_bitrate_bps, 225 // OnNetworkRouteChanged.
226 int max_bitrate_bps) { 226 void CongestionController::OnNetworkRouteChanged(
227 const rtc::NetworkRoute& network_route,
228 int bitrate_bps,
229 int min_bitrate_bps,
230 int max_bitrate_bps) {
227 ClampBitrates(&bitrate_bps, &min_bitrate_bps, &max_bitrate_bps); 231 ClampBitrates(&bitrate_bps, &min_bitrate_bps, &max_bitrate_bps);
228 // TODO(honghaiz): Recreate this object once the bitrate controller is 232 // TODO(honghaiz): Recreate this object once the bitrate controller is
229 // no longer exposed outside CongestionController. 233 // no longer exposed outside CongestionController.
230 bitrate_controller_->ResetBitrates(bitrate_bps, min_bitrate_bps, 234 bitrate_controller_->ResetBitrates(bitrate_bps, min_bitrate_bps,
231 max_bitrate_bps); 235 max_bitrate_bps);
232 min_bitrate_bps_ = min_bitrate_bps; 236 min_bitrate_bps_ = min_bitrate_bps;
233 max_bitrate_bps_ = max_bitrate_bps; 237 max_bitrate_bps_ = max_bitrate_bps;
234 // TODO(honghaiz): Recreate this object once the remote bitrate estimator is 238 // TODO(honghaiz): Recreate this object once the remote bitrate estimator is
235 // no longer exposed outside CongestionController. 239 // no longer exposed outside CongestionController.
236 remote_bitrate_estimator_.SetMinBitrate(min_bitrate_bps); 240 remote_bitrate_estimator_.SetMinBitrate(min_bitrate_bps);
237 241
238 transport_feedback_adapter_.ClearSendTimeHistory(); 242 transport_feedback_adapter_.SetNetworkIds(network_route.local_network_id,
243 network_route.remote_network_id);
239 { 244 {
240 rtc::CritScope cs(&bwe_lock_); 245 rtc::CritScope cs(&bwe_lock_);
241 delay_based_bwe_.reset(new DelayBasedBwe(event_log_, clock_)); 246 delay_based_bwe_.reset(new DelayBasedBwe(event_log_, clock_));
242 delay_based_bwe_->SetStartBitrate(bitrate_bps); 247 delay_based_bwe_->SetStartBitrate(bitrate_bps);
243 delay_based_bwe_->SetMinBitrate(min_bitrate_bps); 248 delay_based_bwe_->SetMinBitrate(min_bitrate_bps);
244 } 249 }
245 250
246 probe_controller_->Reset(); 251 probe_controller_->Reset();
247 probe_controller_->SetBitrates(min_bitrate_bps, bitrate_bps, max_bitrate_bps); 252 probe_controller_->SetBitrates(min_bitrate_bps, bitrate_bps, max_bitrate_bps);
248 253
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
410 bool CongestionController::IsSendQueueFull() const { 415 bool CongestionController::IsSendQueueFull() const {
411 return pacer_->ExpectedQueueTimeMs() > PacedSender::kMaxQueueLengthMs; 416 return pacer_->ExpectedQueueTimeMs() > PacedSender::kMaxQueueLengthMs;
412 } 417 }
413 418
414 bool CongestionController::IsNetworkDown() const { 419 bool CongestionController::IsNetworkDown() const {
415 rtc::CritScope cs(&network_state_lock_); 420 rtc::CritScope cs(&network_state_lock_);
416 return network_state_ == kNetworkDown; 421 return network_state_ == kNetworkDown;
417 } 422 }
418 423
419 } // namespace webrtc 424 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/call/call.cc ('k') | webrtc/modules/congestion_controller/congestion_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698