blob: c8162c1b66dcecf314997c461a6765745d163fce [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"
kwiberg77eab702016-09-28 17:42:01 -070020#include "webrtc/base/ignore_wundef.h"
pbos@webrtc.org788acd12014-12-15 09:41:24 +000021#include "webrtc/base/thread_annotations.h"
peahdf3efa82015-11-28 12:35:15 -080022#include "webrtc/modules/audio_processing/audio_buffer.h"
Michael Graczykdfa36052015-03-25 16:37:27 -070023#include "webrtc/modules/audio_processing/include/audio_processing.h"
peahdf3efa82015-11-28 12:35:15 -080024#include "webrtc/system_wrappers/include/file_wrapper.h"
25
26#ifdef WEBRTC_AUDIOPROC_DEBUG_DUMP
27// Files generated at build-time by the protobuf compiler.
kwiberg77eab702016-09-28 17:42:01 -070028RTC_PUSH_IGNORING_WUNDEF()
peahdf3efa82015-11-28 12:35:15 -080029#ifdef WEBRTC_ANDROID_PLATFORM_BUILD
30#include "external/webrtc/webrtc/modules/audio_processing/debug.pb.h"
31#else
kjellander78ddd732016-02-09 08:13:06 -080032#include "webrtc/modules/audio_processing/debug.pb.h"
peahdf3efa82015-11-28 12:35:15 -080033#endif
kwiberg77eab702016-09-28 17:42:01 -070034RTC_POP_IGNORING_WUNDEF()
peahdf3efa82015-11-28 12:35:15 -080035#endif // WEBRTC_AUDIOPROC_DEBUG_DUMP
niklase@google.com470e71d2011-07-07 08:21:25 +000036
37namespace webrtc {
andrew@webrtc.orgddbb8a22014-04-22 21:00:04 +000038
pbos@webrtc.org788acd12014-12-15 09:41:24 +000039class AgcManagerDirect;
ekmeyerson60d9b332015-08-14 10:35:55 -070040class AudioConverter;
Michael Graczykdfa36052015-03-25 16:37:27 -070041
Alejandro Luebsf4022ff2016-07-01 17:19:09 -070042class NonlinearBeamformer;
Michael Graczykdfa36052015-03-25 16:37:27 -070043
niklase@google.com470e71d2011-07-07 08:21:25 +000044class AudioProcessingImpl : public AudioProcessing {
45 public:
peahdf3efa82015-11-28 12:35:15 -080046 // Methods forcing APM to run in a single-threaded manner.
47 // Acquires both the render and capture locks.
peah88ac8532016-09-12 16:47:25 -070048 explicit AudioProcessingImpl(const webrtc::Config& config);
Michael Graczykdfa36052015-03-25 16:37:27 -070049 // AudioProcessingImpl takes ownership of beamformer.
peah88ac8532016-09-12 16:47:25 -070050 AudioProcessingImpl(const webrtc::Config& config,
51 NonlinearBeamformer* beamformer);
kwiberg83ffe452016-08-29 14:46:07 -070052 ~AudioProcessingImpl() override;
kjellander@webrtc.org14665ff2015-03-04 12:58:35 +000053 int Initialize() override;
peahde65ddc2016-09-16 15:02:15 -070054 int Initialize(int capture_input_sample_rate_hz,
55 int capture_output_sample_rate_hz,
56 int render_sample_rate_hz,
57 ChannelLayout capture_input_layout,
58 ChannelLayout capture_output_layout,
59 ChannelLayout render_input_layout) override;
Michael Graczyk86c6d332015-07-23 11:41:39 -070060 int Initialize(const ProcessingConfig& processing_config) override;
peah88ac8532016-09-12 16:47:25 -070061 void ApplyConfig(const AudioProcessing::Config& config) override;
62 void SetExtraOptions(const webrtc::Config& config) override;
peahdf3efa82015-11-28 12:35:15 -080063 void UpdateHistogramsOnCallEnd() override;
ivocd66b44d2016-01-15 03:06:36 -080064 int StartDebugRecording(const char filename[kMaxFilenameSize],
65 int64_t max_log_size_bytes) override;
66 int StartDebugRecording(FILE* handle, int64_t max_log_size_bytes) override;
67
peahdf3efa82015-11-28 12:35:15 -080068 int StartDebugRecordingForPlatformFile(rtc::PlatformFile handle) override;
69 int StopDebugRecording() override;
70
71 // Capture-side exclusive methods possibly running APM in a
72 // multi-threaded manner. Acquire the capture lock.
kjellander@webrtc.org14665ff2015-03-04 12:58:35 +000073 int ProcessStream(AudioFrame* frame) override;
74 int ProcessStream(const float* const* src,
Peter Kastingdce40cf2015-08-24 14:52:23 -070075 size_t samples_per_channel,
kjellander@webrtc.org14665ff2015-03-04 12:58:35 +000076 int input_sample_rate_hz,
77 ChannelLayout input_layout,
78 int output_sample_rate_hz,
79 ChannelLayout output_layout,
80 float* const* dest) override;
Michael Graczyk86c6d332015-07-23 11:41:39 -070081 int ProcessStream(const float* const* src,
82 const StreamConfig& input_config,
83 const StreamConfig& output_config,
84 float* const* dest) override;
peahdf3efa82015-11-28 12:35:15 -080085 void set_output_will_be_muted(bool muted) override;
86 int set_stream_delay_ms(int delay) override;
87 void set_delay_offset_ms(int offset) override;
88 int delay_offset_ms() const override;
89 void set_stream_key_pressed(bool key_pressed) override;
90
91 // Render-side exclusive methods possibly running APM in a
92 // multi-threaded manner. Acquire the render lock.
ekmeyerson60d9b332015-08-14 10:35:55 -070093 int ProcessReverseStream(AudioFrame* frame) override;
kjellander@webrtc.org14665ff2015-03-04 12:58:35 +000094 int AnalyzeReverseStream(const float* const* data,
Peter Kastingdce40cf2015-08-24 14:52:23 -070095 size_t samples_per_channel,
kjellander@webrtc.org14665ff2015-03-04 12:58:35 +000096 int sample_rate_hz,
97 ChannelLayout layout) override;
ekmeyerson60d9b332015-08-14 10:35:55 -070098 int ProcessReverseStream(const float* const* src,
peahde65ddc2016-09-16 15:02:15 -070099 const StreamConfig& input_config,
100 const StreamConfig& output_config,
ekmeyerson60d9b332015-08-14 10:35:55 -0700101 float* const* dest) override;
peahdf3efa82015-11-28 12:35:15 -0800102
103 // Methods only accessed from APM submodules or
104 // from AudioProcessing tests in a single-threaded manner.
105 // Hence there is no need for locks in these.
106 int proc_sample_rate_hz() const override;
107 int proc_split_sample_rate_hz() const override;
Peter Kasting69558702016-01-12 16:26:35 -0800108 size_t num_input_channels() const override;
109 size_t num_proc_channels() const override;
110 size_t num_output_channels() const override;
111 size_t num_reverse_channels() const override;
kjellander@webrtc.org14665ff2015-03-04 12:58:35 +0000112 int stream_delay_ms() const override;
peahdf3efa82015-11-28 12:35:15 -0800113 bool was_stream_delay_set() const override
114 EXCLUSIVE_LOCKS_REQUIRED(crit_capture_);
115
116 // Methods returning pointers to APM submodules.
117 // No locks are aquired in those, as those locks
118 // would offer no protection (the submodules are
119 // created only once in a single-treaded manner
120 // during APM creation).
kjellander@webrtc.org14665ff2015-03-04 12:58:35 +0000121 EchoCancellation* echo_cancellation() const override;
122 EchoControlMobile* echo_control_mobile() const override;
123 GainControl* gain_control() const override;
124 HighPassFilter* high_pass_filter() const override;
125 LevelEstimator* level_estimator() const override;
126 NoiseSuppression* noise_suppression() const override;
127 VoiceDetection* voice_detection() const override;
niklase@google.com470e71d2011-07-07 08:21:25 +0000128
andrew@webrtc.org60730cf2014-01-07 17:45:09 +0000129 protected:
andrew@webrtc.orga8b97372014-03-10 22:26:12 +0000130 // Overridden in a mock.
peahdf3efa82015-11-28 12:35:15 -0800131 virtual int InitializeLocked()
132 EXCLUSIVE_LOCKS_REQUIRED(crit_render_, crit_capture_);
andrew@webrtc.org60730cf2014-01-07 17:45:09 +0000133
niklase@google.com470e71d2011-07-07 08:21:25 +0000134 private:
peahdf3efa82015-11-28 12:35:15 -0800135 struct ApmPublicSubmodules;
136 struct ApmPrivateSubmodules;
137
peah2ace3f92016-09-10 04:42:27 -0700138 class ApmSubmoduleStates {
139 public:
140 ApmSubmoduleStates();
141 // Updates the submodule state and returns true if it has changed.
142 bool Update(bool high_pass_filter_enabled,
143 bool echo_canceller_enabled,
144 bool mobile_echo_controller_enabled,
145 bool noise_suppressor_enabled,
146 bool intelligibility_enhancer_enabled,
147 bool beamformer_enabled,
148 bool adaptive_gain_controller_enabled,
149 bool level_controller_enabled,
150 bool voice_activity_detector_enabled,
151 bool level_estimator_enabled,
152 bool transient_suppressor_enabled);
153 bool CaptureMultiBandSubModulesActive() const;
154 bool CaptureMultiBandProcessingActive() const;
155 bool RenderMultiBandSubModulesActive() const;
156 bool RenderMultiBandProcessingActive() const;
157
158 private:
159 bool high_pass_filter_enabled_ = false;
160 bool echo_canceller_enabled_ = false;
161 bool mobile_echo_controller_enabled_ = false;
162 bool noise_suppressor_enabled_ = false;
163 bool intelligibility_enhancer_enabled_ = false;
164 bool beamformer_enabled_ = false;
165 bool adaptive_gain_controller_enabled_ = false;
166 bool level_controller_enabled_ = false;
167 bool level_estimator_enabled_ = false;
168 bool voice_activity_detector_enabled_ = false;
169 bool transient_suppressor_enabled_ = false;
170 bool first_update_ = true;
171 };
172
peahdf3efa82015-11-28 12:35:15 -0800173#ifdef WEBRTC_AUDIOPROC_DEBUG_DUMP
174 // State for the debug dump.
175 struct ApmDebugDumpThreadState {
kwiberg83ffe452016-08-29 14:46:07 -0700176 ApmDebugDumpThreadState();
177 ~ApmDebugDumpThreadState();
kwiberg88788ad2016-02-19 07:04:49 -0800178 std::unique_ptr<audioproc::Event> event_msg; // Protobuf message.
peahdf3efa82015-11-28 12:35:15 -0800179 std::string event_str; // Memory for protobuf serialization.
180
181 // Serialized string of last saved APM configuration.
182 std::string last_serialized_config;
183 };
184
185 struct ApmDebugDumpState {
kwiberg83ffe452016-08-29 14:46:07 -0700186 ApmDebugDumpState();
187 ~ApmDebugDumpState();
ivocd66b44d2016-01-15 03:06:36 -0800188 // Number of bytes that can still be written to the log before the maximum
189 // size is reached. A value of <= 0 indicates that no limit is used.
190 int64_t num_bytes_left_for_log_ = -1;
kwiberg88788ad2016-02-19 07:04:49 -0800191 std::unique_ptr<FileWrapper> debug_file;
peahdf3efa82015-11-28 12:35:15 -0800192 ApmDebugDumpThreadState render;
193 ApmDebugDumpThreadState capture;
194 };
195#endif
196
197 // Method for modifying the formats struct that are called from both
198 // the render and capture threads. The check for whether modifications
199 // are needed is done while holding the render lock only, thereby avoiding
200 // that the capture thread blocks the render thread.
201 // The struct is modified in a single-threaded manner by holding both the
202 // render and capture locks.
peah2ace3f92016-09-10 04:42:27 -0700203 int MaybeInitialize(const ProcessingConfig& config, bool force_initialization)
peahdf3efa82015-11-28 12:35:15 -0800204 EXCLUSIVE_LOCKS_REQUIRED(crit_render_);
205
206 int MaybeInitializeRender(const ProcessingConfig& processing_config)
207 EXCLUSIVE_LOCKS_REQUIRED(crit_render_);
208
peah2ace3f92016-09-10 04:42:27 -0700209 int MaybeInitializeCapture(const ProcessingConfig& processing_config,
210 bool force_initialization)
peahdf3efa82015-11-28 12:35:15 -0800211 EXCLUSIVE_LOCKS_REQUIRED(crit_render_);
212
peah2ace3f92016-09-10 04:42:27 -0700213 // Method for updating the state keeping track of the active submodules.
214 // Returns a bool indicating whether the state has changed.
215 bool UpdateActiveSubmoduleStates() EXCLUSIVE_LOCKS_REQUIRED(crit_capture_);
peahdf3efa82015-11-28 12:35:15 -0800216
217 // Methods requiring APM running in a single-threaded manner.
218 // Are called with both the render and capture locks already
219 // acquired.
peahdf3efa82015-11-28 12:35:15 -0800220 void InitializeTransient()
221 EXCLUSIVE_LOCKS_REQUIRED(crit_render_, crit_capture_);
222 void InitializeBeamformer()
223 EXCLUSIVE_LOCKS_REQUIRED(crit_render_, crit_capture_);
224 void InitializeIntelligibility()
225 EXCLUSIVE_LOCKS_REQUIRED(crit_render_, crit_capture_);
Michael Graczyk86c6d332015-07-23 11:41:39 -0700226 int InitializeLocked(const ProcessingConfig& config)
peahdf3efa82015-11-28 12:35:15 -0800227 EXCLUSIVE_LOCKS_REQUIRED(crit_render_, crit_capture_);
peahca4cac72016-06-29 15:26:12 -0700228 void InitializeLevelController() EXCLUSIVE_LOCKS_REQUIRED(crit_capture_);
peahdf3efa82015-11-28 12:35:15 -0800229
230 // Capture-side exclusive methods possibly running APM in a multi-threaded
231 // manner that are called with the render lock already acquired.
peahde65ddc2016-09-16 15:02:15 -0700232 int ProcessCaptureStreamLocked() EXCLUSIVE_LOCKS_REQUIRED(crit_capture_);
peahdf3efa82015-11-28 12:35:15 -0800233 void MaybeUpdateHistograms() EXCLUSIVE_LOCKS_REQUIRED(crit_capture_);
234
235 // Render-side exclusive methods possibly running APM in a multi-threaded
236 // manner that are called with the render lock already acquired.
ekmeyerson60d9b332015-08-14 10:35:55 -0700237 // TODO(ekm): Remove once all clients updated to new interface.
peahdf3efa82015-11-28 12:35:15 -0800238 int AnalyzeReverseStreamLocked(const float* const* src,
239 const StreamConfig& input_config,
240 const StreamConfig& output_config)
241 EXCLUSIVE_LOCKS_REQUIRED(crit_render_);
peahde65ddc2016-09-16 15:02:15 -0700242 int ProcessRenderStreamLocked() EXCLUSIVE_LOCKS_REQUIRED(crit_render_);
andrew@webrtc.org17e40642014-03-04 20:58:13 +0000243
peahdf3efa82015-11-28 12:35:15 -0800244// Debug dump methods that are internal and called without locks.
245// TODO(peah): Make thread safe.
andrew@webrtc.org7bf26462011-12-03 00:03:31 +0000246#ifdef WEBRTC_AUDIOPROC_DEBUG_DUMP
247 // TODO(andrew): make this more graceful. Ideally we would split this stuff
248 // out into a separate class with an "enabled" and "disabled" implementation.
peahdf3efa82015-11-28 12:35:15 -0800249 static int WriteMessageToDebugFile(FileWrapper* debug_file,
ivocd66b44d2016-01-15 03:06:36 -0800250 int64_t* filesize_limit_bytes,
peahdf3efa82015-11-28 12:35:15 -0800251 rtc::CriticalSection* crit_debug,
252 ApmDebugDumpThreadState* debug_state);
253 int WriteInitMessage() EXCLUSIVE_LOCKS_REQUIRED(crit_render_, crit_capture_);
Minyue13b96ba2015-10-03 00:39:14 +0200254
255 // Writes Config message. If not |forced|, only writes the current config if
256 // it is different from the last saved one; if |forced|, writes the config
257 // regardless of the last saved.
peahdf3efa82015-11-28 12:35:15 -0800258 int WriteConfigMessage(bool forced) EXCLUSIVE_LOCKS_REQUIRED(crit_capture_)
259 EXCLUSIVE_LOCKS_REQUIRED(crit_capture_);
Minyue13b96ba2015-10-03 00:39:14 +0200260
peahdf3efa82015-11-28 12:35:15 -0800261 // Critical section.
pbos5ad935c2016-01-25 03:52:44 -0800262 rtc::CriticalSection crit_debug_;
Minyue13b96ba2015-10-03 00:39:14 +0200263
peahdf3efa82015-11-28 12:35:15 -0800264 // Debug dump state.
265 ApmDebugDumpState debug_dump_;
andrew@webrtc.org7bf26462011-12-03 00:03:31 +0000266#endif
niklase@google.com470e71d2011-07-07 08:21:25 +0000267
peahdf3efa82015-11-28 12:35:15 -0800268 // Critical sections.
pbos5ad935c2016-01-25 03:52:44 -0800269 rtc::CriticalSection crit_render_ ACQUIRED_BEFORE(crit_capture_);
270 rtc::CriticalSection crit_capture_;
peahdf3efa82015-11-28 12:35:15 -0800271
peah2ace3f92016-09-10 04:42:27 -0700272 // Class containing information about what submodules are active.
273 ApmSubmoduleStates submodule_states_;
274
peahdf3efa82015-11-28 12:35:15 -0800275 // Structs containing the pointers to the submodules.
kwiberg88788ad2016-02-19 07:04:49 -0800276 std::unique_ptr<ApmPublicSubmodules> public_submodules_;
277 std::unique_ptr<ApmPrivateSubmodules> private_submodules_
peahdf3efa82015-11-28 12:35:15 -0800278 GUARDED_BY(crit_capture_);
279
peah192164e2015-11-17 02:16:45 -0800280 // State that is written to while holding both the render and capture locks
peahdf3efa82015-11-28 12:35:15 -0800281 // but can be read without any lock being held.
282 // As this is only accessed internally of APM, and all internal methods in APM
283 // either are holding the render or capture locks, this construct is safe as
284 // it is not possible to read the variables while writing them.
285 struct ApmFormatState {
286 ApmFormatState()
peah192164e2015-11-17 02:16:45 -0800287 : // Format of processing streams at input/output call sites.
peahdf3efa82015-11-28 12:35:15 -0800288 api_format({{{kSampleRate16kHz, 1, false},
289 {kSampleRate16kHz, 1, false},
290 {kSampleRate16kHz, 1, false},
291 {kSampleRate16kHz, 1, false}}}),
peahde65ddc2016-09-16 15:02:15 -0700292 render_processing_format(kSampleRate16kHz, 1) {}
peahdf3efa82015-11-28 12:35:15 -0800293 ProcessingConfig api_format;
peahde65ddc2016-09-16 15:02:15 -0700294 StreamConfig render_processing_format;
peahdf3efa82015-11-28 12:35:15 -0800295 } formats_;
Michael Graczyk86c6d332015-07-23 11:41:39 -0700296
peahdf3efa82015-11-28 12:35:15 -0800297 // APM constants.
298 const struct ApmConstants {
Alejandro Luebsc9b0c262016-05-16 15:32:38 -0700299 ApmConstants(int agc_startup_min_volume, bool use_experimental_agc)
peahdf3efa82015-11-28 12:35:15 -0800300 : // Format of processing streams at input/output call sites.
301 agc_startup_min_volume(agc_startup_min_volume),
Alejandro Luebsc9b0c262016-05-16 15:32:38 -0700302 use_experimental_agc(use_experimental_agc) {}
peahdf3efa82015-11-28 12:35:15 -0800303 int agc_startup_min_volume;
peahbe615622016-02-13 16:40:47 -0800304 bool use_experimental_agc;
peahdf3efa82015-11-28 12:35:15 -0800305 } constants_;
andrew@webrtc.orgddbb8a22014-04-22 21:00:04 +0000306
peahdf3efa82015-11-28 12:35:15 -0800307 struct ApmCaptureState {
aluebs2a346882016-01-11 18:04:30 -0800308 ApmCaptureState(bool transient_suppressor_enabled,
aluebs2a346882016-01-11 18:04:30 -0800309 const std::vector<Point>& array_geometry,
kwiberg83ffe452016-08-29 14:46:07 -0700310 SphericalPointf target_direction);
311 ~ApmCaptureState();
peahdf3efa82015-11-28 12:35:15 -0800312 int aec_system_delay_jumps;
313 int delay_offset_ms;
314 bool was_stream_delay_set;
315 int last_stream_delay_ms;
316 int last_aec_system_delay_ms;
317 int stream_delay_jumps;
318 bool output_will_be_muted;
319 bool key_pressed;
320 bool transient_suppressor_enabled;
aluebs2a346882016-01-11 18:04:30 -0800321 std::vector<Point> array_geometry;
322 SphericalPointf target_direction;
kwiberg88788ad2016-02-19 07:04:49 -0800323 std::unique_ptr<AudioBuffer> capture_audio;
peahde65ddc2016-09-16 15:02:15 -0700324 // Only the rate and samples fields of capture_processing_format_ are used
325 // because the capture processing number of channels is mutable and is
326 // tracked by the capture_audio_.
327 StreamConfig capture_processing_format;
peahdf3efa82015-11-28 12:35:15 -0800328 int split_rate;
329 } capture_ GUARDED_BY(crit_capture_);
niklase@google.com470e71d2011-07-07 08:21:25 +0000330
peahdf3efa82015-11-28 12:35:15 -0800331 struct ApmCaptureNonLockedState {
Alejandro Luebsc9b0c262016-05-16 15:32:38 -0700332 ApmCaptureNonLockedState(bool beamformer_enabled,
peah88ac8532016-09-12 16:47:25 -0700333 bool intelligibility_enabled)
peahde65ddc2016-09-16 15:02:15 -0700334 : capture_processing_format(kSampleRate16kHz),
peahdf3efa82015-11-28 12:35:15 -0800335 split_rate(kSampleRate16kHz),
aluebsb2328d12016-01-11 20:32:29 -0800336 stream_delay_ms(0),
Alejandro Luebsc9b0c262016-05-16 15:32:38 -0700337 beamformer_enabled(beamformer_enabled),
peah88ac8532016-09-12 16:47:25 -0700338 intelligibility_enabled(intelligibility_enabled) {}
peahde65ddc2016-09-16 15:02:15 -0700339 // Only the rate and samples fields of capture_processing_format_ are used
340 // because the forward processing number of channels is mutable and is
341 // tracked by the capture_audio_.
342 StreamConfig capture_processing_format;
peahdf3efa82015-11-28 12:35:15 -0800343 int split_rate;
344 int stream_delay_ms;
aluebsb2328d12016-01-11 20:32:29 -0800345 bool beamformer_enabled;
Alejandro Luebsc9b0c262016-05-16 15:32:38 -0700346 bool intelligibility_enabled;
peah88ac8532016-09-12 16:47:25 -0700347 bool level_controller_enabled = false;
peahdf3efa82015-11-28 12:35:15 -0800348 } capture_nonlocked_;
andrew@webrtc.org75dd2882014-02-11 20:52:30 +0000349
peahdf3efa82015-11-28 12:35:15 -0800350 struct ApmRenderState {
kwiberg83ffe452016-08-29 14:46:07 -0700351 ApmRenderState();
352 ~ApmRenderState();
kwiberg88788ad2016-02-19 07:04:49 -0800353 std::unique_ptr<AudioConverter> render_converter;
354 std::unique_ptr<AudioBuffer> render_audio;
peahdf3efa82015-11-28 12:35:15 -0800355 } render_ GUARDED_BY(crit_render_);
niklase@google.com470e71d2011-07-07 08:21:25 +0000356};
andrew@webrtc.orgddbb8a22014-04-22 21:00:04 +0000357
niklase@google.com470e71d2011-07-07 08:21:25 +0000358} // namespace webrtc
359
pbos@webrtc.org788acd12014-12-15 09:41:24 +0000360#endif // WEBRTC_MODULES_AUDIO_PROCESSING_AUDIO_PROCESSING_IMPL_H_