Index: webrtc/sdk/objc/Framework/Classes/PeerConnection/RTCPeerConnectionFactory.mm |
diff --git a/webrtc/sdk/objc/Framework/Classes/PeerConnection/RTCPeerConnectionFactory.mm b/webrtc/sdk/objc/Framework/Classes/PeerConnection/RTCPeerConnectionFactory.mm |
index 7c5ba1d16f7e18f1003642fa94aafda8e5bf594c..7accdbbe38752ea85c0b9ae93e2c410f74d152a9 100644 |
--- a/webrtc/sdk/objc/Framework/Classes/PeerConnection/RTCPeerConnectionFactory.mm |
+++ b/webrtc/sdk/objc/Framework/Classes/PeerConnection/RTCPeerConnectionFactory.mm |
@@ -11,7 +11,6 @@ |
#import "RTCPeerConnectionFactory+Private.h" |
#import "NSString+StdString.h" |
-#import "RTCAVFoundationVideoSource+Private.h" |
#import "RTCAudioSource+Private.h" |
#import "RTCAudioTrack+Private.h" |
#import "RTCMediaConstraints+Private.h" |
@@ -19,15 +18,11 @@ |
#import "RTCPeerConnection+Private.h" |
#import "RTCVideoSource+Private.h" |
#import "RTCVideoTrack+Private.h" |
+#import "RTCAVFoundationVideoSource+Private.h" |
#import "WebRTC/RTCLogging.h" |
-#import "WebRTC/RTCVideoCodecFactory.h" |
-#ifndef HAVE_NO_MEDIA |
-#import "WebRTC/RTCVideoCodecH264.h" |
-#endif |
-#include "PeerConnection/objc_video_decoder_factory.h" |
-#include "PeerConnection/objc_video_encoder_factory.h" |
#include "Video/objcvideotracksource.h" |
+#include "VideoToolbox/videocodecfactory.h" |
#include "webrtc/api/videosourceproxy.h" |
// Adding the nogncheck to disable the including header check. |
// The no-media version PeerConnectionFactory doesn't depend on media related |
@@ -46,17 +41,7 @@ |
@synthesize nativeFactory = _nativeFactory; |
- (instancetype)init { |
-#ifdef HAVE_NO_MEDIA |
- return [self initWithEncoderFactory:nil decoderFactory:nil]; |
-#else |
- return [self initWithEncoderFactory:[[RTCVideoEncoderFactoryH264 alloc] init] |
- decoderFactory:[[RTCVideoDecoderFactoryH264 alloc] init]]; |
-#endif |
-} |
- |
-- (instancetype)initWithEncoderFactory:(nullable id<RTCVideoEncoderFactory>)encoderFactory |
- decoderFactory:(nullable id<RTCVideoDecoderFactory>)decoderFactory { |
- if (self = [super init]) { |
+ if ((self = [super init])) { |
_networkThread = rtc::Thread::CreateWithSocketServer(); |
BOOL result = _networkThread->Start(); |
NSAssert(result, @"Failed to start network thread."); |
@@ -83,14 +68,8 @@ |
std::unique_ptr<webrtc::CallFactoryInterface>(), |
std::unique_ptr<webrtc::RtcEventLogFactoryInterface>()); |
#else |
- cricket::WebRtcVideoEncoderFactory *encoder_factory = nullptr; |
- cricket::WebRtcVideoDecoderFactory *decoder_factory = nullptr; |
- if (encoderFactory) { |
- encoder_factory = new webrtc::ObjCVideoEncoderFactory(encoderFactory); |
- } |
- if (decoderFactory) { |
- decoder_factory = new webrtc::ObjCVideoDecoderFactory(decoderFactory); |
- } |
+ const auto encoder_factory = new webrtc::VideoToolboxVideoEncoderFactory(); |
+ const auto decoder_factory = new webrtc::VideoToolboxVideoDecoderFactory(); |
// Ownership of encoder/decoder factories is passed on to the |
// peerconnectionfactory, that handles deleting them. |