Index: webrtc/sdk/objc/Framework/Classes/PeerConnection/RTCPeerConnectionFactory+Video.mm |
diff --git a/webrtc/sdk/objc/Framework/Classes/PeerConnection/RTCPeerConnectionFactory+Video.mm b/webrtc/sdk/objc/Framework/Classes/PeerConnection/RTCPeerConnectionFactory+Video.mm |
new file mode 100644 |
index 0000000000000000000000000000000000000000..8fb5807ed6b4d3199993683cb2a130b3790dcad3 |
--- /dev/null |
+++ b/webrtc/sdk/objc/Framework/Classes/PeerConnection/RTCPeerConnectionFactory+Video.mm |
@@ -0,0 +1,60 @@ |
+/* |
+ * 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+Private.h" |
+ |
+#import "NSString+StdString.h" |
+#import "RTCAVFoundationVideoSource+Private.h" |
+#import "RTCAudioSource+Private.h" |
+#import "RTCAudioTrack+Private.h" |
+#import "RTCMediaConstraints+Private.h" |
+#import "RTCMediaStream+Private.h" |
+#import "RTCPeerConnection+Private.h" |
+#import "RTCVideoSource+Private.h" |
+#import "RTCVideoTrack+Private.h" |
+#import "WebRTC/RTCLogging.h" |
+ |
+#include "Video/objcvideotracksource.h" |
+#include "VideoToolbox/videocodecfactory.h" |
+#include "webrtc/api/videosourceproxy.h" |
+ |
+@implementation RTCPeerConnectionFactory (Video) |
tkchin_webrtc
2017/06/20 21:51:24
ditto: why separate file?
|
+ |
+- (RTCAVFoundationVideoSource *)avFoundationVideoSourceWithConstraints: |
+ (nullable RTCMediaConstraints *)constraints { |
+#ifdef HAVE_RTC_VIDEO |
+ return [[RTCAVFoundationVideoSource alloc] initWithFactory:self constraints:constraints]; |
+#else |
+ return nil; |
+#endif |
+} |
+ |
+- (RTCVideoSource *)videoSource { |
+#ifdef HAVE_RTC_VIDEO |
+ rtc::scoped_refptr<webrtc::ObjcVideoTrackSource> objcVideoTrackSource( |
+ new rtc::RefCountedObject<webrtc::ObjcVideoTrackSource>()); |
+ return [[RTCVideoSource alloc] |
+ initWithNativeVideoSource:webrtc::VideoTrackSourceProxy::Create(_signalingThread.get(), |
+ _workerThread.get(), |
+ objcVideoTrackSource)]; |
+#else |
+ return nil; |
+#endif |
+} |
+ |
+- (RTCVideoTrack *)videoTrackWithSource:(RTCVideoSource *)source trackId:(NSString *)trackId { |
+#ifdef HAVE_RTC_VIDEO |
+ return [[RTCVideoTrack alloc] initWithFactory:self source:source trackId:trackId]; |
tkchin_webrtc
2017/06/20 21:51:24
for the generic case, why do we need to special ca
|
+#else |
+ return nil; |
+#endif |
+} |
+ |
+@end |