| 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); |
| 264 } | 266 } |
| 265 | 267 |
| 266 PacedSender::~PacedSender() {} | 268 PacedSender::~PacedSender() {} |
| 267 | 269 |
| 268 void PacedSender::Pause() { | 270 void PacedSender::Pause() { |
| 269 LOG(LS_INFO) << "PacedSender paused."; | 271 LOG(LS_INFO) << "PacedSender paused."; |
| 270 CriticalSectionScoped cs(critsect_.get()); | 272 CriticalSectionScoped cs(critsect_.get()); |
| 271 paused_ = true; | 273 paused_ = true; |
| 272 } | 274 } |
| 273 | 275 |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 311 uint32_t ssrc, | 313 uint32_t ssrc, |
| 312 uint16_t sequence_number, | 314 uint16_t sequence_number, |
| 313 int64_t capture_time_ms, | 315 int64_t capture_time_ms, |
| 314 size_t bytes, | 316 size_t bytes, |
| 315 bool retransmission) { | 317 bool retransmission) { |
| 316 CriticalSectionScoped cs(critsect_.get()); | 318 CriticalSectionScoped cs(critsect_.get()); |
| 317 RTC_DCHECK(estimated_bitrate_bps_ > 0) | 319 RTC_DCHECK(estimated_bitrate_bps_ > 0) |
| 318 << "SetEstimatedBitrate must be called before InsertPacket."; | 320 << "SetEstimatedBitrate must be called before InsertPacket."; |
| 319 | 321 |
| 320 int64_t now_ms = clock_->TimeInMilliseconds(); | 322 int64_t now_ms = clock_->TimeInMilliseconds(); |
| 321 prober_->OnIncomingPacket(estimated_bitrate_bps_, bytes, now_ms); | 323 prober_->OnIncomingPacket(bytes); |
| 322 | 324 |
| 323 if (capture_time_ms < 0) | 325 if (capture_time_ms < 0) |
| 324 capture_time_ms = now_ms; | 326 capture_time_ms = now_ms; |
| 325 | 327 |
| 326 packets_->Push(paced_sender::Packet(priority, ssrc, sequence_number, | 328 packets_->Push(paced_sender::Packet(priority, ssrc, sequence_number, |
| 327 capture_time_ms, now_ms, bytes, | 329 capture_time_ms, now_ms, bytes, |
| 328 retransmission, packet_counter_++)); | 330 retransmission, packet_counter_++)); |
| 329 } | 331 } |
| 330 | 332 |
| 331 int64_t PacedSender::ExpectedQueueTimeMs() const { | 333 int64_t PacedSender::ExpectedQueueTimeMs() const { |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 477 media_budget_->UseBudget(bytes_sent); | 479 media_budget_->UseBudget(bytes_sent); |
| 478 padding_budget_->UseBudget(bytes_sent); | 480 padding_budget_->UseBudget(bytes_sent); |
| 479 } | 481 } |
| 480 } | 482 } |
| 481 | 483 |
| 482 void PacedSender::UpdateBytesPerInterval(int64_t delta_time_ms) { | 484 void PacedSender::UpdateBytesPerInterval(int64_t delta_time_ms) { |
| 483 media_budget_->IncreaseBudget(delta_time_ms); | 485 media_budget_->IncreaseBudget(delta_time_ms); |
| 484 padding_budget_->IncreaseBudget(delta_time_ms); | 486 padding_budget_->IncreaseBudget(delta_time_ms); |
| 485 } | 487 } |
| 486 } // namespace webrtc | 488 } // namespace webrtc |
| OLD | NEW |