Per Åhgren | cc73ed3 | 2020-04-26 21:56:17 | [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 | |
Per Åhgren | cc73ed3 | 2020-04-26 21:56:17 | [diff] [blame] | 11 | #include <memory> |
| 12 | |
Niels Möller | 105711e | 2022-06-14 13:48:26 | [diff] [blame] | 13 | #include "api/make_ref_counted.h" |
Per Åhgren | cc73ed3 | 2020-04-26 21:56:17 | [diff] [blame] | 14 | #include "modules/audio_processing/audio_processing_impl.h" |
Niels Möller | 105711e | 2022-06-14 13:48:26 | [diff] [blame] | 15 | #include "modules/audio_processing/include/audio_processing.h" |
Per Åhgren | cc73ed3 | 2020-04-26 21:56:17 | [diff] [blame] | 16 | |
| 17 | namespace webrtc { |
| 18 | |
| 19 | AudioProcessingBuilder::AudioProcessingBuilder() = default; |
| 20 | AudioProcessingBuilder::~AudioProcessingBuilder() = default; |
| 21 | |
Niels Möller | 4f776ac | 2021-07-02 09:30:54 | [diff] [blame] | 22 | rtc::scoped_refptr<AudioProcessing> AudioProcessingBuilder::Create() { |
Per Åhgren | cc73ed3 | 2020-04-26 21:56:17 | [diff] [blame] | 23 | #ifdef WEBRTC_EXCLUDE_AUDIO_PROCESSING_MODULE |
Alessio Bazzica | be1b898 | 2021-09-17 06:26:10 | [diff] [blame] | 24 | // Return a null pointer when the APM is excluded from the build. |
Per Åhgren | cc73ed3 | 2020-04-26 21:56:17 | [diff] [blame] | 25 | return nullptr; |
Alessio Bazzica | be1b898 | 2021-09-17 06:26:10 | [diff] [blame] | 26 | #else // WEBRTC_EXCLUDE_AUDIO_PROCESSING_MODULE |
Niels Möller | 4f776ac | 2021-07-02 09:30:54 | [diff] [blame] | 27 | return rtc::make_ref_counted<AudioProcessingImpl>( |
Alessio Bazzica | 20a9ac6 | 2021-10-14 08:55:08 | [diff] [blame] | 28 | config_, std::move(capture_post_processing_), |
| 29 | std::move(render_pre_processing_), std::move(echo_control_factory_), |
| 30 | std::move(echo_detector_), std::move(capture_analyzer_)); |
Per Åhgren | cc73ed3 | 2020-04-26 21:56:17 | [diff] [blame] | 31 | #endif |
| 32 | } |
| 33 | |
| 34 | } // namespace webrtc |