2011-07-07 08:21:25 +00:00
|
|
|
/*
|
2012-03-06 19:03:39 +00:00
|
|
|
* Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
|
2011-07-07 08:21:25 +00:00
|
|
|
*
|
|
|
|
|
* Use of this source code is governed by a BSD-style license
|
|
|
|
|
* that can be found in the LICENSE file in the root of the source
|
|
|
|
|
* tree. An additional intellectual property rights grant can be found
|
|
|
|
|
* in the file PATENTS. All contributing project authors may
|
|
|
|
|
* be found in the AUTHORS file in the root of the source tree.
|
|
|
|
|
*/
|
|
|
|
|
|
2017-09-15 06:47:31 +02:00
|
|
|
#ifndef MODULES_AUDIO_PROCESSING_AUDIO_PROCESSING_IMPL_H_
|
|
|
|
|
#define MODULES_AUDIO_PROCESSING_AUDIO_PROCESSING_IMPL_H_
|
2011-07-07 08:21:25 +00:00
|
|
|
|
2020-05-11 11:03:47 +02:00
|
|
|
#include <stdio.h>
|
|
|
|
|
|
2022-06-27 09:47:02 +02:00
|
|
|
#include <atomic>
|
2011-07-07 08:21:25 +00:00
|
|
|
#include <list>
|
2016-02-19 07:04:49 -08:00
|
|
|
#include <memory>
|
2020-05-11 11:03:47 +02:00
|
|
|
#include <string>
|
2015-07-23 11:41:39 -07:00
|
|
|
#include <vector>
|
2011-07-07 08:21:25 +00:00
|
|
|
|
2024-01-09 11:52:10 +01:00
|
|
|
#include "absl/base/nullability.h"
|
2022-07-25 22:07:08 +02:00
|
|
|
#include "absl/strings/string_view.h"
|
2022-09-07 17:14:26 +02:00
|
|
|
#include "absl/types/optional.h"
|
2022-02-03 16:30:25 +01:00
|
|
|
#include "api/array_view.h"
|
2024-04-19 15:07:08 +00:00
|
|
|
#include "api/audio/audio_processing.h"
|
|
|
|
|
#include "api/audio/audio_processing_statistics.h"
|
2019-03-21 14:37:36 +01:00
|
|
|
#include "api/function_view.h"
|
2024-01-09 11:52:10 +01:00
|
|
|
#include "api/task_queue/task_queue_base.h"
|
2019-10-18 13:29:43 +02:00
|
|
|
#include "modules/audio_processing/aec3/echo_canceller3.h"
|
|
|
|
|
#include "modules/audio_processing/agc/agc_manager_direct.h"
|
2019-10-15 10:10:26 +02:00
|
|
|
#include "modules/audio_processing/agc/gain_control.h"
|
2022-10-24 22:05:19 +02:00
|
|
|
#include "modules/audio_processing/agc2/input_volume_stats_reporter.h"
|
2017-09-15 06:47:31 +02:00
|
|
|
#include "modules/audio_processing/audio_buffer.h"
|
2021-03-15 16:31:04 +00:00
|
|
|
#include "modules/audio_processing/capture_levels_adjuster/capture_levels_adjuster.h"
|
2019-10-18 13:29:43 +02:00
|
|
|
#include "modules/audio_processing/echo_control_mobile_impl.h"
|
|
|
|
|
#include "modules/audio_processing/gain_control_impl.h"
|
|
|
|
|
#include "modules/audio_processing/gain_controller2.h"
|
|
|
|
|
#include "modules/audio_processing/high_pass_filter.h"
|
2017-09-15 06:47:31 +02:00
|
|
|
#include "modules/audio_processing/include/aec_dump.h"
|
2020-03-17 13:23:58 +01:00
|
|
|
#include "modules/audio_processing/include/audio_frame_proxies.h"
|
2019-10-29 22:59:44 +01:00
|
|
|
#include "modules/audio_processing/ns/noise_suppressor.h"
|
2017-09-15 06:47:31 +02:00
|
|
|
#include "modules/audio_processing/render_queue_item_verifier.h"
|
|
|
|
|
#include "modules/audio_processing/rms_level.h"
|
|
|
|
|
#include "rtc_base/gtest_prod_util.h"
|
|
|
|
|
#include "rtc_base/swap_queue.h"
|
2020-07-07 15:53:34 +02:00
|
|
|
#include "rtc_base/synchronization/mutex.h"
|
2017-09-15 06:47:31 +02:00
|
|
|
#include "rtc_base/thread_annotations.h"
|
2015-11-28 12:35:15 -08:00
|
|
|
|
2011-07-07 08:21:25 +00:00
|
|
|
namespace webrtc {
|
2014-04-22 21:00:04 +00:00
|
|
|
|
2018-02-12 21:42:56 +01:00
|
|
|
class ApmDataDumper;
|
2015-08-14 10:35:55 -07:00
|
|
|
class AudioConverter;
|
2015-03-25 16:37:27 -07:00
|
|
|
|
2022-02-08 09:15:12 +00:00
|
|
|
constexpr int RuntimeSettingQueueSize() {
|
|
|
|
|
return 100;
|
|
|
|
|
}
|
|
|
|
|
|
2011-07-07 08:21:25 +00:00
|
|
|
class AudioProcessingImpl : public AudioProcessing {
|
|
|
|
|
public:
|
2015-11-28 12:35:15 -08:00
|
|
|
// Methods forcing APM to run in a single-threaded manner.
|
|
|
|
|
// Acquires both the render and capture locks.
|
2021-09-17 08:26:10 +02:00
|
|
|
AudioProcessingImpl();
|
2021-10-14 10:55:08 +02:00
|
|
|
AudioProcessingImpl(const AudioProcessing::Config& config,
|
|
|
|
|
std::unique_ptr<CustomProcessing> capture_post_processor,
|
2017-12-18 16:02:40 +01:00
|
|
|
std::unique_ptr<CustomProcessing> render_pre_processor,
|
2017-10-12 15:13:17 +02:00
|
|
|
std::unique_ptr<EchoControlFactory> echo_control_factory,
|
2018-08-29 10:37:09 +02:00
|
|
|
rtc::scoped_refptr<EchoDetector> echo_detector,
|
|
|
|
|
std::unique_ptr<CustomAudioAnalyzer> capture_analyzer);
|
2016-08-29 14:46:07 -07:00
|
|
|
~AudioProcessingImpl() override;
|
2015-03-04 12:58:35 +00:00
|
|
|
int Initialize() override;
|
2015-07-23 11:41:39 -07:00
|
|
|
int Initialize(const ProcessingConfig& processing_config) override;
|
2016-09-12 16:47:25 -07:00
|
|
|
void ApplyConfig(const AudioProcessing::Config& config) override;
|
2024-01-09 11:52:10 +01:00
|
|
|
bool CreateAndAttachAecDump(
|
|
|
|
|
absl::string_view file_name,
|
|
|
|
|
int64_t max_log_size_bytes,
|
|
|
|
|
absl::Nonnull<TaskQueueBase*> worker_queue) override;
|
|
|
|
|
bool CreateAndAttachAecDump(
|
|
|
|
|
FILE* handle,
|
|
|
|
|
int64_t max_log_size_bytes,
|
|
|
|
|
absl::Nonnull<TaskQueueBase*> worker_queue) override;
|
2020-05-11 11:03:47 +02:00
|
|
|
// TODO(webrtc:5298) Deprecated variant.
|
AudioProcessingModule has a feature to make a recording of its
configuration, inputs and outputs over a period of time. It is
activated by AudioProcessing::StartRecording. The data is stored in
binary protobuf format in a specified file. The file IO is, as of
this CL, done from the real-time audio thread.
This CL contains an interface for AecDump, a new APM submodule that
will handle the recordings. Calls to the new interface from the
AudioProcessingModule are added. These calls have no effect, and for a
short while, audio_processing_impl.cc will contain two copies of
recording calls.
The original calls are guarded by the WEBRTC_AUDIOPROC_DEBUG_DUMP
preprocessor define. They still have an effect, while the new ones do
not. In the following CLs, the old recording calls will be removed,
and an implementation of AecDump added.
The reasons for the refactoring is to move file IO operations from the
real-time audio thread, to add a top-level low-priority task queue for
logging tasks like this, to simplify and modularize audio_processing_impl.cc
and remove some of the preprocessor directives. These goals will be
archived by the upcoming CLs. The implementation is in
https://codereview.webrtc.org/2865113002.
BUG=webrtc:7404
Review-Url: https://codereview.webrtc.org/2778783002
Cr-Commit-Position: refs/heads/master@{#18233}
2017-05-23 07:20:05 -07:00
|
|
|
void AttachAecDump(std::unique_ptr<AecDump> aec_dump) override;
|
|
|
|
|
void DetachAecDump() override;
|
2018-04-16 12:10:09 +02:00
|
|
|
void SetRuntimeSetting(RuntimeSetting setting) override;
|
2021-02-09 08:47:51 +01:00
|
|
|
bool PostRuntimeSetting(RuntimeSetting setting) override;
|
2018-04-16 12:10:09 +02:00
|
|
|
|
2015-11-28 12:35:15 -08:00
|
|
|
// Capture-side exclusive methods possibly running APM in a
|
|
|
|
|
// multi-threaded manner. Acquire the capture lock.
|
2020-03-16 12:06:02 +01:00
|
|
|
int ProcessStream(const int16_t* const src,
|
|
|
|
|
const StreamConfig& input_config,
|
|
|
|
|
const StreamConfig& output_config,
|
2020-03-19 14:55:58 +01:00
|
|
|
int16_t* const dest) override;
|
2015-07-23 11:41:39 -07:00
|
|
|
int ProcessStream(const float* const* src,
|
|
|
|
|
const StreamConfig& input_config,
|
|
|
|
|
const StreamConfig& output_config,
|
|
|
|
|
float* const* dest) override;
|
2019-11-13 11:12:29 +01:00
|
|
|
bool GetLinearAecOutput(
|
|
|
|
|
rtc::ArrayView<std::array<float, 160>> linear_output) const override;
|
2015-11-28 12:35:15 -08:00
|
|
|
void set_output_will_be_muted(bool muted) override;
|
2021-02-09 08:47:51 +01:00
|
|
|
void HandleCaptureOutputUsedSetting(bool capture_output_used)
|
|
|
|
|
RTC_EXCLUSIVE_LOCKS_REQUIRED(mutex_capture_);
|
2015-11-28 12:35:15 -08:00
|
|
|
int set_stream_delay_ms(int delay) override;
|
|
|
|
|
void set_stream_key_pressed(bool key_pressed) override;
|
2019-03-27 13:28:08 +01:00
|
|
|
void set_stream_analog_level(int level) override;
|
2020-05-14 14:31:18 +02:00
|
|
|
int recommended_stream_analog_level() const
|
2020-07-07 15:53:34 +02:00
|
|
|
RTC_LOCKS_EXCLUDED(mutex_capture_) override;
|
2015-11-28 12:35:15 -08:00
|
|
|
|
|
|
|
|
// Render-side exclusive methods possibly running APM in a
|
|
|
|
|
// multi-threaded manner. Acquire the render lock.
|
2020-03-16 12:06:02 +01:00
|
|
|
int ProcessReverseStream(const int16_t* const src,
|
|
|
|
|
const StreamConfig& input_config,
|
|
|
|
|
const StreamConfig& output_config,
|
|
|
|
|
int16_t* const dest) override;
|
2019-10-22 15:21:31 +02:00
|
|
|
int AnalyzeReverseStream(const float* const* data,
|
|
|
|
|
const StreamConfig& reverse_config) override;
|
2015-08-14 10:35:55 -07:00
|
|
|
int ProcessReverseStream(const float* const* src,
|
2016-09-16 15:02:15 -07:00
|
|
|
const StreamConfig& input_config,
|
|
|
|
|
const StreamConfig& output_config,
|
2015-08-14 10:35:55 -07:00
|
|
|
float* const* dest) override;
|
2015-11-28 12:35:15 -08:00
|
|
|
|
|
|
|
|
// Methods only accessed from APM submodules or
|
|
|
|
|
// from AudioProcessing tests in a single-threaded manner.
|
|
|
|
|
// Hence there is no need for locks in these.
|
|
|
|
|
int proc_sample_rate_hz() const override;
|
|
|
|
|
int proc_split_sample_rate_hz() const override;
|
Convert channel counts to size_t.
IIRC, this was originally requested by ajm during review of the other size_t conversions I did over the past year, and I agreed it made sense, but wanted to do it separately since those changes were already gargantuan.
BUG=chromium:81439
TEST=none
R=henrik.lundin@webrtc.org, henrika@webrtc.org, kjellander@webrtc.org, minyue@webrtc.org, perkj@webrtc.org, solenberg@webrtc.org, stefan@webrtc.org, tina.legrand@webrtc.org
Review URL: https://codereview.webrtc.org/1316523002 .
Cr-Commit-Position: refs/heads/master@{#11229}
2016-01-12 16:26:35 -08:00
|
|
|
size_t num_input_channels() const override;
|
|
|
|
|
size_t num_proc_channels() const override;
|
|
|
|
|
size_t num_output_channels() const override;
|
|
|
|
|
size_t num_reverse_channels() const override;
|
2015-03-04 12:58:35 +00:00
|
|
|
int stream_delay_ms() const override;
|
2015-11-28 12:35:15 -08:00
|
|
|
|
2019-12-30 14:32:14 +01:00
|
|
|
AudioProcessingStats GetStatistics(bool has_remote_tracks) override {
|
|
|
|
|
return GetStatistics();
|
|
|
|
|
}
|
|
|
|
|
AudioProcessingStats GetStatistics() override {
|
|
|
|
|
return stats_reporter_.GetStatistics();
|
|
|
|
|
}
|
2016-10-28 07:55:33 -07:00
|
|
|
|
2017-04-05 05:48:24 -07:00
|
|
|
AudioProcessing::Config GetConfig() const override;
|
2016-11-22 07:24:52 -08:00
|
|
|
|
2014-01-07 17:45:09 +00:00
|
|
|
protected:
|
2014-03-10 22:26:12 +00:00
|
|
|
// Overridden in a mock.
|
2020-09-01 23:57:20 +02:00
|
|
|
virtual void InitializeLocked()
|
2020-07-07 15:53:34 +02:00
|
|
|
RTC_EXCLUSIVE_LOCKS_REQUIRED(mutex_render_, mutex_capture_);
|
2021-07-26 17:16:25 +02:00
|
|
|
void AssertLockedForTest()
|
|
|
|
|
RTC_ASSERT_EXCLUSIVE_LOCK(mutex_render_, mutex_capture_) {
|
|
|
|
|
mutex_render_.AssertHeld();
|
|
|
|
|
mutex_capture_.AssertHeld();
|
|
|
|
|
}
|
2014-01-07 17:45:09 +00:00
|
|
|
|
2011-07-07 08:21:25 +00:00
|
|
|
private:
|
2016-10-07 14:54:10 -07:00
|
|
|
// TODO(peah): These friend classes should be removed as soon as the new
|
|
|
|
|
// parameter setting scheme allows.
|
|
|
|
|
FRIEND_TEST_ALL_PREFIXES(ApmConfiguration, DefaultBehavior);
|
|
|
|
|
FRIEND_TEST_ALL_PREFIXES(ApmConfiguration, ValidConfigBehavior);
|
|
|
|
|
FRIEND_TEST_ALL_PREFIXES(ApmConfiguration, InValidConfigBehavior);
|
2020-04-27 08:39:33 +02:00
|
|
|
|
2022-09-07 15:15:52 +02:00
|
|
|
void set_stream_analog_level_locked(int level)
|
|
|
|
|
RTC_EXCLUSIVE_LOCKS_REQUIRED(mutex_capture_);
|
2022-09-07 16:58:33 +02:00
|
|
|
void UpdateRecommendedInputVolumeLocked()
|
2020-07-07 15:53:34 +02:00
|
|
|
RTC_EXCLUSIVE_LOCKS_REQUIRED(mutex_capture_);
|
2020-05-14 14:31:18 +02:00
|
|
|
|
2018-04-16 12:10:09 +02:00
|
|
|
// Class providing thread-safe message pipe functionality for
|
2021-07-28 20:50:03 +02:00
|
|
|
// `runtime_settings_`.
|
2018-04-16 12:10:09 +02:00
|
|
|
class RuntimeSettingEnqueuer {
|
|
|
|
|
public:
|
|
|
|
|
explicit RuntimeSettingEnqueuer(
|
|
|
|
|
SwapQueue<RuntimeSetting>* runtime_settings);
|
|
|
|
|
~RuntimeSettingEnqueuer();
|
2021-02-09 08:47:51 +01:00
|
|
|
|
|
|
|
|
// Enqueue setting and return whether the setting was successfully enqueued.
|
|
|
|
|
bool Enqueue(RuntimeSetting setting);
|
2018-04-16 12:10:09 +02:00
|
|
|
|
|
|
|
|
private:
|
2018-04-20 13:16:55 +02:00
|
|
|
SwapQueue<RuntimeSetting>& runtime_settings_;
|
2018-05-15 10:52:28 +02:00
|
|
|
};
|
|
|
|
|
|
2021-12-06 15:40:04 +01:00
|
|
|
const std::unique_ptr<ApmDataDumper> data_dumper_;
|
2022-06-27 09:47:02 +02:00
|
|
|
static std::atomic<int> instance_count_;
|
2019-12-02 14:59:40 +01:00
|
|
|
const bool use_setup_specific_default_aec3_config_;
|
2018-05-15 10:52:28 +02:00
|
|
|
|
|
|
|
|
SwapQueue<RuntimeSetting> capture_runtime_settings_;
|
|
|
|
|
SwapQueue<RuntimeSetting> render_runtime_settings_;
|
|
|
|
|
|
|
|
|
|
RuntimeSettingEnqueuer capture_runtime_settings_enqueuer_;
|
|
|
|
|
RuntimeSettingEnqueuer render_runtime_settings_enqueuer_;
|
2018-04-16 12:10:09 +02:00
|
|
|
|
2017-10-12 15:13:17 +02:00
|
|
|
// EchoControl factory.
|
2021-12-06 15:40:04 +01:00
|
|
|
const std::unique_ptr<EchoControlFactory> echo_control_factory_;
|
2017-10-11 16:29:02 +02:00
|
|
|
|
2019-10-18 13:29:43 +02:00
|
|
|
class SubmoduleStates {
|
The audio processing module (APM) relies on two for
functionalities doing sample-rate conversions:
-The implicit resampling done in the AudioBuffer CopyTo,
CopyFrom, InterleaveTo and DeinterleaveFrom methods.
-The multi-band splitting scheme.
The selection of rates in these have been difficult and
complicated, partly due to that the APM API which allows
for activating the APM submodules without notifying
the APM.
This CL adds functionality that for each capture frame
polls all submodules for whether they are active or not
and compares this against a cached result.
Furthermore, new functionality is added that based on the
results of the comparison do a reinitialization of the APM.
This has several advantages
-The code deciding on whether to analysis and synthesis is
needed for the bandsplitting can be much simplified and
centralized.
-The selection of the processing rate can be done such as
to avoid the implicit resampling that was in some cases
unnecessarily done.
-The optimization for whether an output copy is needed
that was done to improve performance due to the implicit
resampling is no longer needed, which simplifies the
code and makes it less error-prone in the sense that
is no longer neccessary to keep track of whether any
module has changed the signal.
Finally, it should be noted that the polling of the state
for all the submodules was done previously as well, but in
a less obvious and distributed manner.
BUG=webrtc:6181, webrtc:6220, webrtc:5298, webrtc:6296, webrtc:6298, webrtc:6297
Review-Url: https://codereview.webrtc.org/2304123002
Cr-Commit-Position: refs/heads/master@{#14175}
2016-09-10 04:42:27 -07:00
|
|
|
public:
|
2019-10-18 13:29:43 +02:00
|
|
|
SubmoduleStates(bool capture_post_processor_enabled,
|
|
|
|
|
bool render_pre_processor_enabled,
|
|
|
|
|
bool capture_analyzer_enabled);
|
The audio processing module (APM) relies on two for
functionalities doing sample-rate conversions:
-The implicit resampling done in the AudioBuffer CopyTo,
CopyFrom, InterleaveTo and DeinterleaveFrom methods.
-The multi-band splitting scheme.
The selection of rates in these have been difficult and
complicated, partly due to that the APM API which allows
for activating the APM submodules without notifying
the APM.
This CL adds functionality that for each capture frame
polls all submodules for whether they are active or not
and compares this against a cached result.
Furthermore, new functionality is added that based on the
results of the comparison do a reinitialization of the APM.
This has several advantages
-The code deciding on whether to analysis and synthesis is
needed for the bandsplitting can be much simplified and
centralized.
-The selection of the processing rate can be done such as
to avoid the implicit resampling that was in some cases
unnecessarily done.
-The optimization for whether an output copy is needed
that was done to improve performance due to the implicit
resampling is no longer needed, which simplifies the
code and makes it less error-prone in the sense that
is no longer neccessary to keep track of whether any
module has changed the signal.
Finally, it should be noted that the polling of the state
for all the submodules was done previously as well, but in
a less obvious and distributed manner.
BUG=webrtc:6181, webrtc:6220, webrtc:5298, webrtc:6296, webrtc:6298, webrtc:6297
Review-Url: https://codereview.webrtc.org/2304123002
Cr-Commit-Position: refs/heads/master@{#14175}
2016-09-10 04:42:27 -07:00
|
|
|
// Updates the submodule state and returns true if it has changed.
|
2018-09-28 14:15:09 +02:00
|
|
|
bool Update(bool high_pass_filter_enabled,
|
The audio processing module (APM) relies on two for
functionalities doing sample-rate conversions:
-The implicit resampling done in the AudioBuffer CopyTo,
CopyFrom, InterleaveTo and DeinterleaveFrom methods.
-The multi-band splitting scheme.
The selection of rates in these have been difficult and
complicated, partly due to that the APM API which allows
for activating the APM submodules without notifying
the APM.
This CL adds functionality that for each capture frame
polls all submodules for whether they are active or not
and compares this against a cached result.
Furthermore, new functionality is added that based on the
results of the comparison do a reinitialization of the APM.
This has several advantages
-The code deciding on whether to analysis and synthesis is
needed for the bandsplitting can be much simplified and
centralized.
-The selection of the processing rate can be done such as
to avoid the implicit resampling that was in some cases
unnecessarily done.
-The optimization for whether an output copy is needed
that was done to improve performance due to the implicit
resampling is no longer needed, which simplifies the
code and makes it less error-prone in the sense that
is no longer neccessary to keep track of whether any
module has changed the signal.
Finally, it should be noted that the polling of the state
for all the submodules was done previously as well, but in
a less obvious and distributed manner.
BUG=webrtc:6181, webrtc:6220, webrtc:5298, webrtc:6296, webrtc:6298, webrtc:6297
Review-Url: https://codereview.webrtc.org/2304123002
Cr-Commit-Position: refs/heads/master@{#14175}
2016-09-10 04:42:27 -07:00
|
|
|
bool mobile_echo_controller_enabled,
|
|
|
|
|
bool noise_suppressor_enabled,
|
|
|
|
|
bool adaptive_gain_controller_enabled,
|
2017-05-22 06:57:06 -07:00
|
|
|
bool gain_controller2_enabled,
|
2021-03-15 16:31:04 +00:00
|
|
|
bool gain_adjustment_enabled,
|
2024-08-02 11:40:22 +03:00
|
|
|
bool echo_controller_enabled);
|
The audio processing module (APM) relies on two for
functionalities doing sample-rate conversions:
-The implicit resampling done in the AudioBuffer CopyTo,
CopyFrom, InterleaveTo and DeinterleaveFrom methods.
-The multi-band splitting scheme.
The selection of rates in these have been difficult and
complicated, partly due to that the APM API which allows
for activating the APM submodules without notifying
the APM.
This CL adds functionality that for each capture frame
polls all submodules for whether they are active or not
and compares this against a cached result.
Furthermore, new functionality is added that based on the
results of the comparison do a reinitialization of the APM.
This has several advantages
-The code deciding on whether to analysis and synthesis is
needed for the bandsplitting can be much simplified and
centralized.
-The selection of the processing rate can be done such as
to avoid the implicit resampling that was in some cases
unnecessarily done.
-The optimization for whether an output copy is needed
that was done to improve performance due to the implicit
resampling is no longer needed, which simplifies the
code and makes it less error-prone in the sense that
is no longer neccessary to keep track of whether any
module has changed the signal.
Finally, it should be noted that the polling of the state
for all the submodules was done previously as well, but in
a less obvious and distributed manner.
BUG=webrtc:6181, webrtc:6220, webrtc:5298, webrtc:6296, webrtc:6298, webrtc:6297
Review-Url: https://codereview.webrtc.org/2304123002
Cr-Commit-Position: refs/heads/master@{#14175}
2016-09-10 04:42:27 -07:00
|
|
|
bool CaptureMultiBandSubModulesActive() const;
|
2019-10-09 13:34:36 +02:00
|
|
|
bool CaptureMultiBandProcessingPresent() const;
|
|
|
|
|
bool CaptureMultiBandProcessingActive(bool ec_processing_active) const;
|
2017-05-23 05:33:56 -07:00
|
|
|
bool CaptureFullBandProcessingActive() const;
|
2018-08-29 10:37:09 +02:00
|
|
|
bool CaptureAnalyzerActive() const;
|
The audio processing module (APM) relies on two for
functionalities doing sample-rate conversions:
-The implicit resampling done in the AudioBuffer CopyTo,
CopyFrom, InterleaveTo and DeinterleaveFrom methods.
-The multi-band splitting scheme.
The selection of rates in these have been difficult and
complicated, partly due to that the APM API which allows
for activating the APM submodules without notifying
the APM.
This CL adds functionality that for each capture frame
polls all submodules for whether they are active or not
and compares this against a cached result.
Furthermore, new functionality is added that based on the
results of the comparison do a reinitialization of the APM.
This has several advantages
-The code deciding on whether to analysis and synthesis is
needed for the bandsplitting can be much simplified and
centralized.
-The selection of the processing rate can be done such as
to avoid the implicit resampling that was in some cases
unnecessarily done.
-The optimization for whether an output copy is needed
that was done to improve performance due to the implicit
resampling is no longer needed, which simplifies the
code and makes it less error-prone in the sense that
is no longer neccessary to keep track of whether any
module has changed the signal.
Finally, it should be noted that the polling of the state
for all the submodules was done previously as well, but in
a less obvious and distributed manner.
BUG=webrtc:6181, webrtc:6220, webrtc:5298, webrtc:6296, webrtc:6298, webrtc:6297
Review-Url: https://codereview.webrtc.org/2304123002
Cr-Commit-Position: refs/heads/master@{#14175}
2016-09-10 04:42:27 -07:00
|
|
|
bool RenderMultiBandSubModulesActive() const;
|
2017-12-18 16:02:40 +01:00
|
|
|
bool RenderFullBandProcessingActive() const;
|
The audio processing module (APM) relies on two for
functionalities doing sample-rate conversions:
-The implicit resampling done in the AudioBuffer CopyTo,
CopyFrom, InterleaveTo and DeinterleaveFrom methods.
-The multi-band splitting scheme.
The selection of rates in these have been difficult and
complicated, partly due to that the APM API which allows
for activating the APM submodules without notifying
the APM.
This CL adds functionality that for each capture frame
polls all submodules for whether they are active or not
and compares this against a cached result.
Furthermore, new functionality is added that based on the
results of the comparison do a reinitialization of the APM.
This has several advantages
-The code deciding on whether to analysis and synthesis is
needed for the bandsplitting can be much simplified and
centralized.
-The selection of the processing rate can be done such as
to avoid the implicit resampling that was in some cases
unnecessarily done.
-The optimization for whether an output copy is needed
that was done to improve performance due to the implicit
resampling is no longer needed, which simplifies the
code and makes it less error-prone in the sense that
is no longer neccessary to keep track of whether any
module has changed the signal.
Finally, it should be noted that the polling of the state
for all the submodules was done previously as well, but in
a less obvious and distributed manner.
BUG=webrtc:6181, webrtc:6220, webrtc:5298, webrtc:6296, webrtc:6298, webrtc:6297
Review-Url: https://codereview.webrtc.org/2304123002
Cr-Commit-Position: refs/heads/master@{#14175}
2016-09-10 04:42:27 -07:00
|
|
|
bool RenderMultiBandProcessingActive() const;
|
2019-08-23 21:29:17 +02:00
|
|
|
bool HighPassFilteringRequired() const;
|
The audio processing module (APM) relies on two for
functionalities doing sample-rate conversions:
-The implicit resampling done in the AudioBuffer CopyTo,
CopyFrom, InterleaveTo and DeinterleaveFrom methods.
-The multi-band splitting scheme.
The selection of rates in these have been difficult and
complicated, partly due to that the APM API which allows
for activating the APM submodules without notifying
the APM.
This CL adds functionality that for each capture frame
polls all submodules for whether they are active or not
and compares this against a cached result.
Furthermore, new functionality is added that based on the
results of the comparison do a reinitialization of the APM.
This has several advantages
-The code deciding on whether to analysis and synthesis is
needed for the bandsplitting can be much simplified and
centralized.
-The selection of the processing rate can be done such as
to avoid the implicit resampling that was in some cases
unnecessarily done.
-The optimization for whether an output copy is needed
that was done to improve performance due to the implicit
resampling is no longer needed, which simplifies the
code and makes it less error-prone in the sense that
is no longer neccessary to keep track of whether any
module has changed the signal.
Finally, it should be noted that the polling of the state
for all the submodules was done previously as well, but in
a less obvious and distributed manner.
BUG=webrtc:6181, webrtc:6220, webrtc:5298, webrtc:6296, webrtc:6298, webrtc:6297
Review-Url: https://codereview.webrtc.org/2304123002
Cr-Commit-Position: refs/heads/master@{#14175}
2016-09-10 04:42:27 -07:00
|
|
|
|
|
|
|
|
private:
|
2017-09-25 12:04:02 +02:00
|
|
|
const bool capture_post_processor_enabled_ = false;
|
2017-12-18 16:02:40 +01:00
|
|
|
const bool render_pre_processor_enabled_ = false;
|
2018-08-29 10:37:09 +02:00
|
|
|
const bool capture_analyzer_enabled_ = false;
|
2018-09-28 14:15:09 +02:00
|
|
|
bool high_pass_filter_enabled_ = false;
|
The audio processing module (APM) relies on two for
functionalities doing sample-rate conversions:
-The implicit resampling done in the AudioBuffer CopyTo,
CopyFrom, InterleaveTo and DeinterleaveFrom methods.
-The multi-band splitting scheme.
The selection of rates in these have been difficult and
complicated, partly due to that the APM API which allows
for activating the APM submodules without notifying
the APM.
This CL adds functionality that for each capture frame
polls all submodules for whether they are active or not
and compares this against a cached result.
Furthermore, new functionality is added that based on the
results of the comparison do a reinitialization of the APM.
This has several advantages
-The code deciding on whether to analysis and synthesis is
needed for the bandsplitting can be much simplified and
centralized.
-The selection of the processing rate can be done such as
to avoid the implicit resampling that was in some cases
unnecessarily done.
-The optimization for whether an output copy is needed
that was done to improve performance due to the implicit
resampling is no longer needed, which simplifies the
code and makes it less error-prone in the sense that
is no longer neccessary to keep track of whether any
module has changed the signal.
Finally, it should be noted that the polling of the state
for all the submodules was done previously as well, but in
a less obvious and distributed manner.
BUG=webrtc:6181, webrtc:6220, webrtc:5298, webrtc:6296, webrtc:6298, webrtc:6297
Review-Url: https://codereview.webrtc.org/2304123002
Cr-Commit-Position: refs/heads/master@{#14175}
2016-09-10 04:42:27 -07:00
|
|
|
bool mobile_echo_controller_enabled_ = false;
|
|
|
|
|
bool noise_suppressor_enabled_ = false;
|
|
|
|
|
bool adaptive_gain_controller_enabled_ = false;
|
2017-05-22 06:57:06 -07:00
|
|
|
bool gain_controller2_enabled_ = false;
|
2021-03-15 16:31:04 +00:00
|
|
|
bool gain_adjustment_enabled_ = false;
|
2017-10-16 13:49:04 +02:00
|
|
|
bool echo_controller_enabled_ = false;
|
The audio processing module (APM) relies on two for
functionalities doing sample-rate conversions:
-The implicit resampling done in the AudioBuffer CopyTo,
CopyFrom, InterleaveTo and DeinterleaveFrom methods.
-The multi-band splitting scheme.
The selection of rates in these have been difficult and
complicated, partly due to that the APM API which allows
for activating the APM submodules without notifying
the APM.
This CL adds functionality that for each capture frame
polls all submodules for whether they are active or not
and compares this against a cached result.
Furthermore, new functionality is added that based on the
results of the comparison do a reinitialization of the APM.
This has several advantages
-The code deciding on whether to analysis and synthesis is
needed for the bandsplitting can be much simplified and
centralized.
-The selection of the processing rate can be done such as
to avoid the implicit resampling that was in some cases
unnecessarily done.
-The optimization for whether an output copy is needed
that was done to improve performance due to the implicit
resampling is no longer needed, which simplifies the
code and makes it less error-prone in the sense that
is no longer neccessary to keep track of whether any
module has changed the signal.
Finally, it should be noted that the polling of the state
for all the submodules was done previously as well, but in
a less obvious and distributed manner.
BUG=webrtc:6181, webrtc:6220, webrtc:5298, webrtc:6296, webrtc:6298, webrtc:6297
Review-Url: https://codereview.webrtc.org/2304123002
Cr-Commit-Position: refs/heads/master@{#14175}
2016-09-10 04:42:27 -07:00
|
|
|
bool first_update_ = true;
|
|
|
|
|
};
|
|
|
|
|
|
2020-01-03 14:54:20 +01:00
|
|
|
// Methods for modifying the formats struct that is used by both
|
|
|
|
|
// the render and capture threads. The check for whether modifications are
|
|
|
|
|
// needed is done while holding a single lock only, thereby avoiding that the
|
|
|
|
|
// capture thread blocks the render thread.
|
|
|
|
|
// Called by render: Holds the render lock when reading the format struct and
|
|
|
|
|
// acquires both locks if reinitialization is required.
|
2022-11-17 11:26:58 +01:00
|
|
|
void MaybeInitializeRender(const StreamConfig& input_config,
|
|
|
|
|
const StreamConfig& output_config)
|
2020-07-07 15:53:34 +02:00
|
|
|
RTC_EXCLUSIVE_LOCKS_REQUIRED(mutex_render_);
|
2022-11-17 11:26:58 +01:00
|
|
|
// Called by capture: Acquires and releases the capture lock to read the
|
|
|
|
|
// format struct and acquires both locks if reinitialization is needed.
|
|
|
|
|
void MaybeInitializeCapture(const StreamConfig& input_config,
|
|
|
|
|
const StreamConfig& output_config);
|
2015-11-28 12:35:15 -08:00
|
|
|
|
The audio processing module (APM) relies on two for
functionalities doing sample-rate conversions:
-The implicit resampling done in the AudioBuffer CopyTo,
CopyFrom, InterleaveTo and DeinterleaveFrom methods.
-The multi-band splitting scheme.
The selection of rates in these have been difficult and
complicated, partly due to that the APM API which allows
for activating the APM submodules without notifying
the APM.
This CL adds functionality that for each capture frame
polls all submodules for whether they are active or not
and compares this against a cached result.
Furthermore, new functionality is added that based on the
results of the comparison do a reinitialization of the APM.
This has several advantages
-The code deciding on whether to analysis and synthesis is
needed for the bandsplitting can be much simplified and
centralized.
-The selection of the processing rate can be done such as
to avoid the implicit resampling that was in some cases
unnecessarily done.
-The optimization for whether an output copy is needed
that was done to improve performance due to the implicit
resampling is no longer needed, which simplifies the
code and makes it less error-prone in the sense that
is no longer neccessary to keep track of whether any
module has changed the signal.
Finally, it should be noted that the polling of the state
for all the submodules was done previously as well, but in
a less obvious and distributed manner.
BUG=webrtc:6181, webrtc:6220, webrtc:5298, webrtc:6296, webrtc:6298, webrtc:6297
Review-Url: https://codereview.webrtc.org/2304123002
Cr-Commit-Position: refs/heads/master@{#14175}
2016-09-10 04:42:27 -07:00
|
|
|
// Method for updating the state keeping track of the active submodules.
|
|
|
|
|
// Returns a bool indicating whether the state has changed.
|
2017-09-07 07:53:45 -07:00
|
|
|
bool UpdateActiveSubmoduleStates()
|
2020-07-07 15:53:34 +02:00
|
|
|
RTC_EXCLUSIVE_LOCKS_REQUIRED(mutex_capture_);
|
2015-11-28 12:35:15 -08:00
|
|
|
|
2020-01-02 15:15:36 +01:00
|
|
|
// Methods requiring APM running in a single-threaded manner, requiring both
|
|
|
|
|
// the render and capture lock to be acquired.
|
2022-11-17 11:26:58 +01:00
|
|
|
void InitializeLocked(const ProcessingConfig& config)
|
2020-07-07 15:53:34 +02:00
|
|
|
RTC_EXCLUSIVE_LOCKS_REQUIRED(mutex_render_, mutex_capture_);
|
2016-10-28 05:39:16 -07:00
|
|
|
void InitializeResidualEchoDetector()
|
2020-07-07 15:53:34 +02:00
|
|
|
RTC_EXCLUSIVE_LOCKS_REQUIRED(mutex_render_, mutex_capture_);
|
2019-04-25 15:18:06 +02:00
|
|
|
void InitializeEchoController()
|
2020-07-07 15:53:34 +02:00
|
|
|
RTC_EXCLUSIVE_LOCKS_REQUIRED(mutex_render_, mutex_capture_);
|
2020-01-02 15:15:36 +01:00
|
|
|
|
2021-10-14 12:14:21 +02:00
|
|
|
// Initializations of capture-only sub-modules, requiring the capture lock
|
2020-01-02 15:15:36 +01:00
|
|
|
// already acquired.
|
2020-01-03 14:27:14 +01:00
|
|
|
void InitializeHighPassFilter(bool forced_reset)
|
2020-07-07 15:53:34 +02:00
|
|
|
RTC_EXCLUSIVE_LOCKS_REQUIRED(mutex_capture_);
|
|
|
|
|
void InitializeGainController1() RTC_EXCLUSIVE_LOCKS_REQUIRED(mutex_capture_);
|
2023-01-16 20:19:48 +01:00
|
|
|
// Initializes the `GainController2` sub-module. If the sub-module is enabled,
|
|
|
|
|
// recreates it.
|
|
|
|
|
void InitializeGainController2() RTC_EXCLUSIVE_LOCKS_REQUIRED(mutex_capture_);
|
2020-07-07 15:53:34 +02:00
|
|
|
void InitializeNoiseSuppressor() RTC_EXCLUSIVE_LOCKS_REQUIRED(mutex_capture_);
|
2021-03-15 16:31:04 +00:00
|
|
|
void InitializeCaptureLevelsAdjuster()
|
|
|
|
|
RTC_EXCLUSIVE_LOCKS_REQUIRED(mutex_capture_);
|
2020-07-07 15:53:34 +02:00
|
|
|
void InitializePostProcessor() RTC_EXCLUSIVE_LOCKS_REQUIRED(mutex_capture_);
|
|
|
|
|
void InitializeAnalyzer() RTC_EXCLUSIVE_LOCKS_REQUIRED(mutex_capture_);
|
2020-01-02 15:15:36 +01:00
|
|
|
|
|
|
|
|
// Initializations of render-only submodules, requiring the render lock
|
|
|
|
|
// already acquired.
|
2020-07-07 15:53:34 +02:00
|
|
|
void InitializePreProcessor() RTC_EXCLUSIVE_LOCKS_REQUIRED(mutex_render_);
|
2015-11-28 12:35:15 -08:00
|
|
|
|
2019-10-09 13:02:14 +02:00
|
|
|
// Sample rate used for the fullband processing.
|
|
|
|
|
int proc_fullband_sample_rate_hz() const
|
2020-07-07 15:53:34 +02:00
|
|
|
RTC_EXCLUSIVE_LOCKS_REQUIRED(mutex_capture_);
|
2019-10-09 13:02:14 +02:00
|
|
|
|
2018-05-15 10:52:28 +02:00
|
|
|
// Empties and handles the respective RuntimeSetting queues.
|
|
|
|
|
void HandleCaptureRuntimeSettings()
|
2020-07-07 15:53:34 +02:00
|
|
|
RTC_EXCLUSIVE_LOCKS_REQUIRED(mutex_capture_);
|
|
|
|
|
void HandleRenderRuntimeSettings()
|
|
|
|
|
RTC_EXCLUSIVE_LOCKS_REQUIRED(mutex_render_);
|
2019-03-27 13:28:08 +01:00
|
|
|
|
2020-07-07 15:53:34 +02:00
|
|
|
void EmptyQueuedRenderAudio() RTC_LOCKS_EXCLUDED(mutex_capture_);
|
2020-05-14 14:31:18 +02:00
|
|
|
void EmptyQueuedRenderAudioLocked()
|
2020-07-07 15:53:34 +02:00
|
|
|
RTC_EXCLUSIVE_LOCKS_REQUIRED(mutex_capture_);
|
2016-10-22 05:04:30 -07:00
|
|
|
void AllocateRenderQueue()
|
2020-07-07 15:53:34 +02:00
|
|
|
RTC_EXCLUSIVE_LOCKS_REQUIRED(mutex_render_, mutex_capture_);
|
2017-05-15 07:19:21 -07:00
|
|
|
void QueueBandedRenderAudio(AudioBuffer* audio)
|
2020-07-07 15:53:34 +02:00
|
|
|
RTC_EXCLUSIVE_LOCKS_REQUIRED(mutex_render_);
|
2017-05-15 07:19:21 -07:00
|
|
|
void QueueNonbandedRenderAudio(AudioBuffer* audio)
|
2020-07-07 15:53:34 +02:00
|
|
|
RTC_EXCLUSIVE_LOCKS_REQUIRED(mutex_render_);
|
2016-10-22 05:04:30 -07:00
|
|
|
|
2015-11-28 12:35:15 -08:00
|
|
|
// Capture-side exclusive methods possibly running APM in a multi-threaded
|
|
|
|
|
// manner that are called with the render lock already acquired.
|
2020-07-07 15:53:34 +02:00
|
|
|
int ProcessCaptureStreamLocked() RTC_EXCLUSIVE_LOCKS_REQUIRED(mutex_capture_);
|
2015-11-28 12:35:15 -08:00
|
|
|
|
|
|
|
|
// Render-side exclusive methods possibly running APM in a multi-threaded
|
|
|
|
|
// manner that are called with the render lock already acquired.
|
|
|
|
|
int AnalyzeReverseStreamLocked(const float* const* src,
|
|
|
|
|
const StreamConfig& input_config,
|
|
|
|
|
const StreamConfig& output_config)
|
2020-07-07 15:53:34 +02:00
|
|
|
RTC_EXCLUSIVE_LOCKS_REQUIRED(mutex_render_);
|
|
|
|
|
int ProcessRenderStreamLocked() RTC_EXCLUSIVE_LOCKS_REQUIRED(mutex_render_);
|
2015-11-28 12:35:15 -08:00
|
|
|
|
AudioProcessingModule has a feature to make a recording of its
configuration, inputs and outputs over a period of time. It is
activated by AudioProcessing::StartRecording. The data is stored in
binary protobuf format in a specified file. The file IO is, as of
this CL, done from the real-time audio thread.
This CL contains an interface for AecDump, a new APM submodule that
will handle the recordings. Calls to the new interface from the
AudioProcessingModule are added. These calls have no effect, and for a
short while, audio_processing_impl.cc will contain two copies of
recording calls.
The original calls are guarded by the WEBRTC_AUDIOPROC_DEBUG_DUMP
preprocessor define. They still have an effect, while the new ones do
not. In the following CLs, the old recording calls will be removed,
and an implementation of AecDump added.
The reasons for the refactoring is to move file IO operations from the
real-time audio thread, to add a top-level low-priority task queue for
logging tasks like this, to simplify and modularize audio_processing_impl.cc
and remove some of the preprocessor directives. These goals will be
archived by the upcoming CLs. The implementation is in
https://codereview.webrtc.org/2865113002.
BUG=webrtc:7404
Review-Url: https://codereview.webrtc.org/2778783002
Cr-Commit-Position: refs/heads/master@{#18233}
2017-05-23 07:20:05 -07:00
|
|
|
// Collects configuration settings from public and private
|
|
|
|
|
// submodules to be saved as an audioproc::Config message on the
|
2021-07-28 20:50:03 +02:00
|
|
|
// AecDump if it is attached. If not `forced`, only writes the current
|
|
|
|
|
// config if it is different from the last saved one; if `forced`,
|
AudioProcessingModule has a feature to make a recording of its
configuration, inputs and outputs over a period of time. It is
activated by AudioProcessing::StartRecording. The data is stored in
binary protobuf format in a specified file. The file IO is, as of
this CL, done from the real-time audio thread.
This CL contains an interface for AecDump, a new APM submodule that
will handle the recordings. Calls to the new interface from the
AudioProcessingModule are added. These calls have no effect, and for a
short while, audio_processing_impl.cc will contain two copies of
recording calls.
The original calls are guarded by the WEBRTC_AUDIOPROC_DEBUG_DUMP
preprocessor define. They still have an effect, while the new ones do
not. In the following CLs, the old recording calls will be removed,
and an implementation of AecDump added.
The reasons for the refactoring is to move file IO operations from the
real-time audio thread, to add a top-level low-priority task queue for
logging tasks like this, to simplify and modularize audio_processing_impl.cc
and remove some of the preprocessor directives. These goals will be
archived by the upcoming CLs. The implementation is in
https://codereview.webrtc.org/2865113002.
BUG=webrtc:7404
Review-Url: https://codereview.webrtc.org/2778783002
Cr-Commit-Position: refs/heads/master@{#18233}
2017-05-23 07:20:05 -07:00
|
|
|
// writes the config regardless of the last saved.
|
|
|
|
|
void WriteAecDumpConfigMessage(bool forced)
|
2020-07-07 15:53:34 +02:00
|
|
|
RTC_EXCLUSIVE_LOCKS_REQUIRED(mutex_capture_);
|
AudioProcessingModule has a feature to make a recording of its
configuration, inputs and outputs over a period of time. It is
activated by AudioProcessing::StartRecording. The data is stored in
binary protobuf format in a specified file. The file IO is, as of
this CL, done from the real-time audio thread.
This CL contains an interface for AecDump, a new APM submodule that
will handle the recordings. Calls to the new interface from the
AudioProcessingModule are added. These calls have no effect, and for a
short while, audio_processing_impl.cc will contain two copies of
recording calls.
The original calls are guarded by the WEBRTC_AUDIOPROC_DEBUG_DUMP
preprocessor define. They still have an effect, while the new ones do
not. In the following CLs, the old recording calls will be removed,
and an implementation of AecDump added.
The reasons for the refactoring is to move file IO operations from the
real-time audio thread, to add a top-level low-priority task queue for
logging tasks like this, to simplify and modularize audio_processing_impl.cc
and remove some of the preprocessor directives. These goals will be
archived by the upcoming CLs. The implementation is in
https://codereview.webrtc.org/2865113002.
BUG=webrtc:7404
Review-Url: https://codereview.webrtc.org/2778783002
Cr-Commit-Position: refs/heads/master@{#18233}
2017-05-23 07:20:05 -07:00
|
|
|
|
|
|
|
|
// Notifies attached AecDump of current configuration and capture data.
|
|
|
|
|
void RecordUnprocessedCaptureStream(const float* const* capture_stream)
|
2020-07-07 15:53:34 +02:00
|
|
|
RTC_EXCLUSIVE_LOCKS_REQUIRED(mutex_capture_);
|
AudioProcessingModule has a feature to make a recording of its
configuration, inputs and outputs over a period of time. It is
activated by AudioProcessing::StartRecording. The data is stored in
binary protobuf format in a specified file. The file IO is, as of
this CL, done from the real-time audio thread.
This CL contains an interface for AecDump, a new APM submodule that
will handle the recordings. Calls to the new interface from the
AudioProcessingModule are added. These calls have no effect, and for a
short while, audio_processing_impl.cc will contain two copies of
recording calls.
The original calls are guarded by the WEBRTC_AUDIOPROC_DEBUG_DUMP
preprocessor define. They still have an effect, while the new ones do
not. In the following CLs, the old recording calls will be removed,
and an implementation of AecDump added.
The reasons for the refactoring is to move file IO operations from the
real-time audio thread, to add a top-level low-priority task queue for
logging tasks like this, to simplify and modularize audio_processing_impl.cc
and remove some of the preprocessor directives. These goals will be
archived by the upcoming CLs. The implementation is in
https://codereview.webrtc.org/2865113002.
BUG=webrtc:7404
Review-Url: https://codereview.webrtc.org/2778783002
Cr-Commit-Position: refs/heads/master@{#18233}
2017-05-23 07:20:05 -07:00
|
|
|
|
2020-03-16 12:06:02 +01:00
|
|
|
void RecordUnprocessedCaptureStream(const int16_t* const data,
|
|
|
|
|
const StreamConfig& config)
|
2020-07-07 15:53:34 +02:00
|
|
|
RTC_EXCLUSIVE_LOCKS_REQUIRED(mutex_capture_);
|
AudioProcessingModule has a feature to make a recording of its
configuration, inputs and outputs over a period of time. It is
activated by AudioProcessing::StartRecording. The data is stored in
binary protobuf format in a specified file. The file IO is, as of
this CL, done from the real-time audio thread.
This CL contains an interface for AecDump, a new APM submodule that
will handle the recordings. Calls to the new interface from the
AudioProcessingModule are added. These calls have no effect, and for a
short while, audio_processing_impl.cc will contain two copies of
recording calls.
The original calls are guarded by the WEBRTC_AUDIOPROC_DEBUG_DUMP
preprocessor define. They still have an effect, while the new ones do
not. In the following CLs, the old recording calls will be removed,
and an implementation of AecDump added.
The reasons for the refactoring is to move file IO operations from the
real-time audio thread, to add a top-level low-priority task queue for
logging tasks like this, to simplify and modularize audio_processing_impl.cc
and remove some of the preprocessor directives. These goals will be
archived by the upcoming CLs. The implementation is in
https://codereview.webrtc.org/2865113002.
BUG=webrtc:7404
Review-Url: https://codereview.webrtc.org/2778783002
Cr-Commit-Position: refs/heads/master@{#18233}
2017-05-23 07:20:05 -07:00
|
|
|
|
|
|
|
|
// Notifies attached AecDump of current configuration and
|
|
|
|
|
// processed capture data and issues a capture stream recording
|
|
|
|
|
// request.
|
|
|
|
|
void RecordProcessedCaptureStream(
|
|
|
|
|
const float* const* processed_capture_stream)
|
2020-07-07 15:53:34 +02:00
|
|
|
RTC_EXCLUSIVE_LOCKS_REQUIRED(mutex_capture_);
|
AudioProcessingModule has a feature to make a recording of its
configuration, inputs and outputs over a period of time. It is
activated by AudioProcessing::StartRecording. The data is stored in
binary protobuf format in a specified file. The file IO is, as of
this CL, done from the real-time audio thread.
This CL contains an interface for AecDump, a new APM submodule that
will handle the recordings. Calls to the new interface from the
AudioProcessingModule are added. These calls have no effect, and for a
short while, audio_processing_impl.cc will contain two copies of
recording calls.
The original calls are guarded by the WEBRTC_AUDIOPROC_DEBUG_DUMP
preprocessor define. They still have an effect, while the new ones do
not. In the following CLs, the old recording calls will be removed,
and an implementation of AecDump added.
The reasons for the refactoring is to move file IO operations from the
real-time audio thread, to add a top-level low-priority task queue for
logging tasks like this, to simplify and modularize audio_processing_impl.cc
and remove some of the preprocessor directives. These goals will be
archived by the upcoming CLs. The implementation is in
https://codereview.webrtc.org/2865113002.
BUG=webrtc:7404
Review-Url: https://codereview.webrtc.org/2778783002
Cr-Commit-Position: refs/heads/master@{#18233}
2017-05-23 07:20:05 -07:00
|
|
|
|
2020-03-16 12:06:02 +01:00
|
|
|
void RecordProcessedCaptureStream(const int16_t* const data,
|
|
|
|
|
const StreamConfig& config)
|
2020-07-07 15:53:34 +02:00
|
|
|
RTC_EXCLUSIVE_LOCKS_REQUIRED(mutex_capture_);
|
AudioProcessingModule has a feature to make a recording of its
configuration, inputs and outputs over a period of time. It is
activated by AudioProcessing::StartRecording. The data is stored in
binary protobuf format in a specified file. The file IO is, as of
this CL, done from the real-time audio thread.
This CL contains an interface for AecDump, a new APM submodule that
will handle the recordings. Calls to the new interface from the
AudioProcessingModule are added. These calls have no effect, and for a
short while, audio_processing_impl.cc will contain two copies of
recording calls.
The original calls are guarded by the WEBRTC_AUDIOPROC_DEBUG_DUMP
preprocessor define. They still have an effect, while the new ones do
not. In the following CLs, the old recording calls will be removed,
and an implementation of AecDump added.
The reasons for the refactoring is to move file IO operations from the
real-time audio thread, to add a top-level low-priority task queue for
logging tasks like this, to simplify and modularize audio_processing_impl.cc
and remove some of the preprocessor directives. These goals will be
archived by the upcoming CLs. The implementation is in
https://codereview.webrtc.org/2865113002.
BUG=webrtc:7404
Review-Url: https://codereview.webrtc.org/2778783002
Cr-Commit-Position: refs/heads/master@{#18233}
2017-05-23 07:20:05 -07:00
|
|
|
|
|
|
|
|
// Notifies attached AecDump about current state (delay, drift, etc).
|
2020-07-07 15:53:34 +02:00
|
|
|
void RecordAudioProcessingState()
|
|
|
|
|
RTC_EXCLUSIVE_LOCKS_REQUIRED(mutex_capture_);
|
AudioProcessingModule has a feature to make a recording of its
configuration, inputs and outputs over a period of time. It is
activated by AudioProcessing::StartRecording. The data is stored in
binary protobuf format in a specified file. The file IO is, as of
this CL, done from the real-time audio thread.
This CL contains an interface for AecDump, a new APM submodule that
will handle the recordings. Calls to the new interface from the
AudioProcessingModule are added. These calls have no effect, and for a
short while, audio_processing_impl.cc will contain two copies of
recording calls.
The original calls are guarded by the WEBRTC_AUDIOPROC_DEBUG_DUMP
preprocessor define. They still have an effect, while the new ones do
not. In the following CLs, the old recording calls will be removed,
and an implementation of AecDump added.
The reasons for the refactoring is to move file IO operations from the
real-time audio thread, to add a top-level low-priority task queue for
logging tasks like this, to simplify and modularize audio_processing_impl.cc
and remove some of the preprocessor directives. These goals will be
archived by the upcoming CLs. The implementation is in
https://codereview.webrtc.org/2865113002.
BUG=webrtc:7404
Review-Url: https://codereview.webrtc.org/2778783002
Cr-Commit-Position: refs/heads/master@{#18233}
2017-05-23 07:20:05 -07:00
|
|
|
|
2021-03-03 10:52:44 +00:00
|
|
|
// Ensures that overruns in the capture runtime settings queue is properly
|
|
|
|
|
// handled by the code, providing safe-fallbacks to mitigate the implications
|
|
|
|
|
// of any settings being missed.
|
|
|
|
|
void HandleOverrunInCaptureRuntimeSettingsQueue()
|
|
|
|
|
RTC_EXCLUSIVE_LOCKS_REQUIRED(mutex_capture_);
|
|
|
|
|
|
AudioProcessingModule has a feature to make a recording of its
configuration, inputs and outputs over a period of time. It is
activated by AudioProcessing::StartRecording. The data is stored in
binary protobuf format in a specified file. The file IO is, as of
this CL, done from the real-time audio thread.
This CL contains an interface for AecDump, a new APM submodule that
will handle the recordings. Calls to the new interface from the
AudioProcessingModule are added. These calls have no effect, and for a
short while, audio_processing_impl.cc will contain two copies of
recording calls.
The original calls are guarded by the WEBRTC_AUDIOPROC_DEBUG_DUMP
preprocessor define. They still have an effect, while the new ones do
not. In the following CLs, the old recording calls will be removed,
and an implementation of AecDump added.
The reasons for the refactoring is to move file IO operations from the
real-time audio thread, to add a top-level low-priority task queue for
logging tasks like this, to simplify and modularize audio_processing_impl.cc
and remove some of the preprocessor directives. These goals will be
archived by the upcoming CLs. The implementation is in
https://codereview.webrtc.org/2865113002.
BUG=webrtc:7404
Review-Url: https://codereview.webrtc.org/2778783002
Cr-Commit-Position: refs/heads/master@{#18233}
2017-05-23 07:20:05 -07:00
|
|
|
// AecDump instance used for optionally logging APM config, input
|
|
|
|
|
// and output to file in the AEC-dump format defined in debug.proto.
|
|
|
|
|
std::unique_ptr<AecDump> aec_dump_;
|
|
|
|
|
|
|
|
|
|
// Hold the last config written with AecDump for avoiding writing
|
|
|
|
|
// the same config twice.
|
2020-07-07 15:53:34 +02:00
|
|
|
InternalAPMConfig apm_config_for_aec_dump_ RTC_GUARDED_BY(mutex_capture_);
|
AudioProcessingModule has a feature to make a recording of its
configuration, inputs and outputs over a period of time. It is
activated by AudioProcessing::StartRecording. The data is stored in
binary protobuf format in a specified file. The file IO is, as of
this CL, done from the real-time audio thread.
This CL contains an interface for AecDump, a new APM submodule that
will handle the recordings. Calls to the new interface from the
AudioProcessingModule are added. These calls have no effect, and for a
short while, audio_processing_impl.cc will contain two copies of
recording calls.
The original calls are guarded by the WEBRTC_AUDIOPROC_DEBUG_DUMP
preprocessor define. They still have an effect, while the new ones do
not. In the following CLs, the old recording calls will be removed,
and an implementation of AecDump added.
The reasons for the refactoring is to move file IO operations from the
real-time audio thread, to add a top-level low-priority task queue for
logging tasks like this, to simplify and modularize audio_processing_impl.cc
and remove some of the preprocessor directives. These goals will be
archived by the upcoming CLs. The implementation is in
https://codereview.webrtc.org/2865113002.
BUG=webrtc:7404
Review-Url: https://codereview.webrtc.org/2778783002
Cr-Commit-Position: refs/heads/master@{#18233}
2017-05-23 07:20:05 -07:00
|
|
|
|
2015-11-28 12:35:15 -08:00
|
|
|
// Critical sections.
|
2020-07-07 15:53:34 +02:00
|
|
|
mutable Mutex mutex_render_ RTC_ACQUIRED_BEFORE(mutex_capture_);
|
|
|
|
|
mutable Mutex mutex_capture_;
|
2015-11-28 12:35:15 -08:00
|
|
|
|
2016-10-07 14:54:10 -07:00
|
|
|
// Struct containing the Config specifying the behavior of APM.
|
|
|
|
|
AudioProcessing::Config config_;
|
|
|
|
|
|
The audio processing module (APM) relies on two for
functionalities doing sample-rate conversions:
-The implicit resampling done in the AudioBuffer CopyTo,
CopyFrom, InterleaveTo and DeinterleaveFrom methods.
-The multi-band splitting scheme.
The selection of rates in these have been difficult and
complicated, partly due to that the APM API which allows
for activating the APM submodules without notifying
the APM.
This CL adds functionality that for each capture frame
polls all submodules for whether they are active or not
and compares this against a cached result.
Furthermore, new functionality is added that based on the
results of the comparison do a reinitialization of the APM.
This has several advantages
-The code deciding on whether to analysis and synthesis is
needed for the bandsplitting can be much simplified and
centralized.
-The selection of the processing rate can be done such as
to avoid the implicit resampling that was in some cases
unnecessarily done.
-The optimization for whether an output copy is needed
that was done to improve performance due to the implicit
resampling is no longer needed, which simplifies the
code and makes it less error-prone in the sense that
is no longer neccessary to keep track of whether any
module has changed the signal.
Finally, it should be noted that the polling of the state
for all the submodules was done previously as well, but in
a less obvious and distributed manner.
BUG=webrtc:6181, webrtc:6220, webrtc:5298, webrtc:6296, webrtc:6298, webrtc:6297
Review-Url: https://codereview.webrtc.org/2304123002
Cr-Commit-Position: refs/heads/master@{#14175}
2016-09-10 04:42:27 -07:00
|
|
|
// Class containing information about what submodules are active.
|
2019-10-18 13:29:43 +02:00
|
|
|
SubmoduleStates submodule_states_;
|
|
|
|
|
|
|
|
|
|
// Struct containing the pointers to the submodules.
|
|
|
|
|
struct Submodules {
|
|
|
|
|
Submodules(std::unique_ptr<CustomProcessing> capture_post_processor,
|
|
|
|
|
std::unique_ptr<CustomProcessing> render_pre_processor,
|
|
|
|
|
rtc::scoped_refptr<EchoDetector> echo_detector,
|
2019-11-22 12:11:40 +01:00
|
|
|
std::unique_ptr<CustomAudioAnalyzer> capture_analyzer)
|
2019-10-18 13:29:43 +02:00
|
|
|
: echo_detector(std::move(echo_detector)),
|
|
|
|
|
capture_post_processor(std::move(capture_post_processor)),
|
|
|
|
|
render_pre_processor(std::move(render_pre_processor)),
|
2019-11-22 12:11:40 +01:00
|
|
|
capture_analyzer(std::move(capture_analyzer)) {}
|
2019-10-18 13:29:43 +02:00
|
|
|
// Accessed internally from capture or during initialization.
|
2021-12-06 15:40:04 +01:00
|
|
|
const rtc::scoped_refptr<EchoDetector> echo_detector;
|
|
|
|
|
const std::unique_ptr<CustomProcessing> capture_post_processor;
|
|
|
|
|
const std::unique_ptr<CustomProcessing> render_pre_processor;
|
|
|
|
|
const std::unique_ptr<CustomAudioAnalyzer> capture_analyzer;
|
2019-10-18 13:29:43 +02:00
|
|
|
std::unique_ptr<AgcManagerDirect> agc_manager;
|
|
|
|
|
std::unique_ptr<GainControlImpl> gain_control;
|
|
|
|
|
std::unique_ptr<GainController2> gain_controller2;
|
|
|
|
|
std::unique_ptr<HighPassFilter> high_pass_filter;
|
|
|
|
|
std::unique_ptr<EchoControl> echo_controller;
|
|
|
|
|
std::unique_ptr<EchoControlMobileImpl> echo_control_mobile;
|
2019-10-29 22:59:44 +01:00
|
|
|
std::unique_ptr<NoiseSuppressor> noise_suppressor;
|
2021-03-15 16:31:04 +00:00
|
|
|
std::unique_ptr<CaptureLevelsAdjuster> capture_levels_adjuster;
|
2019-10-18 13:29:43 +02:00
|
|
|
} submodules_;
|
2015-11-28 12:35:15 -08:00
|
|
|
|
2015-11-17 02:16:45 -08:00
|
|
|
// State that is written to while holding both the render and capture locks
|
2015-11-28 12:35:15 -08:00
|
|
|
// but can be read without any lock being held.
|
|
|
|
|
// As this is only accessed internally of APM, and all internal methods in APM
|
|
|
|
|
// either are holding the render or capture locks, this construct is safe as
|
|
|
|
|
// it is not possible to read the variables while writing them.
|
|
|
|
|
struct ApmFormatState {
|
|
|
|
|
ApmFormatState()
|
|
|
|
|
: // Format of processing streams at input/output call sites.
|
2022-02-04 09:02:48 +00:00
|
|
|
api_format({{{kSampleRate16kHz, 1},
|
|
|
|
|
{kSampleRate16kHz, 1},
|
|
|
|
|
{kSampleRate16kHz, 1},
|
|
|
|
|
{kSampleRate16kHz, 1}}}),
|
2016-09-16 15:02:15 -07:00
|
|
|
render_processing_format(kSampleRate16kHz, 1) {}
|
2015-11-28 12:35:15 -08:00
|
|
|
ProcessingConfig api_format;
|
2016-09-16 15:02:15 -07:00
|
|
|
StreamConfig render_processing_format;
|
2015-11-28 12:35:15 -08:00
|
|
|
} formats_;
|
|
|
|
|
|
|
|
|
|
// APM constants.
|
|
|
|
|
const struct ApmConstants {
|
2020-01-13 14:43:13 +01:00
|
|
|
ApmConstants(bool multi_channel_render_support,
|
2019-12-10 13:04:15 +01:00
|
|
|
bool multi_channel_capture_support,
|
2021-03-12 23:08:09 +00:00
|
|
|
bool enforce_split_band_hpf,
|
2024-08-02 11:40:22 +03:00
|
|
|
bool minimize_processing_for_unused_output)
|
2020-01-13 14:43:13 +01:00
|
|
|
: multi_channel_render_support(multi_channel_render_support),
|
2019-12-10 13:04:15 +01:00
|
|
|
multi_channel_capture_support(multi_channel_capture_support),
|
2021-03-12 23:08:09 +00:00
|
|
|
enforce_split_band_hpf(enforce_split_band_hpf),
|
|
|
|
|
minimize_processing_for_unused_output(
|
2024-08-02 11:40:22 +03:00
|
|
|
minimize_processing_for_unused_output) {}
|
2019-11-27 09:34:22 +01:00
|
|
|
bool multi_channel_render_support;
|
|
|
|
|
bool multi_channel_capture_support;
|
2019-12-10 13:04:15 +01:00
|
|
|
bool enforce_split_band_hpf;
|
2021-03-12 23:08:09 +00:00
|
|
|
bool minimize_processing_for_unused_output;
|
2015-11-28 12:35:15 -08:00
|
|
|
} constants_;
|
|
|
|
|
|
|
|
|
|
struct ApmCaptureState {
|
2020-01-02 15:15:36 +01:00
|
|
|
ApmCaptureState();
|
2016-08-29 14:46:07 -07:00
|
|
|
~ApmCaptureState();
|
2015-11-28 12:35:15 -08:00
|
|
|
bool was_stream_delay_set;
|
2021-02-09 08:47:51 +01:00
|
|
|
bool capture_output_used;
|
2021-03-12 14:18:36 +00:00
|
|
|
bool capture_output_used_last_frame;
|
2015-11-28 12:35:15 -08:00
|
|
|
bool key_pressed;
|
2016-02-19 07:04:49 -08:00
|
|
|
std::unique_ptr<AudioBuffer> capture_audio;
|
2019-10-09 13:02:14 +02:00
|
|
|
std::unique_ptr<AudioBuffer> capture_fullband_audio;
|
2019-11-13 11:12:29 +01:00
|
|
|
std::unique_ptr<AudioBuffer> linear_aec_output;
|
2016-09-16 15:02:15 -07:00
|
|
|
// Only the rate and samples fields of capture_processing_format_ are used
|
|
|
|
|
// because the capture processing number of channels is mutable and is
|
|
|
|
|
// tracked by the capture_audio_.
|
|
|
|
|
StreamConfig capture_processing_format;
|
2015-11-28 12:35:15 -08:00
|
|
|
int split_rate;
|
2017-04-10 14:12:41 -07:00
|
|
|
bool echo_path_gain_change;
|
2021-03-15 16:31:04 +00:00
|
|
|
float prev_pre_adjustment_gain;
|
2019-05-10 15:50:02 +02:00
|
|
|
int playout_volume;
|
|
|
|
|
int prev_playout_volume;
|
2018-11-26 16:18:25 +01:00
|
|
|
AudioProcessingStats stats;
|
2022-09-07 17:14:26 +02:00
|
|
|
// Input volume applied on the audio input device when the audio is
|
|
|
|
|
// acquired. Unspecified when unknown.
|
|
|
|
|
absl::optional<int> applied_input_volume;
|
|
|
|
|
bool applied_input_volume_changed;
|
2022-09-07 16:58:33 +02:00
|
|
|
// Recommended input volume to apply on the audio input device the next time
|
|
|
|
|
// that audio is acquired. Unspecified when no input volume can be
|
|
|
|
|
// recommended.
|
|
|
|
|
absl::optional<int> recommended_input_volume;
|
2020-07-07 15:53:34 +02:00
|
|
|
} capture_ RTC_GUARDED_BY(mutex_capture_);
|
2015-11-28 12:35:15 -08:00
|
|
|
|
|
|
|
|
struct ApmCaptureNonLockedState {
|
2018-08-30 13:01:34 +02:00
|
|
|
ApmCaptureNonLockedState()
|
2016-09-16 15:02:15 -07:00
|
|
|
: capture_processing_format(kSampleRate16kHz),
|
2015-11-28 12:35:15 -08:00
|
|
|
split_rate(kSampleRate16kHz),
|
2018-08-30 13:01:34 +02:00
|
|
|
stream_delay_ms(0) {}
|
2016-09-16 15:02:15 -07:00
|
|
|
// Only the rate and samples fields of capture_processing_format_ are used
|
|
|
|
|
// because the forward processing number of channels is mutable and is
|
|
|
|
|
// tracked by the capture_audio_.
|
|
|
|
|
StreamConfig capture_processing_format;
|
2015-11-28 12:35:15 -08:00
|
|
|
int split_rate;
|
|
|
|
|
int stream_delay_ms;
|
2017-10-16 13:49:04 +02:00
|
|
|
bool echo_controller_enabled = false;
|
2015-11-28 12:35:15 -08:00
|
|
|
} capture_nonlocked_;
|
|
|
|
|
|
|
|
|
|
struct ApmRenderState {
|
2016-08-29 14:46:07 -07:00
|
|
|
ApmRenderState();
|
|
|
|
|
~ApmRenderState();
|
2016-02-19 07:04:49 -08:00
|
|
|
std::unique_ptr<AudioConverter> render_converter;
|
|
|
|
|
std::unique_ptr<AudioBuffer> render_audio;
|
2020-07-07 15:53:34 +02:00
|
|
|
} render_ RTC_GUARDED_BY(mutex_render_);
|
2017-09-07 07:53:45 -07:00
|
|
|
|
2019-12-30 14:32:14 +01:00
|
|
|
// Class for statistics reporting. The class is thread-safe and no lock is
|
|
|
|
|
// needed when accessing it.
|
|
|
|
|
class ApmStatsReporter {
|
|
|
|
|
public:
|
|
|
|
|
ApmStatsReporter();
|
|
|
|
|
~ApmStatsReporter();
|
|
|
|
|
|
|
|
|
|
// Returns the most recently reported statistics.
|
|
|
|
|
AudioProcessingStats GetStatistics();
|
|
|
|
|
|
|
|
|
|
// Update the cached statistics.
|
|
|
|
|
void UpdateStatistics(const AudioProcessingStats& new_stats);
|
|
|
|
|
|
|
|
|
|
private:
|
2020-07-07 15:53:34 +02:00
|
|
|
Mutex mutex_stats_;
|
|
|
|
|
AudioProcessingStats cached_stats_ RTC_GUARDED_BY(mutex_stats_);
|
2019-12-30 14:32:14 +01:00
|
|
|
SwapQueue<AudioProcessingStats> stats_message_queue_;
|
|
|
|
|
} stats_reporter_;
|
|
|
|
|
|
2020-07-07 15:53:34 +02:00
|
|
|
std::vector<int16_t> aecm_render_queue_buffer_ RTC_GUARDED_BY(mutex_render_);
|
|
|
|
|
std::vector<int16_t> aecm_capture_queue_buffer_
|
|
|
|
|
RTC_GUARDED_BY(mutex_capture_);
|
2017-09-07 07:53:45 -07:00
|
|
|
|
2020-07-07 15:53:34 +02:00
|
|
|
size_t agc_render_queue_element_max_size_ RTC_GUARDED_BY(mutex_render_)
|
|
|
|
|
RTC_GUARDED_BY(mutex_capture_) = 0;
|
|
|
|
|
std::vector<int16_t> agc_render_queue_buffer_ RTC_GUARDED_BY(mutex_render_);
|
|
|
|
|
std::vector<int16_t> agc_capture_queue_buffer_ RTC_GUARDED_BY(mutex_capture_);
|
2017-09-07 07:53:45 -07:00
|
|
|
|
2020-07-07 15:53:34 +02:00
|
|
|
size_t red_render_queue_element_max_size_ RTC_GUARDED_BY(mutex_render_)
|
|
|
|
|
RTC_GUARDED_BY(mutex_capture_) = 0;
|
|
|
|
|
std::vector<float> red_render_queue_buffer_ RTC_GUARDED_BY(mutex_render_);
|
|
|
|
|
std::vector<float> red_capture_queue_buffer_ RTC_GUARDED_BY(mutex_capture_);
|
2017-09-07 07:53:45 -07:00
|
|
|
|
2020-07-07 15:53:34 +02:00
|
|
|
RmsLevel capture_input_rms_ RTC_GUARDED_BY(mutex_capture_);
|
|
|
|
|
RmsLevel capture_output_rms_ RTC_GUARDED_BY(mutex_capture_);
|
|
|
|
|
int capture_rms_interval_counter_ RTC_GUARDED_BY(mutex_capture_) = 0;
|
2016-11-29 08:09:09 -08:00
|
|
|
|
2022-10-26 13:30:25 +00:00
|
|
|
InputVolumeStatsReporter applied_input_volume_stats_reporter_
|
2021-10-29 14:55:45 +02:00
|
|
|
RTC_GUARDED_BY(mutex_capture_);
|
2022-10-27 00:05:32 +02:00
|
|
|
InputVolumeStatsReporter recommended_input_volume_stats_reporter_
|
|
|
|
|
RTC_GUARDED_BY(mutex_capture_);
|
2021-10-29 14:55:45 +02:00
|
|
|
|
2016-10-22 05:04:30 -07:00
|
|
|
// Lock protection not needed.
|
2016-10-25 05:42:20 -07:00
|
|
|
std::unique_ptr<
|
|
|
|
|
SwapQueue<std::vector<int16_t>, RenderQueueItemVerifier<int16_t>>>
|
|
|
|
|
aecm_render_signal_queue_;
|
2016-10-25 04:45:24 -07:00
|
|
|
std::unique_ptr<
|
|
|
|
|
SwapQueue<std::vector<int16_t>, RenderQueueItemVerifier<int16_t>>>
|
2016-10-25 05:42:20 -07:00
|
|
|
agc_render_signal_queue_;
|
2016-10-28 05:39:16 -07:00
|
|
|
std::unique_ptr<SwapQueue<std::vector<float>, RenderQueueItemVerifier<float>>>
|
|
|
|
|
red_render_signal_queue_;
|
2011-07-07 08:21:25 +00:00
|
|
|
};
|
2014-04-22 21:00:04 +00:00
|
|
|
|
2011-07-07 08:21:25 +00:00
|
|
|
} // namespace webrtc
|
|
|
|
|
|
2017-09-15 06:47:31 +02:00
|
|
|
#endif // MODULES_AUDIO_PROCESSING_AUDIO_PROCESSING_IMPL_H_
|