OLD | NEW |
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 Loading... |
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 (bytes_sent > 0) { | 453 if (is_probing && bytes_sent > 0) |
454 if (is_probing) | 454 prober_->ProbeSent(clock_->TimeInMilliseconds(), bytes_sent); |
455 prober_->ProbeSent(clock_->TimeInMilliseconds(), bytes_sent); | 455 alr_detector_->OnBytesSent(bytes_sent, now_us / 1000); |
456 alr_detector_->OnBytesSent(bytes_sent, now_us / 1000); | |
457 } | |
458 } | 456 } |
459 | 457 |
460 bool PacedSender::SendPacket(const paced_sender::Packet& packet, | 458 bool PacedSender::SendPacket(const paced_sender::Packet& packet, |
461 int probe_cluster_id) { | 459 int probe_cluster_id) { |
462 // TODO(holmer): Because of this bug issue 5307 we have to send audio | 460 // TODO(holmer): Because of this bug issue 5307 we have to send audio |
463 // packets even when the pacer is paused. Here we assume audio packets are | 461 // packets even when the pacer is paused. Here we assume audio packets are |
464 // always high priority and that they are the only high priority packets. | 462 // always high priority and that they are the only high priority packets. |
465 if (packet.priority != kHighPriority) { | 463 if (packet.priority != kHighPriority) { |
466 if (paused_) | 464 if (paused_) |
467 return false; | 465 return false; |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
503 void PacedSender::UpdateBudgetWithElapsedTime(int64_t delta_time_ms) { | 501 void PacedSender::UpdateBudgetWithElapsedTime(int64_t delta_time_ms) { |
504 media_budget_->IncreaseBudget(delta_time_ms); | 502 media_budget_->IncreaseBudget(delta_time_ms); |
505 padding_budget_->IncreaseBudget(delta_time_ms); | 503 padding_budget_->IncreaseBudget(delta_time_ms); |
506 } | 504 } |
507 | 505 |
508 void PacedSender::UpdateBudgetWithBytesSent(size_t bytes_sent) { | 506 void PacedSender::UpdateBudgetWithBytesSent(size_t bytes_sent) { |
509 media_budget_->UseBudget(bytes_sent); | 507 media_budget_->UseBudget(bytes_sent); |
510 padding_budget_->UseBudget(bytes_sent); | 508 padding_budget_->UseBudget(bytes_sent); |
511 } | 509 } |
512 } // namespace webrtc | 510 } // namespace webrtc |
OLD | NEW |