Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(40)

Unified Diff: webrtc/sdk/objc/Framework/Classes/PeerConnection/RTCPeerConnectionFactory+Video.mm

Issue 2944643002: Support building WebRTC without audio and video for IOS (Closed)
Patch Set: Reponse to comments. Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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

Powered by Google App Engine
This is Rietveld 408576698