Florent Castelli | 6b0f19f | 2021-04-08 12:59:12 | [diff] [blame] | 1 | /* |
| 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 Castelli | a80c3e5 | 2021-04-15 13:02:56 | [diff] [blame] | 13 | #include "rtc_base/system/unused.h" |
| 14 | |
Florent Castelli | a6983c6 | 2021-05-06 08:50:07 | [diff] [blame] | 15 | #ifdef WEBRTC_HAVE_DCSCTP |
Florent Castelli | f2599a7 | 2022-03-31 17:15:10 | [diff] [blame] | 16 | #include "media/sctp/dcsctp_transport.h" // nogncheck |
| 17 | #include "system_wrappers/include/clock.h" // nogncheck |
Florent Castelli | a80c3e5 | 2021-04-15 13:02:56 | [diff] [blame] | 18 | #endif |
| 19 | |
Florent Castelli | 6b0f19f | 2021-04-08 12:59:12 | [diff] [blame] | 20 | namespace cricket { |
| 21 | |
Florent Castelli | f2599a7 | 2022-03-31 17:15:10 | [diff] [blame] | 22 | SctpTransportFactory::SctpTransportFactory(rtc::Thread* network_thread) |
| 23 | : network_thread_(network_thread) { |
Florent Castelli | a80c3e5 | 2021-04-15 13:02:56 | [diff] [blame] | 24 | RTC_UNUSED(network_thread_); |
| 25 | } |
Florent Castelli | 6b0f19f | 2021-04-08 12:59:12 | [diff] [blame] | 26 | |
| 27 | std::unique_ptr<SctpTransportInternal> |
| 28 | SctpTransportFactory::CreateSctpTransport( |
| 29 | rtc::PacketTransportInternal* transport) { |
Florent Castelli | a80c3e5 | 2021-04-15 13:02:56 | [diff] [blame] | 30 | std::unique_ptr<SctpTransportInternal> result; |
Florent Castelli | a6983c6 | 2021-05-06 08:50:07 | [diff] [blame] | 31 | #ifdef WEBRTC_HAVE_DCSCTP |
Florent Castelli | f2599a7 | 2022-03-31 17:15:10 | [diff] [blame] | 32 | result = std::unique_ptr<SctpTransportInternal>(new webrtc::DcSctpTransport( |
| 33 | network_thread_, transport, webrtc::Clock::GetRealTimeClock())); |
Florent Castelli | a80c3e5 | 2021-04-15 13:02:56 | [diff] [blame] | 34 | #endif |
| 35 | return result; |
Florent Castelli | 6b0f19f | 2021-04-08 12:59:12 | [diff] [blame] | 36 | } |
| 37 | |
| 38 | } // namespace cricket |