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}
This commit is contained in:
Per Åhgren
2020-03-16 12:06:02 +01:00
committed by Commit Bot
parent d5d0a2b546
commit 645f24cb86
16 changed files with 257 additions and 114 deletions

View File

@ -82,6 +82,12 @@ class MockAudioProcessing : public ::testing::NiceMock<AudioProcessing> {
MOCK_METHOD1(set_output_will_be_muted, void(bool muted));
MOCK_METHOD1(SetRuntimeSetting, void(RuntimeSetting setting));
MOCK_METHOD1(ProcessStream, int(AudioFrame* frame));
MOCK_METHOD5(ProcessStream,
int(const int16_t* const src,
const StreamConfig& input_config,
const StreamConfig& output_config,
int16_t* const dest,
VoiceDetectionResult* const vad_result));
MOCK_METHOD7(ProcessStream,
int(const float* const* src,
size_t samples_per_channel,
@ -96,6 +102,11 @@ class MockAudioProcessing : public ::testing::NiceMock<AudioProcessing> {
const StreamConfig& output_config,
float* const* dest));
MOCK_METHOD1(ProcessReverseStream, int(AudioFrame* frame));
MOCK_METHOD4(ProcessReverseStream,
int(const int16_t* const src,
const StreamConfig& input_config,
const StreamConfig& output_config,
int16_t* const dest));
MOCK_METHOD4(AnalyzeReverseStream,
int(const float* const* data,
size_t samples_per_channel,