RTCPeerConnectionFactory.h 3.0 KB

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