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

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

Issue 2778783002: AecDump interface (Closed)
Patch Set: Implemented most of Karl's suggestions. Created 3 years, 8 months 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_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/criticalsection.h" 19 #include "webrtc/base/criticalsection.h"
20 #include "webrtc/base/function_view.h" 20 #include "webrtc/base/function_view.h"
21 #include "webrtc/base/gtest_prod_util.h" 21 #include "webrtc/base/gtest_prod_util.h"
22 #include "webrtc/base/ignore_wundef.h" 22 #include "webrtc/base/ignore_wundef.h"
23 #include "webrtc/base/swap_queue.h" 23 #include "webrtc/base/swap_queue.h"
24 #include "webrtc/base/thread_annotations.h" 24 #include "webrtc/base/thread_annotations.h"
25 #include "webrtc/modules/audio_processing/aec_dumper/aec_dumper.h"
25 #include "webrtc/modules/audio_processing/audio_buffer.h" 26 #include "webrtc/modules/audio_processing/audio_buffer.h"
26 #include "webrtc/modules/audio_processing/include/audio_processing.h" 27 #include "webrtc/modules/audio_processing/include/audio_processing.h"
27 #include "webrtc/modules/audio_processing/render_queue_item_verifier.h" 28 #include "webrtc/modules/audio_processing/render_queue_item_verifier.h"
28 #include "webrtc/modules/audio_processing/rms_level.h" 29 #include "webrtc/modules/audio_processing/rms_level.h"
29 #include "webrtc/system_wrappers/include/file_wrapper.h" 30 #include "webrtc/system_wrappers/include/file_wrapper.h"
30 31
31 #ifdef WEBRTC_AUDIOPROC_DEBUG_DUMP 32 #ifdef WEBRTC_AUDIOPROC_DEBUG_DUMP
32 // Files generated at build-time by the protobuf compiler. 33 // Files generated at build-time by the protobuf compiler.
33 RTC_PUSH_IGNORING_WUNDEF() 34 RTC_PUSH_IGNORING_WUNDEF()
34 #ifdef WEBRTC_ANDROID_PLATFORM_BUILD 35 #ifdef WEBRTC_ANDROID_PLATFORM_BUILD
(...skipping 24 matching lines...) Expand all
59 int Initialize(int capture_input_sample_rate_hz, 60 int Initialize(int capture_input_sample_rate_hz,
60 int capture_output_sample_rate_hz, 61 int capture_output_sample_rate_hz,
61 int render_sample_rate_hz, 62 int render_sample_rate_hz,
62 ChannelLayout capture_input_layout, 63 ChannelLayout capture_input_layout,
63 ChannelLayout capture_output_layout, 64 ChannelLayout capture_output_layout,
64 ChannelLayout render_input_layout) override; 65 ChannelLayout render_input_layout) override;
65 int Initialize(const ProcessingConfig& processing_config) override; 66 int Initialize(const ProcessingConfig& processing_config) override;
66 void ApplyConfig(const AudioProcessing::Config& config) override; 67 void ApplyConfig(const AudioProcessing::Config& config) override;
67 void SetExtraOptions(const webrtc::Config& config) override; 68 void SetExtraOptions(const webrtc::Config& config) override;
68 void UpdateHistogramsOnCallEnd() override; 69 void UpdateHistogramsOnCallEnd() override;
69 int StartDebugRecording(const char filename[kMaxFilenameSize], 70 int StartDebugRecording(const char filename[kMaxFilenameSize],
the sun 2017/04/03 14:33:02 I think we only need one method StartAecDump(std:
aleloi 2017/04/06 15:46:11 Good idea! I can't get rid of the other StartDebug
70 int64_t max_log_size_bytes) override; 71 int64_t max_log_size_bytes,
71 int StartDebugRecording(FILE* handle, int64_t max_log_size_bytes) override; 72 rtc::TaskQueue* worker_queue) override;
72 int StartDebugRecording(FILE* handle) override; 73 int StartDebugRecording(FILE* handle,
73 int StartDebugRecordingForPlatformFile(rtc::PlatformFile handle) override; 74 int64_t max_log_size_bytes,
75 rtc::TaskQueue* worker_queue) override;
76 int StartDebugRecording(FILE* handle, rtc::TaskQueue* worker_queue) override;
77 int StartDebugRecordingForPlatformFile(rtc::PlatformFile handle,
78 rtc::TaskQueue* worker_queue) override;
74 int StopDebugRecording() override; 79 int StopDebugRecording() override;
75 80
76 // Capture-side exclusive methods possibly running APM in a 81 // Capture-side exclusive methods possibly running APM in a
77 // multi-threaded manner. Acquire the capture lock. 82 // multi-threaded manner. Acquire the capture lock.
78 int ProcessStream(AudioFrame* frame) override; 83 int ProcessStream(AudioFrame* frame) override;
79 int ProcessStream(const float* const* src, 84 int ProcessStream(const float* const* src,
80 size_t samples_per_channel, 85 size_t samples_per_channel,
81 int input_sample_rate_hz, 86 int input_sample_rate_hz,
82 ChannelLayout input_layout, 87 ChannelLayout input_layout,
83 int output_sample_rate_hz, 88 int output_sample_rate_hz,
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
292 int WriteConfigMessage(bool forced) EXCLUSIVE_LOCKS_REQUIRED(crit_capture_) 297 int WriteConfigMessage(bool forced) EXCLUSIVE_LOCKS_REQUIRED(crit_capture_)
293 EXCLUSIVE_LOCKS_REQUIRED(crit_capture_); 298 EXCLUSIVE_LOCKS_REQUIRED(crit_capture_);
294 299
295 // Critical section. 300 // Critical section.
296 rtc::CriticalSection crit_debug_; 301 rtc::CriticalSection crit_debug_;
297 302
298 // Debug dump state. 303 // Debug dump state.
299 ApmDebugDumpState debug_dump_; 304 ApmDebugDumpState debug_dump_;
300 #endif 305 #endif
301 306
307 // TODO(aleloi) doc.
peah-webrtc 2017/03/31 07:24:43 Please change the comment according to the style g
aleloi 2017/04/06 15:46:11 Done.
308 std::unique_ptr<AecDumper> aec_dumper_;
peah-webrtc 2017/03/31 07:24:43 Won't this be accessed concurrently? In that case,
aleloi 2017/04/06 15:46:11 The implementation is actually thread-safe. The me
aleloi 2017/04/12 11:05:29 I've added locks for writing to aec_dump_, and an
302 // Critical sections. 309 // Critical sections.
303 rtc::CriticalSection crit_render_ ACQUIRED_BEFORE(crit_capture_); 310 rtc::CriticalSection crit_render_ ACQUIRED_BEFORE(crit_capture_);
304 rtc::CriticalSection crit_capture_; 311 rtc::CriticalSection crit_capture_;
305 312
306 // Struct containing the Config specifying the behavior of APM. 313 // Struct containing the Config specifying the behavior of APM.
307 AudioProcessing::Config config_; 314 AudioProcessing::Config config_;
308 315
309 // Class containing information about what submodules are active. 316 // Class containing information about what submodules are active.
310 ApmSubmoduleStates submodule_states_; 317 ApmSubmoduleStates submodule_states_;
311 318
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
428 std::unique_ptr< 435 std::unique_ptr<
429 SwapQueue<std::vector<int16_t>, RenderQueueItemVerifier<int16_t>>> 436 SwapQueue<std::vector<int16_t>, RenderQueueItemVerifier<int16_t>>>
430 agc_render_signal_queue_; 437 agc_render_signal_queue_;
431 std::unique_ptr<SwapQueue<std::vector<float>, RenderQueueItemVerifier<float>>> 438 std::unique_ptr<SwapQueue<std::vector<float>, RenderQueueItemVerifier<float>>>
432 red_render_signal_queue_; 439 red_render_signal_queue_;
433 }; 440 };
434 441
435 } // namespace webrtc 442 } // namespace webrtc
436 443
437 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_AUDIO_PROCESSING_IMPL_H_ 444 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_AUDIO_PROCESSING_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698