blob: 79c6fbf52444215a61a9f36c6625a85be4d7edb4 [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 Bazzica20a9ac62021-10-14 10:55:08 +020029 config_, std::move(capture_post_processing_),
30 std::move(render_pre_processing_), std::move(echo_control_factory_),
31 std::move(echo_detector_), std::move(capture_analyzer_));
Per Åhgrencc73ed32020-04-26 23:56:17 +020032#endif
33}
34
35} // namespace webrtc