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

Side by Side Diff: webrtc/modules/pacing/paced_sender.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/modules/pacing/alr_detector.cc ('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 (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 432 matching lines...) Expand 10 before | Expand all | Expand 10 after
443 // do, timestamps get messed up. 443 // do, timestamps get messed up.
444 if (packet_counter_ > 0) { 444 if (packet_counter_ > 0) {
445 int padding_needed = 445 int padding_needed =
446 static_cast<int>(is_probing ? (recommended_probe_size - bytes_sent) 446 static_cast<int>(is_probing ? (recommended_probe_size - bytes_sent)
447 : padding_budget_->bytes_remaining()); 447 : padding_budget_->bytes_remaining());
448 448
449 if (padding_needed > 0) 449 if (padding_needed > 0)
450 bytes_sent += SendPadding(padding_needed, probe_cluster_id); 450 bytes_sent += SendPadding(padding_needed, probe_cluster_id);
451 } 451 }
452 } 452 }
453 if (is_probing && bytes_sent > 0) 453 if (bytes_sent > 0) {
454 prober_->ProbeSent(clock_->TimeInMilliseconds(), bytes_sent); 454 if (is_probing)
455 alr_detector_->OnBytesSent(bytes_sent, now_us / 1000); 455 prober_->ProbeSent(clock_->TimeInMilliseconds(), bytes_sent);
456 alr_detector_->OnBytesSent(bytes_sent, now_us / 1000);
457 }
456 } 458 }
457 459
458 bool PacedSender::SendPacket(const paced_sender::Packet& packet, 460 bool PacedSender::SendPacket(const paced_sender::Packet& packet,
459 int probe_cluster_id) { 461 int probe_cluster_id) {
460 // TODO(holmer): Because of this bug issue 5307 we have to send audio 462 // TODO(holmer): Because of this bug issue 5307 we have to send audio
461 // packets even when the pacer is paused. Here we assume audio packets are 463 // packets even when the pacer is paused. Here we assume audio packets are
462 // always high priority and that they are the only high priority packets. 464 // always high priority and that they are the only high priority packets.
463 if (packet.priority != kHighPriority) { 465 if (packet.priority != kHighPriority) {
464 if (paused_) 466 if (paused_)
465 return false; 467 return false;
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
501 void PacedSender::UpdateBudgetWithElapsedTime(int64_t delta_time_ms) { 503 void PacedSender::UpdateBudgetWithElapsedTime(int64_t delta_time_ms) {
502 media_budget_->IncreaseBudget(delta_time_ms); 504 media_budget_->IncreaseBudget(delta_time_ms);
503 padding_budget_->IncreaseBudget(delta_time_ms); 505 padding_budget_->IncreaseBudget(delta_time_ms);
504 } 506 }
505 507
506 void PacedSender::UpdateBudgetWithBytesSent(size_t bytes_sent) { 508 void PacedSender::UpdateBudgetWithBytesSent(size_t bytes_sent) {
507 media_budget_->UseBudget(bytes_sent); 509 media_budget_->UseBudget(bytes_sent);
508 padding_budget_->UseBudget(bytes_sent); 510 padding_budget_->UseBudget(bytes_sent);
509 } 511 }
510 } // namespace webrtc 512 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/modules/pacing/alr_detector.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698