blob: a6b7d5f23e86115b55b6271b7481ed350dbb3bd7 [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 webrtc::Config config;
25 return Create(config);
26}
27
Niels Möller4f776ac2021-07-02 11:30:54 +020028rtc::scoped_refptr<AudioProcessing> AudioProcessingBuilder::Create(
29 const webrtc::Config& config) {
Per Åhgrencc73ed32020-04-26 23:56:17 +020030#ifdef WEBRTC_EXCLUDE_AUDIO_PROCESSING_MODULE
31
32 // Implementation returning a null pointer for using when the APM is excluded
33 // from the build..
34 return nullptr;
35
36#else
37
38 // Standard implementation.
Niels Möller4f776ac2021-07-02 11:30:54 +020039 return rtc::make_ref_counted<AudioProcessingImpl>(
Per Åhgrencc73ed32020-04-26 23:56:17 +020040 config, std::move(capture_post_processing_),
41 std::move(render_pre_processing_), std::move(echo_control_factory_),
42 std::move(echo_detector_), std::move(capture_analyzer_));
Per Åhgrencc73ed32020-04-26 23:56:17 +020043#endif
44}
45
46} // namespace webrtc