ice_transport_factory.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /*
  2. * Copyright 2019 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. #ifndef API_ICE_TRANSPORT_FACTORY_H_
  11. #define API_ICE_TRANSPORT_FACTORY_H_
  12. #include "api/ice_transport_interface.h"
  13. #include "api/scoped_refptr.h"
  14. #include "rtc_base/system/rtc_export.h"
  15. namespace cricket {
  16. class PortAllocator;
  17. } // namespace cricket
  18. namespace webrtc {
  19. // Static factory for an IceTransport object that can be created
  20. // without using a webrtc::PeerConnection.
  21. // The returned object must be accessed and destroyed on the thread that
  22. // created it.
  23. // The PortAllocator must outlive the created IceTransportInterface object.
  24. // TODO(steveanton): Remove in favor of the overload that takes
  25. // IceTransportInit.
  26. RTC_EXPORT rtc::scoped_refptr<IceTransportInterface> CreateIceTransport(
  27. cricket::PortAllocator* port_allocator);
  28. // Static factory for an IceTransport object that can be created
  29. // without using a webrtc::PeerConnection.
  30. // The returned object must be accessed and destroyed on the thread that
  31. // created it.
  32. // |init.port_allocator()| is required and must outlive the created
  33. // IceTransportInterface object.
  34. // |init.async_resolver_factory()| and |init.event_log()| are optional, but if
  35. // provided must outlive the created IceTransportInterface object.
  36. RTC_EXPORT rtc::scoped_refptr<IceTransportInterface> CreateIceTransport(
  37. IceTransportInit);
  38. } // namespace webrtc
  39. #endif // API_ICE_TRANSPORT_FACTORY_H_