Index: webrtc/modules/audio_processing/aec3/block_processor.h |
diff --git a/webrtc/modules/audio_processing/aec3/block_processor.h b/webrtc/modules/audio_processing/aec3/block_processor.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..062b7e0468b8ccecde659c432551c612463024dd |
--- /dev/null |
+++ b/webrtc/modules/audio_processing/aec3/block_processor.h |
@@ -0,0 +1,69 @@ |
+/* |
+ * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. |
+ * |
+ * Use of this source code is governed by a BSD-style license |
+ * that can be found in the LICENSE file in the root of the source |
+ * tree. An additional intellectual property rights grant can be found |
+ * in the file PATENTS. All contributing project authors may |
+ * be found in the AUTHORS file in the root of the source tree. |
+ */ |
+ |
+#ifndef WEBRTC_MODULES_AUDIO_PROCESSING_AEC3_BLOCK_PROCESSOR_H_ |
+#define WEBRTC_MODULES_AUDIO_PROCESSING_AEC3_BLOCK_PROCESSOR_H_ |
+ |
+#include <memory> |
+#include <vector> |
+ |
+#include "webrtc/base/constructormagic.h" |
+#include "webrtc/modules/audio_processing/logging/apm_data_dumper.h" |
+ |
+namespace webrtc { |
+ |
+// BlockProcessor interface. |
aleloi
2016/12/20 15:55:35
I think this comment can be removed or changed to
peah-webrtc
2016/12/21 23:13:50
Done.
|
+class BlockProcessor { |
+ public: |
+ static BlockProcessor* Create(int sample_rate_hz, size_t num_bands); |
+ virtual ~BlockProcessor() {} |
aleloi
2016/12/20 15:55:35
= default.
peah-webrtc
2016/12/21 23:13:50
Done.
|
+ |
+ // Processes a block of capture data. |
+ virtual void ProcessCapture( |
+ bool known_echo_path_change, |
+ bool saturated_microphone_signal, |
+ std::vector<std::vector<float>>* capture_block) = 0; |
+ |
+ // Buffers a block of render data supplied by a FrameBlocker object. |
+ virtual bool BufferRender(std::vector<std::vector<float>>* block) = 0; |
+ |
+ // Reports whether echo leakage has been detected in the echo canceller |
+ // output. |
+ virtual void ReportEchoLeakage(bool leakage_detected) = 0; |
+}; |
+ |
+// Class for performing echo cancellation on 64 sample blocks of audio data. |
+// Implements the BlockProcessor interface. |
+class BlockProcessorImpl : public BlockProcessor { |
hlundin-webrtc
2016/12/20 15:10:35
final
hlundin-webrtc
2016/12/20 15:10:35
Since you have a Create method in the interface cl
peah-webrtc
2016/12/21 23:13:50
Done.
peah-webrtc
2016/12/21 23:13:50
Awesome suggestion!
Done.
|
+ public: |
+ BlockProcessorImpl(int sample_rate_hz, size_t num_bands); |
+ ~BlockProcessorImpl() override; |
+ |
+ // Processes a block of capture data. |
hlundin-webrtc
2016/12/20 15:10:35
You can skip all the duplicated method comments. T
peah-webrtc
2016/12/21 23:13:50
Done.
|
+ void ProcessCapture(bool known_echo_path_change, |
+ bool saturated_microphone_signal, |
+ std::vector<std::vector<float>>* capture_block) override; |
+ |
+ // Buffers a block of render data supplied by a FrameBlocker object. |
+ bool BufferRender(std::vector<std::vector<float>>* block) override; |
+ |
+ // Reports whether echo leakage has been detected in the echo canceller |
+ // output. |
+ void ReportEchoLeakage(bool leakage_detected) override; |
+ |
+ private: |
+ static int instance_count_; |
+ std::unique_ptr<ApmDataDumper> data_dumper_; |
+ RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(BlockProcessorImpl); |
+}; |
+ |
+} // namespace webrtc |
+ |
+#endif // WEBRTC_MODULES_AUDIO_PROCESSING_AEC3_BLOCK_PROCESSOR_H_ |