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_AUDIO_PROCESSING_IMPL_H_ | 11 #ifndef WEBRTC_MODULES_AUDIO_PROCESSING_AUDIO_PROCESSING_IMPL_H_ |
12 #define WEBRTC_MODULES_AUDIO_PROCESSING_AUDIO_PROCESSING_IMPL_H_ | 12 #define WEBRTC_MODULES_AUDIO_PROCESSING_AUDIO_PROCESSING_IMPL_H_ |
13 | 13 |
14 #include <list> | 14 #include <list> |
15 #include <memory> | 15 #include <memory> |
16 #include <string> | 16 #include <string> |
17 #include <vector> | 17 #include <vector> |
18 | 18 |
19 #include "webrtc/base/gtest_prod_util.h" | |
hlundin-webrtc
2016/10/05 12:29:18
Sort.
peah-webrtc
2016/10/06 06:27:27
Done.
| |
19 #include "webrtc/base/criticalsection.h" | 20 #include "webrtc/base/criticalsection.h" |
20 #include "webrtc/base/thread_annotations.h" | 21 #include "webrtc/base/thread_annotations.h" |
21 #include "webrtc/modules/audio_processing/audio_buffer.h" | 22 #include "webrtc/modules/audio_processing/audio_buffer.h" |
22 #include "webrtc/modules/audio_processing/include/audio_processing.h" | 23 #include "webrtc/modules/audio_processing/include/audio_processing.h" |
23 #include "webrtc/system_wrappers/include/file_wrapper.h" | 24 #include "webrtc/system_wrappers/include/file_wrapper.h" |
24 | 25 |
25 #ifdef WEBRTC_AUDIOPROC_DEBUG_DUMP | 26 #ifdef WEBRTC_AUDIOPROC_DEBUG_DUMP |
26 // Files generated at build-time by the protobuf compiler. | 27 // Files generated at build-time by the protobuf compiler. |
27 #ifdef WEBRTC_ANDROID_PLATFORM_BUILD | 28 #ifdef WEBRTC_ANDROID_PLATFORM_BUILD |
28 #include "external/webrtc/webrtc/modules/audio_processing/debug.pb.h" | 29 #include "external/webrtc/webrtc/modules/audio_processing/debug.pb.h" |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
122 LevelEstimator* level_estimator() const override; | 123 LevelEstimator* level_estimator() const override; |
123 NoiseSuppression* noise_suppression() const override; | 124 NoiseSuppression* noise_suppression() const override; |
124 VoiceDetection* voice_detection() const override; | 125 VoiceDetection* voice_detection() const override; |
125 | 126 |
126 protected: | 127 protected: |
127 // Overridden in a mock. | 128 // Overridden in a mock. |
128 virtual int InitializeLocked() | 129 virtual int InitializeLocked() |
129 EXCLUSIVE_LOCKS_REQUIRED(crit_render_, crit_capture_); | 130 EXCLUSIVE_LOCKS_REQUIRED(crit_render_, crit_capture_); |
130 | 131 |
131 private: | 132 private: |
133 FRIEND_TEST_ALL_PREFIXES(ApmConfiguration, DefaultBehavior); | |
134 FRIEND_TEST_ALL_PREFIXES(ApmConfiguration, ValidConfigBehavior); | |
135 FRIEND_TEST_ALL_PREFIXES(ApmConfiguration, NonValidConfigBehavior); | |
132 struct ApmPublicSubmodules; | 136 struct ApmPublicSubmodules; |
133 struct ApmPrivateSubmodules; | 137 struct ApmPrivateSubmodules; |
134 | 138 |
135 class ApmSubmoduleStates { | 139 class ApmSubmoduleStates { |
136 public: | 140 public: |
137 ApmSubmoduleStates(); | 141 ApmSubmoduleStates(); |
138 // Updates the submodule state and returns true if it has changed. | 142 // Updates the submodule state and returns true if it has changed. |
139 bool Update(bool high_pass_filter_enabled, | 143 bool Update(bool high_pass_filter_enabled, |
140 bool echo_canceller_enabled, | 144 bool echo_canceller_enabled, |
141 bool mobile_echo_controller_enabled, | 145 bool mobile_echo_controller_enabled, |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
275 rtc::CriticalSection crit_debug_; | 279 rtc::CriticalSection crit_debug_; |
276 | 280 |
277 // Debug dump state. | 281 // Debug dump state. |
278 ApmDebugDumpState debug_dump_; | 282 ApmDebugDumpState debug_dump_; |
279 #endif | 283 #endif |
280 | 284 |
281 // Critical sections. | 285 // Critical sections. |
282 rtc::CriticalSection crit_render_ ACQUIRED_BEFORE(crit_capture_); | 286 rtc::CriticalSection crit_render_ ACQUIRED_BEFORE(crit_capture_); |
283 rtc::CriticalSection crit_capture_; | 287 rtc::CriticalSection crit_capture_; |
284 | 288 |
289 // Struct containing the Config specifying the behavior of APM. | |
290 AudioProcessing::Config config_; | |
291 | |
285 // Class containing information about what submodules are active. | 292 // Class containing information about what submodules are active. |
286 ApmSubmoduleStates submodule_states_; | 293 ApmSubmoduleStates submodule_states_; |
287 | 294 |
288 // Structs containing the pointers to the submodules. | 295 // Structs containing the pointers to the submodules. |
289 std::unique_ptr<ApmPublicSubmodules> public_submodules_; | 296 std::unique_ptr<ApmPublicSubmodules> public_submodules_; |
290 std::unique_ptr<ApmPrivateSubmodules> private_submodules_ | 297 std::unique_ptr<ApmPrivateSubmodules> private_submodules_ |
291 GUARDED_BY(crit_capture_); | 298 GUARDED_BY(crit_capture_); |
292 | 299 |
293 // State that is written to while holding both the render and capture locks | 300 // State that is written to while holding both the render and capture locks |
294 // but can be read without any lock being held. | 301 // but can be read without any lock being held. |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
364 ApmRenderState(); | 371 ApmRenderState(); |
365 ~ApmRenderState(); | 372 ~ApmRenderState(); |
366 std::unique_ptr<AudioConverter> render_converter; | 373 std::unique_ptr<AudioConverter> render_converter; |
367 std::unique_ptr<AudioBuffer> render_audio; | 374 std::unique_ptr<AudioBuffer> render_audio; |
368 } render_ GUARDED_BY(crit_render_); | 375 } render_ GUARDED_BY(crit_render_); |
369 }; | 376 }; |
370 | 377 |
371 } // namespace webrtc | 378 } // namespace webrtc |
372 | 379 |
373 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_AUDIO_PROCESSING_IMPL_H_ | 380 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_AUDIO_PROCESSING_IMPL_H_ |
OLD | NEW |