Per Åhgren | cc73ed3 | 2020-04-26 23:56:17 +0200 | [diff] [blame] | 1 | /* |
| 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 | |
| 18 | namespace webrtc { |
| 19 | |
| 20 | AudioProcessingBuilder::AudioProcessingBuilder() = default; |
| 21 | AudioProcessingBuilder::~AudioProcessingBuilder() = default; |
| 22 | |
Niels Möller | 4f776ac | 2021-07-02 11:30:54 +0200 | [diff] [blame^] | 23 | rtc::scoped_refptr<AudioProcessing> AudioProcessingBuilder::Create() { |
Per Åhgren | cc73ed3 | 2020-04-26 23:56:17 +0200 | [diff] [blame] | 24 | webrtc::Config config; |
| 25 | return Create(config); |
| 26 | } |
| 27 | |
Niels Möller | 4f776ac | 2021-07-02 11:30:54 +0200 | [diff] [blame^] | 28 | rtc::scoped_refptr<AudioProcessing> AudioProcessingBuilder::Create( |
| 29 | const webrtc::Config& config) { |
Per Åhgren | cc73ed3 | 2020-04-26 23:56:17 +0200 | [diff] [blame] | 30 | #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öller | 4f776ac | 2021-07-02 11:30:54 +0200 | [diff] [blame^] | 39 | return rtc::make_ref_counted<AudioProcessingImpl>( |
Per Åhgren | cc73ed3 | 2020-04-26 23:56:17 +0200 | [diff] [blame] | 40 | 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 Åhgren | cc73ed3 | 2020-04-26 23:56:17 +0200 | [diff] [blame] | 43 | #endif |
| 44 | } |
| 45 | |
| 46 | } // namespace webrtc |