Moved the AGC render sample queue into the audio processing module

Several subcomponents inside APM copy render audio from
the render side to the capture side using the same
pattern. Currently this is done independently for the
submodules.

This CL moves the the AGC functionality for this into
APM.

BUG=webrtc:5298, webrtc:6540

Review-Url: https://codereview.webrtc.org/2444283002
Cr-Commit-Position: refs/heads/master@{#14770}
diff --git a/webrtc/modules/audio_processing/gain_control_impl.h b/webrtc/modules/audio_processing/gain_control_impl.h
index 1af6d7b..812b88c 100644
--- a/webrtc/modules/audio_processing/gain_control_impl.h
+++ b/webrtc/modules/audio_processing/gain_control_impl.h
@@ -31,21 +31,21 @@
                   rtc::CriticalSection* crit_capture);
   ~GainControlImpl() override;
 
-  int ProcessRenderAudio(AudioBuffer* audio);
+  void ProcessRenderAudio(rtc::ArrayView<const int16_t> packed_render_audio);
   int AnalyzeCaptureAudio(AudioBuffer* audio);
   int ProcessCaptureAudio(AudioBuffer* audio, bool stream_has_echo);
 
   void Initialize(size_t num_proc_channels, int sample_rate_hz);
 
+  static void PackRenderAudioBuffer(AudioBuffer* audio,
+                                    std::vector<int16_t>* packed_buffer);
+
   // GainControl implementation.
   bool is_enabled() const override;
   int stream_analog_level() override;
   bool is_limiter_enabled() const override;
   Mode mode() const override;
 
-  // Reads render side data that has been queued on the render call.
-  void ReadQueuedRenderData();
-
   int compression_gain_db() const override;
 
  private:
@@ -64,7 +64,6 @@
   int analog_level_maximum() const override;
   bool stream_is_saturated() const override;
 
-  void AllocateRenderQueue();
   int Configure();
 
   rtc::CriticalSection* const crit_render_ ACQUIRED_BEFORE(crit_capture_);
@@ -82,16 +81,6 @@
   bool was_analog_level_set_ GUARDED_BY(crit_capture_);
   bool stream_is_saturated_ GUARDED_BY(crit_capture_);
 
-  size_t render_queue_element_max_size_ GUARDED_BY(crit_render_)
-      GUARDED_BY(crit_capture_);
-  std::vector<int16_t> render_queue_buffer_ GUARDED_BY(crit_render_);
-  std::vector<int16_t> capture_queue_buffer_ GUARDED_BY(crit_capture_);
-
-  // Lock protection not needed.
-  std::unique_ptr<
-      SwapQueue<std::vector<int16_t>, RenderQueueItemVerifier<int16_t>>>
-      render_signal_queue_;
-
   std::vector<std::unique_ptr<GainController>> gain_controllers_;
 
   rtc::Optional<size_t> num_proc_channels_ GUARDED_BY(crit_capture_);