| 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 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 254 padding_budget_(new paced_sender::IntervalBudget(0)), | 254 padding_budget_(new paced_sender::IntervalBudget(0)), |
| 255 prober_(new BitrateProber()), | 255 prober_(new BitrateProber()), |
| 256 estimated_bitrate_bps_(0), | 256 estimated_bitrate_bps_(0), |
| 257 min_send_bitrate_kbps_(0u), | 257 min_send_bitrate_kbps_(0u), |
| 258 max_padding_bitrate_kbps_(0u), | 258 max_padding_bitrate_kbps_(0u), |
| 259 pacing_bitrate_kbps_(0), | 259 pacing_bitrate_kbps_(0), |
| 260 time_last_update_us_(clock->TimeInMicroseconds()), | 260 time_last_update_us_(clock->TimeInMicroseconds()), |
| 261 packets_(new paced_sender::PacketQueue(clock)), | 261 packets_(new paced_sender::PacketQueue(clock)), |
| 262 packet_counter_(0) { | 262 packet_counter_(0) { |
| 263 UpdateBytesPerInterval(kMinPacketLimitMs); | 263 UpdateBytesPerInterval(kMinPacketLimitMs); |
| 264 prober_->ProbeAtBitrate(900000, 6); | |
| 265 prober_->ProbeAtBitrate(1800000, 5); | |
| 266 } | 264 } |
| 267 | 265 |
| 268 PacedSender::~PacedSender() {} | 266 PacedSender::~PacedSender() {} |
| 269 | 267 |
| 268 void PacedSender::CreateProbeCluster(int bitrate_bps, int num_packets) { |
| 269 CriticalSectionScoped cs(critsect_.get()); |
| 270 prober_->CreateProbeCluster(bitrate_bps, num_packets); |
| 271 } |
| 272 |
| 270 void PacedSender::Pause() { | 273 void PacedSender::Pause() { |
| 271 LOG(LS_INFO) << "PacedSender paused."; | 274 LOG(LS_INFO) << "PacedSender paused."; |
| 272 CriticalSectionScoped cs(critsect_.get()); | 275 CriticalSectionScoped cs(critsect_.get()); |
| 273 paused_ = true; | 276 paused_ = true; |
| 274 } | 277 } |
| 275 | 278 |
| 276 void PacedSender::Resume() { | 279 void PacedSender::Resume() { |
| 277 LOG(LS_INFO) << "PacedSender resumed."; | 280 LOG(LS_INFO) << "PacedSender resumed."; |
| 278 CriticalSectionScoped cs(critsect_.get()); | 281 CriticalSectionScoped cs(critsect_.get()); |
| 279 paused_ = false; | 282 paused_ = false; |
| (...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 479 media_budget_->UseBudget(bytes_sent); | 482 media_budget_->UseBudget(bytes_sent); |
| 480 padding_budget_->UseBudget(bytes_sent); | 483 padding_budget_->UseBudget(bytes_sent); |
| 481 } | 484 } |
| 482 } | 485 } |
| 483 | 486 |
| 484 void PacedSender::UpdateBytesPerInterval(int64_t delta_time_ms) { | 487 void PacedSender::UpdateBytesPerInterval(int64_t delta_time_ms) { |
| 485 media_budget_->IncreaseBudget(delta_time_ms); | 488 media_budget_->IncreaseBudget(delta_time_ms); |
| 486 padding_budget_->IncreaseBudget(delta_time_ms); | 489 padding_budget_->IncreaseBudget(delta_time_ms); |
| 487 } | 490 } |
| 488 } // namespace webrtc | 491 } // namespace webrtc |
| OLD | NEW |