diff --git a/webrtc/api/audio_codecs/audio_encoder.cc b/webrtc/api/audio_codecs/audio_encoder.cc index 8dab4d6df1..ac5f89f6fe 100644 --- a/webrtc/api/audio_codecs/audio_encoder.cc +++ b/webrtc/api/audio_codecs/audio_encoder.cc @@ -86,7 +86,7 @@ void AudioEncoder::OnReceivedTargetAudioBitrate(int target_audio_bitrate_bps) { void AudioEncoder::OnReceivedUplinkBandwidth( int target_audio_bitrate_bps, - rtc::Optional probing_interval_ms) {} + rtc::Optional bwe_period_ms) {} void AudioEncoder::OnReceivedRtt(int rtt_ms) {} diff --git a/webrtc/api/audio_codecs/audio_encoder.h b/webrtc/api/audio_codecs/audio_encoder.h index 3e810005fd..06e232d0ce 100644 --- a/webrtc/api/audio_codecs/audio_encoder.h +++ b/webrtc/api/audio_codecs/audio_encoder.h @@ -189,7 +189,7 @@ class AudioEncoder { // the bandwidth estimator to this encoder to allow it to adapt. virtual void OnReceivedUplinkBandwidth( int target_audio_bitrate_bps, - rtc::Optional probing_interval_ms); + rtc::Optional bwe_period_ms); // Provides RTT to this encoder to allow it to adapt. virtual void OnReceivedRtt(int rtt_ms); diff --git a/webrtc/audio/audio_send_stream.cc b/webrtc/audio/audio_send_stream.cc index e95c5e717c..3d636c2a67 100644 --- a/webrtc/audio/audio_send_stream.cc +++ b/webrtc/audio/audio_send_stream.cc @@ -305,7 +305,7 @@ bool AudioSendStream::DeliverRtcp(const uint8_t* packet, size_t length) { uint32_t AudioSendStream::OnBitrateUpdated(uint32_t bitrate_bps, uint8_t fraction_loss, int64_t rtt, - int64_t probing_interval_ms) { + int64_t bwe_period_ms) { // A send stream may be allocated a bitrate of zero if the allocator decides // to disable it. For now we ignore this decision and keep sending on min // bitrate. @@ -320,7 +320,7 @@ uint32_t AudioSendStream::OnBitrateUpdated(uint32_t bitrate_bps, if (bitrate_bps > max_bitrate_bps) bitrate_bps = max_bitrate_bps; - channel_proxy_->SetBitrate(bitrate_bps, probing_interval_ms); + channel_proxy_->SetBitrate(bitrate_bps, bwe_period_ms); // The amount of audio protection is not exposed by the encoder, hence // always returning 0. diff --git a/webrtc/audio/audio_send_stream.h b/webrtc/audio/audio_send_stream.h index dcc28c9dbc..065fee7894 100644 --- a/webrtc/audio/audio_send_stream.h +++ b/webrtc/audio/audio_send_stream.h @@ -64,7 +64,7 @@ class AudioSendStream final : public webrtc::AudioSendStream, uint32_t OnBitrateUpdated(uint32_t bitrate_bps, uint8_t fraction_loss, int64_t rtt, - int64_t probing_interval_ms) override; + int64_t bwe_period_ms) override; // From PacketFeedbackObserver. void OnPacketAdded(uint32_t ssrc, uint16_t seq_num) override; diff --git a/webrtc/call/bitrate_allocator.cc b/webrtc/call/bitrate_allocator.cc index c3568df34c..9aecc6e3e8 100644 --- a/webrtc/call/bitrate_allocator.cc +++ b/webrtc/call/bitrate_allocator.cc @@ -68,14 +68,14 @@ BitrateAllocator::~BitrateAllocator() { void BitrateAllocator::OnNetworkChanged(uint32_t target_bitrate_bps, uint8_t fraction_loss, int64_t rtt, - int64_t probing_interval_ms) { + int64_t bwe_period_ms) { RTC_DCHECK_CALLED_SEQUENTIALLY(&sequenced_checker_); last_bitrate_bps_ = target_bitrate_bps; last_non_zero_bitrate_bps_ = target_bitrate_bps > 0 ? target_bitrate_bps : last_non_zero_bitrate_bps_; last_fraction_loss_ = fraction_loss; last_rtt_ = rtt; - last_probing_interval_ms_ = probing_interval_ms; + last_bwe_period_ms_ = bwe_period_ms; // Periodically log the incoming BWE. int64_t now = clock_->TimeInMilliseconds(); @@ -90,7 +90,7 @@ void BitrateAllocator::OnNetworkChanged(uint32_t target_bitrate_bps, uint32_t allocated_bitrate = allocation[config.observer]; uint32_t protection_bitrate = config.observer->OnBitrateUpdated( allocated_bitrate, last_fraction_loss_, last_rtt_, - last_probing_interval_ms_); + last_bwe_period_ms_); if (allocated_bitrate == 0 && config.allocated_bitrate_bps > 0) { if (target_bitrate_bps > 0) @@ -148,7 +148,7 @@ void BitrateAllocator::AddObserver(BitrateAllocatorObserver* observer, uint32_t allocated_bitrate = allocation[config.observer]; uint32_t protection_bitrate = config.observer->OnBitrateUpdated( allocated_bitrate, last_fraction_loss_, last_rtt_, - last_probing_interval_ms_); + last_bwe_period_ms_); config.allocated_bitrate_bps = allocated_bitrate; if (allocated_bitrate > 0) config.media_ratio = MediaRatio(allocated_bitrate, protection_bitrate); @@ -159,7 +159,7 @@ void BitrateAllocator::AddObserver(BitrateAllocatorObserver* observer, // observer know that it can not produce frames. allocation = AllocateBitrates(last_non_zero_bitrate_bps_); observer->OnBitrateUpdated(0, last_fraction_loss_, last_rtt_, - last_probing_interval_ms_); + last_bwe_period_ms_); } UpdateAllocationLimits(); } diff --git a/webrtc/call/bitrate_allocator.h b/webrtc/call/bitrate_allocator.h index f133fa1723..e92eac90e6 100644 --- a/webrtc/call/bitrate_allocator.h +++ b/webrtc/call/bitrate_allocator.h @@ -34,7 +34,7 @@ class BitrateAllocatorObserver { virtual uint32_t OnBitrateUpdated(uint32_t bitrate_bps, uint8_t fraction_loss, int64_t rtt, - int64_t probing_interval_ms) = 0; + int64_t bwe_period_ms) = 0; protected: virtual ~BitrateAllocatorObserver() {} @@ -64,7 +64,7 @@ class BitrateAllocator { void OnNetworkChanged(uint32_t target_bitrate_bps, uint8_t fraction_loss, int64_t rtt, - int64_t probing_interval_ms); + int64_t bwe_period_ms); // Set the start and max send bitrate used by the bandwidth management. // @@ -160,7 +160,7 @@ class BitrateAllocator { uint32_t last_non_zero_bitrate_bps_ GUARDED_BY(&sequenced_checker_); uint8_t last_fraction_loss_ GUARDED_BY(&sequenced_checker_); int64_t last_rtt_ GUARDED_BY(&sequenced_checker_); - int64_t last_probing_interval_ms_ GUARDED_BY(&sequenced_checker_); + int64_t last_bwe_period_ms_ GUARDED_BY(&sequenced_checker_); // Number of mute events based on too low BWE, not network up/down. int num_pause_events_ GUARDED_BY(&sequenced_checker_); Clock* const clock_ GUARDED_BY(&sequenced_checker_); diff --git a/webrtc/modules/remote_bitrate_estimator/aimd_rate_control.cc b/webrtc/modules/remote_bitrate_estimator/aimd_rate_control.cc index e645090b35..d903cf9af7 100644 --- a/webrtc/modules/remote_bitrate_estimator/aimd_rate_control.cc +++ b/webrtc/modules/remote_bitrate_estimator/aimd_rate_control.cc @@ -136,18 +136,18 @@ int AimdRateControl::GetNearMaxIncreaseRateBps() const { } int AimdRateControl::GetExpectedBandwidthPeriodMs() const { - constexpr int kMinIntervalMs = 2000; - constexpr int kDefaultIntervalMs = 3000; - constexpr int kMaxIntervalMs = 50000; + constexpr int kMinPeriodMs = 2000; + constexpr int kDefaultPeriodMs = 3000; + constexpr int kMaxPeriodMs = 50000; int increase_rate = GetNearMaxIncreaseRateBps(); if (!last_decrease_) - return kDefaultIntervalMs; + return kDefaultPeriodMs; - return std::min(kMaxIntervalMs, + return std::min(kMaxPeriodMs, std::max(1000 * static_cast(*last_decrease_) / increase_rate, - kMinIntervalMs)); + kMinPeriodMs)); } uint32_t AimdRateControl::ChangeBitrate(uint32_t new_bitrate_bps, diff --git a/webrtc/test/fuzzers/congestion_controller_feedback_fuzzer.cc b/webrtc/test/fuzzers/congestion_controller_feedback_fuzzer.cc index de78a85afe..008d7a5500 100644 --- a/webrtc/test/fuzzers/congestion_controller_feedback_fuzzer.cc +++ b/webrtc/test/fuzzers/congestion_controller_feedback_fuzzer.cc @@ -27,7 +27,7 @@ class NullBitrateObserver : public CongestionController::Observer, void OnNetworkChanged(uint32_t bitrate_bps, uint8_t fraction_loss, int64_t rtt_ms, - int64_t probing_interval_ms) override {} + int64_t bwe_period_ms) override {} void OnReceiveBitrateChanged(const std::vector& ssrcs, uint32_t bitrate) override {} };