APM: Add a field trial for input volume controller

Add a field trial WebRTC-Audio-InputVolumeControllerExperiment and
a mechanism to adjust the config accordingly. Pass the additional
input volume controller config to GainController2.

Bug: webrtc:7494
Change-Id: I3dd624df1f4774cb533417747627995e1f60aa68
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/284101
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Reviewed-by: Per Åhgren <peah@webrtc.org>
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Commit-Queue: Hanna Silen <silen@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38780}
This commit is contained in:
Hanna Silen
2022-11-30 16:59:05 +01:00
committed by WebRTC LUCI CQ
parent c19ec96bd7
commit a6574909e9
7 changed files with 565 additions and 48 deletions

View File

@ -160,6 +160,9 @@ class AudioProcessingImpl : public AudioProcessing {
ReinitializeTransientSuppressor);
FRIEND_TEST_ALL_PREFIXES(ApmWithSubmodulesExcludedTest,
BitexactWithDisabledModules);
FRIEND_TEST_ALL_PREFIXES(
AudioProcessingImplInputVolumeControllerExperimentParametrizedTest,
ConfigAdjustedWhenExperimentEnabled);
void set_stream_analog_level_locked(int level)
RTC_EXCLUSIVE_LOCKS_REQUIRED(mutex_capture_);
@ -188,6 +191,12 @@ class AudioProcessingImpl : public AudioProcessing {
static std::atomic<int> instance_count_;
const bool use_setup_specific_default_aec3_config_;
// TODO(bugs.webrtc.org/7494): Remove the the config when the field trial is
// removed. "WebRTC-Audio-InputVolumeControllerExperiment" field trial
// override for the input volume controller config.
const absl::optional<InputVolumeController::Config>
input_volume_controller_config_override_;
const bool use_denormal_disabler_;
const TransientSuppressor::VadMode transient_suppressor_vad_mode_;