APM: Replace most usages of AudioFrame with a stream interface

This CL creates a new stream interface and uses it to replace
most of the usage of AudioFrame in the non-test code.

The CL changes some of the test code as well, as the other
changes required that.

The CL will be followed by 2 more related CLs.

Bug: webrtc:5298
Change-Id: I5cfbe6079f30fc3fbf35b35fd077b6fb49c7def0
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/170040
Commit-Queue: Per Åhgren <peah@webrtc.org>
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30799}
diff --git a/modules/audio_processing/audio_processing_impl.h b/modules/audio_processing/audio_processing_impl.h
index fd86f39..23ae28f 100644
--- a/modules/audio_processing/audio_processing_impl.h
+++ b/modules/audio_processing/audio_processing_impl.h
@@ -43,6 +43,7 @@
 namespace webrtc {
 
 class ApmDataDumper;
+class AudioFrame;
 class AudioConverter;
 
 class AudioProcessingImpl : public AudioProcessing {
@@ -80,6 +81,11 @@
   // Capture-side exclusive methods possibly running APM in a
   // multi-threaded manner. Acquire the capture lock.
   int ProcessStream(AudioFrame* frame) override;
+  int ProcessStream(const int16_t* const src,
+                    const StreamConfig& input_config,
+                    const StreamConfig& output_config,
+                    int16_t* const dest,
+                    VoiceDetectionResult* vad_state) override;
   int ProcessStream(const float* const* src,
                     const StreamConfig& input_config,
                     const StreamConfig& output_config,
@@ -95,6 +101,10 @@
   // Render-side exclusive methods possibly running APM in a
   // multi-threaded manner. Acquire the render lock.
   int ProcessReverseStream(AudioFrame* frame) override;
+  int ProcessReverseStream(const int16_t* const src,
+                           const StreamConfig& input_config,
+                           const StreamConfig& output_config,
+                           int16_t* const dest) override;
   int AnalyzeReverseStream(const float* const* data,
                            const StreamConfig& reverse_config) override;
   int ProcessReverseStream(const float* const* src,
@@ -292,7 +302,8 @@
   void RecordUnprocessedCaptureStream(const float* const* capture_stream)
       RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_capture_);
 
-  void RecordUnprocessedCaptureStream(const AudioFrame& capture_frame)
+  void RecordUnprocessedCaptureStream(const int16_t* const data,
+                                      const StreamConfig& config)
       RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_capture_);
 
   // Notifies attached AecDump of current configuration and
@@ -302,7 +313,8 @@
       const float* const* processed_capture_stream)
       RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_capture_);
 
-  void RecordProcessedCaptureStream(const AudioFrame& processed_capture_frame)
+  void RecordProcessedCaptureStream(const int16_t* const data,
+                                    const StreamConfig& config)
       RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_capture_);
 
   // Notifies attached AecDump about current state (delay, drift, etc).