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; |
Sebastian Jansson | 77c0a62 | 2019-04-23 10:24:03 +0200 | [diff] [blame] | 20 | class NetworkControllerFactoryInterface; |
Anders Carlsson | 7bca8ca | 2018-08-30 09:30:29 +0200 | [diff] [blame] | 21 | class VideoEncoderFactory; |
| 22 | class VideoDecoderFactory; |
| 23 | class AudioProcessing; |
Jonas Oreland | 285f83d | 2020-02-07 10:30:08 +0100 | [diff] [blame] | 24 | struct PeerConnectionDependencies; |
Anders Carlsson | 7bca8ca | 2018-08-30 09:30:29 +0200 | [diff] [blame] | 25 | |
| 26 | } // namespace webrtc |
| 27 | |
| 28 | NS_ASSUME_NONNULL_BEGIN |
| 29 | |
| 30 | /** |
| 31 | * This class extension exposes methods that work directly with injectable C++ components. |
| 32 | */ |
Mirko Bonadei | a81e9c8 | 2020-05-04 16:14:32 +0200 | [diff] [blame] | 33 | @interface RTC_OBJC_TYPE (RTCPeerConnectionFactory) |
| 34 | () |
Anders Carlsson | 7bca8ca | 2018-08-30 09:30:29 +0200 | [diff] [blame] | 35 | |
Mirko Bonadei | a81e9c8 | 2020-05-04 16:14:32 +0200 | [diff] [blame] | 36 | - (instancetype)initNative NS_DESIGNATED_INITIALIZER; |
Anders Carlsson | 7bca8ca | 2018-08-30 09:30:29 +0200 | [diff] [blame] | 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 |
Sebastian Jansson | 77c0a62 | 2019-04-23 10:24:03 +0200 | [diff] [blame] | 67 | networkControllerFactory:(std::unique_ptr<webrtc::NetworkControllerFactoryInterface>) |
Niels Möller | 938bc33 | 2020-06-10 17:36:17 +0200 | [diff] [blame] | 68 | networkControllerFactory; |
Sebastian Jansson | 77c0a62 | 2019-04-23 10:24:03 +0200 | [diff] [blame] | 69 | |
Mirko Bonadei | a81e9c8 | 2020-05-04 16:14:32 +0200 | [diff] [blame] | 70 | - (instancetype) |
| 71 | initWithEncoderFactory:(nullable id<RTC_OBJC_TYPE(RTCVideoEncoderFactory)>)encoderFactory |
Niels Möller | 938bc33 | 2020-06-10 17:36:17 +0200 | [diff] [blame] | 72 | decoderFactory:(nullable id<RTC_OBJC_TYPE(RTCVideoDecoderFactory)>)decoderFactory; |
Jonas Oreland | 285f83d | 2020-02-07 10:30:08 +0100 | [diff] [blame] | 73 | |
| 74 | /** Initialize an RTCPeerConnection with a configuration, constraints, and |
| 75 | * dependencies. |
| 76 | */ |
Yura Yaroshevich | d140c8f | 2021-03-02 23:25:10 +0300 | [diff] [blame^] | 77 | - (nullable RTC_OBJC_TYPE(RTCPeerConnection) *) |
Mirko Bonadei | a81e9c8 | 2020-05-04 16:14:32 +0200 | [diff] [blame] | 78 | peerConnectionWithDependencies:(RTC_OBJC_TYPE(RTCConfiguration) *)configuration |
| 79 | constraints:(RTC_OBJC_TYPE(RTCMediaConstraints) *)constraints |
Jonas Oreland | 285f83d | 2020-02-07 10:30:08 +0100 | [diff] [blame] | 80 | dependencies:(std::unique_ptr<webrtc::PeerConnectionDependencies>)dependencies |
Mirko Bonadei | a81e9c8 | 2020-05-04 16:14:32 +0200 | [diff] [blame] | 81 | delegate:(nullable id<RTC_OBJC_TYPE(RTCPeerConnectionDelegate)>)delegate; |
Jonas Oreland | 285f83d | 2020-02-07 10:30:08 +0100 | [diff] [blame] | 82 | |
Anders Carlsson | 7bca8ca | 2018-08-30 09:30:29 +0200 | [diff] [blame] | 83 | @end |
| 84 | |
| 85 | NS_ASSUME_NONNULL_END |