Cleanup of AudioAllocationSettings flags.
Using simple IsEnabled/IsDisabled instead of the parser for Enabled/
Disabled flags to improve readability.
Bug: webrtc:9883
Change-Id: I3dbf906d49f99269f73a8ced6b3f042181228f3d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/138078
Reviewed-by: Christoffer Rodbro <crodbro@webrtc.org>
Commit-Queue: Sebastian Jansson <srte@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28062}
diff --git a/rtc_base/experiments/audio_allocation_settings.cc b/rtc_base/experiments/audio_allocation_settings.cc
index 62f0c8c..034bcbb 100644
--- a/rtc_base/experiments/audio_allocation_settings.cc
+++ b/rtc_base/experiments/audio_allocation_settings.cc
@@ -17,26 +17,19 @@
constexpr int kOverheadPerPacket = 20 + 8 + 10 + 12;
} // namespace
AudioAllocationSettings::AudioAllocationSettings()
- : audio_send_side_bwe_(/*Flag key*/ "Enabled"),
- allocate_audio_without_feedback_(/*Flag key*/ "Enabled"),
- force_no_audio_feedback_(/*Flag key*/ "Enabled"),
- disable_audio_alr_request_(/*Flag key*/ "Disabled"),
- send_side_bwe_with_overhead_(/*Flag key*/ "Enabled"),
+ : audio_send_side_bwe_(field_trial::IsEnabled("WebRTC-Audio-SendSideBwe")),
+ allocate_audio_without_feedback_(
+ field_trial::IsEnabled("WebRTC-Audio-ABWENoTWCC")),
+ force_no_audio_feedback_(
+ field_trial::IsEnabled("WebRTC-Audio-ForceNoTWCC")),
+ enable_audio_alr_probing_(
+ !field_trial::IsDisabled("WebRTC-Audio-AlrProbing")),
+ send_side_bwe_with_overhead_(
+ field_trial::IsEnabled("WebRTC-SendSideBwe-WithOverhead")),
min_bitrate_("min"),
max_bitrate_("max"),
priority_bitrate_("prio_rate", DataRate::Zero()),
bitrate_priority_("rate_prio") {
- ParseFieldTrial({&audio_send_side_bwe_},
- field_trial::FindFullName("WebRTC-Audio-SendSideBwe"));
- ParseFieldTrial({&allocate_audio_without_feedback_},
- field_trial::FindFullName("WebRTC-Audio-ABWENoTWCC"));
- ParseFieldTrial({&force_no_audio_feedback_},
- field_trial::FindFullName("WebRTC-Audio-ForceNoTWCC"));
- ParseFieldTrial({&disable_audio_alr_request_},
- field_trial::FindFullName("WebRTC-Audio-AlrProbing"));
-
- ParseFieldTrial({&send_side_bwe_with_overhead_},
- field_trial::FindFullName("WebRTC-SendSideBwe-WithOverhead"));
ParseFieldTrial(
{&min_bitrate_, &max_bitrate_, &priority_bitrate_, &bitrate_priority_},
field_trial::FindFullName("WebRTC-Audio-Allocation"));
@@ -72,7 +65,7 @@
}
bool AudioAllocationSettings::RequestAlrProbing() const {
- return !disable_audio_alr_request_;
+ return enable_audio_alr_probing_;
}
bool AudioAllocationSettings::IncludeAudioInAllocationOnStart(
diff --git a/rtc_base/experiments/audio_allocation_settings.h b/rtc_base/experiments/audio_allocation_settings.h
index c908a57..6c655b8 100644
--- a/rtc_base/experiments/audio_allocation_settings.h
+++ b/rtc_base/experiments/audio_allocation_settings.h
@@ -79,11 +79,11 @@
absl::optional<double> BitratePriority() const;
private:
- FieldTrialFlag audio_send_side_bwe_;
- FieldTrialFlag allocate_audio_without_feedback_;
- FieldTrialFlag force_no_audio_feedback_;
- FieldTrialFlag disable_audio_alr_request_;
- FieldTrialFlag send_side_bwe_with_overhead_;
+ const bool audio_send_side_bwe_;
+ const bool allocate_audio_without_feedback_;
+ const bool force_no_audio_feedback_;
+ const bool enable_audio_alr_probing_;
+ const bool send_side_bwe_with_overhead_;
int min_overhead_bps_ = 0;
// Field Trial configured bitrates to use as overrides over default/user
// configured bitrate range when audio bitrate allocation is enabled.