| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 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_ECHO_CANCELLATION_IMPL_H_ | 11 #ifndef WEBRTC_MODULES_AUDIO_PROCESSING_ECHO_CANCELLATION_IMPL_H_ |
| 12 #define WEBRTC_MODULES_AUDIO_PROCESSING_ECHO_CANCELLATION_IMPL_H_ | 12 #define WEBRTC_MODULES_AUDIO_PROCESSING_ECHO_CANCELLATION_IMPL_H_ |
| 13 | 13 |
| 14 #include "webrtc/base/scoped_ptr.h" | 14 #include "webrtc/base/scoped_ptr.h" |
| 15 #include "webrtc/base/thread_checker.h" |
| 15 #include "webrtc/common_audio/swap_queue.h" | 16 #include "webrtc/common_audio/swap_queue.h" |
| 16 #include "webrtc/modules/audio_processing/include/audio_processing.h" | 17 #include "webrtc/modules/audio_processing/include/audio_processing.h" |
| 17 #include "webrtc/modules/audio_processing/processing_component.h" | 18 #include "webrtc/modules/audio_processing/processing_component.h" |
| 18 | 19 |
| 19 namespace webrtc { | 20 namespace webrtc { |
| 20 | 21 |
| 21 class AudioBuffer; | 22 class AudioBuffer; |
| 22 class CriticalSectionWrapper; | 23 class CriticalSectionWrapper; |
| 23 | 24 |
| 24 class EchoCancellationImpl : public EchoCancellation, | 25 class EchoCancellationImpl : public EchoCancellation, |
| 25 public ProcessingComponent { | 26 public ProcessingComponent { |
| 26 public: | 27 public: |
| 27 EchoCancellationImpl(const AudioProcessing* apm, | 28 EchoCancellationImpl(const AudioProcessing* apm, |
| 28 CriticalSectionWrapper* crit); | 29 CriticalSectionWrapper* crit, |
| 30 const rtc::ThreadChecker* render_thread_checker); |
| 29 virtual ~EchoCancellationImpl(); | 31 virtual ~EchoCancellationImpl(); |
| 30 | 32 |
| 31 int ProcessRenderAudio(const AudioBuffer* audio); | 33 int ProcessRenderAudio(const AudioBuffer* audio); |
| 32 int ProcessCaptureAudio(AudioBuffer* audio); | 34 int ProcessCaptureAudio(AudioBuffer* audio); |
| 33 | 35 |
| 34 // EchoCancellation implementation. | 36 // EchoCancellation implementation. |
| 35 bool is_enabled() const override; | 37 bool is_enabled() const override; |
| 36 int stream_drift_samples() const override; | 38 int stream_drift_samples() const override; |
| 37 SuppressionLevel suppression_level() const override; | 39 SuppressionLevel suppression_level() const override; |
| 38 bool is_drift_compensation_enabled() const override; | 40 bool is_drift_compensation_enabled() const override; |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 int InitializeHandle(void* handle) const override; | 72 int InitializeHandle(void* handle) const override; |
| 71 int ConfigureHandle(void* handle) const override; | 73 int ConfigureHandle(void* handle) const override; |
| 72 void DestroyHandle(void* handle) const override; | 74 void DestroyHandle(void* handle) const override; |
| 73 int num_handles_required() const override; | 75 int num_handles_required() const override; |
| 74 int GetHandleError(void* handle) const override; | 76 int GetHandleError(void* handle) const override; |
| 75 | 77 |
| 76 void AllocateRenderQueue(); | 78 void AllocateRenderQueue(); |
| 77 | 79 |
| 78 const AudioProcessing* apm_; | 80 const AudioProcessing* apm_; |
| 79 CriticalSectionWrapper* crit_; | 81 CriticalSectionWrapper* crit_; |
| 82 const rtc::ThreadChecker* const render_thread_checker_; |
| 83 |
| 80 bool drift_compensation_enabled_; | 84 bool drift_compensation_enabled_; |
| 81 bool metrics_enabled_; | 85 bool metrics_enabled_; |
| 82 SuppressionLevel suppression_level_; | 86 SuppressionLevel suppression_level_; |
| 83 int stream_drift_samples_; | 87 int stream_drift_samples_; |
| 84 bool was_stream_drift_set_; | 88 bool was_stream_drift_set_; |
| 85 bool stream_has_echo_; | 89 bool stream_has_echo_; |
| 86 bool delay_logging_enabled_; | 90 bool delay_logging_enabled_; |
| 87 bool extended_filter_enabled_; | 91 bool extended_filter_enabled_; |
| 88 bool delay_agnostic_enabled_; | 92 bool delay_agnostic_enabled_; |
| 89 | 93 |
| 90 size_t render_queue_element_max_size_; | 94 size_t render_queue_element_max_size_; |
| 91 std::vector<float> render_queue_buffer_; | 95 std::vector<float> render_queue_buffer_; |
| 92 std::vector<float> capture_queue_buffer_; | 96 std::vector<float> capture_queue_buffer_; |
| 93 rtc::scoped_ptr<SwapQueue<std::vector<float>, RenderQueueItemVerifier<float>>> | 97 rtc::scoped_ptr<SwapQueue<std::vector<float>, RenderQueueItemVerifier<float>>> |
| 94 render_signal_queue_; | 98 render_signal_queue_; |
| 95 }; | 99 }; |
| 96 | 100 |
| 97 } // namespace webrtc | 101 } // namespace webrtc |
| 98 | 102 |
| 99 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_ECHO_CANCELLATION_IMPL_H_ | 103 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_ECHO_CANCELLATION_IMPL_H_ |
| OLD | NEW |