diff --git a/media/BUILD.gn b/media/BUILD.gn index f0967c8f68..e89322b4cf 100644 --- a/media/BUILD.gn +++ b/media/BUILD.gn @@ -421,6 +421,8 @@ rtc_library("rtc_data") { sources = [ "sctp/sctp_transport.cc", "sctp/sctp_transport.h", + "sctp/sctp_transport_factory.cc", + "sctp/sctp_transport_factory.h", "sctp/sctp_transport_internal.h", ] } else { diff --git a/media/sctp/sctp_transport.h b/media/sctp/sctp_transport.h index e357e706ee..cf352deff0 100644 --- a/media/sctp/sctp_transport.h +++ b/media/sctp/sctp_transport.h @@ -286,21 +286,6 @@ class SctpTransport : public SctpTransportInternal, RTC_DISALLOW_COPY_AND_ASSIGN(SctpTransport); }; -class SctpTransportFactory : public webrtc::SctpTransportFactoryInterface { - public: - explicit SctpTransportFactory(rtc::Thread* network_thread) - : network_thread_(network_thread) {} - - std::unique_ptr CreateSctpTransport( - rtc::PacketTransportInternal* transport) override { - return std::unique_ptr( - new SctpTransport(network_thread_, transport)); - } - - private: - rtc::Thread* network_thread_; -}; - class SctpTransportMap; } // namespace cricket diff --git a/media/sctp/sctp_transport_factory.cc b/media/sctp/sctp_transport_factory.cc new file mode 100644 index 0000000000..23793ca733 --- /dev/null +++ b/media/sctp/sctp_transport_factory.cc @@ -0,0 +1,25 @@ +/* + * Copyright 2021 The WebRTC project authors. All Rights Reserved. + * + * Use of this source code is governed by a BSD-style license + * that can be found in the LICENSE file in the root of the source + * tree. An additional intellectual property rights grant can be found + * in the file PATENTS. All contributing project authors may + * be found in the AUTHORS file in the root of the source tree. + */ + +#include "media/sctp/sctp_transport_factory.h" + +namespace cricket { + +SctpTransportFactory::SctpTransportFactory(rtc::Thread* network_thread) + : network_thread_(network_thread) {} + +std::unique_ptr +SctpTransportFactory::CreateSctpTransport( + rtc::PacketTransportInternal* transport) { + return std::unique_ptr( + new SctpTransport(network_thread_, transport)); +} + +} // namespace cricket diff --git a/media/sctp/sctp_transport_factory.h b/media/sctp/sctp_transport_factory.h new file mode 100644 index 0000000000..92d9692ea6 --- /dev/null +++ b/media/sctp/sctp_transport_factory.h @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2021 The WebRTC project authors. All Rights Reserved. + * + * Use of this source code is governed by a BSD-style license + * that can be found in the LICENSE file in the root of the source + * tree. An additional intellectual property rights grant can be found + * in the file PATENTS. All contributing project authors may + * be found in the AUTHORS file in the root of the source tree. + */ + +#ifndef MEDIA_SCTP_SCTP_TRANSPORT_FACTORY_H_ +#define MEDIA_SCTP_SCTP_TRANSPORT_FACTORY_H_ + +#include + +#include "api/transport/sctp_transport_factory_interface.h" +#include "media/sctp/sctp_transport.h" +#include "rtc_base/thread.h" + +namespace cricket { + +class SctpTransportFactory : public webrtc::SctpTransportFactoryInterface { + public: + explicit SctpTransportFactory(rtc::Thread* network_thread); + + std::unique_ptr CreateSctpTransport( + rtc::PacketTransportInternal* transport) override; + + private: + rtc::Thread* network_thread_; +}; + +} // namespace cricket + +#endif // MEDIA_SCTP_SCTP_TRANSPORT_FACTORY_H__ diff --git a/pc/connection_context.cc b/pc/connection_context.cc index 213a8f37df..4da4bb0fae 100644 --- a/pc/connection_context.cc +++ b/pc/connection_context.cc @@ -16,6 +16,7 @@ #include "api/transport/field_trial_based_config.h" #include "media/base/rtp_data_engine.h" +#include "media/sctp/sctp_transport_factory.h" #include "rtc_base/helpers.h" #include "rtc_base/ref_counted_object.h" #include "rtc_base/task_utils/to_queued_task.h" diff --git a/pc/sctp_transport.h b/pc/sctp_transport.h index 4bb42748fc..a8bc45b770 100644 --- a/pc/sctp_transport.h +++ b/pc/sctp_transport.h @@ -16,7 +16,6 @@ #include "api/dtls_transport_interface.h" #include "api/scoped_refptr.h" #include "api/sctp_transport_interface.h" -#include "media/sctp/sctp_transport.h" #include "media/sctp/sctp_transport_internal.h" #include "p2p/base/dtls_transport_internal.h" #include "pc/dtls_transport.h"