Add ability to set max probing bitrate via GoogCcNetworkController

Bug: webrtc:10223
Change-Id: I8e9ee0cd333634e7d0b53d3d446a580374cc88b4
Reviewed-on: https://webrtc-review.googlesource.com/c/120342
Commit-Queue: Erik Språng <sprang@webrtc.org>
Reviewed-by: Sebastian Jansson <srte@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26452}
This commit is contained in:
Erik Språng 2019-01-29 18:28:06 +01:00 committed by Commit Bot
parent d3be0171b0
commit 5118bbc8b7
4 changed files with 26 additions and 13 deletions

View File

@ -100,11 +100,11 @@ GoogCcNetworkController::GoogCcNetworkController(RtcEventLog* event_log,
fall_back_to_probe_rate_(
key_value_config_->Lookup("WebRTC-Bwe-ProbeRateFallback")
.find("Enabled") == 0),
rate_control_experiments_(
rate_control_settings_(
RateControlSettings::ParseFromKeyValueConfig(key_value_config_)),
probe_controller_(new ProbeController(key_value_config_)),
congestion_window_pushback_controller_(
rate_control_experiments_.UseCongestionWindowPushback()
rate_control_settings_.UseCongestionWindowPushback()
? absl::make_unique<CongestionWindowPushbackController>(
key_value_config_)
: nullptr),
@ -315,9 +315,13 @@ NetworkControlUpdate GoogCcNetworkController::OnStreamsConfig(
}
if (msg.max_total_allocated_bitrate &&
*msg.max_total_allocated_bitrate != max_total_allocated_bitrate_) {
update.probe_cluster_configs =
probe_controller_->OnMaxTotalAllocatedBitrate(
msg.max_total_allocated_bitrate->bps(), msg.at_time.ms());
if (rate_control_settings_.TriggerProbeOnMaxAllocatedBitrateChange()) {
update.probe_cluster_configs =
probe_controller_->OnMaxTotalAllocatedBitrate(
msg.max_total_allocated_bitrate->bps(), msg.at_time.ms());
} else {
probe_controller_->SetMaxBitrate(msg.max_total_allocated_bitrate->bps());
}
max_total_allocated_bitrate_ = *msg.max_total_allocated_bitrate;
}
bool pacing_changed = false;
@ -544,7 +548,7 @@ NetworkControlUpdate GoogCcNetworkController::OnTransportPacketsFeedback(
// No valid RTT could be because send-side BWE isn't used, in which case
// we don't try to limit the outstanding packets.
if (rate_control_experiments_.UseCongestionWindow() &&
if (rate_control_settings_.UseCongestionWindow() &&
max_feedback_rtt.IsFinite()) {
int64_t min_feedback_max_rtt_ms =
*std::min_element(feedback_max_rtts_.begin(), feedback_max_rtts_.end());
@ -552,7 +556,7 @@ NetworkControlUpdate GoogCcNetworkController::OnTransportPacketsFeedback(
const DataSize kMinCwnd = DataSize::bytes(2 * 1500);
TimeDelta time_window = TimeDelta::ms(
min_feedback_max_rtt_ms +
rate_control_experiments_.GetCongestionWindowAdditionalTimeMs());
rate_control_settings_.GetCongestionWindowAdditionalTimeMs());
DataSize data_window = last_raw_target_rate_ * time_window;
if (current_data_window_) {
data_window =

View File

@ -79,7 +79,7 @@ class GoogCcNetworkController : public NetworkControllerInterface {
FieldTrialFlag safe_reset_acknowledged_rate_;
const bool use_stable_bandwidth_estimate_;
const bool fall_back_to_probe_rate_;
const RateControlSettings rate_control_experiments_;
const RateControlSettings rate_control_settings_;
const std::unique_ptr<ProbeController> probe_controller_;
const std::unique_ptr<CongestionWindowPushbackController>

View File

@ -120,11 +120,13 @@ RateControlSettings::RateControlSettings(
"screenshare_hysteresis",
ParseHysteresisFactor(key_value_config,
kScreenshareHysteresisFieldTrialname,
kDefaultScreenshareHysteresisFactor)) {
ParseFieldTrial({&congestion_window_, &congestion_window_pushback_,
&pacing_factor_, &alr_probing_, &trust_vp8_, &trust_vp9_,
&video_hysteresis_, &screenshare_hysteresis_},
key_value_config->Lookup("WebRTC-VideoRateControl"));
kDefaultScreenshareHysteresisFactor)),
probe_max_allocation_("probe_max_allocation", true) {
ParseFieldTrial(
{&congestion_window_, &congestion_window_pushback_, &pacing_factor_,
&alr_probing_, &trust_vp8_, &trust_vp9_, &video_hysteresis_,
&screenshare_hysteresis_, &probe_max_allocation_},
key_value_config->Lookup("WebRTC-VideoRateControl"));
}
RateControlSettings::~RateControlSettings() = default;
@ -184,4 +186,8 @@ double RateControlSettings::GetSimulcastScreenshareHysteresisFactor() const {
return screenshare_hysteresis_.Get();
}
bool RateControlSettings::TriggerProbeOnMaxAllocatedBitrateChange() const {
return probe_max_allocation_.Get();
}
} // namespace webrtc

View File

@ -44,6 +44,8 @@ class RateControlSettings final {
double GetSimulcastVideoHysteresisFactor() const;
double GetSimulcastScreenshareHysteresisFactor() const;
bool TriggerProbeOnMaxAllocatedBitrateChange() const;
private:
explicit RateControlSettings(
const WebRtcKeyValueConfig* const key_value_config);
@ -56,6 +58,7 @@ class RateControlSettings final {
FieldTrialParameter<bool> trust_vp9_;
FieldTrialParameter<double> video_hysteresis_;
FieldTrialParameter<double> screenshare_hysteresis_;
FieldTrialParameter<bool> probe_max_allocation_;
};
} // namespace webrtc