xref: /aosp_15_r20/external/webrtc/api/voip/voip_engine_factory.cc (revision d9f758449e529ab9291ac668be2861e7a55c2422)
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 "api/voip/voip_engine_factory.h"
12 
13 #include <utility>
14 
15 #include "audio/voip/voip_core.h"
16 #include "rtc_base/logging.h"
17 
18 namespace webrtc {
19 
CreateVoipEngine(VoipEngineConfig config)20 std::unique_ptr<VoipEngine> CreateVoipEngine(VoipEngineConfig config) {
21   RTC_CHECK(config.encoder_factory);
22   RTC_CHECK(config.decoder_factory);
23   RTC_CHECK(config.task_queue_factory);
24   RTC_CHECK(config.audio_device_module);
25 
26   if (!config.audio_processing) {
27     RTC_DLOG(LS_INFO) << "No audio processing functionality provided.";
28   }
29 
30   return std::make_unique<VoipCore>(std::move(config.encoder_factory),
31                                     std::move(config.decoder_factory),
32                                     std::move(config.task_queue_factory),
33                                     std::move(config.audio_device_module),
34                                     std::move(config.audio_processing));
35 }
36 
37 }  // namespace webrtc
38