Delete MediaTransportFactory from android and objc apis
Bug: webrtc:9719 Change-Id: Ic3e3c4c323dd4550d2f74269ef08f7035bedf0f4 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/176855 Reviewed-by: Stefan Holmer <stefan@webrtc.org> Reviewed-by: Kári Helgason <kthelgason@webrtc.org> Reviewed-by: Sami Kalliomäki <sakal@webrtc.org> Commit-Queue: Niels Moller <nisse@webrtc.org> Cr-Commit-Position: refs/heads/master@{#31510}
This commit is contained in:
@ -946,7 +946,6 @@ if (is_ios || is_mac) {
|
|||||||
"../api/crypto:frame_encryptor_interface",
|
"../api/crypto:frame_encryptor_interface",
|
||||||
"../api/rtc_event_log:rtc_event_log_factory",
|
"../api/rtc_event_log:rtc_event_log_factory",
|
||||||
"../api/task_queue:default_task_queue_factory",
|
"../api/task_queue:default_task_queue_factory",
|
||||||
"../api/transport/media:media_transport_interface",
|
|
||||||
"../api/video:video_frame",
|
"../api/video:video_frame",
|
||||||
"../api/video:video_rtp_headers",
|
"../api/video:video_rtp_headers",
|
||||||
"../api/video_codecs:video_codecs_api",
|
"../api/video_codecs:video_codecs_api",
|
||||||
@ -1217,7 +1216,6 @@ if (is_ios || is_mac) {
|
|||||||
"../api/audio_codecs:audio_codecs_api",
|
"../api/audio_codecs:audio_codecs_api",
|
||||||
"../api/audio_codecs:builtin_audio_decoder_factory",
|
"../api/audio_codecs:builtin_audio_decoder_factory",
|
||||||
"../api/audio_codecs:builtin_audio_encoder_factory",
|
"../api/audio_codecs:builtin_audio_encoder_factory",
|
||||||
"../api/transport/media:media_transport_interface",
|
|
||||||
"../api/video_codecs:video_codecs_api",
|
"../api/video_codecs:video_codecs_api",
|
||||||
"../media:rtc_media_base",
|
"../media:rtc_media_base",
|
||||||
"../modules:module_api",
|
"../modules:module_api",
|
||||||
|
@ -272,7 +272,6 @@ if (is_android) {
|
|||||||
"api/org/webrtc/MediaSource.java",
|
"api/org/webrtc/MediaSource.java",
|
||||||
"api/org/webrtc/MediaStream.java",
|
"api/org/webrtc/MediaStream.java",
|
||||||
"api/org/webrtc/MediaStreamTrack.java",
|
"api/org/webrtc/MediaStreamTrack.java",
|
||||||
"api/org/webrtc/MediaTransportFactoryFactory.java",
|
|
||||||
"api/org/webrtc/NativeLibraryLoader.java",
|
"api/org/webrtc/NativeLibraryLoader.java",
|
||||||
"api/org/webrtc/NativePeerConnectionFactory.java",
|
"api/org/webrtc/NativePeerConnectionFactory.java",
|
||||||
"api/org/webrtc/NetEqFactoryFactory.java",
|
"api/org/webrtc/NetEqFactoryFactory.java",
|
||||||
|
@ -1,22 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright 2018 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.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package org.webrtc;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Factory for creating webrtc::MediaTransportFactory instances.
|
|
||||||
*/
|
|
||||||
public interface MediaTransportFactoryFactory {
|
|
||||||
/**
|
|
||||||
* Dynamically allocates a webrtc::MediaTransportFactory instance and returns a pointer to it.
|
|
||||||
* The caller takes ownership of the object.
|
|
||||||
*/
|
|
||||||
public long createNativeMediaTransportFactory();
|
|
||||||
}
|
|
@ -536,18 +536,6 @@ public class PeerConnection {
|
|||||||
// Null indicates no change to currently configured value.
|
// Null indicates no change to currently configured value.
|
||||||
@Nullable public Boolean allowCodecSwitching;
|
@Nullable public Boolean allowCodecSwitching;
|
||||||
|
|
||||||
/*
|
|
||||||
* Experimental flag that enables a use of media transport. If this is true, the media transport
|
|
||||||
* factory MUST be provided to the PeerConnectionFactory.
|
|
||||||
*/
|
|
||||||
public boolean useMediaTransport;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Experimental flag that enables a use of media transport for data channels. If this is true,
|
|
||||||
* the media transport factory MUST be provided to the PeerConnectionFactory.
|
|
||||||
*/
|
|
||||||
public boolean useMediaTransportForDataChannels;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Defines advanced optional cryptographic settings related to SRTP and
|
* Defines advanced optional cryptographic settings related to SRTP and
|
||||||
* frame encryption for native WebRTC. Setting this will overwrite any
|
* frame encryption for native WebRTC. Setting this will overwrite any
|
||||||
@ -602,8 +590,6 @@ public class PeerConnection {
|
|||||||
networkPreference = AdapterType.UNKNOWN;
|
networkPreference = AdapterType.UNKNOWN;
|
||||||
sdpSemantics = SdpSemantics.PLAN_B;
|
sdpSemantics = SdpSemantics.PLAN_B;
|
||||||
activeResetSrtpParams = false;
|
activeResetSrtpParams = false;
|
||||||
useMediaTransport = false;
|
|
||||||
useMediaTransportForDataChannels = false;
|
|
||||||
cryptoOptions = null;
|
cryptoOptions = null;
|
||||||
turnLoggingId = null;
|
turnLoggingId = null;
|
||||||
allowCodecSwitching = null;
|
allowCodecSwitching = null;
|
||||||
@ -816,16 +802,6 @@ public class PeerConnection {
|
|||||||
return allowCodecSwitching;
|
return allowCodecSwitching;
|
||||||
}
|
}
|
||||||
|
|
||||||
@CalledByNative("RTCConfiguration")
|
|
||||||
boolean getUseMediaTransport() {
|
|
||||||
return useMediaTransport;
|
|
||||||
}
|
|
||||||
|
|
||||||
@CalledByNative("RTCConfiguration")
|
|
||||||
boolean getUseMediaTransportForDataChannels() {
|
|
||||||
return useMediaTransportForDataChannels;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
@CalledByNative("RTCConfiguration")
|
@CalledByNative("RTCConfiguration")
|
||||||
CryptoOptions getCryptoOptions() {
|
CryptoOptions getCryptoOptions() {
|
||||||
|
@ -175,7 +175,6 @@ public class PeerConnectionFactory {
|
|||||||
@Nullable private FecControllerFactoryFactoryInterface fecControllerFactoryFactory;
|
@Nullable private FecControllerFactoryFactoryInterface fecControllerFactoryFactory;
|
||||||
@Nullable private NetworkControllerFactoryFactory networkControllerFactoryFactory;
|
@Nullable private NetworkControllerFactoryFactory networkControllerFactoryFactory;
|
||||||
@Nullable private NetworkStatePredictorFactoryFactory networkStatePredictorFactoryFactory;
|
@Nullable private NetworkStatePredictorFactoryFactory networkStatePredictorFactoryFactory;
|
||||||
@Nullable private MediaTransportFactoryFactory mediaTransportFactoryFactory;
|
|
||||||
@Nullable private NetEqFactoryFactory neteqFactoryFactory;
|
@Nullable private NetEqFactoryFactory neteqFactoryFactory;
|
||||||
|
|
||||||
private Builder() {}
|
private Builder() {}
|
||||||
@ -247,13 +246,6 @@ public class PeerConnectionFactory {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Sets a MediaTransportFactoryFactory for a PeerConnectionFactory. */
|
|
||||||
public Builder setMediaTransportFactoryFactory(
|
|
||||||
MediaTransportFactoryFactory mediaTransportFactoryFactory) {
|
|
||||||
this.mediaTransportFactoryFactory = mediaTransportFactoryFactory;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets a NetEqFactoryFactory for the PeerConnectionFactory. When using a
|
* Sets a NetEqFactoryFactory for the PeerConnectionFactory. When using a
|
||||||
* custom NetEqFactoryFactory, the AudioDecoderFactoryFactory will be set
|
* custom NetEqFactoryFactory, the AudioDecoderFactoryFactory will be set
|
||||||
@ -284,9 +276,6 @@ public class PeerConnectionFactory {
|
|||||||
networkStatePredictorFactoryFactory == null
|
networkStatePredictorFactoryFactory == null
|
||||||
? 0
|
? 0
|
||||||
: networkStatePredictorFactoryFactory.createNativeNetworkStatePredictorFactory(),
|
: networkStatePredictorFactoryFactory.createNativeNetworkStatePredictorFactory(),
|
||||||
mediaTransportFactoryFactory == null
|
|
||||||
? 0
|
|
||||||
: mediaTransportFactoryFactory.createNativeMediaTransportFactory(),
|
|
||||||
neteqFactoryFactory == null ? 0 : neteqFactoryFactory.createNativeNetEqFactory());
|
neteqFactoryFactory == null ? 0 : neteqFactoryFactory.createNativeNetEqFactory());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -607,7 +596,7 @@ public class PeerConnectionFactory {
|
|||||||
long audioDecoderFactory, VideoEncoderFactory encoderFactory,
|
long audioDecoderFactory, VideoEncoderFactory encoderFactory,
|
||||||
VideoDecoderFactory decoderFactory, long nativeAudioProcessor,
|
VideoDecoderFactory decoderFactory, long nativeAudioProcessor,
|
||||||
long nativeFecControllerFactory, long nativeNetworkControllerFactory,
|
long nativeFecControllerFactory, long nativeNetworkControllerFactory,
|
||||||
long nativeNetworkStatePredictorFactory, long mediaTransportFactory, long neteqFactory);
|
long nativeNetworkStatePredictorFactory, long neteqFactory);
|
||||||
|
|
||||||
private static native long nativeCreatePeerConnection(long factory,
|
private static native long nativeCreatePeerConnection(long factory,
|
||||||
PeerConnection.RTCConfiguration rtcConfig, MediaConstraints constraints, long nativeObserver,
|
PeerConnection.RTCConfiguration rtcConfig, MediaConstraints constraints, long nativeObserver,
|
||||||
|
@ -264,11 +264,6 @@ void JavaToNativeRTCConfiguration(
|
|||||||
rtc_config->sdp_semantics = JavaToNativeSdpSemantics(jni, j_sdp_semantics);
|
rtc_config->sdp_semantics = JavaToNativeSdpSemantics(jni, j_sdp_semantics);
|
||||||
rtc_config->active_reset_srtp_params =
|
rtc_config->active_reset_srtp_params =
|
||||||
Java_RTCConfiguration_getActiveResetSrtpParams(jni, j_rtc_config);
|
Java_RTCConfiguration_getActiveResetSrtpParams(jni, j_rtc_config);
|
||||||
rtc_config->use_media_transport =
|
|
||||||
Java_RTCConfiguration_getUseMediaTransport(jni, j_rtc_config);
|
|
||||||
rtc_config->use_media_transport_for_data_channels =
|
|
||||||
Java_RTCConfiguration_getUseMediaTransportForDataChannels(jni,
|
|
||||||
j_rtc_config);
|
|
||||||
rtc_config->crypto_options =
|
rtc_config->crypto_options =
|
||||||
JavaToNativeOptionalCryptoOptions(jni, j_crypto_options);
|
JavaToNativeOptionalCryptoOptions(jni, j_crypto_options);
|
||||||
|
|
||||||
|
@ -246,7 +246,7 @@ static void JNI_PeerConnectionFactory_ShutdownInternalTracer(JNIEnv* jni) {
|
|||||||
|
|
||||||
// Following parameters are optional:
|
// Following parameters are optional:
|
||||||
// |audio_device_module|, |jencoder_factory|, |jdecoder_factory|,
|
// |audio_device_module|, |jencoder_factory|, |jdecoder_factory|,
|
||||||
// |audio_processor|, |media_transport_factory|, |fec_controller_factory|,
|
// |audio_processor|, |fec_controller_factory|,
|
||||||
// |network_state_predictor_factory|, |neteq_factory|.
|
// |network_state_predictor_factory|, |neteq_factory|.
|
||||||
ScopedJavaLocalRef<jobject> CreatePeerConnectionFactoryForJava(
|
ScopedJavaLocalRef<jobject> CreatePeerConnectionFactoryForJava(
|
||||||
JNIEnv* jni,
|
JNIEnv* jni,
|
||||||
@ -263,7 +263,6 @@ ScopedJavaLocalRef<jobject> CreatePeerConnectionFactoryForJava(
|
|||||||
network_controller_factory,
|
network_controller_factory,
|
||||||
std::unique_ptr<NetworkStatePredictorFactoryInterface>
|
std::unique_ptr<NetworkStatePredictorFactoryInterface>
|
||||||
network_state_predictor_factory,
|
network_state_predictor_factory,
|
||||||
std::unique_ptr<MediaTransportFactory> media_transport_factory,
|
|
||||||
std::unique_ptr<NetEqFactory> neteq_factory) {
|
std::unique_ptr<NetEqFactory> neteq_factory) {
|
||||||
// talk/ assumes pretty widely that the current Thread is ThreadManager'd, but
|
// talk/ assumes pretty widely that the current Thread is ThreadManager'd, but
|
||||||
// ThreadManager only WrapCurrentThread()s the thread where it is first
|
// ThreadManager only WrapCurrentThread()s the thread where it is first
|
||||||
@ -310,7 +309,6 @@ ScopedJavaLocalRef<jobject> CreatePeerConnectionFactoryForJava(
|
|||||||
std::move(network_controller_factory);
|
std::move(network_controller_factory);
|
||||||
dependencies.network_state_predictor_factory =
|
dependencies.network_state_predictor_factory =
|
||||||
std::move(network_state_predictor_factory);
|
std::move(network_state_predictor_factory);
|
||||||
dependencies.media_transport_factory = std::move(media_transport_factory);
|
|
||||||
dependencies.neteq_factory = std::move(neteq_factory);
|
dependencies.neteq_factory = std::move(neteq_factory);
|
||||||
|
|
||||||
cricket::MediaEngineDependencies media_dependencies;
|
cricket::MediaEngineDependencies media_dependencies;
|
||||||
@ -355,7 +353,6 @@ JNI_PeerConnectionFactory_CreatePeerConnectionFactory(
|
|||||||
jlong native_fec_controller_factory,
|
jlong native_fec_controller_factory,
|
||||||
jlong native_network_controller_factory,
|
jlong native_network_controller_factory,
|
||||||
jlong native_network_state_predictor_factory,
|
jlong native_network_state_predictor_factory,
|
||||||
jlong native_media_transport_factory,
|
|
||||||
jlong native_neteq_factory) {
|
jlong native_neteq_factory) {
|
||||||
rtc::scoped_refptr<AudioProcessing> audio_processor =
|
rtc::scoped_refptr<AudioProcessing> audio_processor =
|
||||||
reinterpret_cast<AudioProcessing*>(native_audio_processor);
|
reinterpret_cast<AudioProcessing*>(native_audio_processor);
|
||||||
@ -372,8 +369,6 @@ JNI_PeerConnectionFactory_CreatePeerConnectionFactory(
|
|||||||
native_network_controller_factory),
|
native_network_controller_factory),
|
||||||
TakeOwnershipOfUniquePtr<NetworkStatePredictorFactoryInterface>(
|
TakeOwnershipOfUniquePtr<NetworkStatePredictorFactoryInterface>(
|
||||||
native_network_state_predictor_factory),
|
native_network_state_predictor_factory),
|
||||||
TakeOwnershipOfUniquePtr<MediaTransportFactory>(
|
|
||||||
native_media_transport_factory),
|
|
||||||
TakeOwnershipOfUniquePtr<NetEqFactory>(native_neteq_factory));
|
TakeOwnershipOfUniquePtr<NetEqFactory>(native_neteq_factory));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -197,18 +197,6 @@ RTC_OBJC_EXPORT
|
|||||||
|
|
||||||
@property(nonatomic, assign) BOOL allowCodecSwitching;
|
@property(nonatomic, assign) BOOL allowCodecSwitching;
|
||||||
|
|
||||||
/**
|
|
||||||
* If MediaTransportFactory is provided in PeerConnectionFactory, this flag informs PeerConnection
|
|
||||||
* that it should use the MediaTransportInterface.
|
|
||||||
*/
|
|
||||||
@property(nonatomic, assign) BOOL useMediaTransport;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* If MediaTransportFactory is provided in PeerConnectionFactory, this flag informs PeerConnection
|
|
||||||
* that it should use the MediaTransportInterface for data channels.
|
|
||||||
*/
|
|
||||||
@property(nonatomic, assign) BOOL useMediaTransportForDataChannels;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Defines advanced optional cryptographic settings related to SRTP and
|
* Defines advanced optional cryptographic settings related to SRTP and
|
||||||
* frame encryption for native WebRTC. Setting this will overwrite any
|
* frame encryption for native WebRTC. Setting this will overwrite any
|
||||||
|
@ -52,8 +52,6 @@
|
|||||||
@synthesize turnCustomizer = _turnCustomizer;
|
@synthesize turnCustomizer = _turnCustomizer;
|
||||||
@synthesize activeResetSrtpParams = _activeResetSrtpParams;
|
@synthesize activeResetSrtpParams = _activeResetSrtpParams;
|
||||||
@synthesize allowCodecSwitching = _allowCodecSwitching;
|
@synthesize allowCodecSwitching = _allowCodecSwitching;
|
||||||
@synthesize useMediaTransport = _useMediaTransport;
|
|
||||||
@synthesize useMediaTransportForDataChannels = _useMediaTransportForDataChannels;
|
|
||||||
@synthesize cryptoOptions = _cryptoOptions;
|
@synthesize cryptoOptions = _cryptoOptions;
|
||||||
@synthesize rtcpAudioReportIntervalMs = _rtcpAudioReportIntervalMs;
|
@synthesize rtcpAudioReportIntervalMs = _rtcpAudioReportIntervalMs;
|
||||||
@synthesize rtcpVideoReportIntervalMs = _rtcpVideoReportIntervalMs;
|
@synthesize rtcpVideoReportIntervalMs = _rtcpVideoReportIntervalMs;
|
||||||
@ -106,8 +104,6 @@
|
|||||||
_iceConnectionReceivingTimeout = config.ice_connection_receiving_timeout;
|
_iceConnectionReceivingTimeout = config.ice_connection_receiving_timeout;
|
||||||
_iceBackupCandidatePairPingInterval =
|
_iceBackupCandidatePairPingInterval =
|
||||||
config.ice_backup_candidate_pair_ping_interval;
|
config.ice_backup_candidate_pair_ping_interval;
|
||||||
_useMediaTransport = config.use_media_transport;
|
|
||||||
_useMediaTransportForDataChannels = config.use_media_transport_for_data_channels;
|
|
||||||
_keyType = RTCEncryptionKeyTypeECDSA;
|
_keyType = RTCEncryptionKeyTypeECDSA;
|
||||||
_iceCandidatePoolSize = config.ice_candidate_pool_size;
|
_iceCandidatePoolSize = config.ice_candidate_pool_size;
|
||||||
_shouldPruneTurnPorts = config.prune_turn_ports;
|
_shouldPruneTurnPorts = config.prune_turn_ports;
|
||||||
@ -143,7 +139,7 @@
|
|||||||
- (NSString *)description {
|
- (NSString *)description {
|
||||||
static NSString *formatString = @"RTC_OBJC_TYPE(RTCConfiguration): "
|
static NSString *formatString = @"RTC_OBJC_TYPE(RTCConfiguration): "
|
||||||
@"{\n%@\n%@\n%@\n%@\n%@\n%@\n%@\n%@\n%d\n%d\n%d\n%d\n%d\n%d\n"
|
@"{\n%@\n%@\n%@\n%@\n%@\n%@\n%@\n%@\n%d\n%d\n%d\n%d\n%d\n%d\n"
|
||||||
@"%d\n%@\n%d\n%d\n%d\n%d\n%d\n%@\n%d\n}\n";
|
@"%d\n%@\n%d\n%d\n%d\n%d\n%d\n%@\n}\n";
|
||||||
|
|
||||||
return [NSString
|
return [NSString
|
||||||
stringWithFormat:formatString,
|
stringWithFormat:formatString,
|
||||||
@ -169,7 +165,6 @@
|
|||||||
_disableIPV6OnWiFi,
|
_disableIPV6OnWiFi,
|
||||||
_maxIPv6Networks,
|
_maxIPv6Networks,
|
||||||
_activeResetSrtpParams,
|
_activeResetSrtpParams,
|
||||||
_useMediaTransport,
|
|
||||||
_enableDscp];
|
_enableDscp];
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -208,8 +203,6 @@
|
|||||||
_iceConnectionReceivingTimeout;
|
_iceConnectionReceivingTimeout;
|
||||||
nativeConfig->ice_backup_candidate_pair_ping_interval =
|
nativeConfig->ice_backup_candidate_pair_ping_interval =
|
||||||
_iceBackupCandidatePairPingInterval;
|
_iceBackupCandidatePairPingInterval;
|
||||||
nativeConfig->use_media_transport = _useMediaTransport;
|
|
||||||
nativeConfig->use_media_transport_for_data_channels = _useMediaTransportForDataChannels;
|
|
||||||
rtc::KeyType keyType =
|
rtc::KeyType keyType =
|
||||||
[[self class] nativeEncryptionKeyTypeForKeyType:_keyType];
|
[[self class] nativeEncryptionKeyTypeForKeyType:_keyType];
|
||||||
if (_certificate != nullptr) {
|
if (_certificate != nullptr) {
|
||||||
|
@ -29,7 +29,6 @@
|
|||||||
|
|
||||||
#include "api/jsep_ice_candidate.h"
|
#include "api/jsep_ice_candidate.h"
|
||||||
#include "api/rtc_event_log_output_file.h"
|
#include "api/rtc_event_log_output_file.h"
|
||||||
#include "api/transport/media/media_transport_interface.h"
|
|
||||||
#include "rtc_base/checks.h"
|
#include "rtc_base/checks.h"
|
||||||
#include "rtc_base/numerics/safe_conversions.h"
|
#include "rtc_base/numerics/safe_conversions.h"
|
||||||
|
|
||||||
|
@ -17,7 +17,6 @@ namespace webrtc {
|
|||||||
class AudioDeviceModule;
|
class AudioDeviceModule;
|
||||||
class AudioEncoderFactory;
|
class AudioEncoderFactory;
|
||||||
class AudioDecoderFactory;
|
class AudioDecoderFactory;
|
||||||
class MediaTransportFactory;
|
|
||||||
class NetworkControllerFactoryInterface;
|
class NetworkControllerFactoryInterface;
|
||||||
class VideoEncoderFactory;
|
class VideoEncoderFactory;
|
||||||
class VideoDecoderFactory;
|
class VideoDecoderFactory;
|
||||||
@ -53,21 +52,6 @@ NS_ASSUME_NONNULL_BEGIN
|
|||||||
audioProcessingModule:
|
audioProcessingModule:
|
||||||
(rtc::scoped_refptr<webrtc::AudioProcessing>)audioProcessingModule;
|
(rtc::scoped_refptr<webrtc::AudioProcessing>)audioProcessingModule;
|
||||||
|
|
||||||
- (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
|
|
||||||
mediaTransportFactory:
|
|
||||||
(std::unique_ptr<webrtc::MediaTransportFactory>)mediaTransportFactory;
|
|
||||||
|
|
||||||
- (instancetype)
|
- (instancetype)
|
||||||
initWithNativeAudioEncoderFactory:
|
initWithNativeAudioEncoderFactory:
|
||||||
(rtc::scoped_refptr<webrtc::AudioEncoderFactory>)audioEncoderFactory
|
(rtc::scoped_refptr<webrtc::AudioEncoderFactory>)audioEncoderFactory
|
||||||
@ -81,14 +65,11 @@ NS_ASSUME_NONNULL_BEGIN
|
|||||||
audioProcessingModule:
|
audioProcessingModule:
|
||||||
(rtc::scoped_refptr<webrtc::AudioProcessing>)audioProcessingModule
|
(rtc::scoped_refptr<webrtc::AudioProcessing>)audioProcessingModule
|
||||||
networkControllerFactory:(std::unique_ptr<webrtc::NetworkControllerFactoryInterface>)
|
networkControllerFactory:(std::unique_ptr<webrtc::NetworkControllerFactoryInterface>)
|
||||||
networkControllerFactory
|
networkControllerFactory;
|
||||||
mediaTransportFactory:
|
|
||||||
(std::unique_ptr<webrtc::MediaTransportFactory>)mediaTransportFactory;
|
|
||||||
|
|
||||||
- (instancetype)
|
- (instancetype)
|
||||||
initWithEncoderFactory:(nullable id<RTC_OBJC_TYPE(RTCVideoEncoderFactory)>)encoderFactory
|
initWithEncoderFactory:(nullable id<RTC_OBJC_TYPE(RTCVideoEncoderFactory)>)encoderFactory
|
||||||
decoderFactory:(nullable id<RTC_OBJC_TYPE(RTCVideoDecoderFactory)>)decoderFactory
|
decoderFactory:(nullable id<RTC_OBJC_TYPE(RTCVideoDecoderFactory)>)decoderFactory;
|
||||||
mediaTransportFactory:(std::unique_ptr<webrtc::MediaTransportFactory>)mediaTransportFactory;
|
|
||||||
|
|
||||||
/** Initialize an RTCPeerConnection with a configuration, constraints, and
|
/** Initialize an RTCPeerConnection with a configuration, constraints, and
|
||||||
* dependencies.
|
* dependencies.
|
||||||
|
@ -52,7 +52,6 @@
|
|||||||
// C++ target.
|
// C++ target.
|
||||||
// TODO(zhihuang): Remove nogncheck once MediaEngineInterface is moved to C++
|
// TODO(zhihuang): Remove nogncheck once MediaEngineInterface is moved to C++
|
||||||
// API layer.
|
// API layer.
|
||||||
#include "api/transport/media/media_transport_interface.h"
|
|
||||||
#include "media/engine/webrtc_media_engine.h" // nogncheck
|
#include "media/engine/webrtc_media_engine.h" // nogncheck
|
||||||
|
|
||||||
@implementation RTC_OBJC_TYPE (RTCPeerConnectionFactory) {
|
@implementation RTC_OBJC_TYPE (RTCPeerConnectionFactory) {
|
||||||
@ -84,15 +83,13 @@
|
|||||||
nativeVideoDecoderFactory:webrtc::ObjCToNativeVideoDecoderFactory([[RTC_OBJC_TYPE(
|
nativeVideoDecoderFactory:webrtc::ObjCToNativeVideoDecoderFactory([[RTC_OBJC_TYPE(
|
||||||
RTCVideoDecoderFactoryH264) alloc] init])
|
RTCVideoDecoderFactoryH264) alloc] init])
|
||||||
audioDeviceModule:[self audioDeviceModule]
|
audioDeviceModule:[self audioDeviceModule]
|
||||||
audioProcessingModule:nullptr
|
audioProcessingModule:nullptr];
|
||||||
mediaTransportFactory:nullptr];
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
- (instancetype)
|
- (instancetype)
|
||||||
initWithEncoderFactory:(nullable id<RTC_OBJC_TYPE(RTCVideoEncoderFactory)>)encoderFactory
|
initWithEncoderFactory:(nullable id<RTC_OBJC_TYPE(RTCVideoEncoderFactory)>)encoderFactory
|
||||||
decoderFactory:(nullable id<RTC_OBJC_TYPE(RTCVideoDecoderFactory)>)decoderFactory
|
decoderFactory:(nullable id<RTC_OBJC_TYPE(RTCVideoDecoderFactory)>)decoderFactory {
|
||||||
mediaTransportFactory:(std::unique_ptr<webrtc::MediaTransportFactory>)mediaTransportFactory {
|
|
||||||
#ifdef HAVE_NO_MEDIA
|
#ifdef HAVE_NO_MEDIA
|
||||||
return [self initWithNoMedia];
|
return [self initWithNoMedia];
|
||||||
#else
|
#else
|
||||||
@ -109,18 +106,9 @@
|
|||||||
nativeVideoEncoderFactory:std::move(native_encoder_factory)
|
nativeVideoEncoderFactory:std::move(native_encoder_factory)
|
||||||
nativeVideoDecoderFactory:std::move(native_decoder_factory)
|
nativeVideoDecoderFactory:std::move(native_decoder_factory)
|
||||||
audioDeviceModule:[self audioDeviceModule]
|
audioDeviceModule:[self audioDeviceModule]
|
||||||
audioProcessingModule:nullptr
|
audioProcessingModule:nullptr];
|
||||||
mediaTransportFactory:std::move(mediaTransportFactory)];
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
- (instancetype)
|
|
||||||
initWithEncoderFactory:(nullable id<RTC_OBJC_TYPE(RTCVideoEncoderFactory)>)encoderFactory
|
|
||||||
decoderFactory:(nullable id<RTC_OBJC_TYPE(RTCVideoDecoderFactory)>)decoderFactory {
|
|
||||||
return [self initWithEncoderFactory:encoderFactory
|
|
||||||
decoderFactory:decoderFactory
|
|
||||||
mediaTransportFactory:nullptr];
|
|
||||||
}
|
|
||||||
|
|
||||||
- (instancetype)initNative {
|
- (instancetype)initNative {
|
||||||
if (self = [super init]) {
|
if (self = [super init]) {
|
||||||
_networkThread = rtc::Thread::CreateWithSocketServer();
|
_networkThread = rtc::Thread::CreateWithSocketServer();
|
||||||
@ -170,30 +158,7 @@
|
|||||||
nativeVideoDecoderFactory:std::move(videoDecoderFactory)
|
nativeVideoDecoderFactory:std::move(videoDecoderFactory)
|
||||||
audioDeviceModule:audioDeviceModule
|
audioDeviceModule:audioDeviceModule
|
||||||
audioProcessingModule:audioProcessingModule
|
audioProcessingModule:audioProcessingModule
|
||||||
mediaTransportFactory:nullptr];
|
networkControllerFactory:nullptr];
|
||||||
}
|
|
||||||
|
|
||||||
- (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:(webrtc::AudioDeviceModule *)audioDeviceModule
|
|
||||||
audioProcessingModule:
|
|
||||||
(rtc::scoped_refptr<webrtc::AudioProcessing>)audioProcessingModule
|
|
||||||
mediaTransportFactory:(std::unique_ptr<webrtc::MediaTransportFactory>)
|
|
||||||
mediaTransportFactory {
|
|
||||||
return [self initWithNativeAudioEncoderFactory:audioEncoderFactory
|
|
||||||
nativeAudioDecoderFactory:audioDecoderFactory
|
|
||||||
nativeVideoEncoderFactory:std::move(videoEncoderFactory)
|
|
||||||
nativeVideoDecoderFactory:std::move(videoDecoderFactory)
|
|
||||||
audioDeviceModule:audioDeviceModule
|
|
||||||
audioProcessingModule:audioProcessingModule
|
|
||||||
networkControllerFactory:nullptr
|
|
||||||
mediaTransportFactory:std::move(mediaTransportFactory)];
|
|
||||||
}
|
}
|
||||||
- (instancetype)initWithNativeAudioEncoderFactory:
|
- (instancetype)initWithNativeAudioEncoderFactory:
|
||||||
(rtc::scoped_refptr<webrtc::AudioEncoderFactory>)audioEncoderFactory
|
(rtc::scoped_refptr<webrtc::AudioEncoderFactory>)audioEncoderFactory
|
||||||
@ -208,9 +173,7 @@
|
|||||||
(rtc::scoped_refptr<webrtc::AudioProcessing>)audioProcessingModule
|
(rtc::scoped_refptr<webrtc::AudioProcessing>)audioProcessingModule
|
||||||
networkControllerFactory:
|
networkControllerFactory:
|
||||||
(std::unique_ptr<webrtc::NetworkControllerFactoryInterface>)
|
(std::unique_ptr<webrtc::NetworkControllerFactoryInterface>)
|
||||||
networkControllerFactory
|
networkControllerFactory {
|
||||||
mediaTransportFactory:(std::unique_ptr<webrtc::MediaTransportFactory>)
|
|
||||||
mediaTransportFactory {
|
|
||||||
if (self = [self initNative]) {
|
if (self = [self initNative]) {
|
||||||
webrtc::PeerConnectionFactoryDependencies dependencies;
|
webrtc::PeerConnectionFactoryDependencies dependencies;
|
||||||
dependencies.network_thread = _networkThread.get();
|
dependencies.network_thread = _networkThread.get();
|
||||||
@ -235,7 +198,6 @@
|
|||||||
dependencies.event_log_factory =
|
dependencies.event_log_factory =
|
||||||
std::make_unique<webrtc::RtcEventLogFactory>(dependencies.task_queue_factory.get());
|
std::make_unique<webrtc::RtcEventLogFactory>(dependencies.task_queue_factory.get());
|
||||||
dependencies.network_controller_factory = std::move(networkControllerFactory);
|
dependencies.network_controller_factory = std::move(networkControllerFactory);
|
||||||
dependencies.media_transport_factory = std::move(mediaTransportFactory);
|
|
||||||
#endif
|
#endif
|
||||||
_nativeFactory = webrtc::CreateModularPeerConnectionFactory(std::move(dependencies));
|
_nativeFactory = webrtc::CreateModularPeerConnectionFactory(std::move(dependencies));
|
||||||
NSAssert(_nativeFactory, @"Failed to initialize PeerConnectionFactory!");
|
NSAssert(_nativeFactory, @"Failed to initialize PeerConnectionFactory!");
|
||||||
|
@ -13,7 +13,6 @@
|
|||||||
|
|
||||||
#include "api/audio_codecs/audio_decoder_factory.h"
|
#include "api/audio_codecs/audio_decoder_factory.h"
|
||||||
#include "api/audio_codecs/audio_encoder_factory.h"
|
#include "api/audio_codecs/audio_encoder_factory.h"
|
||||||
#include "api/transport/media/media_transport_interface.h"
|
|
||||||
#include "api/video_codecs/video_decoder_factory.h"
|
#include "api/video_codecs/video_decoder_factory.h"
|
||||||
#include "api/video_codecs/video_encoder_factory.h"
|
#include "api/video_codecs/video_encoder_factory.h"
|
||||||
#include "modules/audio_device/include/audio_device.h"
|
#include "modules/audio_device/include/audio_device.h"
|
||||||
@ -26,7 +25,6 @@
|
|||||||
rtc::scoped_refptr<webrtc::AudioDecoderFactory> _audioDecoderFactory;
|
rtc::scoped_refptr<webrtc::AudioDecoderFactory> _audioDecoderFactory;
|
||||||
rtc::scoped_refptr<webrtc::AudioDeviceModule> _audioDeviceModule;
|
rtc::scoped_refptr<webrtc::AudioDeviceModule> _audioDeviceModule;
|
||||||
rtc::scoped_refptr<webrtc::AudioProcessing> _audioProcessingModule;
|
rtc::scoped_refptr<webrtc::AudioProcessing> _audioProcessingModule;
|
||||||
std::unique_ptr<webrtc::MediaTransportFactory> _mediaTransportFactory;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
+ (RTCPeerConnectionFactoryBuilder *)builder {
|
+ (RTCPeerConnectionFactoryBuilder *)builder {
|
||||||
@ -41,8 +39,7 @@
|
|||||||
nativeVideoEncoderFactory:std::move(_videoEncoderFactory)
|
nativeVideoEncoderFactory:std::move(_videoEncoderFactory)
|
||||||
nativeVideoDecoderFactory:std::move(_videoDecoderFactory)
|
nativeVideoDecoderFactory:std::move(_videoDecoderFactory)
|
||||||
audioDeviceModule:_audioDeviceModule
|
audioDeviceModule:_audioDeviceModule
|
||||||
audioProcessingModule:_audioProcessingModule
|
audioProcessingModule:_audioProcessingModule];
|
||||||
mediaTransportFactory:std::move(_mediaTransportFactory)];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)setVideoEncoderFactory:(std::unique_ptr<webrtc::VideoEncoderFactory>)videoEncoderFactory {
|
- (void)setVideoEncoderFactory:(std::unique_ptr<webrtc::VideoEncoderFactory>)videoEncoderFactory {
|
||||||
|
@ -22,7 +22,6 @@ extern "C" {
|
|||||||
|
|
||||||
#include "api/audio_codecs/builtin_audio_decoder_factory.h"
|
#include "api/audio_codecs/builtin_audio_decoder_factory.h"
|
||||||
#include "api/audio_codecs/builtin_audio_encoder_factory.h"
|
#include "api/audio_codecs/builtin_audio_encoder_factory.h"
|
||||||
#include "api/transport/media/media_transport_interface.h"
|
|
||||||
#include "api/video_codecs/video_decoder_factory.h"
|
#include "api/video_codecs/video_decoder_factory.h"
|
||||||
#include "api/video_codecs/video_encoder_factory.h"
|
#include "api/video_codecs/video_encoder_factory.h"
|
||||||
#include "modules/audio_device/include/audio_device.h"
|
#include "modules/audio_device/include/audio_device.h"
|
||||||
@ -50,8 +49,7 @@ extern "C" {
|
|||||||
nativeVideoEncoderFactory:nullptr
|
nativeVideoEncoderFactory:nullptr
|
||||||
nativeVideoDecoderFactory:nullptr
|
nativeVideoDecoderFactory:nullptr
|
||||||
audioDeviceModule:nullptr
|
audioDeviceModule:nullptr
|
||||||
audioProcessingModule:nullptr
|
audioProcessingModule:nullptr]);
|
||||||
mediaTransportFactory:nullptr]);
|
|
||||||
#endif
|
#endif
|
||||||
RTCPeerConnectionFactoryBuilder* builder = [[RTCPeerConnectionFactoryBuilder alloc] init];
|
RTCPeerConnectionFactoryBuilder* builder = [[RTCPeerConnectionFactoryBuilder alloc] init];
|
||||||
RTC_OBJC_TYPE(RTCPeerConnectionFactory)* peerConnectionFactory =
|
RTC_OBJC_TYPE(RTCPeerConnectionFactory)* peerConnectionFactory =
|
||||||
@ -72,8 +70,7 @@ extern "C" {
|
|||||||
nativeVideoEncoderFactory:nullptr
|
nativeVideoEncoderFactory:nullptr
|
||||||
nativeVideoDecoderFactory:nullptr
|
nativeVideoDecoderFactory:nullptr
|
||||||
audioDeviceModule:nullptr
|
audioDeviceModule:nullptr
|
||||||
audioProcessingModule:nullptr
|
audioProcessingModule:nullptr]);
|
||||||
mediaTransportFactory:nullptr]);
|
|
||||||
#endif
|
#endif
|
||||||
RTCPeerConnectionFactoryBuilder* builder = [RTCPeerConnectionFactoryBuilder defaultBuilder];
|
RTCPeerConnectionFactoryBuilder* builder = [RTCPeerConnectionFactoryBuilder defaultBuilder];
|
||||||
RTC_OBJC_TYPE(RTCPeerConnectionFactory)* peerConnectionFactory =
|
RTC_OBJC_TYPE(RTCPeerConnectionFactory)* peerConnectionFactory =
|
||||||
|
Reference in New Issue
Block a user