blob: f55c9158fb573459bc0add1651c2a035a27db2ec [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
23AudioProcessing* AudioProcessingBuilder::Create() {
24 webrtc::Config config;
25 return Create(config);
26}
27
28AudioProcessing* AudioProcessingBuilder::Create(const webrtc::Config& config) {
29#ifdef WEBRTC_EXCLUDE_AUDIO_PROCESSING_MODULE
30
31 // Implementation returning a null pointer for using when the APM is excluded
32 // from the build..
33 return nullptr;
34
35#else
36
37 // Standard implementation.
Per Åhgren0ade9832020-09-01 23:57:20 +020038 return new rtc::RefCountedObject<AudioProcessingImpl>(
Per Åhgrencc73ed32020-04-26 23:56:17 +020039 config, std::move(capture_post_processing_),
40 std::move(render_pre_processing_), std::move(echo_control_factory_),
41 std::move(echo_detector_), std::move(capture_analyzer_));
Per Åhgrencc73ed32020-04-26 23:56:17 +020042#endif
43}
44
45} // namespace webrtc