AGC2 config change detection fixed

AGC2 is correctly (re)initialized when its config changes.
This CL also improves the `AudioProcessingImpl::ApplyConfig`
readability by defining operator!= also for the AGC1 config.

Bug: webrtc:7494
Change-Id: I62068de32c941e6b18d4618c656f569647042345
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/187120
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Reviewed-by: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32402}
This commit is contained in:
Alessio Bazzica
2020-10-14 12:47:50 +02:00
committed by Commit Bot
parent 44f749dac6
commit 3438a9383c
4 changed files with 313 additions and 34 deletions

View File

@ -274,6 +274,11 @@ class RTC_EXPORT AudioProcessing : public rtc::RefCountInterface {
// HAL.
// Recommended to be enabled on the client-side.
struct GainController1 {
bool operator==(const GainController1& rhs) const;
bool operator!=(const GainController1& rhs) const {
return !(*this == rhs);
}
bool enabled = false;
enum Mode {
// Adaptive mode intended for use if an analog volume control is
@ -338,6 +343,11 @@ class RTC_EXPORT AudioProcessing : public rtc::RefCountInterface {
// first applies a fixed gain. The adaptive digital AGC can be turned off by
// setting |adaptive_digital_mode=false|.
struct GainController2 {
bool operator==(const GainController2& rhs) const;
bool operator!=(const GainController2& rhs) const {
return !(*this == rhs);
}
enum LevelEstimator { kRms, kPeak };
bool enabled = false;
struct {