| 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/modules/audio_processing/aec3/echo_remover.h" | 17 #include "webrtc/modules/audio_processing/aec3/echo_remover.h" |
| 18 #include "webrtc/modules/audio_processing/aec3/render_delay_buffer.h" | 18 #include "webrtc/modules/audio_processing/aec3/render_delay_buffer.h" |
| 19 #include "webrtc/modules/audio_processing/aec3/render_delay_controller.h" | 19 #include "webrtc/modules/audio_processing/aec3/render_delay_controller.h" |
| 20 | 20 |
| 21 namespace webrtc { | 21 namespace webrtc { |
| 22 | 22 |
| 23 // Class for performing echo cancellation on 64 sample blocks of audio data. | 23 // Class for performing echo cancellation on 64 sample blocks of audio data. |
| 24 class BlockProcessor { | 24 class BlockProcessor { |
| 25 public: | 25 public: |
| 26 static BlockProcessor* Create(int sample_rate_hz); | 26 static BlockProcessor* Create( |
| 27 const AudioProcessing::Config::EchoCanceller3& config, |
| 28 int sample_rate_hz); |
| 27 // Only used for testing purposes. | 29 // Only used for testing purposes. |
| 28 static BlockProcessor* Create( | 30 static BlockProcessor* Create( |
| 31 const AudioProcessing::Config::EchoCanceller3& config, |
| 29 int sample_rate_hz, | 32 int sample_rate_hz, |
| 30 std::unique_ptr<RenderDelayBuffer> render_buffer); | 33 std::unique_ptr<RenderDelayBuffer> render_buffer); |
| 31 static BlockProcessor* Create( | 34 static BlockProcessor* Create( |
| 35 const AudioProcessing::Config::EchoCanceller3& config, |
| 32 int sample_rate_hz, | 36 int sample_rate_hz, |
| 33 std::unique_ptr<RenderDelayBuffer> render_buffer, | 37 std::unique_ptr<RenderDelayBuffer> render_buffer, |
| 34 std::unique_ptr<RenderDelayController> delay_controller, | 38 std::unique_ptr<RenderDelayController> delay_controller, |
| 35 std::unique_ptr<EchoRemover> echo_remover); | 39 std::unique_ptr<EchoRemover> echo_remover); |
| 36 | 40 |
| 37 virtual ~BlockProcessor() = default; | 41 virtual ~BlockProcessor() = default; |
| 38 | 42 |
| 39 // Processes a block of capture data. | 43 // Processes a block of capture data. |
| 40 virtual void ProcessCapture( | 44 virtual void ProcessCapture( |
| 41 bool echo_path_gain_change, | 45 bool echo_path_gain_change, |
| 42 bool capture_signal_saturation, | 46 bool capture_signal_saturation, |
| 43 std::vector<std::vector<float>>* capture_block) = 0; | 47 std::vector<std::vector<float>>* capture_block) = 0; |
| 44 | 48 |
| 45 // Buffers a block of render data supplied by a FrameBlocker object. | 49 // Buffers a block of render data supplied by a FrameBlocker object. |
| 46 virtual void BufferRender( | 50 virtual void BufferRender( |
| 47 const std::vector<std::vector<float>>& render_block) = 0; | 51 const std::vector<std::vector<float>>& render_block) = 0; |
| 48 | 52 |
| 49 // Reports whether echo leakage has been detected in the echo canceller | 53 // Reports whether echo leakage has been detected in the echo canceller |
| 50 // output. | 54 // output. |
| 51 virtual void UpdateEchoLeakageStatus(bool leakage_detected) = 0; | 55 virtual void UpdateEchoLeakageStatus(bool leakage_detected) = 0; |
| 52 }; | 56 }; |
| 53 | 57 |
| 54 } // namespace webrtc | 58 } // namespace webrtc |
| 55 | 59 |
| 56 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_AEC3_BLOCK_PROCESSOR_H_ | 60 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_AEC3_BLOCK_PROCESSOR_H_ |
| OLD | NEW |