RTCPeerConnectionFactory.h 3.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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 "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. RTC_OBJC_EXPORT
  29. @interface RTC_OBJC_TYPE (RTCPeerConnectionFactory) : NSObject
  30. /* Initialize object with default H264 video encoder/decoder factories */
  31. - (instancetype)init;
  32. /* Initialize object with injectable video encoder/decoder factories */
  33. - (instancetype)
  34. initWithEncoderFactory:(nullable id<RTC_OBJC_TYPE(RTCVideoEncoderFactory)>)encoderFactory
  35. decoderFactory:(nullable id<RTC_OBJC_TYPE(RTCVideoDecoderFactory)>)decoderFactory;
  36. /** Initialize an RTCAudioSource with constraints. */
  37. - (RTC_OBJC_TYPE(RTCAudioSource) *)audioSourceWithConstraints:
  38. (nullable RTC_OBJC_TYPE(RTCMediaConstraints) *)constraints;
  39. /** Initialize an RTCAudioTrack with an id. Convenience ctor to use an audio source
  40. * with no constraints.
  41. */
  42. - (RTC_OBJC_TYPE(RTCAudioTrack) *)audioTrackWithTrackId:(NSString *)trackId;
  43. /** Initialize an RTCAudioTrack with a source and an id. */
  44. - (RTC_OBJC_TYPE(RTCAudioTrack) *)audioTrackWithSource:(RTC_OBJC_TYPE(RTCAudioSource) *)source
  45. trackId:(NSString *)trackId;
  46. /** Initialize a generic RTCVideoSource. The RTCVideoSource should be
  47. * passed to a RTCVideoCapturer implementation, e.g.
  48. * RTCCameraVideoCapturer, in order to produce frames.
  49. */
  50. - (RTC_OBJC_TYPE(RTCVideoSource) *)videoSource;
  51. /** Initialize an RTCVideoTrack with a source and an id. */
  52. - (RTC_OBJC_TYPE(RTCVideoTrack) *)videoTrackWithSource:(RTC_OBJC_TYPE(RTCVideoSource) *)source
  53. trackId:(NSString *)trackId;
  54. /** Initialize an RTCMediaStream with an id. */
  55. - (RTC_OBJC_TYPE(RTCMediaStream) *)mediaStreamWithStreamId:(NSString *)streamId;
  56. /** Initialize an RTCPeerConnection with a configuration, constraints, and
  57. * delegate.
  58. */
  59. - (RTC_OBJC_TYPE(RTCPeerConnection) *)
  60. peerConnectionWithConfiguration:(RTC_OBJC_TYPE(RTCConfiguration) *)configuration
  61. constraints:(RTC_OBJC_TYPE(RTCMediaConstraints) *)constraints
  62. delegate:(nullable id<RTC_OBJC_TYPE(RTCPeerConnectionDelegate)>)delegate;
  63. /** Set the options to be used for subsequently created RTCPeerConnections */
  64. - (void)setOptions:(nonnull RTC_OBJC_TYPE(RTCPeerConnectionFactoryOptions) *)options;
  65. /** Start an AecDump recording. This API call will likely change in the future. */
  66. - (BOOL)startAecDumpWithFilePath:(NSString *)filePath maxSizeInBytes:(int64_t)maxSizeInBytes;
  67. /* Stop an active AecDump recording */
  68. - (void)stopAecDump;
  69. @end
  70. NS_ASSUME_NONNULL_END