APM: mirror "remove unused field trial" in InputVolumeController

See https://webrtc-review.googlesource.com/c/src/+/278781

Bug: webrtc:7494
Change-Id: I800a93d321bd8c8c7a71b856e151158ec2655d8a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/282822
Reviewed-by: Hanna Silen <silen@webrtc.org>
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38592}
This commit is contained in:
Alessio Bazzica
2022-11-09 11:15:17 +01:00
committed by WebRTC LUCI CQ
parent b83cd92a1a
commit 7f2d4afc40
2 changed files with 5 additions and 24 deletions

View File

@ -56,12 +56,6 @@ Agc1ClippingPredictorConfig CreateClippingPredictorConfig(bool enabled) {
return config;
}
// Returns whether a fall-back solution to choose the maximum level should be
// chosen.
bool UseMaxAnalogChannelLevel() {
return field_trial::IsEnabled("WebRTC-UseMaxAnalogAgcChannelLevel");
}
// If the "WebRTC-Audio-2ndAgcMinMicLevelExperiment" field trial is specified,
// parses it and returns a value between 0 and 255 depending on the field-trial
// string. Returns an unspecified value if the field trial is not specified, if
@ -347,7 +341,6 @@ InputVolumeController::InputVolumeController(int num_capture_channels,
: analog_controller_enabled_(config.enabled),
num_capture_channels_(num_capture_channels),
min_mic_level_override_(GetMinMicLevelOverride()),
use_min_channel_level_(!UseMaxAnalogChannelLevel()),
capture_output_used_(true),
clipped_level_step_(config.clipped_level_step),
clipped_ratio_threshold_(config.clipped_ratio_threshold),
@ -525,21 +518,11 @@ void InputVolumeController::AggregateChannelLevels() {
int new_recommended_input_volume =
channel_controllers_[0]->recommended_analog_level();
channel_controlling_gain_ = 0;
if (use_min_channel_level_) {
for (size_t ch = 1; ch < channel_controllers_.size(); ++ch) {
int level = channel_controllers_[ch]->recommended_analog_level();
if (level < new_recommended_input_volume) {
new_recommended_input_volume = level;
channel_controlling_gain_ = static_cast<int>(ch);
}
}
} else {
for (size_t ch = 1; ch < channel_controllers_.size(); ++ch) {
int level = channel_controllers_[ch]->recommended_analog_level();
if (level > new_recommended_input_volume) {
new_recommended_input_volume = level;
channel_controlling_gain_ = static_cast<int>(ch);
}
for (size_t ch = 1; ch < channel_controllers_.size(); ++ch) {
int level = channel_controllers_[ch]->recommended_analog_level();
if (level < new_recommended_input_volume) {
new_recommended_input_volume = level;
channel_controlling_gain_ = static_cast<int>(ch);
}
}

View File

@ -143,8 +143,6 @@ class InputVolumeController final {
// If not empty, the value is used to override the minimum input volume.
const absl::optional<int> min_mic_level_override_;
const bool use_min_channel_level_;
// TODO(bugs.webrtc.org/7494): Create a separate member for the applied input
// volume.
// TODO(bugs.webrtc.org/7494): Once