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

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

Issue 2637783003: Move congestion controller processing to the pacer thread. (Closed)
Patch Set: Reorder calls in CongestionController::Process. 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 unified diff | Download patch
« no previous file with comments | « webrtc/call/call.cc ('k') | webrtc/modules/pacing/alr_detector.cc » ('j') | 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 (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 309 matching lines...) Expand 10 before | Expand all | Expand 10 after
320 transport_feedback_adapter_.OnSentPacket(sent_packet.packet_id, 320 transport_feedback_adapter_.OnSentPacket(sent_packet.packet_id,
321 sent_packet.send_time_ms); 321 sent_packet.send_time_ms);
322 } 322 }
323 323
324 void CongestionController::OnRttUpdate(int64_t avg_rtt_ms, int64_t max_rtt_ms) { 324 void CongestionController::OnRttUpdate(int64_t avg_rtt_ms, int64_t max_rtt_ms) {
325 remote_bitrate_estimator_->OnRttUpdate(avg_rtt_ms, max_rtt_ms); 325 remote_bitrate_estimator_->OnRttUpdate(avg_rtt_ms, max_rtt_ms);
326 transport_feedback_adapter_.OnRttUpdate(avg_rtt_ms, max_rtt_ms); 326 transport_feedback_adapter_.OnRttUpdate(avg_rtt_ms, max_rtt_ms);
327 } 327 }
328 328
329 int64_t CongestionController::TimeUntilNextProcess() { 329 int64_t CongestionController::TimeUntilNextProcess() {
330 return std::min(bitrate_controller_->TimeUntilNextProcess(), 330 return std::min({bitrate_controller_->TimeUntilNextProcess(),
331 remote_bitrate_estimator_->TimeUntilNextProcess()); 331 remote_bitrate_estimator_->TimeUntilNextProcess(),
332 pacer_->TimeUntilNextProcess(),
333 remote_estimator_proxy_.TimeUntilNextProcess()});
332 } 334 }
333 335
334 void CongestionController::Process() { 336 void CongestionController::Process() {
335 bitrate_controller_->Process(); 337 bitrate_controller_->Process();
336 remote_bitrate_estimator_->Process(); 338 remote_bitrate_estimator_->Process();
339 MaybeTriggerOnNetworkChanged();
337 probe_controller_->Process(); 340 probe_controller_->Process();
338 MaybeTriggerOnNetworkChanged(); 341 pacer_->Process();
342 remote_estimator_proxy_.Process();
339 } 343 }
340 344
341 void CongestionController::MaybeTriggerOnNetworkChanged() { 345 void CongestionController::MaybeTriggerOnNetworkChanged() {
342 // TODO(perkj): |observer_| can be nullptr if the ctor that accepts a 346 // TODO(perkj): |observer_| can be nullptr if the ctor that accepts a
343 // BitrateObserver is used. Remove this check once the ctor is removed. 347 // BitrateObserver is used. Remove this check once the ctor is removed.
344 if (!observer_) 348 if (!observer_)
345 return; 349 return;
346 350
347 uint32_t bitrate_bps; 351 uint32_t bitrate_bps;
348 uint8_t fraction_loss; 352 uint8_t fraction_loss;
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
387 bool CongestionController::IsSendQueueFull() const { 391 bool CongestionController::IsSendQueueFull() const {
388 return pacer_->ExpectedQueueTimeMs() > PacedSender::kMaxQueueLengthMs; 392 return pacer_->ExpectedQueueTimeMs() > PacedSender::kMaxQueueLengthMs;
389 } 393 }
390 394
391 bool CongestionController::IsNetworkDown() const { 395 bool CongestionController::IsNetworkDown() const {
392 rtc::CritScope cs(&critsect_); 396 rtc::CritScope cs(&critsect_);
393 return network_state_ == kNetworkDown; 397 return network_state_ == kNetworkDown;
394 } 398 }
395 399
396 } // namespace webrtc 400 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/call/call.cc ('k') | webrtc/modules/pacing/alr_detector.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698