blob: c808218b5452fbe56604740e595a36ac29952422 [file] [log] [blame]
Anders Carlsson7bca8ca2018-08-30 09:30:29 +02001/*
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
11#import <Foundation/Foundation.h>
12
13#import "RTCMacros.h"
14
15NS_ASSUME_NONNULL_BEGIN
16
17@class RTCAudioSource;
18@class RTCAudioTrack;
19@class RTCConfiguration;
20@class RTCMediaConstraints;
21@class RTCMediaStream;
22@class RTCPeerConnection;
23@class RTCVideoSource;
24@class RTCVideoTrack;
25@class RTCPeerConnectionFactoryOptions;
26@protocol RTCPeerConnectionDelegate;
27@protocol RTCVideoDecoderFactory;
28@protocol RTCVideoEncoderFactory;
29
Mirko Bonadeie8d57242018-09-17 10:22:56 +020030RTC_OBJC_EXPORT
Anders Carlsson7bca8ca2018-08-30 09:30:29 +020031@interface RTCPeerConnectionFactory : NSObject
32
33/* Initialize object with default H264 video encoder/decoder factories */
34- (instancetype)init;
35
36/* Initialize object with injectable video encoder/decoder factories */
37- (instancetype)initWithEncoderFactory:(nullable id<RTCVideoEncoderFactory>)encoderFactory
38 decoderFactory:(nullable id<RTCVideoDecoderFactory>)decoderFactory;
39
40/** Initialize an RTCAudioSource with constraints. */
41- (RTCAudioSource *)audioSourceWithConstraints:(nullable RTCMediaConstraints *)constraints;
42
43/** Initialize an RTCAudioTrack with an id. Convenience ctor to use an audio source with no
44 * constraints.
45 */
46- (RTCAudioTrack *)audioTrackWithTrackId:(NSString *)trackId;
47
48/** Initialize an RTCAudioTrack with a source and an id. */
49- (RTCAudioTrack *)audioTrackWithSource:(RTCAudioSource *)source trackId:(NSString *)trackId;
50
51/** Initialize a generic RTCVideoSource. The RTCVideoSource should be passed to a RTCVideoCapturer
52 * implementation, e.g. RTCCameraVideoCapturer, in order to produce frames.
53 */
54- (RTCVideoSource *)videoSource;
55
56/** Initialize an RTCVideoTrack with a source and an id. */
57- (RTCVideoTrack *)videoTrackWithSource:(RTCVideoSource *)source trackId:(NSString *)trackId;
58
59/** Initialize an RTCMediaStream with an id. */
60- (RTCMediaStream *)mediaStreamWithStreamId:(NSString *)streamId;
61
62/** Initialize an RTCPeerConnection with a configuration, constraints, and
63 * delegate.
64 */
65- (RTCPeerConnection *)peerConnectionWithConfiguration:(RTCConfiguration *)configuration
66 constraints:(RTCMediaConstraints *)constraints
67 delegate:
68 (nullable id<RTCPeerConnectionDelegate>)delegate;
69
70/** Set the options to be used for subsequently created RTCPeerConnections */
71- (void)setOptions:(nonnull RTCPeerConnectionFactoryOptions *)options;
72
73/** Start an AecDump recording. This API call will likely change in the future. */
74- (BOOL)startAecDumpWithFilePath:(NSString *)filePath maxSizeInBytes:(int64_t)maxSizeInBytes;
75
76/* Stop an active AecDump recording */
77- (void)stopAecDump;
78
79@end
80
81NS_ASSUME_NONNULL_END