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_buffer.h b/modules/audio_processing/audio_buffer.h
index 161c509..3eecf0d 100644
--- a/modules/audio_processing/audio_buffer.h
+++ b/modules/audio_processing/audio_buffer.h
@@ -17,7 +17,6 @@
#include <memory>
#include <vector>
-#include "api/audio/audio_frame.h"
#include "common_audio/channel_buffer.h"
#include "modules/audio_processing/include/audio_processing.h"
@@ -109,12 +108,15 @@
}
// Copies data into the buffer.
- void CopyFrom(const AudioFrame* frame);
- void CopyFrom(const float* const* data, const StreamConfig& stream_config);
+ void CopyFrom(const int16_t* const interleaved_data,
+ const StreamConfig& stream_config);
+ void CopyFrom(const float* const* stacked_data,
+ const StreamConfig& stream_config);
// Copies data from the buffer.
- void CopyTo(AudioFrame* frame) const;
- void CopyTo(const StreamConfig& stream_config, float* const* data);
+ void CopyTo(const StreamConfig& stream_config,
+ int16_t* const interleaved_data);
+ void CopyTo(const StreamConfig& stream_config, float* const* stacked_data);
void CopyTo(AudioBuffer* buffer) const;
// Splits the buffer data into frequency bands.
@@ -145,8 +147,6 @@
const float* const* split_channels_const_f(Band band) const {
return split_channels_const(band);
}
- void DeinterleaveFrom(const AudioFrame* frame) { CopyFrom(frame); }
- void InterleaveTo(AudioFrame* frame) const { CopyTo(frame); }
private:
FRIEND_TEST_ALL_PREFIXES(AudioBufferTest,