Index: webrtc/modules/audio_processing/aec_dumper/null_aec_dumper.h |
diff --git a/webrtc/modules/audio_processing/aec_dumper/null_aec_dumper.h b/webrtc/modules/audio_processing/aec_dumper/null_aec_dumper.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..24c78f620f4779362f391f5a3a96037a5cd89b56 |
--- /dev/null |
+++ b/webrtc/modules/audio_processing/aec_dumper/null_aec_dumper.h |
@@ -0,0 +1,67 @@ |
+/* |
+ * Copyright (c) 2017 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_AEC_DUMPER_NULL_AEC_DUMPER_H_ |
+#define WEBRTC_MODULES_AUDIO_PROCESSING_AEC_DUMPER_NULL_AEC_DUMPER_H_ |
+ |
+#include <memory> |
+#include <vector> |
+ |
+#include "webrtc/modules/audio_processing/aec_dumper/aec_dumper.h" |
+ |
+namespace webrtc { |
+ |
+class AudioFrame; |
+ |
+class NullCaptureStreamInfo final : public AecDumper::CaptureStreamInfo { |
+ void AddInput(std::vector<rtc::ArrayView<const float>> src) override{}; |
+ void AddOutput(std::vector<rtc::ArrayView<const float>> src) override{}; |
+ |
+ void AddInput(const AudioFrame& frame) override{}; |
+ void AddOutput(const AudioFrame& frame) override{}; |
+ void set_delay(int delay) override{}; |
+ void set_drift(int drift) override{}; |
+ void set_level(int level) override{}; |
+ void set_keypress(bool keypress) override{}; |
+}; |
+ |
+class NullAecDumper final : public AecDumper { |
peah-webrtc
2017/03/31 07:24:43
What is the purpose of the NullAecDumper class? Co
aleloi
2017/04/06 15:46:11
Done.
|
+ public: |
+ ~NullAecDumper() override = default; |
+ |
+ std::unique_ptr<CaptureStreamInfo> GetCaptureStreamInfo() override; |
+ |
+ // TODO(aleloi): doc |
+ void WriteInitMessage(const ProcessingConfig& api_format) override{}; |
+ |
+ void WriteReverseStreamMessage(const AudioFrame& frame) override{}; |
+ |
+ void WriteReverseStreamMessage( |
+ std::vector<rtc::ArrayView<const float>> src) override{}; |
+ |
+ void WriteCaptureStreamMessage( |
+ std::unique_ptr<CaptureStreamInfo> stream_info) override{}; |
+ |
+ void WriteConfig(const InternalAPMConfig& config, bool forced) override{}; |
+}; |
+ |
+inline std::unique_ptr<AecDumper::CaptureStreamInfo> |
+NullAecDumper::GetCaptureStreamInfo() { |
+ return std::unique_ptr<AecDumper::CaptureStreamInfo>( |
+ new NullCaptureStreamInfo()); |
+} |
+ |
+inline std::unique_ptr<AecDumper> AecDumper::CreateNullDumper() { |
+ return std::unique_ptr<NullAecDumper>(new NullAecDumper()); |
+} |
+ |
+} // namespace webrtc |
+ |
+#endif // WEBRTC_MODULES_AUDIO_PROCESSING_AEC_DUMPER_NULL_AEC_DUMPER_H_ |