| Index: webrtc/call/call.cc
|
| diff --git a/webrtc/call/call.cc b/webrtc/call/call.cc
|
| index 3fd7a931d0cecc88cff0b30a47557db5a21ed586..e6502becd1466b3a61beb127d9b2404f1834a0bf 100644
|
| --- a/webrtc/call/call.cc
|
| +++ b/webrtc/call/call.cc
|
| @@ -33,6 +33,7 @@
|
| #include "webrtc/modules/rtp_rtcp/include/rtp_header_parser.h"
|
| #include "webrtc/modules/rtp_rtcp/source/byte_io.h"
|
| #include "webrtc/modules/utility/include/process_thread.h"
|
| +#include "webrtc/p2p/base/port.h"
|
| #include "webrtc/system_wrappers/include/cpu_info.h"
|
| #include "webrtc/system_wrappers/include/critical_section_wrapper.h"
|
| #include "webrtc/system_wrappers/include/metrics.h"
|
| @@ -88,6 +89,8 @@ class Call : public webrtc::Call, public PacketReceiver,
|
| const webrtc::Call::Config::BitrateConfig& bitrate_config) override;
|
| void SignalNetworkState(NetworkState state) override;
|
|
|
| + void OnBestConnectionChanged(cricket::Connection* best_connection) override;
|
| +
|
| void OnSentPacket(const rtc::SentPacket& sent_packet) override;
|
|
|
| // Implements BitrateObserver.
|
| @@ -101,7 +104,6 @@ class Call : public webrtc::Call, public PacketReceiver,
|
| const uint8_t* packet,
|
| size_t length,
|
| const PacketTime& packet_time);
|
| -
|
| 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;
|
| +
|
| VieRemb remb_;
|
| const std::unique_ptr<CongestionController> congestion_controller_;
|
|
|
| @@ -570,6 +575,29 @@ void Call::SignalNetworkState(NetworkState state) {
|
| }
|
| }
|
|
|
| +void Call::OnBestConnectionChanged(cricket::Connection* connection) {
|
| + RTC_DCHECK(configuration_thread_checker_.CalledOnValidThread());
|
| + // Reset the BWE estimate when network changes.
|
| + // Check if the network has actually changed.
|
| + if (connection == nullptr) {
|
| + LOG(LS_INFO) << "Transport channel is disconnected";
|
| + // TODO(honghaiz): stop sending when this happens.
|
| + return;
|
| + }
|
| + uint16_t local_net_id = connection->local_candidate().network_id();
|
| + uint16_t remote_net_id = connection->local_candidate().network_id();
|
| + if (local_net_id == local_network_id_ &&
|
| + remote_net_id == remote_network_id_) {
|
| + 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;
|
| + congestion_controller_->ResetBweBitrates(
|
| + config_.bitrate_config.start_bitrate_bps);
|
| +}
|
| +
|
| void Call::OnSentPacket(const rtc::SentPacket& sent_packet) {
|
| if (first_packet_sent_ms_ == -1)
|
| first_packet_sent_ms_ = clock_->TimeInMilliseconds();
|
|
|