diff --git a/webrtc/common_types.h b/webrtc/common_types.h index fd5d820892..0a1c67c63a 100644 --- a/webrtc/common_types.h +++ b/webrtc/common_types.h @@ -708,6 +708,9 @@ class BitrateAllocation { // Bandwidth over-use detector options. These are used to drive // experimentation with bandwidth estimation parameters. // See modules/remote_bitrate_estimator/overuse_detector.h +// TODO(terelius): This is only used in overuse_estimator.cc, and only in the +// default constructed state. Can we move the relevant variables into that +// class and delete this? See also disabled warning at line 27 struct OverUseDetectorOptions { OverUseDetectorOptions() : initial_slope(8.0 / 512.0), diff --git a/webrtc/modules/congestion_controller/delay_based_bwe.cc b/webrtc/modules/congestion_controller/delay_based_bwe.cc index bb63f353da..6338f9646f 100644 --- a/webrtc/modules/congestion_controller/delay_based_bwe.cc +++ b/webrtc/modules/congestion_controller/delay_based_bwe.cc @@ -213,7 +213,7 @@ DelayBasedBwe::DelayBasedBwe(Clock* clock) inter_arrival_(), kalman_estimator_(), trendline_estimator_(), - detector_(OverUseDetectorOptions()), + detector_(), receiver_incoming_bitrate_(), last_update_ms_(-1), last_seen_packet_ms_(-1), diff --git a/webrtc/modules/remote_bitrate_estimator/overuse_detector.cc b/webrtc/modules/remote_bitrate_estimator/overuse_detector.cc index 8c2854dacd..86854291e4 100644 --- a/webrtc/modules/remote_bitrate_estimator/overuse_detector.cc +++ b/webrtc/modules/remote_bitrate_estimator/overuse_detector.cc @@ -60,14 +60,13 @@ bool ReadExperimentConstants(double* k_up, double* k_down) { "%lf,%lf", k_up, k_down) == 2; } -OveruseDetector::OveruseDetector(const OverUseDetectorOptions& options) +OveruseDetector::OveruseDetector() // Experiment is on by default, but can be disabled with finch by setting // the field trial string to "WebRTC-AdaptiveBweThreshold/Disabled/". : in_experiment_(!AdaptiveThresholdExperimentIsDisabled()), k_up_(0.0087), k_down_(0.039), overusing_time_threshold_(100), - options_(options), threshold_(12.5), last_update_ms_(-1), prev_offset_(0.0), diff --git a/webrtc/modules/remote_bitrate_estimator/overuse_detector.h b/webrtc/modules/remote_bitrate_estimator/overuse_detector.h index ce61e3b4d9..03ddb1ee6a 100644 --- a/webrtc/modules/remote_bitrate_estimator/overuse_detector.h +++ b/webrtc/modules/remote_bitrate_estimator/overuse_detector.h @@ -24,7 +24,7 @@ bool AdaptiveThresholdExperimentIsDisabled(); class OveruseDetector { public: - explicit OveruseDetector(const OverUseDetectorOptions& options); + OveruseDetector(); virtual ~OveruseDetector(); // Update the detection state based on the estimated inter-arrival time delta @@ -49,9 +49,6 @@ class OveruseDetector { double k_up_; double k_down_; double overusing_time_threshold_; - // Must be first member variable. Cannot be const because we need to be - // copyable. - webrtc::OverUseDetectorOptions options_; double threshold_; int64_t last_update_ms_; double prev_offset_; diff --git a/webrtc/modules/remote_bitrate_estimator/overuse_detector_unittest.cc b/webrtc/modules/remote_bitrate_estimator/overuse_detector_unittest.cc index 576e253621..fb5d4e7939 100644 --- a/webrtc/modules/remote_bitrate_estimator/overuse_detector_unittest.cc +++ b/webrtc/modules/remote_bitrate_estimator/overuse_detector_unittest.cc @@ -42,7 +42,7 @@ class OveruseDetectorTest : public ::testing::Test { protected: void SetUp() override { - overuse_detector_.reset(new OveruseDetector(options_)); + overuse_detector_.reset(new OveruseDetector()); } int Run100000Samples(int packets_per_frame, size_t packet_size, int mean_ms, @@ -649,7 +649,7 @@ class OveruseDetectorExperimentTest : public OveruseDetectorTest { protected: void SetUp() override { - overuse_detector_.reset(new OveruseDetector(options_)); + overuse_detector_.reset(new OveruseDetector()); } test::ScopedFieldTrials override_field_trials_; diff --git a/webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator_abs_send_time.cc b/webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator_abs_send_time.cc index 93344dd05d..269a5d117d 100644 --- a/webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator_abs_send_time.cc +++ b/webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator_abs_send_time.cc @@ -86,7 +86,7 @@ bool RemoteBitrateEstimatorAbsSendTime::IsWithinClusterBounds( observer_(observer), inter_arrival_(), estimator_(), - detector_(OverUseDetectorOptions()), + detector_(), incoming_bitrate_(kBitrateWindowMs, 8000), incoming_bitrate_initialized_(false), total_probes_received_(0), diff --git a/webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator_single_stream.cc b/webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator_single_stream.cc index b689aa62b8..51d79cd9c2 100644 --- a/webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator_single_stream.cc +++ b/webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator_single_stream.cc @@ -38,7 +38,7 @@ struct RemoteBitrateEstimatorSingleStream::Detector { kTimestampToMs, enable_burst_grouping), estimator(options), - detector(options) {} + detector() {} int64_t last_packet_time_ms; InterArrival inter_arrival; OveruseEstimator estimator;