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 343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
354 if (prober_->IsProbing()) { | 354 if (prober_->IsProbing()) { |
355 return 0; | 355 return 0; |
356 } | 356 } |
357 } else { | 357 } else { |
358 // Send failed, put it back into the queue. | 358 // Send failed, put it back into the queue. |
359 packets_->CancelPop(packet); | 359 packets_->CancelPop(packet); |
360 return 0; | 360 return 0; |
361 } | 361 } |
362 } | 362 } |
363 | 363 |
| 364 if (!packets_->Empty()) |
| 365 return 0; |
| 366 |
364 size_t padding_needed; | 367 size_t padding_needed; |
365 if (prober_->IsProbing() && ProbingExperimentIsEnabled()) | 368 if (prober_->IsProbing()) |
366 padding_needed = prober_->RecommendedPacketSize(); | 369 padding_needed = prober_->RecommendedPacketSize(); |
367 else | 370 else |
368 padding_needed = padding_budget_->bytes_remaining(); | 371 padding_needed = padding_budget_->bytes_remaining(); |
369 | 372 |
370 if (padding_needed > 0) | 373 if (padding_needed > 0) |
371 SendPadding(static_cast<size_t>(padding_needed)); | 374 SendPadding(static_cast<size_t>(padding_needed)); |
372 } | 375 } |
373 return 0; | 376 return 0; |
374 } | 377 } |
375 | 378 |
(...skipping 24 matching lines...) Expand all Loading... |
400 prober_->PacketSent(clock_->TimeInMilliseconds(), bytes_sent); | 403 prober_->PacketSent(clock_->TimeInMilliseconds(), bytes_sent); |
401 media_budget_->UseBudget(bytes_sent); | 404 media_budget_->UseBudget(bytes_sent); |
402 padding_budget_->UseBudget(bytes_sent); | 405 padding_budget_->UseBudget(bytes_sent); |
403 } | 406 } |
404 } | 407 } |
405 | 408 |
406 void PacedSender::UpdateBytesPerInterval(int64_t delta_time_ms) { | 409 void PacedSender::UpdateBytesPerInterval(int64_t delta_time_ms) { |
407 media_budget_->IncreaseBudget(delta_time_ms); | 410 media_budget_->IncreaseBudget(delta_time_ms); |
408 padding_budget_->IncreaseBudget(delta_time_ms); | 411 padding_budget_->IncreaseBudget(delta_time_ms); |
409 } | 412 } |
410 | |
411 bool PacedSender::ProbingExperimentIsEnabled() const { | |
412 return webrtc::field_trial::FindFullName("WebRTC-BitrateProbing") == | |
413 "Enabled"; | |
414 } | |
415 } // namespace webrtc | 413 } // namespace webrtc |
OLD | NEW |