blob: f361b9f0ea02f90f8824e7c2d9ecd7bbb4eb45cc [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;
Sebastian Jansson77c0a622019-04-23 10:24:03 +020020class NetworkControllerFactoryInterface;
Anders Carlsson7bca8ca2018-08-30 09:30:29 +020021class VideoEncoderFactory;
22class VideoDecoderFactory;
23class AudioProcessing;
Jonas Oreland285f83d2020-02-07 10:30:08 +010024struct PeerConnectionDependencies;
Anders Carlsson7bca8ca2018-08-30 09:30:29 +020025
26} // namespace webrtc
27
28NS_ASSUME_NONNULL_BEGIN
29
30/**
31 * This class extension exposes methods that work directly with injectable C++ components.
32 */
Mirko Bonadeia81e9c82020-05-04 16:14:32 +020033@interface RTC_OBJC_TYPE (RTCPeerConnectionFactory)
34()
Anders Carlsson7bca8ca2018-08-30 09:30:29 +020035
Mirko Bonadeia81e9c82020-05-04 16:14:32 +020036 - (instancetype)initNative NS_DESIGNATED_INITIALIZER;
Anders Carlsson7bca8ca2018-08-30 09:30:29 +020037
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
Sebastian Jansson77c0a622019-04-23 10:24:03 +020067 networkControllerFactory:(std::unique_ptr<webrtc::NetworkControllerFactoryInterface>)
Niels Möller938bc332020-06-10 17:36:17 +020068 networkControllerFactory;
Sebastian Jansson77c0a622019-04-23 10:24:03 +020069
Mirko Bonadeia81e9c82020-05-04 16:14:32 +020070- (instancetype)
71 initWithEncoderFactory:(nullable id<RTC_OBJC_TYPE(RTCVideoEncoderFactory)>)encoderFactory
Niels Möller938bc332020-06-10 17:36:17 +020072 decoderFactory:(nullable id<RTC_OBJC_TYPE(RTCVideoDecoderFactory)>)decoderFactory;
Jonas Oreland285f83d2020-02-07 10:30:08 +010073
74/** Initialize an RTCPeerConnection with a configuration, constraints, and
75 * dependencies.
76 */
Yura Yaroshevichd140c8f2021-03-02 23:25:10 +030077- (nullable RTC_OBJC_TYPE(RTCPeerConnection) *)
Mirko Bonadeia81e9c82020-05-04 16:14:32 +020078 peerConnectionWithDependencies:(RTC_OBJC_TYPE(RTCConfiguration) *)configuration
79 constraints:(RTC_OBJC_TYPE(RTCMediaConstraints) *)constraints
Jonas Oreland285f83d2020-02-07 10:30:08 +010080 dependencies:(std::unique_ptr<webrtc::PeerConnectionDependencies>)dependencies
Mirko Bonadeia81e9c82020-05-04 16:14:32 +020081 delegate:(nullable id<RTC_OBJC_TYPE(RTCPeerConnectionDelegate)>)delegate;
Jonas Oreland285f83d2020-02-07 10:30:08 +010082
Anders Carlsson7bca8ca2018-08-30 09:30:29 +020083@end
84
85NS_ASSUME_NONNULL_END