blob: 457bc5f88943759cb0b4721c28dc03fb0715753d [file] [log] [blame]
Florent Castelli6b0f19f2021-04-08 12:59:121/*
2 * Copyright 2021 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 "media/sctp/sctp_transport_factory.h"
12
Florent Castellia80c3e52021-04-15 13:02:5613#include "rtc_base/system/unused.h"
14
Florent Castellia6983c62021-05-06 08:50:0715#ifdef WEBRTC_HAVE_DCSCTP
Florent Castellif2599a72022-03-31 17:15:1016#include "media/sctp/dcsctp_transport.h" // nogncheck
17#include "system_wrappers/include/clock.h" // nogncheck
Florent Castellia80c3e52021-04-15 13:02:5618#endif
19
Florent Castelli6b0f19f2021-04-08 12:59:1220namespace cricket {
21
Florent Castellif2599a72022-03-31 17:15:1022SctpTransportFactory::SctpTransportFactory(rtc::Thread* network_thread)
23 : network_thread_(network_thread) {
Florent Castellia80c3e52021-04-15 13:02:5624 RTC_UNUSED(network_thread_);
25}
Florent Castelli6b0f19f2021-04-08 12:59:1226
27std::unique_ptr<SctpTransportInternal>
28SctpTransportFactory::CreateSctpTransport(
29 rtc::PacketTransportInternal* transport) {
Florent Castellia80c3e52021-04-15 13:02:5630 std::unique_ptr<SctpTransportInternal> result;
Florent Castellia6983c62021-05-06 08:50:0731#ifdef WEBRTC_HAVE_DCSCTP
Florent Castellif2599a72022-03-31 17:15:1032 result = std::unique_ptr<SctpTransportInternal>(new webrtc::DcSctpTransport(
33 network_thread_, transport, webrtc::Clock::GetRealTimeClock()));
Florent Castellia80c3e52021-04-15 13:02:5634#endif
35 return result;
Florent Castelli6b0f19f2021-04-08 12:59:1236}
37
38} // namespace cricket