Chromium Code Reviews| Index: webrtc/call/call.cc |
| diff --git a/webrtc/call/call.cc b/webrtc/call/call.cc |
| index 3fd7a931d0cecc88cff0b30a47557db5a21ed586..5fb54875c5901a9a6be69a0a4ef9af1c5150ea2b 100644 |
| --- a/webrtc/call/call.cc |
| +++ b/webrtc/call/call.cc |
| @@ -88,6 +88,8 @@ class Call : public webrtc::Call, public PacketReceiver, |
| const webrtc::Call::Config::BitrateConfig& bitrate_config) override; |
| void SignalNetworkState(NetworkState state) override; |
| + void OnNetworkChanged(int local_net_id, int remote_net_id) override; |
| + |
| void OnSentPacket(const rtc::SentPacket& sent_packet) override; |
| // Implements BitrateObserver. |
| @@ -101,7 +103,7 @@ class Call : public webrtc::Call, public PacketReceiver, |
| const uint8_t* packet, |
| size_t length, |
| const PacketTime& packet_time); |
| - |
| + void ResetBweBitrates(); |
| void ConfigureSync(const std::string& sync_group) |
| EXCLUSIVE_LOCKS_REQUIRED(receive_crit_); |
| @@ -167,6 +169,9 @@ class Call : public webrtc::Call, public PacketReceiver, |
| int64_t pacer_bitrate_sum_kbits_ GUARDED_BY(&bitrate_crit_); |
| int64_t num_bitrate_updates_ GUARDED_BY(&bitrate_crit_); |
| + int local_network_id_ = 0; |
| + int remote_network_id_ = 0; |
|
pthatcher1
2016/03/16 21:22:03
If the signal has both old and new route infos, we
honghaiz3
2016/03/17 03:38:27
Keep this as we have discussed.
|
| + |
| VieRemb remb_; |
| const std::unique_ptr<CongestionController> congestion_controller_; |
| @@ -570,6 +575,30 @@ void Call::SignalNetworkState(NetworkState state) { |
| } |
| } |
| +void Call::OnNetworkChanged(int local_net_id, int remote_net_id) { |
| + RTC_DCHECK(configuration_thread_checker_.CalledOnValidThread()); |
| + // Reset the BWE estimate when network changes. |
| + // Check if the network has actually changed. |
| + if (local_net_id == local_network_id_ && |
| + remote_net_id == remote_network_id_) { |
|
pthatcher1
2016/03/16 21:22:03
If we use NetworkRoute structs, we should also che
honghaiz3
2016/03/17 03:38:27
We can now use the null pointer for best connectio
|
| + return; |
| + } |
| + LOG(LS_INFO) << "Network changed: new local network id " << local_net_id |
| + << " new remote network id " << remote_net_id; |
| + local_network_id_ = local_net_id; |
| + remote_network_id_ = remote_net_id; |
| + ResetBweBitrates(); |
| +} |
| + |
| +void Call::ResetBweBitrates() { |
|
pthatcher1
2016/03/16 21:22:03
If !new_route.connected, we probably want to do so
honghaiz3
2016/03/17 03:38:27
Done. Add TODO.
|
| + LOG(LS_INFO) << "Reset BWE estimate to " |
| + << config_.bitrate_config.start_bitrate_bps << "bps"; |
| + congestion_controller_->SetBweBitrates( |
| + config_.bitrate_config.min_bitrate_bps, |
| + config_.bitrate_config.start_bitrate_bps, |
| + config_.bitrate_config.max_bitrate_bps); |
|
pthatcher1
2016/03/16 21:22:03
Does this really restart the BWE?
honghaiz3
2016/03/17 03:38:27
Actually It may not. Maybe we can leave this to BW
|
| +} |
| + |
| void Call::OnSentPacket(const rtc::SentPacket& sent_packet) { |
| if (first_packet_sent_ms_ == -1) |
| first_packet_sent_ms_ = clock_->TimeInMilliseconds(); |