Renaming probing_interval to bwe_period globally.
probing_interval as a name is used for the period that BWE attempt to increase its estimate. The name is confusing since it is not related to "probing" which is a special mechanism for estimating BWE. BUG=None Review-Url: https://codereview.webrtc.org/2888893002 Cr-Commit-Position: refs/heads/master@{#18203}
This commit is contained in:
parent
fb0ff45aa0
commit
93e4522105
@ -86,7 +86,7 @@ void AudioEncoder::OnReceivedTargetAudioBitrate(int target_audio_bitrate_bps) {
|
||||
|
||||
void AudioEncoder::OnReceivedUplinkBandwidth(
|
||||
int target_audio_bitrate_bps,
|
||||
rtc::Optional<int64_t> probing_interval_ms) {}
|
||||
rtc::Optional<int64_t> bwe_period_ms) {}
|
||||
|
||||
void AudioEncoder::OnReceivedRtt(int rtt_ms) {}
|
||||
|
||||
|
||||
@ -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<int64_t> probing_interval_ms);
|
||||
rtc::Optional<int64_t> bwe_period_ms);
|
||||
|
||||
// Provides RTT to this encoder to allow it to adapt.
|
||||
virtual void OnReceivedRtt(int rtt_ms);
|
||||
|
||||
@ -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.
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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();
|
||||
}
|
||||
|
||||
@ -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_);
|
||||
|
||||
@ -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<int>(1000 * static_cast<int64_t>(*last_decrease_) /
|
||||
increase_rate,
|
||||
kMinIntervalMs));
|
||||
kMinPeriodMs));
|
||||
}
|
||||
|
||||
uint32_t AimdRateControl::ChangeBitrate(uint32_t new_bitrate_bps,
|
||||
|
||||
@ -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<uint32_t>& ssrcs,
|
||||
uint32_t bitrate) override {}
|
||||
};
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user