blob: f83f6adb0735692ca2d1743466fc68f0182bd9c4 [file] [log] [blame]
niklase@google.com470e71d2011-07-07 08:21:25 +00001/*
andrew@webrtc.org6f9f8172012-03-06 19:03:39 +00002 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
niklase@google.com470e71d2011-07-07 08:21:25 +00003 *
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
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
9 */
10
pbos@webrtc.org788acd12014-12-15 09:41:24 +000011#ifndef WEBRTC_MODULES_AUDIO_PROCESSING_AUDIO_PROCESSING_IMPL_H_
12#define WEBRTC_MODULES_AUDIO_PROCESSING_AUDIO_PROCESSING_IMPL_H_
niklase@google.com470e71d2011-07-07 08:21:25 +000013
14#include <list>
kwiberg88788ad2016-02-19 07:04:49 -080015#include <memory>
ajm@google.com808e0e02011-08-03 21:08:51 +000016#include <string>
Michael Graczyk86c6d332015-07-23 11:41:39 -070017#include <vector>
niklase@google.com470e71d2011-07-07 08:21:25 +000018
peahdf3efa82015-11-28 12:35:15 -080019#include "webrtc/base/criticalsection.h"
pbos@webrtc.org788acd12014-12-15 09:41:24 +000020#include "webrtc/base/thread_annotations.h"
peahdf3efa82015-11-28 12:35:15 -080021#include "webrtc/modules/audio_processing/audio_buffer.h"
Michael Graczykdfa36052015-03-25 16:37:27 -070022#include "webrtc/modules/audio_processing/include/audio_processing.h"
peahdf3efa82015-11-28 12:35:15 -080023#include "webrtc/system_wrappers/include/file_wrapper.h"
24
25#ifdef WEBRTC_AUDIOPROC_DEBUG_DUMP
26// Files generated at build-time by the protobuf compiler.
27#ifdef WEBRTC_ANDROID_PLATFORM_BUILD
28#include "external/webrtc/webrtc/modules/audio_processing/debug.pb.h"
29#else
kjellander78ddd732016-02-09 08:13:06 -080030#include "webrtc/modules/audio_processing/debug.pb.h"
peahdf3efa82015-11-28 12:35:15 -080031#endif
32#endif // WEBRTC_AUDIOPROC_DEBUG_DUMP
niklase@google.com470e71d2011-07-07 08:21:25 +000033
34namespace webrtc {
andrew@webrtc.orgddbb8a22014-04-22 21:00:04 +000035
pbos@webrtc.org788acd12014-12-15 09:41:24 +000036class AgcManagerDirect;
ekmeyerson60d9b332015-08-14 10:35:55 -070037class AudioConverter;
Michael Graczykdfa36052015-03-25 16:37:27 -070038
Alejandro Luebsf4022ff2016-07-01 17:19:09 -070039class NonlinearBeamformer;
Michael Graczykdfa36052015-03-25 16:37:27 -070040
niklase@google.com470e71d2011-07-07 08:21:25 +000041class AudioProcessingImpl : public AudioProcessing {
42 public:
peahdf3efa82015-11-28 12:35:15 -080043 // Methods forcing APM to run in a single-threaded manner.
44 // Acquires both the render and capture locks.
kjellander10f606d2016-09-11 23:04:31 -070045 explicit AudioProcessingImpl(const Config& config);
Michael Graczykdfa36052015-03-25 16:37:27 -070046 // AudioProcessingImpl takes ownership of beamformer.
kjellander10f606d2016-09-11 23:04:31 -070047 AudioProcessingImpl(const Config& config, NonlinearBeamformer* beamformer);
kwiberg83ffe452016-08-29 14:46:07 -070048 ~AudioProcessingImpl() override;
kjellander@webrtc.org14665ff2015-03-04 12:58:35 +000049 int Initialize() override;
50 int Initialize(int input_sample_rate_hz,
51 int output_sample_rate_hz,
52 int reverse_sample_rate_hz,
53 ChannelLayout input_layout,
54 ChannelLayout output_layout,
55 ChannelLayout reverse_layout) override;
Michael Graczyk86c6d332015-07-23 11:41:39 -070056 int Initialize(const ProcessingConfig& processing_config) override;
kjellander10f606d2016-09-11 23:04:31 -070057 void SetExtraOptions(const Config& config) override;
peahdf3efa82015-11-28 12:35:15 -080058 void UpdateHistogramsOnCallEnd() override;
ivocd66b44d2016-01-15 03:06:36 -080059 int StartDebugRecording(const char filename[kMaxFilenameSize],
60 int64_t max_log_size_bytes) override;
61 int StartDebugRecording(FILE* handle, int64_t max_log_size_bytes) override;
62
peahdf3efa82015-11-28 12:35:15 -080063 int StartDebugRecordingForPlatformFile(rtc::PlatformFile handle) override;
64 int StopDebugRecording() override;
65
66 // Capture-side exclusive methods possibly running APM in a
67 // multi-threaded manner. Acquire the capture lock.
kjellander@webrtc.org14665ff2015-03-04 12:58:35 +000068 int ProcessStream(AudioFrame* frame) override;
69 int ProcessStream(const float* const* src,
Peter Kastingdce40cf2015-08-24 14:52:23 -070070 size_t samples_per_channel,
kjellander@webrtc.org14665ff2015-03-04 12:58:35 +000071 int input_sample_rate_hz,
72 ChannelLayout input_layout,
73 int output_sample_rate_hz,
74 ChannelLayout output_layout,
75 float* const* dest) override;
Michael Graczyk86c6d332015-07-23 11:41:39 -070076 int ProcessStream(const float* const* src,
77 const StreamConfig& input_config,
78 const StreamConfig& output_config,
79 float* const* dest) override;
peahdf3efa82015-11-28 12:35:15 -080080 void set_output_will_be_muted(bool muted) override;
81 int set_stream_delay_ms(int delay) override;
82 void set_delay_offset_ms(int offset) override;
83 int delay_offset_ms() const override;
84 void set_stream_key_pressed(bool key_pressed) override;
85
86 // Render-side exclusive methods possibly running APM in a
87 // multi-threaded manner. Acquire the render lock.
ekmeyerson60d9b332015-08-14 10:35:55 -070088 int ProcessReverseStream(AudioFrame* frame) override;
kjellander@webrtc.org14665ff2015-03-04 12:58:35 +000089 int AnalyzeReverseStream(const float* const* data,
Peter Kastingdce40cf2015-08-24 14:52:23 -070090 size_t samples_per_channel,
kjellander@webrtc.org14665ff2015-03-04 12:58:35 +000091 int sample_rate_hz,
92 ChannelLayout layout) override;
ekmeyerson60d9b332015-08-14 10:35:55 -070093 int ProcessReverseStream(const float* const* src,
94 const StreamConfig& reverse_input_config,
95 const StreamConfig& reverse_output_config,
96 float* const* dest) override;
peahdf3efa82015-11-28 12:35:15 -080097
98 // Methods only accessed from APM submodules or
99 // from AudioProcessing tests in a single-threaded manner.
100 // Hence there is no need for locks in these.
101 int proc_sample_rate_hz() const override;
102 int proc_split_sample_rate_hz() const override;
Peter Kasting69558702016-01-12 16:26:35 -0800103 size_t num_input_channels() const override;
104 size_t num_proc_channels() const override;
105 size_t num_output_channels() const override;
106 size_t num_reverse_channels() const override;
kjellander@webrtc.org14665ff2015-03-04 12:58:35 +0000107 int stream_delay_ms() const override;
peahdf3efa82015-11-28 12:35:15 -0800108 bool was_stream_delay_set() const override
109 EXCLUSIVE_LOCKS_REQUIRED(crit_capture_);
110
111 // Methods returning pointers to APM submodules.
112 // No locks are aquired in those, as those locks
113 // would offer no protection (the submodules are
114 // created only once in a single-treaded manner
115 // during APM creation).
kjellander@webrtc.org14665ff2015-03-04 12:58:35 +0000116 EchoCancellation* echo_cancellation() const override;
117 EchoControlMobile* echo_control_mobile() const override;
118 GainControl* gain_control() const override;
119 HighPassFilter* high_pass_filter() const override;
120 LevelEstimator* level_estimator() const override;
121 NoiseSuppression* noise_suppression() const override;
122 VoiceDetection* voice_detection() const override;
niklase@google.com470e71d2011-07-07 08:21:25 +0000123
andrew@webrtc.org60730cf2014-01-07 17:45:09 +0000124 protected:
andrew@webrtc.orga8b97372014-03-10 22:26:12 +0000125 // Overridden in a mock.
peahdf3efa82015-11-28 12:35:15 -0800126 virtual int InitializeLocked()
127 EXCLUSIVE_LOCKS_REQUIRED(crit_render_, crit_capture_);
andrew@webrtc.org60730cf2014-01-07 17:45:09 +0000128
niklase@google.com470e71d2011-07-07 08:21:25 +0000129 private:
peahdf3efa82015-11-28 12:35:15 -0800130 struct ApmPublicSubmodules;
131 struct ApmPrivateSubmodules;
132
peah2ace3f92016-09-10 04:42:27 -0700133 class ApmSubmoduleStates {
134 public:
135 ApmSubmoduleStates();
136 // Updates the submodule state and returns true if it has changed.
137 bool Update(bool high_pass_filter_enabled,
138 bool echo_canceller_enabled,
139 bool mobile_echo_controller_enabled,
140 bool noise_suppressor_enabled,
141 bool intelligibility_enhancer_enabled,
142 bool beamformer_enabled,
143 bool adaptive_gain_controller_enabled,
144 bool level_controller_enabled,
145 bool voice_activity_detector_enabled,
146 bool level_estimator_enabled,
147 bool transient_suppressor_enabled);
148 bool CaptureMultiBandSubModulesActive() const;
149 bool CaptureMultiBandProcessingActive() const;
150 bool RenderMultiBandSubModulesActive() const;
151 bool RenderMultiBandProcessingActive() const;
152
153 private:
154 bool high_pass_filter_enabled_ = false;
155 bool echo_canceller_enabled_ = false;
156 bool mobile_echo_controller_enabled_ = false;
157 bool noise_suppressor_enabled_ = false;
158 bool intelligibility_enhancer_enabled_ = false;
159 bool beamformer_enabled_ = false;
160 bool adaptive_gain_controller_enabled_ = false;
161 bool level_controller_enabled_ = false;
162 bool level_estimator_enabled_ = false;
163 bool voice_activity_detector_enabled_ = false;
164 bool transient_suppressor_enabled_ = false;
165 bool first_update_ = true;
166 };
167
peahdf3efa82015-11-28 12:35:15 -0800168#ifdef WEBRTC_AUDIOPROC_DEBUG_DUMP
169 // State for the debug dump.
170 struct ApmDebugDumpThreadState {
kwiberg83ffe452016-08-29 14:46:07 -0700171 ApmDebugDumpThreadState();
172 ~ApmDebugDumpThreadState();
kwiberg88788ad2016-02-19 07:04:49 -0800173 std::unique_ptr<audioproc::Event> event_msg; // Protobuf message.
peahdf3efa82015-11-28 12:35:15 -0800174 std::string event_str; // Memory for protobuf serialization.
175
176 // Serialized string of last saved APM configuration.
177 std::string last_serialized_config;
178 };
179
180 struct ApmDebugDumpState {
kwiberg83ffe452016-08-29 14:46:07 -0700181 ApmDebugDumpState();
182 ~ApmDebugDumpState();
ivocd66b44d2016-01-15 03:06:36 -0800183 // Number of bytes that can still be written to the log before the maximum
184 // size is reached. A value of <= 0 indicates that no limit is used.
185 int64_t num_bytes_left_for_log_ = -1;
kwiberg88788ad2016-02-19 07:04:49 -0800186 std::unique_ptr<FileWrapper> debug_file;
peahdf3efa82015-11-28 12:35:15 -0800187 ApmDebugDumpThreadState render;
188 ApmDebugDumpThreadState capture;
189 };
190#endif
191
192 // Method for modifying the formats struct that are called from both
193 // the render and capture threads. The check for whether modifications
194 // are needed is done while holding the render lock only, thereby avoiding
195 // that the capture thread blocks the render thread.
196 // The struct is modified in a single-threaded manner by holding both the
197 // render and capture locks.
peah2ace3f92016-09-10 04:42:27 -0700198 int MaybeInitialize(const ProcessingConfig& config, bool force_initialization)
peahdf3efa82015-11-28 12:35:15 -0800199 EXCLUSIVE_LOCKS_REQUIRED(crit_render_);
200
201 int MaybeInitializeRender(const ProcessingConfig& processing_config)
202 EXCLUSIVE_LOCKS_REQUIRED(crit_render_);
203
peah2ace3f92016-09-10 04:42:27 -0700204 int MaybeInitializeCapture(const ProcessingConfig& processing_config,
205 bool force_initialization)
peahdf3efa82015-11-28 12:35:15 -0800206 EXCLUSIVE_LOCKS_REQUIRED(crit_render_);
207
peah2ace3f92016-09-10 04:42:27 -0700208 // Method for updating the state keeping track of the active submodules.
209 // Returns a bool indicating whether the state has changed.
210 bool UpdateActiveSubmoduleStates() EXCLUSIVE_LOCKS_REQUIRED(crit_capture_);
peahdf3efa82015-11-28 12:35:15 -0800211
212 // Methods requiring APM running in a single-threaded manner.
213 // Are called with both the render and capture locks already
214 // acquired.
215 void InitializeExperimentalAgc()
216 EXCLUSIVE_LOCKS_REQUIRED(crit_render_, crit_capture_);
217 void InitializeTransient()
218 EXCLUSIVE_LOCKS_REQUIRED(crit_render_, crit_capture_);
219 void InitializeBeamformer()
220 EXCLUSIVE_LOCKS_REQUIRED(crit_render_, crit_capture_);
221 void InitializeIntelligibility()
222 EXCLUSIVE_LOCKS_REQUIRED(crit_render_, crit_capture_);
solenberg70f99032015-12-08 11:07:32 -0800223 void InitializeHighPassFilter()
224 EXCLUSIVE_LOCKS_REQUIRED(crit_capture_);
solenberg5e465c32015-12-08 13:22:33 -0800225 void InitializeNoiseSuppression()
226 EXCLUSIVE_LOCKS_REQUIRED(crit_capture_);
solenberg949028f2015-12-15 11:39:38 -0800227 void InitializeLevelEstimator()
228 EXCLUSIVE_LOCKS_REQUIRED(crit_capture_);
solenberga29386c2015-12-16 03:31:12 -0800229 void InitializeVoiceDetection()
230 EXCLUSIVE_LOCKS_REQUIRED(crit_capture_);
peahb624d8c2016-03-05 03:01:14 -0800231 void InitializeEchoCanceller()
232 EXCLUSIVE_LOCKS_REQUIRED(crit_render_, crit_capture_);
peahbfa97112016-03-10 21:09:04 -0800233 void InitializeGainController()
234 EXCLUSIVE_LOCKS_REQUIRED(crit_render_, crit_capture_);
peahbb9edbd2016-03-10 12:54:25 -0800235 void InitializeEchoControlMobile()
236 EXCLUSIVE_LOCKS_REQUIRED(crit_render_, crit_capture_);
Michael Graczyk86c6d332015-07-23 11:41:39 -0700237 int InitializeLocked(const ProcessingConfig& config)
peahdf3efa82015-11-28 12:35:15 -0800238 EXCLUSIVE_LOCKS_REQUIRED(crit_render_, crit_capture_);
peahca4cac72016-06-29 15:26:12 -0700239 void InitializeLevelController() EXCLUSIVE_LOCKS_REQUIRED(crit_capture_);
peahdf3efa82015-11-28 12:35:15 -0800240
241 // Capture-side exclusive methods possibly running APM in a multi-threaded
242 // manner that are called with the render lock already acquired.
243 int ProcessStreamLocked() EXCLUSIVE_LOCKS_REQUIRED(crit_capture_);
peahdf3efa82015-11-28 12:35:15 -0800244 void MaybeUpdateHistograms() EXCLUSIVE_LOCKS_REQUIRED(crit_capture_);
245
246 // Render-side exclusive methods possibly running APM in a multi-threaded
247 // manner that are called with the render lock already acquired.
ekmeyerson60d9b332015-08-14 10:35:55 -0700248 // TODO(ekm): Remove once all clients updated to new interface.
peahdf3efa82015-11-28 12:35:15 -0800249 int AnalyzeReverseStreamLocked(const float* const* src,
250 const StreamConfig& input_config,
251 const StreamConfig& output_config)
252 EXCLUSIVE_LOCKS_REQUIRED(crit_render_);
peahdf3efa82015-11-28 12:35:15 -0800253 int ProcessReverseStreamLocked() EXCLUSIVE_LOCKS_REQUIRED(crit_render_);
andrew@webrtc.org17e40642014-03-04 20:58:13 +0000254
peahdf3efa82015-11-28 12:35:15 -0800255// Debug dump methods that are internal and called without locks.
256// TODO(peah): Make thread safe.
andrew@webrtc.org7bf26462011-12-03 00:03:31 +0000257#ifdef WEBRTC_AUDIOPROC_DEBUG_DUMP
258 // TODO(andrew): make this more graceful. Ideally we would split this stuff
259 // out into a separate class with an "enabled" and "disabled" implementation.
peahdf3efa82015-11-28 12:35:15 -0800260 static int WriteMessageToDebugFile(FileWrapper* debug_file,
ivocd66b44d2016-01-15 03:06:36 -0800261 int64_t* filesize_limit_bytes,
peahdf3efa82015-11-28 12:35:15 -0800262 rtc::CriticalSection* crit_debug,
263 ApmDebugDumpThreadState* debug_state);
264 int WriteInitMessage() EXCLUSIVE_LOCKS_REQUIRED(crit_render_, crit_capture_);
Minyue13b96ba2015-10-03 00:39:14 +0200265
266 // Writes Config message. If not |forced|, only writes the current config if
267 // it is different from the last saved one; if |forced|, writes the config
268 // regardless of the last saved.
peahdf3efa82015-11-28 12:35:15 -0800269 int WriteConfigMessage(bool forced) EXCLUSIVE_LOCKS_REQUIRED(crit_capture_)
270 EXCLUSIVE_LOCKS_REQUIRED(crit_capture_);
Minyue13b96ba2015-10-03 00:39:14 +0200271
peahdf3efa82015-11-28 12:35:15 -0800272 // Critical section.
pbos5ad935c2016-01-25 03:52:44 -0800273 rtc::CriticalSection crit_debug_;
Minyue13b96ba2015-10-03 00:39:14 +0200274
peahdf3efa82015-11-28 12:35:15 -0800275 // Debug dump state.
276 ApmDebugDumpState debug_dump_;
andrew@webrtc.org7bf26462011-12-03 00:03:31 +0000277#endif
niklase@google.com470e71d2011-07-07 08:21:25 +0000278
peahdf3efa82015-11-28 12:35:15 -0800279 // Critical sections.
pbos5ad935c2016-01-25 03:52:44 -0800280 rtc::CriticalSection crit_render_ ACQUIRED_BEFORE(crit_capture_);
281 rtc::CriticalSection crit_capture_;
peahdf3efa82015-11-28 12:35:15 -0800282
peah2ace3f92016-09-10 04:42:27 -0700283 // Class containing information about what submodules are active.
284 ApmSubmoduleStates submodule_states_;
285
peahdf3efa82015-11-28 12:35:15 -0800286 // Structs containing the pointers to the submodules.
kwiberg88788ad2016-02-19 07:04:49 -0800287 std::unique_ptr<ApmPublicSubmodules> public_submodules_;
288 std::unique_ptr<ApmPrivateSubmodules> private_submodules_
peahdf3efa82015-11-28 12:35:15 -0800289 GUARDED_BY(crit_capture_);
290
peah192164e2015-11-17 02:16:45 -0800291 // State that is written to while holding both the render and capture locks
peahdf3efa82015-11-28 12:35:15 -0800292 // but can be read without any lock being held.
293 // As this is only accessed internally of APM, and all internal methods in APM
294 // either are holding the render or capture locks, this construct is safe as
295 // it is not possible to read the variables while writing them.
296 struct ApmFormatState {
297 ApmFormatState()
peah192164e2015-11-17 02:16:45 -0800298 : // Format of processing streams at input/output call sites.
peahdf3efa82015-11-28 12:35:15 -0800299 api_format({{{kSampleRate16kHz, 1, false},
300 {kSampleRate16kHz, 1, false},
301 {kSampleRate16kHz, 1, false},
302 {kSampleRate16kHz, 1, false}}}),
303 rev_proc_format(kSampleRate16kHz, 1) {}
304 ProcessingConfig api_format;
305 StreamConfig rev_proc_format;
306 } formats_;
Michael Graczyk86c6d332015-07-23 11:41:39 -0700307
peahdf3efa82015-11-28 12:35:15 -0800308 // APM constants.
309 const struct ApmConstants {
Alejandro Luebsc9b0c262016-05-16 15:32:38 -0700310 ApmConstants(int agc_startup_min_volume, bool use_experimental_agc)
peahdf3efa82015-11-28 12:35:15 -0800311 : // Format of processing streams at input/output call sites.
312 agc_startup_min_volume(agc_startup_min_volume),
Alejandro Luebsc9b0c262016-05-16 15:32:38 -0700313 use_experimental_agc(use_experimental_agc) {}
peahdf3efa82015-11-28 12:35:15 -0800314 int agc_startup_min_volume;
peahbe615622016-02-13 16:40:47 -0800315 bool use_experimental_agc;
peahdf3efa82015-11-28 12:35:15 -0800316 } constants_;
andrew@webrtc.orgddbb8a22014-04-22 21:00:04 +0000317
peahdf3efa82015-11-28 12:35:15 -0800318 struct ApmCaptureState {
aluebs2a346882016-01-11 18:04:30 -0800319 ApmCaptureState(bool transient_suppressor_enabled,
aluebs2a346882016-01-11 18:04:30 -0800320 const std::vector<Point>& array_geometry,
kwiberg83ffe452016-08-29 14:46:07 -0700321 SphericalPointf target_direction);
322 ~ApmCaptureState();
peahdf3efa82015-11-28 12:35:15 -0800323 int aec_system_delay_jumps;
324 int delay_offset_ms;
325 bool was_stream_delay_set;
326 int last_stream_delay_ms;
327 int last_aec_system_delay_ms;
328 int stream_delay_jumps;
329 bool output_will_be_muted;
330 bool key_pressed;
331 bool transient_suppressor_enabled;
aluebs2a346882016-01-11 18:04:30 -0800332 std::vector<Point> array_geometry;
333 SphericalPointf target_direction;
kwiberg88788ad2016-02-19 07:04:49 -0800334 std::unique_ptr<AudioBuffer> capture_audio;
peahdf3efa82015-11-28 12:35:15 -0800335 // Only the rate and samples fields of fwd_proc_format_ are used because the
336 // forward processing number of channels is mutable and is tracked by the
337 // capture_audio_.
338 StreamConfig fwd_proc_format;
339 int split_rate;
340 } capture_ GUARDED_BY(crit_capture_);
niklase@google.com470e71d2011-07-07 08:21:25 +0000341
peahdf3efa82015-11-28 12:35:15 -0800342 struct ApmCaptureNonLockedState {
Alejandro Luebsc9b0c262016-05-16 15:32:38 -0700343 ApmCaptureNonLockedState(bool beamformer_enabled,
kjellander10f606d2016-09-11 23:04:31 -0700344 bool intelligibility_enabled,
345 bool level_controller_enabled)
peahdf3efa82015-11-28 12:35:15 -0800346 : fwd_proc_format(kSampleRate16kHz),
347 split_rate(kSampleRate16kHz),
aluebsb2328d12016-01-11 20:32:29 -0800348 stream_delay_ms(0),
Alejandro Luebsc9b0c262016-05-16 15:32:38 -0700349 beamformer_enabled(beamformer_enabled),
kjellander10f606d2016-09-11 23:04:31 -0700350 intelligibility_enabled(intelligibility_enabled),
351 level_controller_enabled(level_controller_enabled) {}
peahdf3efa82015-11-28 12:35:15 -0800352 // Only the rate and samples fields of fwd_proc_format_ are used because the
353 // forward processing number of channels is mutable and is tracked by the
354 // capture_audio_.
355 StreamConfig fwd_proc_format;
356 int split_rate;
357 int stream_delay_ms;
aluebsb2328d12016-01-11 20:32:29 -0800358 bool beamformer_enabled;
Alejandro Luebsc9b0c262016-05-16 15:32:38 -0700359 bool intelligibility_enabled;
kjellander10f606d2016-09-11 23:04:31 -0700360 bool level_controller_enabled;
peahdf3efa82015-11-28 12:35:15 -0800361 } capture_nonlocked_;
andrew@webrtc.org75dd2882014-02-11 20:52:30 +0000362
peahdf3efa82015-11-28 12:35:15 -0800363 struct ApmRenderState {
kwiberg83ffe452016-08-29 14:46:07 -0700364 ApmRenderState();
365 ~ApmRenderState();
kwiberg88788ad2016-02-19 07:04:49 -0800366 std::unique_ptr<AudioConverter> render_converter;
367 std::unique_ptr<AudioBuffer> render_audio;
peahdf3efa82015-11-28 12:35:15 -0800368 } render_ GUARDED_BY(crit_render_);
niklase@google.com470e71d2011-07-07 08:21:25 +0000369};
andrew@webrtc.orgddbb8a22014-04-22 21:00:04 +0000370
niklase@google.com470e71d2011-07-07 08:21:25 +0000371} // namespace webrtc
372
pbos@webrtc.org788acd12014-12-15 09:41:24 +0000373#endif // WEBRTC_MODULES_AUDIO_PROCESSING_AUDIO_PROCESSING_IMPL_H_