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