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 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
240 static const int kWindowMs = 500; | 240 static const int kWindowMs = 500; |
241 | 241 |
242 int target_rate_kbps_; | 242 int target_rate_kbps_; |
243 int bytes_remaining_; | 243 int bytes_remaining_; |
244 }; | 244 }; |
245 } // namespace paced_sender | 245 } // namespace paced_sender |
246 | 246 |
247 const int64_t PacedSender::kMaxQueueLengthMs = 2000; | 247 const int64_t PacedSender::kMaxQueueLengthMs = 2000; |
248 const float PacedSender::kDefaultPaceMultiplier = 2.5f; | 248 const float PacedSender::kDefaultPaceMultiplier = 2.5f; |
249 | 249 |
250 PacedSender::PacedSender(const Clock* clock, PacketSender* packet_sender) | 250 PacedSender::PacedSender(const Clock* clock, |
| 251 PacketSender* packet_sender, |
| 252 RtcEventLog* event_log) |
251 : clock_(clock), | 253 : clock_(clock), |
252 packet_sender_(packet_sender), | 254 packet_sender_(packet_sender), |
253 alr_detector_(new AlrDetector()), | 255 alr_detector_(new AlrDetector()), |
254 critsect_(CriticalSectionWrapper::CreateCriticalSection()), | 256 critsect_(CriticalSectionWrapper::CreateCriticalSection()), |
255 paused_(false), | 257 paused_(false), |
256 media_budget_(new paced_sender::IntervalBudget(0)), | 258 media_budget_(new paced_sender::IntervalBudget(0)), |
257 padding_budget_(new paced_sender::IntervalBudget(0)), | 259 padding_budget_(new paced_sender::IntervalBudget(0)), |
258 prober_(new BitrateProber()), | 260 prober_(new BitrateProber(event_log)), |
259 probing_send_failure_(false), | 261 probing_send_failure_(false), |
260 estimated_bitrate_bps_(0), | 262 estimated_bitrate_bps_(0), |
261 min_send_bitrate_kbps_(0u), | 263 min_send_bitrate_kbps_(0u), |
262 max_padding_bitrate_kbps_(0u), | 264 max_padding_bitrate_kbps_(0u), |
263 pacing_bitrate_kbps_(0), | 265 pacing_bitrate_kbps_(0), |
264 time_last_update_us_(clock->TimeInMicroseconds()), | 266 time_last_update_us_(clock->TimeInMicroseconds()), |
265 packets_(new paced_sender::PacketQueue(clock)), | 267 packets_(new paced_sender::PacketQueue(clock)), |
266 packet_counter_(0) { | 268 packet_counter_(0) { |
267 UpdateBudgetWithElapsedTime(kMinPacketLimitMs); | 269 UpdateBudgetWithElapsedTime(kMinPacketLimitMs); |
268 } | 270 } |
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
521 void PacedSender::UpdateBudgetWithElapsedTime(int64_t delta_time_ms) { | 523 void PacedSender::UpdateBudgetWithElapsedTime(int64_t delta_time_ms) { |
522 media_budget_->IncreaseBudget(delta_time_ms); | 524 media_budget_->IncreaseBudget(delta_time_ms); |
523 padding_budget_->IncreaseBudget(delta_time_ms); | 525 padding_budget_->IncreaseBudget(delta_time_ms); |
524 } | 526 } |
525 | 527 |
526 void PacedSender::UpdateBudgetWithBytesSent(size_t bytes_sent) { | 528 void PacedSender::UpdateBudgetWithBytesSent(size_t bytes_sent) { |
527 media_budget_->UseBudget(bytes_sent); | 529 media_budget_->UseBudget(bytes_sent); |
528 padding_budget_->UseBudget(bytes_sent); | 530 padding_budget_->UseBudget(bytes_sent); |
529 } | 531 } |
530 } // namespace webrtc | 532 } // namespace webrtc |
OLD | NEW |