| 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_CONTROL_MOBILE_IMPL_H_ | 11 #ifndef WEBRTC_MODULES_AUDIO_PROCESSING_ECHO_CONTROL_MOBILE_IMPL_H_ |
| 12 #define WEBRTC_MODULES_AUDIO_PROCESSING_ECHO_CONTROL_MOBILE_IMPL_H_ | 12 #define WEBRTC_MODULES_AUDIO_PROCESSING_ECHO_CONTROL_MOBILE_IMPL_H_ |
| 13 | 13 |
| 14 #include "webrtc/base/scoped_ptr.h" | 14 #include "webrtc/base/scoped_ptr.h" |
| 15 #include "webrtc/base/thread_annotations.h" |
| 15 #include "webrtc/base/thread_checker.h" | 16 #include "webrtc/base/thread_checker.h" |
| 16 #include "webrtc/common_audio/swap_queue.h" | 17 #include "webrtc/common_audio/swap_queue.h" |
| 17 #include "webrtc/modules/audio_processing/include/audio_processing.h" | 18 #include "webrtc/modules/audio_processing/include/audio_processing.h" |
| 18 #include "webrtc/modules/audio_processing/processing_component.h" | 19 #include "webrtc/modules/audio_processing/processing_component.h" |
| 19 | 20 |
| 20 namespace webrtc { | 21 namespace webrtc { |
| 21 | 22 |
| 22 namespace { | 23 namespace { |
| 23 // Functor to use when supplying a verifier function for the queue item | 24 // Functor to use when supplying a verifier function for the queue item |
| 24 // verifcation. | 25 // verifcation. |
| (...skipping 15 matching lines...) Expand all Loading... |
| 40 | 41 |
| 41 } // namespace anonymous | 42 } // namespace anonymous |
| 42 | 43 |
| 43 class AudioBuffer; | 44 class AudioBuffer; |
| 44 class CriticalSectionWrapper; | 45 class CriticalSectionWrapper; |
| 45 | 46 |
| 46 class EchoControlMobileImpl : public EchoControlMobile, | 47 class EchoControlMobileImpl : public EchoControlMobile, |
| 47 public ProcessingComponent { | 48 public ProcessingComponent { |
| 48 public: | 49 public: |
| 49 EchoControlMobileImpl(const AudioProcessing* apm, | 50 EchoControlMobileImpl(const AudioProcessing* apm, |
| 50 CriticalSectionWrapper* crit, | 51 rtc::CriticalSection* crit_render, |
| 52 rtc::CriticalSection* crit_capture, |
| 51 rtc::ThreadChecker* render_thread, | 53 rtc::ThreadChecker* render_thread, |
| 52 rtc::ThreadChecker* capture_thread); | 54 rtc::ThreadChecker* capture_thread); |
| 53 virtual ~EchoControlMobileImpl(); | 55 virtual ~EchoControlMobileImpl(); |
| 54 | 56 |
| 55 int ProcessRenderAudio(const AudioBuffer* audio); | 57 int ProcessRenderAudio(const AudioBuffer* audio); |
| 56 int ProcessCaptureAudio(AudioBuffer* audio); | 58 int ProcessCaptureAudio(AudioBuffer* audio); |
| 57 | 59 |
| 58 // EchoControlMobile implementation. | 60 // EchoControlMobile implementation. |
| 59 bool is_enabled() const override; | 61 bool is_enabled() const override; |
| 60 RoutingMode routing_mode() const override; | 62 RoutingMode routing_mode() const override; |
| (...skipping 23 matching lines...) Expand all Loading... |
| 84 void* CreateHandle() const override; | 86 void* CreateHandle() const override; |
| 85 int InitializeHandle(void* handle) const override; | 87 int InitializeHandle(void* handle) const override; |
| 86 int ConfigureHandle(void* handle) const override; | 88 int ConfigureHandle(void* handle) const override; |
| 87 void DestroyHandle(void* handle) const override; | 89 void DestroyHandle(void* handle) const override; |
| 88 int num_handles_required() const override; | 90 int num_handles_required() const override; |
| 89 int GetHandleError(void* handle) const override; | 91 int GetHandleError(void* handle) const override; |
| 90 | 92 |
| 91 void AllocateRenderQueue(); | 93 void AllocateRenderQueue(); |
| 92 | 94 |
| 93 const AudioProcessing* apm_; | 95 const AudioProcessing* apm_; |
| 94 CriticalSectionWrapper* crit_; | 96 rtc::CriticalSection* const crit_render_; |
| 97 rtc::CriticalSection* const crit_capture_; |
| 95 const rtc::ThreadChecker* const render_thread_; | 98 const rtc::ThreadChecker* const render_thread_; |
| 96 const rtc::ThreadChecker* const capture_thread_; | 99 const rtc::ThreadChecker* const capture_thread_; |
| 97 RoutingMode routing_mode_; | 100 RoutingMode routing_mode_; |
| 98 bool comfort_noise_enabled_; | 101 bool comfort_noise_enabled_; |
| 99 unsigned char* external_echo_path_; | 102 unsigned char* external_echo_path_; |
| 100 | 103 |
| 101 size_t render_queue_element_max_size_; | 104 size_t render_queue_element_max_size_; |
| 102 std::vector<int16_t> render_queue_buffer_; | 105 std::vector<int16_t> render_queue_buffer_; |
| 103 std::vector<int16_t> capture_queue_buffer_; | 106 std::vector<int16_t> capture_queue_buffer_; |
| 104 rtc::scoped_ptr<SwapQueue<std::vector<int16_t>, AecmRenderQueueItemVerifier> > | 107 rtc::scoped_ptr<SwapQueue<std::vector<int16_t>, AecmRenderQueueItemVerifier> > |
| 105 render_signal_queue_; | 108 render_signal_queue_; |
| 106 }; | 109 }; |
| 107 } // namespace webrtc | 110 } // namespace webrtc |
| 108 | 111 |
| 109 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_ECHO_CONTROL_MOBILE_IMPL_H_ | 112 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_ECHO_CONTROL_MOBILE_IMPL_H_ |
| OLD | NEW |