2018-08-30 09:30:29 +02:00
|
|
|
/*
|
|
|
|
|
* Copyright 2017 The WebRTC project authors. All Rights Reserved.
|
|
|
|
|
*
|
|
|
|
|
* Use of this source code is governed by a BSD-style license
|
|
|
|
|
* that can be found in the LICENSE file in the root of the source
|
|
|
|
|
* tree. An additional intellectual property rights grant can be found
|
|
|
|
|
* in the file PATENTS. All contributing project authors may
|
|
|
|
|
* be found in the AUTHORS file in the root of the source tree.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#import "RTCPeerConnectionFactory.h"
|
|
|
|
|
|
2024-06-18 16:20:35 +03:00
|
|
|
#include "api/audio/audio_device.h"
|
|
|
|
|
#include "api/audio/audio_processing.h"
|
|
|
|
|
#include "api/audio_codecs/audio_decoder_factory.h"
|
|
|
|
|
#include "api/audio_codecs/audio_encoder_factory.h"
|
2024-11-04 15:45:01 +01:00
|
|
|
#include "api/peer_connection_interface.h"
|
2019-01-25 20:26:48 +01:00
|
|
|
#include "api/scoped_refptr.h"
|
2024-06-18 16:20:35 +03:00
|
|
|
#include "api/transport/network_control.h"
|
|
|
|
|
#include "api/video_codecs/video_decoder_factory.h"
|
|
|
|
|
#include "api/video_codecs/video_encoder_factory.h"
|
2018-08-30 09:30:29 +02:00
|
|
|
|
|
|
|
|
NS_ASSUME_NONNULL_BEGIN
|
|
|
|
|
|
|
|
|
|
/**
|
2025-01-08 05:45:56 -08:00
|
|
|
* This class extension exposes methods that work directly with injectable C++
|
|
|
|
|
* components.
|
2018-08-30 09:30:29 +02:00
|
|
|
*/
|
2020-05-04 16:14:32 +02:00
|
|
|
@interface RTC_OBJC_TYPE (RTCPeerConnectionFactory)
|
|
|
|
|
()
|
2018-08-30 09:30:29 +02:00
|
|
|
|
2025-01-08 05:45:56 -08:00
|
|
|
/* Initializer used when WebRTC is compiled with no media support */
|
|
|
|
|
- (instancetype)initWithNoMedia;
|
2018-08-30 09:30:29 +02:00
|
|
|
|
2024-11-04 15:45:01 +01:00
|
|
|
/* Initialize object with provided dependencies and with media support. */
|
|
|
|
|
- (instancetype)initWithMediaAndDependencies:
|
|
|
|
|
(webrtc::PeerConnectionFactoryDependencies)dependencies;
|
|
|
|
|
|
2025-01-08 05:45:56 -08:00
|
|
|
/* Initialize object with injectable native audio/video encoder/decoder
|
|
|
|
|
* factories */
|
|
|
|
|
- (instancetype)
|
|
|
|
|
initWithNativeAudioEncoderFactory:
|
|
|
|
|
(rtc::scoped_refptr<webrtc::AudioEncoderFactory>)audioEncoderFactory
|
|
|
|
|
nativeAudioDecoderFactory:
|
|
|
|
|
(rtc::scoped_refptr<webrtc::AudioDecoderFactory>)
|
|
|
|
|
audioDecoderFactory
|
|
|
|
|
nativeVideoEncoderFactory:
|
|
|
|
|
(std::unique_ptr<webrtc::VideoEncoderFactory>)
|
|
|
|
|
videoEncoderFactory
|
|
|
|
|
nativeVideoDecoderFactory:
|
|
|
|
|
(std::unique_ptr<webrtc::VideoDecoderFactory>)
|
|
|
|
|
videoDecoderFactory
|
|
|
|
|
audioDeviceModule:
|
|
|
|
|
(nullable webrtc::AudioDeviceModule *)audioDeviceModule
|
|
|
|
|
audioProcessingModule:
|
|
|
|
|
(rtc::scoped_refptr<webrtc::AudioProcessing>)
|
|
|
|
|
audioProcessingModule;
|
2018-08-30 09:30:29 +02:00
|
|
|
|
2019-04-23 10:24:03 +02:00
|
|
|
- (instancetype)
|
|
|
|
|
initWithNativeAudioEncoderFactory:
|
|
|
|
|
(rtc::scoped_refptr<webrtc::AudioEncoderFactory>)audioEncoderFactory
|
|
|
|
|
nativeAudioDecoderFactory:
|
2025-01-08 05:45:56 -08:00
|
|
|
(rtc::scoped_refptr<webrtc::AudioDecoderFactory>)
|
|
|
|
|
audioDecoderFactory
|
2019-04-23 10:24:03 +02:00
|
|
|
nativeVideoEncoderFactory:
|
2025-01-08 05:45:56 -08:00
|
|
|
(std::unique_ptr<webrtc::VideoEncoderFactory>)
|
|
|
|
|
videoEncoderFactory
|
2019-04-23 10:24:03 +02:00
|
|
|
nativeVideoDecoderFactory:
|
2025-01-08 05:45:56 -08:00
|
|
|
(std::unique_ptr<webrtc::VideoDecoderFactory>)
|
|
|
|
|
videoDecoderFactory
|
|
|
|
|
audioDeviceModule:
|
|
|
|
|
(nullable webrtc::AudioDeviceModule *)audioDeviceModule
|
2019-04-23 10:24:03 +02:00
|
|
|
audioProcessingModule:
|
2025-01-08 05:45:56 -08:00
|
|
|
(rtc::scoped_refptr<webrtc::AudioProcessing>)
|
|
|
|
|
audioProcessingModule
|
|
|
|
|
networkControllerFactory:
|
|
|
|
|
(std::unique_ptr<webrtc::NetworkControllerFactoryInterface>)
|
|
|
|
|
networkControllerFactory;
|
2019-04-23 10:24:03 +02:00
|
|
|
|
2020-05-04 16:14:32 +02:00
|
|
|
- (instancetype)
|
2025-01-08 05:45:56 -08:00
|
|
|
initWithEncoderFactory:
|
|
|
|
|
(nullable id<RTC_OBJC_TYPE(RTCVideoEncoderFactory)>)encoderFactory
|
|
|
|
|
decoderFactory:(nullable id<RTC_OBJC_TYPE(RTCVideoDecoderFactory)>)
|
|
|
|
|
decoderFactory;
|
2020-02-07 10:30:08 +01:00
|
|
|
|
|
|
|
|
/** Initialize an RTCPeerConnection with a configuration, constraints, and
|
|
|
|
|
* dependencies.
|
|
|
|
|
*/
|
2021-03-02 23:25:10 +03:00
|
|
|
- (nullable RTC_OBJC_TYPE(RTCPeerConnection) *)
|
2025-01-08 05:45:56 -08:00
|
|
|
peerConnectionWithDependencies:
|
|
|
|
|
(RTC_OBJC_TYPE(RTCConfiguration) *)configuration
|
|
|
|
|
constraints:
|
|
|
|
|
(RTC_OBJC_TYPE(RTCMediaConstraints) *)constraints
|
|
|
|
|
dependencies:
|
|
|
|
|
(std::unique_ptr<webrtc::PeerConnectionDependencies>)
|
|
|
|
|
dependencies
|
|
|
|
|
delegate:(nullable id<RTC_OBJC_TYPE(
|
|
|
|
|
RTCPeerConnectionDelegate)>)delegate;
|
2020-02-07 10:30:08 +01:00
|
|
|
|
2018-08-30 09:30:29 +02:00
|
|
|
@end
|
|
|
|
|
|
|
|
|
|
NS_ASSUME_NONNULL_END
|