blob: 40be2a511d57947d36e404c9e8edfd0711f9406b [file] [log] [blame]
Per Åhgrencc73ed32020-04-26 23:56:17 +02001/*
2 * Copyright (c) 2020 The WebRTC project authors. All Rights Reserved.
3 *
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
11#include "modules/audio_processing/include/audio_processing.h"
12
13#include <memory>
14
15#include "modules/audio_processing/audio_processing_impl.h"
16#include "rtc_base/ref_counted_object.h"
17
18namespace webrtc {
19
20AudioProcessingBuilder::AudioProcessingBuilder() = default;
21AudioProcessingBuilder::~AudioProcessingBuilder() = default;
22
Niels Möller4f776ac2021-07-02 11:30:54 +020023rtc::scoped_refptr<AudioProcessing> AudioProcessingBuilder::Create() {
Per Åhgrencc73ed32020-04-26 23:56:17 +020024#ifdef WEBRTC_EXCLUDE_AUDIO_PROCESSING_MODULE
Alessio Bazzicabe1b8982021-09-17 08:26:10 +020025 // Return a null pointer when the APM is excluded from the build.
Per Åhgrencc73ed32020-04-26 23:56:17 +020026 return nullptr;
Alessio Bazzicabe1b8982021-09-17 08:26:10 +020027#else // WEBRTC_EXCLUDE_AUDIO_PROCESSING_MODULE
Niels Möller4f776ac2021-07-02 11:30:54 +020028 return rtc::make_ref_counted<AudioProcessingImpl>(
Alessio Bazzicabe1b8982021-09-17 08:26:10 +020029 std::move(capture_post_processing_), std::move(render_pre_processing_),
30 std::move(echo_control_factory_), std::move(echo_detector_),
31 std::move(capture_analyzer_));
Per Åhgrencc73ed32020-04-26 23:56:17 +020032#endif
33}
34
35} // namespace webrtc