RTCPeerConnectionFactory+Native.h 3.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. /*
  2. * Copyright 2017 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. #import "RTCPeerConnectionFactory.h"
  11. #include "api/scoped_refptr.h"
  12. namespace webrtc {
  13. class AudioDeviceModule;
  14. class AudioEncoderFactory;
  15. class AudioDecoderFactory;
  16. class NetworkControllerFactoryInterface;
  17. class VideoEncoderFactory;
  18. class VideoDecoderFactory;
  19. class AudioProcessing;
  20. struct PeerConnectionDependencies;
  21. } // namespace webrtc
  22. NS_ASSUME_NONNULL_BEGIN
  23. /**
  24. * This class extension exposes methods that work directly with injectable C++ components.
  25. */
  26. @interface RTC_OBJC_TYPE (RTCPeerConnectionFactory)
  27. ()
  28. - (instancetype)initNative NS_DESIGNATED_INITIALIZER;
  29. /* Initializer used when WebRTC is compiled with no media support */
  30. - (instancetype)initWithNoMedia;
  31. /* Initialize object with injectable native audio/video encoder/decoder factories */
  32. - (instancetype)initWithNativeAudioEncoderFactory:
  33. (rtc::scoped_refptr<webrtc::AudioEncoderFactory>)audioEncoderFactory
  34. nativeAudioDecoderFactory:
  35. (rtc::scoped_refptr<webrtc::AudioDecoderFactory>)audioDecoderFactory
  36. nativeVideoEncoderFactory:
  37. (std::unique_ptr<webrtc::VideoEncoderFactory>)videoEncoderFactory
  38. nativeVideoDecoderFactory:
  39. (std::unique_ptr<webrtc::VideoDecoderFactory>)videoDecoderFactory
  40. audioDeviceModule:
  41. (nullable webrtc::AudioDeviceModule *)audioDeviceModule
  42. audioProcessingModule:
  43. (rtc::scoped_refptr<webrtc::AudioProcessing>)audioProcessingModule;
  44. - (instancetype)
  45. initWithNativeAudioEncoderFactory:
  46. (rtc::scoped_refptr<webrtc::AudioEncoderFactory>)audioEncoderFactory
  47. nativeAudioDecoderFactory:
  48. (rtc::scoped_refptr<webrtc::AudioDecoderFactory>)audioDecoderFactory
  49. nativeVideoEncoderFactory:
  50. (std::unique_ptr<webrtc::VideoEncoderFactory>)videoEncoderFactory
  51. nativeVideoDecoderFactory:
  52. (std::unique_ptr<webrtc::VideoDecoderFactory>)videoDecoderFactory
  53. audioDeviceModule:(nullable webrtc::AudioDeviceModule *)audioDeviceModule
  54. audioProcessingModule:
  55. (rtc::scoped_refptr<webrtc::AudioProcessing>)audioProcessingModule
  56. networkControllerFactory:(std::unique_ptr<webrtc::NetworkControllerFactoryInterface>)
  57. networkControllerFactory;
  58. - (instancetype)
  59. initWithEncoderFactory:(nullable id<RTC_OBJC_TYPE(RTCVideoEncoderFactory)>)encoderFactory
  60. decoderFactory:(nullable id<RTC_OBJC_TYPE(RTCVideoDecoderFactory)>)decoderFactory;
  61. /** Initialize an RTCPeerConnection with a configuration, constraints, and
  62. * dependencies.
  63. */
  64. - (RTC_OBJC_TYPE(RTCPeerConnection) *)
  65. peerConnectionWithDependencies:(RTC_OBJC_TYPE(RTCConfiguration) *)configuration
  66. constraints:(RTC_OBJC_TYPE(RTCMediaConstraints) *)constraints
  67. dependencies:(std::unique_ptr<webrtc::PeerConnectionDependencies>)dependencies
  68. delegate:(nullable id<RTC_OBJC_TYPE(RTCPeerConnectionDelegate)>)delegate;
  69. @end
  70. NS_ASSUME_NONNULL_END