Reset Agc2 on analog gain changes.

Agc2 applies a digital gain to the nearend signal.
When the analog level changes, the digital gain calculation is no
longer valid. Therefore Agc2 should be notified to analog gain
changes.

This CL also allow audioproc_f to chain AGC1 and AGC2. In a dependent
CL we will allow using AGC1 for analog gain and AGC2 for digital
gain.

Bug: webrtc:7494
Change-Id: Id75b3728fbf2de1d84b7fba005e4670c7a2985d9
Reviewed-on: https://webrtc-review.googlesource.com/89387
Commit-Queue: Alex Loiko <aleloi@webrtc.org>
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24231}
diff --git a/modules/audio_processing/gain_controller2.h b/modules/audio_processing/gain_controller2.h
index e2ca05e..41b7b69 100644
--- a/modules/audio_processing/gain_controller2.h
+++ b/modules/audio_processing/gain_controller2.h
@@ -33,6 +33,7 @@
 
   void Initialize(int sample_rate_hz);
   void Process(AudioBuffer* audio);
+  void NotifyAnalogLevel(int level);
 
   void ApplyConfig(const AudioProcessing::Config::GainController2& config);
   static bool Validate(const AudioProcessing::Config::GainController2& config);
@@ -45,6 +46,7 @@
   FixedGainController fixed_gain_controller_;
   AudioProcessing::Config::GainController2 config_;
   AdaptiveAgc adaptive_agc_;
+  int analog_level_ = -1;
 
   RTC_DISALLOW_COPY_AND_ASSIGN(GainController2);
 };