RTCPeerConnectionFactory.h 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. /*
  2. * Copyright 2015 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 <Foundation/Foundation.h>
  11. #import <WebRTC/RTCMacros.h>
  12. NS_ASSUME_NONNULL_BEGIN
  13. @class RTC_OBJC_TYPE(RTCAudioSource);
  14. @class RTC_OBJC_TYPE(RTCAudioTrack);
  15. @class RTC_OBJC_TYPE(RTCConfiguration);
  16. @class RTC_OBJC_TYPE(RTCMediaConstraints);
  17. @class RTC_OBJC_TYPE(RTCMediaStream);
  18. @class RTC_OBJC_TYPE(RTCPeerConnection);
  19. @class RTC_OBJC_TYPE(RTCVideoSource);
  20. @class RTC_OBJC_TYPE(RTCVideoTrack);
  21. @class RTC_OBJC_TYPE(RTCPeerConnectionFactoryOptions);
  22. @protocol RTC_OBJC_TYPE
  23. (RTCPeerConnectionDelegate);
  24. @protocol RTC_OBJC_TYPE
  25. (RTCVideoDecoderFactory);
  26. @protocol RTC_OBJC_TYPE
  27. (RTCVideoEncoderFactory);
  28. @protocol RTC_OBJC_TYPE
  29. (RTCSSLCertificateVerifier);
  30. @protocol RTC_OBJC_TYPE
  31. (RTCAudioDevice);
  32. RTC_OBJC_EXPORT
  33. @interface RTC_OBJC_TYPE (RTCPeerConnectionFactory) : NSObject
  34. /* Initialize object with default H264 video encoder/decoder factories and default ADM */
  35. - (instancetype)init;
  36. /* Initialize object with injectable video encoder/decoder factories and default ADM */
  37. - (instancetype)
  38. initWithEncoderFactory:(nullable id<RTC_OBJC_TYPE(RTCVideoEncoderFactory)>)encoderFactory
  39. decoderFactory:(nullable id<RTC_OBJC_TYPE(RTCVideoDecoderFactory)>)decoderFactory;
  40. /* Initialize object with injectable video encoder/decoder factories and injectable ADM */
  41. - (instancetype)
  42. initWithEncoderFactory:(nullable id<RTC_OBJC_TYPE(RTCVideoEncoderFactory)>)encoderFactory
  43. decoderFactory:(nullable id<RTC_OBJC_TYPE(RTCVideoDecoderFactory)>)decoderFactory
  44. audioDevice:(nullable id<RTC_OBJC_TYPE(RTCAudioDevice)>)audioDevice;
  45. /** Initialize an RTCAudioSource with constraints. */
  46. - (RTC_OBJC_TYPE(RTCAudioSource) *)audioSourceWithConstraints:
  47. (nullable RTC_OBJC_TYPE(RTCMediaConstraints) *)constraints;
  48. /** Initialize an RTCAudioTrack with an id. Convenience ctor to use an audio source
  49. * with no constraints.
  50. */
  51. - (RTC_OBJC_TYPE(RTCAudioTrack) *)audioTrackWithTrackId:(NSString *)trackId;
  52. /** Initialize an RTCAudioTrack with a source and an id. */
  53. - (RTC_OBJC_TYPE(RTCAudioTrack) *)audioTrackWithSource:(RTC_OBJC_TYPE(RTCAudioSource) *)source
  54. trackId:(NSString *)trackId;
  55. /** Initialize a generic RTCVideoSource. The RTCVideoSource should be
  56. * passed to a RTCVideoCapturer implementation, e.g.
  57. * RTCCameraVideoCapturer, in order to produce frames.
  58. */
  59. - (RTC_OBJC_TYPE(RTCVideoSource) *)videoSource;
  60. /** Initialize a generic RTCVideoSource with he posibility of marking
  61. * it as usable for screen sharing. The RTCVideoSource should be
  62. * passed to a RTCVideoCapturer implementation, e.g.
  63. * RTCCameraVideoCapturer, in order to produce frames.
  64. */
  65. - (RTC_OBJC_TYPE(RTCVideoSource) *)videoSourceForScreenCast:(BOOL)forScreenCast;
  66. /** Initialize an RTCVideoTrack with a source and an id. */
  67. - (RTC_OBJC_TYPE(RTCVideoTrack) *)videoTrackWithSource:(RTC_OBJC_TYPE(RTCVideoSource) *)source
  68. trackId:(NSString *)trackId;
  69. /** Initialize an RTCMediaStream with an id. */
  70. - (RTC_OBJC_TYPE(RTCMediaStream) *)mediaStreamWithStreamId:(NSString *)streamId;
  71. /** Initialize an RTCPeerConnection with a configuration, constraints, and
  72. * delegate.
  73. */
  74. - (nullable RTC_OBJC_TYPE(RTCPeerConnection) *)
  75. peerConnectionWithConfiguration:(RTC_OBJC_TYPE(RTCConfiguration) *)configuration
  76. constraints:(RTC_OBJC_TYPE(RTCMediaConstraints) *)constraints
  77. delegate:(nullable id<RTC_OBJC_TYPE(RTCPeerConnectionDelegate)>)delegate;
  78. - (nullable RTC_OBJC_TYPE(RTCPeerConnection) *)
  79. peerConnectionWithConfiguration:(RTC_OBJC_TYPE(RTCConfiguration) *)configuration
  80. constraints:(RTC_OBJC_TYPE(RTCMediaConstraints) *)constraints
  81. certificateVerifier:
  82. (id<RTC_OBJC_TYPE(RTCSSLCertificateVerifier)>)certificateVerifier
  83. delegate:(nullable id<RTC_OBJC_TYPE(RTCPeerConnectionDelegate)>)delegate;
  84. /** Set the options to be used for subsequently created RTCPeerConnections */
  85. - (void)setOptions:(nonnull RTC_OBJC_TYPE(RTCPeerConnectionFactoryOptions) *)options;
  86. /** Start an AecDump recording. This API call will likely change in the future. */
  87. - (BOOL)startAecDumpWithFilePath:(NSString *)filePath maxSizeInBytes:(int64_t)maxSizeInBytes;
  88. /* Stop an active AecDump recording */
  89. - (void)stopAecDump;
  90. @end
  91. NS_ASSUME_NONNULL_END