Replace field trials with WebRtcKeyValueConfig in SendSideBandwidthEstimate
And ad field trial flag to be able to disable RttBasedBackoff Bug: webrtc:10335 Change-Id: Ib67d3e75787daed96e22b2c732f6839e23e4abda Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/191967 Reviewed-by: Christoffer Rodbro <crodbro@webrtc.org> Commit-Queue: Per Kjellander <perkj@webrtc.org> Cr-Commit-Position: refs/heads/master@{#32566}
This commit is contained in:
parent
9c99b7964f
commit
9dfe2fce9a
@ -157,6 +157,7 @@ rtc_library("loss_based_controller") {
|
|||||||
deps = [
|
deps = [
|
||||||
"../../../api/rtc_event_log",
|
"../../../api/rtc_event_log",
|
||||||
"../../../api/transport:network_control",
|
"../../../api/transport:network_control",
|
||||||
|
"../../../api/transport:webrtc_key_value_config",
|
||||||
"../../../api/units:data_rate",
|
"../../../api/units:data_rate",
|
||||||
"../../../api/units:time_delta",
|
"../../../api/units:time_delta",
|
||||||
"../../../api/units:timestamp",
|
"../../../api/units:timestamp",
|
||||||
@ -292,6 +293,7 @@ if (rtc_include_tests) {
|
|||||||
"../../../rtc_base:rtc_base_tests_utils",
|
"../../../rtc_base:rtc_base_tests_utils",
|
||||||
"../../../rtc_base/experiments:alr_experiment",
|
"../../../rtc_base/experiments:alr_experiment",
|
||||||
"../../../system_wrappers",
|
"../../../system_wrappers",
|
||||||
|
"../../../test:explicit_key_value_config",
|
||||||
"../../../test:field_trial",
|
"../../../test:field_trial",
|
||||||
"../../../test:test_support",
|
"../../../test:test_support",
|
||||||
"../../../test/scenario",
|
"../../../test/scenario",
|
||||||
|
|||||||
@ -96,7 +96,8 @@ GoogCcNetworkController::GoogCcNetworkController(NetworkControllerConfig config,
|
|||||||
key_value_config_)
|
key_value_config_)
|
||||||
: nullptr),
|
: nullptr),
|
||||||
bandwidth_estimation_(
|
bandwidth_estimation_(
|
||||||
std::make_unique<SendSideBandwidthEstimation>(event_log_)),
|
std::make_unique<SendSideBandwidthEstimation>(key_value_config_,
|
||||||
|
event_log_)),
|
||||||
alr_detector_(
|
alr_detector_(
|
||||||
std::make_unique<AlrDetector>(key_value_config_, config.event_log)),
|
std::make_unique<AlrDetector>(key_value_config_, config.event_log)),
|
||||||
probe_bitrate_estimator_(new ProbeBitrateEstimator(config.event_log)),
|
probe_bitrate_estimator_(new ProbeBitrateEstimator(config.event_log)),
|
||||||
|
|||||||
@ -19,6 +19,8 @@
|
|||||||
#include "absl/strings/match.h"
|
#include "absl/strings/match.h"
|
||||||
#include "api/rtc_event_log/rtc_event.h"
|
#include "api/rtc_event_log/rtc_event.h"
|
||||||
#include "api/rtc_event_log/rtc_event_log.h"
|
#include "api/rtc_event_log/rtc_event_log.h"
|
||||||
|
#include "api/transport/webrtc_key_value_config.h"
|
||||||
|
#include "api/units/time_delta.h"
|
||||||
#include "logging/rtc_event_log/events/rtc_event_bwe_update_loss_based.h"
|
#include "logging/rtc_event_log/events/rtc_event_bwe_update_loss_based.h"
|
||||||
#include "modules/remote_bitrate_estimator/include/bwe_defines.h"
|
#include "modules/remote_bitrate_estimator/include/bwe_defines.h"
|
||||||
#include "rtc_base/checks.h"
|
#include "rtc_base/checks.h"
|
||||||
@ -153,19 +155,24 @@ DataRate LinkCapacityTracker::estimate() const {
|
|||||||
return DataRate::BitsPerSec(capacity_estimate_bps_);
|
return DataRate::BitsPerSec(capacity_estimate_bps_);
|
||||||
}
|
}
|
||||||
|
|
||||||
RttBasedBackoff::RttBasedBackoff()
|
RttBasedBackoff::RttBasedBackoff(const WebRtcKeyValueConfig* key_value_config)
|
||||||
: rtt_limit_("limit", TimeDelta::Seconds(3)),
|
: disabled_("Disabled"),
|
||||||
|
configured_limit_("limit", TimeDelta::Seconds(3)),
|
||||||
drop_fraction_("fraction", 0.8),
|
drop_fraction_("fraction", 0.8),
|
||||||
drop_interval_("interval", TimeDelta::Seconds(1)),
|
drop_interval_("interval", TimeDelta::Seconds(1)),
|
||||||
bandwidth_floor_("floor", DataRate::KilobitsPerSec(5)),
|
bandwidth_floor_("floor", DataRate::KilobitsPerSec(5)),
|
||||||
|
rtt_limit_(TimeDelta::PlusInfinity()),
|
||||||
// By initializing this to plus infinity, we make sure that we never
|
// By initializing this to plus infinity, we make sure that we never
|
||||||
// trigger rtt backoff unless packet feedback is enabled.
|
// trigger rtt backoff unless packet feedback is enabled.
|
||||||
last_propagation_rtt_update_(Timestamp::PlusInfinity()),
|
last_propagation_rtt_update_(Timestamp::PlusInfinity()),
|
||||||
last_propagation_rtt_(TimeDelta::Zero()),
|
last_propagation_rtt_(TimeDelta::Zero()),
|
||||||
last_packet_sent_(Timestamp::MinusInfinity()) {
|
last_packet_sent_(Timestamp::MinusInfinity()) {
|
||||||
ParseFieldTrial(
|
ParseFieldTrial({&disabled_, &configured_limit_, &drop_fraction_,
|
||||||
{&rtt_limit_, &drop_fraction_, &drop_interval_, &bandwidth_floor_},
|
&drop_interval_, &bandwidth_floor_},
|
||||||
field_trial::FindFullName("WebRTC-Bwe-MaxRttLimit"));
|
key_value_config->Lookup("WebRTC-Bwe-MaxRttLimit"));
|
||||||
|
if (!disabled_) {
|
||||||
|
rtt_limit_ = configured_limit_.Get();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void RttBasedBackoff::UpdatePropagationRtt(Timestamp at_time,
|
void RttBasedBackoff::UpdatePropagationRtt(Timestamp at_time,
|
||||||
@ -186,8 +193,11 @@ TimeDelta RttBasedBackoff::CorrectedRtt(Timestamp at_time) const {
|
|||||||
|
|
||||||
RttBasedBackoff::~RttBasedBackoff() = default;
|
RttBasedBackoff::~RttBasedBackoff() = default;
|
||||||
|
|
||||||
SendSideBandwidthEstimation::SendSideBandwidthEstimation(RtcEventLog* event_log)
|
SendSideBandwidthEstimation::SendSideBandwidthEstimation(
|
||||||
: lost_packets_since_last_loss_update_(0),
|
const WebRtcKeyValueConfig* key_value_config,
|
||||||
|
RtcEventLog* event_log)
|
||||||
|
: rtt_backoff_(key_value_config),
|
||||||
|
lost_packets_since_last_loss_update_(0),
|
||||||
expected_packets_since_last_loss_update_(0),
|
expected_packets_since_last_loss_update_(0),
|
||||||
current_target_(DataRate::Zero()),
|
current_target_(DataRate::Zero()),
|
||||||
last_logged_target_(DataRate::Zero()),
|
last_logged_target_(DataRate::Zero()),
|
||||||
|
|||||||
@ -21,6 +21,7 @@
|
|||||||
|
|
||||||
#include "absl/types/optional.h"
|
#include "absl/types/optional.h"
|
||||||
#include "api/transport/network_types.h"
|
#include "api/transport/network_types.h"
|
||||||
|
#include "api/transport/webrtc_key_value_config.h"
|
||||||
#include "api/units/data_rate.h"
|
#include "api/units/data_rate.h"
|
||||||
#include "api/units/time_delta.h"
|
#include "api/units/time_delta.h"
|
||||||
#include "api/units/timestamp.h"
|
#include "api/units/timestamp.h"
|
||||||
@ -54,17 +55,19 @@ class LinkCapacityTracker {
|
|||||||
|
|
||||||
class RttBasedBackoff {
|
class RttBasedBackoff {
|
||||||
public:
|
public:
|
||||||
RttBasedBackoff();
|
explicit RttBasedBackoff(const WebRtcKeyValueConfig* key_value_config);
|
||||||
~RttBasedBackoff();
|
~RttBasedBackoff();
|
||||||
void UpdatePropagationRtt(Timestamp at_time, TimeDelta propagation_rtt);
|
void UpdatePropagationRtt(Timestamp at_time, TimeDelta propagation_rtt);
|
||||||
TimeDelta CorrectedRtt(Timestamp at_time) const;
|
TimeDelta CorrectedRtt(Timestamp at_time) const;
|
||||||
|
|
||||||
FieldTrialParameter<TimeDelta> rtt_limit_;
|
FieldTrialFlag disabled_;
|
||||||
|
FieldTrialParameter<TimeDelta> configured_limit_;
|
||||||
FieldTrialParameter<double> drop_fraction_;
|
FieldTrialParameter<double> drop_fraction_;
|
||||||
FieldTrialParameter<TimeDelta> drop_interval_;
|
FieldTrialParameter<TimeDelta> drop_interval_;
|
||||||
FieldTrialParameter<DataRate> bandwidth_floor_;
|
FieldTrialParameter<DataRate> bandwidth_floor_;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
TimeDelta rtt_limit_;
|
||||||
Timestamp last_propagation_rtt_update_;
|
Timestamp last_propagation_rtt_update_;
|
||||||
TimeDelta last_propagation_rtt_;
|
TimeDelta last_propagation_rtt_;
|
||||||
Timestamp last_packet_sent_;
|
Timestamp last_packet_sent_;
|
||||||
@ -73,7 +76,8 @@ class RttBasedBackoff {
|
|||||||
class SendSideBandwidthEstimation {
|
class SendSideBandwidthEstimation {
|
||||||
public:
|
public:
|
||||||
SendSideBandwidthEstimation() = delete;
|
SendSideBandwidthEstimation() = delete;
|
||||||
explicit SendSideBandwidthEstimation(RtcEventLog* event_log);
|
SendSideBandwidthEstimation(const WebRtcKeyValueConfig* key_value_config,
|
||||||
|
RtcEventLog* event_log);
|
||||||
~SendSideBandwidthEstimation();
|
~SendSideBandwidthEstimation();
|
||||||
|
|
||||||
void OnRouteChange();
|
void OnRouteChange();
|
||||||
|
|||||||
@ -13,6 +13,7 @@
|
|||||||
#include "api/rtc_event_log/rtc_event.h"
|
#include "api/rtc_event_log/rtc_event.h"
|
||||||
#include "logging/rtc_event_log/events/rtc_event_bwe_update_loss_based.h"
|
#include "logging/rtc_event_log/events/rtc_event_bwe_update_loss_based.h"
|
||||||
#include "logging/rtc_event_log/mock/mock_rtc_event_log.h"
|
#include "logging/rtc_event_log/mock/mock_rtc_event_log.h"
|
||||||
|
#include "test/explicit_key_value_config.h"
|
||||||
#include "test/gmock.h"
|
#include "test/gmock.h"
|
||||||
#include "test/gtest.h"
|
#include "test/gtest.h"
|
||||||
|
|
||||||
@ -36,7 +37,8 @@ MATCHER(LossBasedBweUpdateWithBitrateAndLossFraction, "") {
|
|||||||
|
|
||||||
void TestProbing(bool use_delay_based) {
|
void TestProbing(bool use_delay_based) {
|
||||||
::testing::NiceMock<MockRtcEventLog> event_log;
|
::testing::NiceMock<MockRtcEventLog> event_log;
|
||||||
SendSideBandwidthEstimation bwe(&event_log);
|
test::ExplicitKeyValueConfig key_value_config("");
|
||||||
|
SendSideBandwidthEstimation bwe(&key_value_config, &event_log);
|
||||||
int64_t now_ms = 0;
|
int64_t now_ms = 0;
|
||||||
bwe.SetMinMaxBitrate(DataRate::BitsPerSec(100000),
|
bwe.SetMinMaxBitrate(DataRate::BitsPerSec(100000),
|
||||||
DataRate::BitsPerSec(1500000));
|
DataRate::BitsPerSec(1500000));
|
||||||
@ -88,7 +90,8 @@ TEST(SendSideBweTest, DoesntReapplyBitrateDecreaseWithoutFollowingRemb) {
|
|||||||
EXPECT_CALL(event_log,
|
EXPECT_CALL(event_log,
|
||||||
LogProxy(LossBasedBweUpdateWithBitrateAndLossFraction()))
|
LogProxy(LossBasedBweUpdateWithBitrateAndLossFraction()))
|
||||||
.Times(1);
|
.Times(1);
|
||||||
SendSideBandwidthEstimation bwe(&event_log);
|
test::ExplicitKeyValueConfig key_value_config("");
|
||||||
|
SendSideBandwidthEstimation bwe(&key_value_config, &event_log);
|
||||||
static const int kMinBitrateBps = 100000;
|
static const int kMinBitrateBps = 100000;
|
||||||
static const int kInitialBitrateBps = 1000000;
|
static const int kInitialBitrateBps = 1000000;
|
||||||
int64_t now_ms = 1000;
|
int64_t now_ms = 1000;
|
||||||
@ -138,7 +141,8 @@ TEST(SendSideBweTest, DoesntReapplyBitrateDecreaseWithoutFollowingRemb) {
|
|||||||
|
|
||||||
TEST(SendSideBweTest, SettingSendBitrateOverridesDelayBasedEstimate) {
|
TEST(SendSideBweTest, SettingSendBitrateOverridesDelayBasedEstimate) {
|
||||||
::testing::NiceMock<MockRtcEventLog> event_log;
|
::testing::NiceMock<MockRtcEventLog> event_log;
|
||||||
SendSideBandwidthEstimation bwe(&event_log);
|
test::ExplicitKeyValueConfig key_value_config("");
|
||||||
|
SendSideBandwidthEstimation bwe(&key_value_config, &event_log);
|
||||||
static const int kMinBitrateBps = 10000;
|
static const int kMinBitrateBps = 10000;
|
||||||
static const int kMaxBitrateBps = 10000000;
|
static const int kMaxBitrateBps = 10000000;
|
||||||
static const int kInitialBitrateBps = 300000;
|
static const int kInitialBitrateBps = 300000;
|
||||||
@ -163,4 +167,17 @@ TEST(SendSideBweTest, SettingSendBitrateOverridesDelayBasedEstimate) {
|
|||||||
EXPECT_EQ(bwe.target_rate().bps(), kForcedHighBitrate);
|
EXPECT_EQ(bwe.target_rate().bps(), kForcedHighBitrate);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TEST(RttBasedBackoff, DefaultEnabled) {
|
||||||
|
test::ExplicitKeyValueConfig key_value_config("");
|
||||||
|
RttBasedBackoff rtt_backoff(&key_value_config);
|
||||||
|
EXPECT_TRUE(rtt_backoff.rtt_limit_.IsFinite());
|
||||||
|
}
|
||||||
|
|
||||||
|
TEST(RttBasedBackoff, CanBeDisabled) {
|
||||||
|
test::ExplicitKeyValueConfig key_value_config(
|
||||||
|
"WebRTC-Bwe-MaxRttLimit/Disabled/");
|
||||||
|
RttBasedBackoff rtt_backoff(&key_value_config);
|
||||||
|
EXPECT_TRUE(rtt_backoff.rtt_limit_.IsPlusInfinity());
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace webrtc
|
} // namespace webrtc
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user