OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 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 | 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 | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
11 #ifndef WEBRTC_MODULES_AUDIO_PROCESSING_AEC3_BLOCK_PROCESSOR_H_ | 11 #ifndef WEBRTC_MODULES_AUDIO_PROCESSING_AEC3_BLOCK_PROCESSOR_H_ |
12 #define WEBRTC_MODULES_AUDIO_PROCESSING_AEC3_BLOCK_PROCESSOR_H_ | 12 #define WEBRTC_MODULES_AUDIO_PROCESSING_AEC3_BLOCK_PROCESSOR_H_ |
13 | 13 |
14 #include <memory> | 14 #include <memory> |
15 #include <vector> | 15 #include <vector> |
16 | 16 |
17 #include "webrtc/base/constructormagic.h" | 17 #include "webrtc/base/constructormagic.h" |
18 #include "webrtc/modules/audio_processing/logging/apm_data_dumper.h" | 18 #include "webrtc/modules/audio_processing/aec3/echo_remover.h" |
19 #include "webrtc/modules/audio_processing/aec3/render_delay_buffer.h" | |
20 #include "webrtc/modules/audio_processing/aec3/render_delay_controller.h" | |
19 | 21 |
20 namespace webrtc { | 22 namespace webrtc { |
21 | 23 |
22 // Class for performing echo cancellation on 64 sample blocks of audio data. | 24 // Class for performing echo cancellation on 64 sample blocks of audio data. |
23 class BlockProcessor { | 25 class BlockProcessor { |
24 public: | 26 public: |
25 static BlockProcessor* Create(int sample_rate_hz); | 27 static BlockProcessor* Create(int sample_rate_hz); |
28 // Only used for testing purposes | |
hlundin-webrtc
2017/01/18 13:08:48
End with .
peah-webrtc
2017/01/19 15:33:04
Done.
| |
29 static BlockProcessor* Create( | |
30 int sample_rate_hz, | |
31 std::unique_ptr<RenderDelayBuffer> render_buffer); | |
32 static BlockProcessor* Create( | |
33 int sample_rate_hz, | |
34 std::unique_ptr<RenderDelayBuffer> render_buffer, | |
35 std::unique_ptr<RenderDelayController> delay_controller, | |
36 std::unique_ptr<EchoRemover> echo_remover); | |
37 | |
26 virtual ~BlockProcessor() = default; | 38 virtual ~BlockProcessor() = default; |
27 | 39 |
28 // Processes a block of capture data. | 40 // Processes a block of capture data. |
29 virtual void ProcessCapture( | 41 virtual void ProcessCapture( |
30 bool known_echo_path_change, | 42 bool echo_path_gain_change, |
31 bool saturated_microphone_signal, | 43 bool capture_signal_saturation, |
32 std::vector<std::vector<float>>* capture_block) = 0; | 44 std::vector<std::vector<float>>* capture_block) = 0; |
33 | 45 |
34 // Buffers a block of render data supplied by a FrameBlocker object. | 46 // Buffers a block of render data supplied by a FrameBlocker object. |
hlundin-webrtc
2017/01/18 13:08:48
What does it return?
peah-webrtc
2017/01/19 15:33:04
Done.
| |
35 virtual bool BufferRender(std::vector<std::vector<float>>* render_block) = 0; | 47 virtual bool BufferRender(std::vector<std::vector<float>>* render_block) = 0; |
36 | 48 |
37 // Reports whether echo leakage has been detected in the echo canceller | 49 // Reports whether echo leakage has been detected in the echo canceller |
38 // output. | 50 // output. |
39 virtual void ReportEchoLeakage(bool leakage_detected) = 0; | 51 virtual void UpdateEchoLeakageStatus(bool leakage_detected) = 0; |
40 }; | 52 }; |
41 | 53 |
42 } // namespace webrtc | 54 } // namespace webrtc |
43 | 55 |
44 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_AEC3_BLOCK_PROCESSOR_H_ | 56 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_AEC3_BLOCK_PROCESSOR_H_ |
OLD | NEW |