Chromium Code Reviews| 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 namespace { | 22 namespace { |
| 22 // Functor to use when supplying a verifier function for the queue item | 23 // Functor to use when supplying a verifier function for the queue item |
| 23 // verifcation. | 24 // verifcation. |
| 24 class AecRenderQueueItemVerifier { | 25 class AecRenderQueueItemVerifier { |
| (...skipping 11 matching lines...) Expand all Loading... | |
| 36 | 37 |
| 37 } // namespace anonymous | 38 } // namespace anonymous |
| 38 | 39 |
| 39 class AudioBuffer; | 40 class AudioBuffer; |
| 40 class CriticalSectionWrapper; | 41 class CriticalSectionWrapper; |
| 41 | 42 |
| 42 class EchoCancellationImpl : public EchoCancellation, | 43 class EchoCancellationImpl : public EchoCancellation, |
| 43 public ProcessingComponent { | 44 public ProcessingComponent { |
| 44 public: | 45 public: |
| 45 EchoCancellationImpl(const AudioProcessing* apm, | 46 EchoCancellationImpl(const AudioProcessing* apm, |
| 46 CriticalSectionWrapper* crit); | 47 CriticalSectionWrapper* crit, |
| 48 rtc::ThreadChecker* render_thread_checker); | |
|
hlundin-webrtc
2015/11/05 13:08:55
const rtc::ThreadChecker*
peah-webrtc
2015/11/06 07:31:14
Done.
| |
| 47 virtual ~EchoCancellationImpl(); | 49 virtual ~EchoCancellationImpl(); |
| 48 | 50 |
| 49 int ProcessRenderAudio(const AudioBuffer* audio); | 51 int ProcessRenderAudio(const AudioBuffer* audio); |
| 50 int ProcessCaptureAudio(AudioBuffer* audio); | 52 int ProcessCaptureAudio(AudioBuffer* audio); |
| 51 | 53 |
| 52 // EchoCancellation implementation. | 54 // EchoCancellation implementation. |
| 53 bool is_enabled() const override; | 55 bool is_enabled() const override; |
| 54 int stream_drift_samples() const override; | 56 int stream_drift_samples() const override; |
| 55 SuppressionLevel suppression_level() const override; | 57 SuppressionLevel suppression_level() const override; |
| 56 bool is_drift_compensation_enabled() const override; | 58 bool is_drift_compensation_enabled() const override; |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 94 int InitializeHandle(void* handle) const override; | 96 int InitializeHandle(void* handle) const override; |
| 95 int ConfigureHandle(void* handle) const override; | 97 int ConfigureHandle(void* handle) const override; |
| 96 void DestroyHandle(void* handle) const override; | 98 void DestroyHandle(void* handle) const override; |
| 97 int num_handles_required() const override; | 99 int num_handles_required() const override; |
| 98 int GetHandleError(void* handle) const override; | 100 int GetHandleError(void* handle) const override; |
| 99 | 101 |
| 100 void AllocateRenderQueue(); | 102 void AllocateRenderQueue(); |
| 101 | 103 |
| 102 const AudioProcessing* apm_; | 104 const AudioProcessing* apm_; |
| 103 CriticalSectionWrapper* crit_; | 105 CriticalSectionWrapper* crit_; |
| 106 const rtc::ThreadChecker* const render_thread_checker_; | |
| 107 | |
| 104 bool drift_compensation_enabled_; | 108 bool drift_compensation_enabled_; |
| 105 bool metrics_enabled_; | 109 bool metrics_enabled_; |
| 106 SuppressionLevel suppression_level_; | 110 SuppressionLevel suppression_level_; |
| 107 int stream_drift_samples_; | 111 int stream_drift_samples_; |
| 108 bool was_stream_drift_set_; | 112 bool was_stream_drift_set_; |
| 109 bool stream_has_echo_; | 113 bool stream_has_echo_; |
| 110 bool delay_logging_enabled_; | 114 bool delay_logging_enabled_; |
| 111 bool extended_filter_enabled_; | 115 bool extended_filter_enabled_; |
| 112 bool delay_agnostic_enabled_; | 116 bool delay_agnostic_enabled_; |
| 113 | 117 |
| 114 size_t render_queue_element_max_size_; | 118 size_t render_queue_element_max_size_; |
| 115 std::vector<float> render_queue_buffer_; | 119 std::vector<float> render_queue_buffer_; |
| 116 std::vector<float> capture_queue_buffer_; | 120 std::vector<float> capture_queue_buffer_; |
| 117 rtc::scoped_ptr<SwapQueue<std::vector<float>, AecRenderQueueItemVerifier>> | 121 rtc::scoped_ptr<SwapQueue<std::vector<float>, AecRenderQueueItemVerifier>> |
| 118 render_signal_queue_; | 122 render_signal_queue_; |
| 119 }; | 123 }; |
| 120 | 124 |
| 121 } // namespace webrtc | 125 } // namespace webrtc |
| 122 | 126 |
| 123 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_ECHO_CANCELLATION_IMPL_H_ | 127 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_ECHO_CANCELLATION_IMPL_H_ |
| OLD | NEW |