Chromium Code Reviews| 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 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 373 pacer_->Resume(); | 373 pacer_->Resume(); |
| 374 } else { | 374 } else { |
| 375 pacer_->Pause(); | 375 pacer_->Pause(); |
| 376 } | 376 } |
| 377 } | 377 } |
| 378 | 378 |
| 379 // TODO(mflodman): Move this logic out from ChannelGroup. | 379 // TODO(mflodman): Move this logic out from ChannelGroup. |
| 380 void ChannelGroup::OnNetworkChanged(uint32_t target_bitrate_bps, | 380 void ChannelGroup::OnNetworkChanged(uint32_t target_bitrate_bps, |
| 381 uint8_t fraction_loss, | 381 uint8_t fraction_loss, |
| 382 int64_t rtt) { | 382 int64_t rtt) { |
| 383 bitrate_allocator_->OnNetworkChanged(target_bitrate_bps, fraction_loss, rtt); | 383 uint32_t allocated_bitrate = bitrate_allocator_->OnNetworkChanged( |
|
stefan-webrtc
2015/10/20 10:13:47
unit on allocated_bitrate
sprang_webrtc
2015/10/21 08:09:16
Done.
| |
| 384 target_bitrate_bps, fraction_loss, rtt); | |
| 385 target_bitrate_bps = std::max(target_bitrate_bps, allocated_bitrate); | |
|
mflodman
2015/10/20 10:10:45
And also comment why this is done.
mflodman
2015/10/20 10:10:45
I'd prefer a new variable with another name for th
sprang_webrtc
2015/10/21 08:09:16
Done.
sprang_webrtc
2015/10/21 08:09:16
Done.
| |
| 384 int pad_up_to_bitrate_bps = 0; | 386 int pad_up_to_bitrate_bps = 0; |
| 385 { | 387 { |
| 386 rtc::CritScope lock(&encoder_crit_); | 388 rtc::CritScope lock(&encoder_crit_); |
| 387 for (const auto& encoder : encoders_) | 389 for (const auto& encoder : encoders_) |
| 388 pad_up_to_bitrate_bps += encoder->GetPaddingNeededBps(); | 390 pad_up_to_bitrate_bps += encoder->GetPaddingNeededBps(); |
| 389 } | 391 } |
| 390 pacer_->UpdateBitrate( | 392 pacer_->UpdateBitrate( |
| 391 target_bitrate_bps / 1000, | 393 target_bitrate_bps / 1000, |
| 392 PacedSender::kDefaultPaceMultiplier * target_bitrate_bps / 1000, | 394 PacedSender::kDefaultPaceMultiplier * target_bitrate_bps / 1000, |
| 393 pad_up_to_bitrate_bps / 1000); | 395 pad_up_to_bitrate_bps / 1000); |
| 394 } | 396 } |
| 395 | 397 |
| 396 void ChannelGroup::OnSentPacket(const rtc::SentPacket& sent_packet) { | 398 void ChannelGroup::OnSentPacket(const rtc::SentPacket& sent_packet) { |
| 397 if (transport_feedback_adapter_) { | 399 if (transport_feedback_adapter_) { |
| 398 transport_feedback_adapter_->UpdateSendTime(sent_packet.packet_id, | 400 transport_feedback_adapter_->UpdateSendTime(sent_packet.packet_id, |
| 399 sent_packet.send_time_ms); | 401 sent_packet.send_time_ms); |
| 400 } | 402 } |
| 401 } | 403 } |
| 402 } // namespace webrtc | 404 } // namespace webrtc |
| OLD | NEW |