Chromium Code Reviews

Side by Side Diff: webrtc/modules/audio_processing/aec3/block_processor.cc

Issue 2584493002: Added first layer of the echo canceller 3 functionality (Closed)
Patch Set: Minor changes Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff |
OLDNEW
(Empty)
1 /*
2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.
3 *
4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
9 */
10 #include "webrtc/modules/audio_processing/aec3/block_processor.h"
11
12 #include "webrtc/base/atomicops.h"
13 #include "webrtc/base/optional.h"
14
15 namespace webrtc {
16 namespace {
17
18 class BlockProcessorImpl final : public BlockProcessor {
19 public:
20 BlockProcessorImpl(int sample_rate_hz, size_t num_bands);
21 ~BlockProcessorImpl() override;
22
23 void ProcessCapture(bool known_echo_path_change,
24 bool saturated_microphone_signal,
25 std::vector<std::vector<float>>* capture_block) override;
26
27 bool BufferRender(std::vector<std::vector<float>>* block) override;
28
29 void ReportEchoLeakage(bool leakage_detected) override;
30
31 private:
32 static int instance_count_;
33 std::unique_ptr<ApmDataDumper> data_dumper_;
34 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(BlockProcessorImpl);
35 };
36
37 int BlockProcessorImpl::instance_count_ = 0;
38
39 BlockProcessorImpl::BlockProcessorImpl(int sample_rate_hz, size_t num_bands)
40 : data_dumper_(new ApmDataDumper(instance_count_)) {
41 instance_count_ = rtc::AtomicOps::Increment(&instance_count_);
42 }
43
44 BlockProcessorImpl::~BlockProcessorImpl() = default;
45
46 void BlockProcessorImpl::ProcessCapture(
47 bool known_echo_path_change,
48 bool saturated_microphone_signal,
49 std::vector<std::vector<float>>* capture_block) {}
50
51 bool BlockProcessorImpl::BufferRender(std::vector<std::vector<float>>* block) {
52 return false;
53 }
54
55 void BlockProcessorImpl::ReportEchoLeakage(bool leakage_detected) {}
56
57 } // namespace
58
59 BlockProcessor* BlockProcessor::Create(int sample_rate_hz, size_t num_bands) {
60 return new BlockProcessorImpl(sample_rate_hz, num_bands);
61 }
62
63 } // namespace webrtc
OLDNEW

Powered by Google App Engine