Anders Carlsson | 7bca8ca | 2018-08-30 09:30:29 +0200 | [diff] [blame] | 1 | /* |
| 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 Bonadei | d970807 | 2019-01-25 20:26:48 +0100 | [diff] [blame] | 13 | #include "api/scoped_refptr.h" |
Anders Carlsson | 7bca8ca | 2018-08-30 09:30:29 +0200 | [diff] [blame] | 14 | |
| 15 | namespace webrtc { |
| 16 | |
| 17 | class AudioDeviceModule; |
| 18 | class AudioEncoderFactory; |
| 19 | class AudioDecoderFactory; |
Piotr (Peter) Slatala | e0c2e97 | 2018-10-08 09:43:21 -0700 | [diff] [blame] | 20 | class MediaTransportFactory; |
Sebastian Jansson | 77c0a62 | 2019-04-23 10:24:03 +0200 | [diff] [blame] | 21 | class NetworkControllerFactoryInterface; |
Anders Carlsson | 7bca8ca | 2018-08-30 09:30:29 +0200 | [diff] [blame] | 22 | class VideoEncoderFactory; |
| 23 | class VideoDecoderFactory; |
| 24 | class AudioProcessing; |
Jonas Oreland | 285f83d | 2020-02-07 10:30:08 +0100 | [diff] [blame^] | 25 | struct PeerConnectionDependencies; |
Anders Carlsson | 7bca8ca | 2018-08-30 09:30:29 +0200 | [diff] [blame] | 26 | |
| 27 | } // namespace webrtc |
| 28 | |
| 29 | NS_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) Slatala | e0c2e97 | 2018-10-08 09:43:21 -0700 | [diff] [blame] | 55 | - (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 Jansson | 77c0a62 | 2019-04-23 10:24:03 +0200 | [diff] [blame] | 70 | - (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) Slatala | e0c2e97 | 2018-10-08 09:43:21 -0700 | [diff] [blame] | 87 | - (instancetype)initWithEncoderFactory:(nullable id<RTCVideoEncoderFactory>)encoderFactory |
| 88 | decoderFactory:(nullable id<RTCVideoDecoderFactory>)decoderFactory |
| 89 | mediaTransportFactory: |
| 90 | (std::unique_ptr<webrtc::MediaTransportFactory>)mediaTransportFactory; |
Jonas Oreland | 285f83d | 2020-02-07 10:30:08 +0100 | [diff] [blame^] | 91 | |
| 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 Carlsson | 7bca8ca | 2018-08-30 09:30:29 +0200 | [diff] [blame] | 101 | @end |
| 102 | |
| 103 | NS_ASSUME_NONNULL_END |