Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(616)

Side by Side Diff: webrtc/modules/audio_processing/echo_control_mobile_impl.h

Issue 1422013002: Preparational work for an upcoming addition of a threadchecking scheme for APM (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@bundling_of_state_CL
Patch Set: Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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_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 AecmRenderQueueItemVerifier { 25 class AecmRenderQueueItemVerifier {
(...skipping 14 matching lines...) Expand all
39 40
40 } // namespace anonymous 41 } // namespace anonymous
41 42
42 class AudioBuffer; 43 class AudioBuffer;
43 class CriticalSectionWrapper; 44 class CriticalSectionWrapper;
44 45
45 class EchoControlMobileImpl : public EchoControlMobile, 46 class EchoControlMobileImpl : public EchoControlMobile,
46 public ProcessingComponent { 47 public ProcessingComponent {
47 public: 48 public:
48 EchoControlMobileImpl(const AudioProcessing* apm, 49 EchoControlMobileImpl(const AudioProcessing* apm,
49 CriticalSectionWrapper* crit); 50 CriticalSectionWrapper* crit,
51 rtc::ThreadChecker* render_thread,
52 rtc::ThreadChecker* capture_thread);
50 virtual ~EchoControlMobileImpl(); 53 virtual ~EchoControlMobileImpl();
51 54
52 int ProcessRenderAudio(const AudioBuffer* audio); 55 int ProcessRenderAudio(const AudioBuffer* audio);
53 int ProcessCaptureAudio(AudioBuffer* audio); 56 int ProcessCaptureAudio(AudioBuffer* audio);
54 57
55 // EchoControlMobile implementation. 58 // EchoControlMobile implementation.
56 bool is_enabled() const override; 59 bool is_enabled() const override;
57 RoutingMode routing_mode() const override; 60 RoutingMode routing_mode() const override;
58 bool is_comfort_noise_enabled() const override; 61 bool is_comfort_noise_enabled() const override;
59 62
(...skipping 22 matching lines...) Expand all
82 int InitializeHandle(void* handle) const override; 85 int InitializeHandle(void* handle) const override;
83 int ConfigureHandle(void* handle) const override; 86 int ConfigureHandle(void* handle) const override;
84 void DestroyHandle(void* handle) const override; 87 void DestroyHandle(void* handle) const override;
85 int num_handles_required() const override; 88 int num_handles_required() const override;
86 int GetHandleError(void* handle) const override; 89 int GetHandleError(void* handle) const override;
87 90
88 void AllocateRenderQueue(); 91 void AllocateRenderQueue();
89 92
90 const AudioProcessing* apm_; 93 const AudioProcessing* apm_;
91 CriticalSectionWrapper* crit_; 94 CriticalSectionWrapper* crit_;
95 const rtc::ThreadChecker* const render_thread_;
96 const rtc::ThreadChecker* const capture_thread_;
92 RoutingMode routing_mode_; 97 RoutingMode routing_mode_;
93 bool comfort_noise_enabled_; 98 bool comfort_noise_enabled_;
94 unsigned char* external_echo_path_; 99 unsigned char* external_echo_path_;
95 100
96 size_t render_queue_element_max_size_; 101 size_t render_queue_element_max_size_;
97 std::vector<int16_t> render_queue_buffer_; 102 std::vector<int16_t> render_queue_buffer_;
98 std::vector<int16_t> capture_queue_buffer_; 103 std::vector<int16_t> capture_queue_buffer_;
99 rtc::scoped_ptr<SwapQueue<std::vector<int16_t>, AecmRenderQueueItemVerifier> > 104 rtc::scoped_ptr<SwapQueue<std::vector<int16_t>, AecmRenderQueueItemVerifier> >
100 render_signal_queue_; 105 render_signal_queue_;
101 }; 106 };
102 } // namespace webrtc 107 } // namespace webrtc
103 108
104 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_ECHO_CONTROL_MOBILE_IMPL_H_ 109 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_ECHO_CONTROL_MOBILE_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698