Chromium Code Reviews| Index: webrtc/call/call.cc |
| diff --git a/webrtc/call/call.cc b/webrtc/call/call.cc |
| index 67abc5669d478773f74cbd7e630ec6ca96976ca4..c39aac37492e5266e2bc8ca668733c29589aa293 100644 |
| --- a/webrtc/call/call.cc |
| +++ b/webrtc/call/call.cc |
| @@ -666,8 +666,8 @@ void Call::OnSentPacket(const rtc::SentPacket& sent_packet) { |
| void Call::OnNetworkChanged(uint32_t target_bitrate_bps, uint8_t fraction_loss, |
| int64_t rtt_ms) { |
| - uint32_t allocated_bitrate_bps = bitrate_allocator_->OnNetworkChanged( |
| - target_bitrate_bps, fraction_loss, rtt_ms); |
| + bitrate_allocator_->OnNetworkChanged(target_bitrate_bps, fraction_loss, |
| + rtt_ms); |
| int pad_up_to_bitrate_bps = 0; |
| { |
| @@ -679,23 +679,27 @@ void Call::OnNetworkChanged(uint32_t target_bitrate_bps, uint8_t fraction_loss, |
| for (VideoSendStream* stream : video_send_streams_) |
| pad_up_to_bitrate_bps += stream->GetPaddingNeededBps(); |
| } |
| - // Allocated bitrate might be higher than bitrate estimate if enforcing min |
| - // bitrate, or lower if estimate is higher than the sum of max bitrates, so |
| - // set the pacer bitrate to the maximum of the two. |
| - uint32_t pacer_bitrate_bps = |
| - std::max(target_bitrate_bps, allocated_bitrate_bps); |
| + |
| + uint32_t min_send_bitrate = bitrate_allocator_->GetMinSendBitrate(); |
|
stefan-webrtc
2016/04/29 10:48:38
I think this can race with the call on 669. Probab
perkj_webrtc
2016/05/02 11:29:10
discussed off line. Reverting.
|
| { |
| rtc::CritScope lock(&bitrate_crit_); |
| // We only update these stats if we have send streams, and assume that |
| // OnNetworkChanged is called roughly with a fixed frequency. |
| estimated_send_bitrate_sum_kbits_ += target_bitrate_bps / 1000; |
| - pacer_bitrate_sum_kbits_ += pacer_bitrate_bps / 1000; |
| + |
| + // Allocated bitrate might be higher than bitrate estimate if enforcing min |
| + // bitrate, or lower if estimate is higher than the sum of max bitrates, so |
| + // set the pacer bitrate to the maximum of the two. |
| + pacer_bitrate_sum_kbits_ += |
| + std::max(target_bitrate_bps, min_send_bitrate) / 1000; |
| ++num_bitrate_updates_; |
| } |
| - congestion_controller_->UpdatePacerBitrate( |
| - target_bitrate_bps / 1000, |
| - PacedSender::kDefaultPaceMultiplier * pacer_bitrate_bps / 1000, |
| - pad_up_to_bitrate_bps / 1000); |
| + congestion_controller_->UpdatePaddingBitrate(pad_up_to_bitrate_bps); |
|
stefan-webrtc
2016/04/29 10:48:38
I think we still have to set the target_bitrate_bp
perkj_webrtc
2016/05/02 11:29:09
See new architecture.
|
| + |
| + // TODO(perkj): Refactor setting the minimum send bitrate. |
| + // It changes when a stream is added or removed based on settings. |
| + // Not when the network change. |
| + congestion_controller_->SetMinimumSendBitrate(min_send_bitrate); |
| } |
| void Call::ConfigureSync(const std::string& sync_group) { |