blob: 7922c91b4bae814c019b4f0aaa3b518a6605868e [file] [log] [blame]
Anders Carlsson7bca8ca2018-08-30 09:30:29 +02001/*
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
11#import "RTCPeerConnectionFactory.h"
12
Mirko Bonadeid9708072019-01-25 20:26:48 +010013#include "api/scoped_refptr.h"
Anders Carlsson7bca8ca2018-08-30 09:30:29 +020014
15namespace webrtc {
16
17class AudioDeviceModule;
18class AudioEncoderFactory;
19class AudioDecoderFactory;
Piotr (Peter) Slatalae0c2e972018-10-08 09:43:21 -070020class MediaTransportFactory;
Sebastian Jansson77c0a622019-04-23 10:24:03 +020021class NetworkControllerFactoryInterface;
Anders Carlsson7bca8ca2018-08-30 09:30:29 +020022class VideoEncoderFactory;
23class VideoDecoderFactory;
24class AudioProcessing;
Jonas Oreland285f83d2020-02-07 10:30:08 +010025struct PeerConnectionDependencies;
Anders Carlsson7bca8ca2018-08-30 09:30:29 +020026
27} // namespace webrtc
28
29NS_ASSUME_NONNULL_BEGIN
30
31/**
32 * This class extension exposes methods that work directly with injectable C++ components.
33 */
34@interface RTCPeerConnectionFactory ()
35
36- (instancetype)initNative NS_DESIGNATED_INITIALIZER;
37
38/* Initializer used when WebRTC is compiled with no media support */
39- (instancetype)initWithNoMedia;
40
41/* Initialize object with injectable native audio/video encoder/decoder factories */
42- (instancetype)initWithNativeAudioEncoderFactory:
43 (rtc::scoped_refptr<webrtc::AudioEncoderFactory>)audioEncoderFactory
44 nativeAudioDecoderFactory:
45 (rtc::scoped_refptr<webrtc::AudioDecoderFactory>)audioDecoderFactory
46 nativeVideoEncoderFactory:
47 (std::unique_ptr<webrtc::VideoEncoderFactory>)videoEncoderFactory
48 nativeVideoDecoderFactory:
49 (std::unique_ptr<webrtc::VideoDecoderFactory>)videoDecoderFactory
50 audioDeviceModule:
51 (nullable webrtc::AudioDeviceModule *)audioDeviceModule
52 audioProcessingModule:
53 (rtc::scoped_refptr<webrtc::AudioProcessing>)audioProcessingModule;
54
Piotr (Peter) Slatalae0c2e972018-10-08 09:43:21 -070055- (instancetype)
56 initWithNativeAudioEncoderFactory:
57 (rtc::scoped_refptr<webrtc::AudioEncoderFactory>)audioEncoderFactory
58 nativeAudioDecoderFactory:
59 (rtc::scoped_refptr<webrtc::AudioDecoderFactory>)audioDecoderFactory
60 nativeVideoEncoderFactory:
61 (std::unique_ptr<webrtc::VideoEncoderFactory>)videoEncoderFactory
62 nativeVideoDecoderFactory:
63 (std::unique_ptr<webrtc::VideoDecoderFactory>)videoDecoderFactory
64 audioDeviceModule:(nullable webrtc::AudioDeviceModule *)audioDeviceModule
65 audioProcessingModule:
66 (rtc::scoped_refptr<webrtc::AudioProcessing>)audioProcessingModule
67 mediaTransportFactory:
68 (std::unique_ptr<webrtc::MediaTransportFactory>)mediaTransportFactory;
69
Sebastian Jansson77c0a622019-04-23 10:24:03 +020070- (instancetype)
71 initWithNativeAudioEncoderFactory:
72 (rtc::scoped_refptr<webrtc::AudioEncoderFactory>)audioEncoderFactory
73 nativeAudioDecoderFactory:
74 (rtc::scoped_refptr<webrtc::AudioDecoderFactory>)audioDecoderFactory
75 nativeVideoEncoderFactory:
76 (std::unique_ptr<webrtc::VideoEncoderFactory>)videoEncoderFactory
77 nativeVideoDecoderFactory:
78 (std::unique_ptr<webrtc::VideoDecoderFactory>)videoDecoderFactory
79 audioDeviceModule:(nullable webrtc::AudioDeviceModule *)audioDeviceModule
80 audioProcessingModule:
81 (rtc::scoped_refptr<webrtc::AudioProcessing>)audioProcessingModule
82 networkControllerFactory:(std::unique_ptr<webrtc::NetworkControllerFactoryInterface>)
83 networkControllerFactory
84 mediaTransportFactory:
85 (std::unique_ptr<webrtc::MediaTransportFactory>)mediaTransportFactory;
86
Piotr (Peter) Slatalae0c2e972018-10-08 09:43:21 -070087- (instancetype)initWithEncoderFactory:(nullable id<RTCVideoEncoderFactory>)encoderFactory
88 decoderFactory:(nullable id<RTCVideoDecoderFactory>)decoderFactory
89 mediaTransportFactory:
90 (std::unique_ptr<webrtc::MediaTransportFactory>)mediaTransportFactory;
Jonas Oreland285f83d2020-02-07 10:30:08 +010091
92/** Initialize an RTCPeerConnection with a configuration, constraints, and
93 * dependencies.
94 */
95- (RTCPeerConnection *)
96 peerConnectionWithDependencies:(RTCConfiguration *)configuration
97 constraints:(RTCMediaConstraints *)constraints
98 dependencies:(std::unique_ptr<webrtc::PeerConnectionDependencies>)dependencies
99 delegate:(nullable id<RTCPeerConnectionDelegate>)delegate;
100
Anders Carlsson7bca8ca2018-08-30 09:30:29 +0200101@end
102
103NS_ASSUME_NONNULL_END