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

Unified Diff: webrtc/examples/objc/AppRTCMobile/ios/ARDVideoCallView.m

Issue 2722583002: Add Metal video view in AppRTCMobile and metal availability macro. (Closed)
Patch Set: Created 3 years, 10 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/examples/objc/AppRTCMobile/ios/ARDVideoCallView.m
diff --git a/webrtc/examples/objc/AppRTCMobile/ios/ARDVideoCallView.m b/webrtc/examples/objc/AppRTCMobile/ios/ARDVideoCallView.m
index 6e5fc597e9fc2defaba07e8dc02dad4eafb2f9b6..0f3f1a476e08707ee298b69eb512c69676001e15 100644
--- a/webrtc/examples/objc/AppRTCMobile/ios/ARDVideoCallView.m
+++ b/webrtc/examples/objc/AppRTCMobile/ios/ARDVideoCallView.m
@@ -11,8 +11,13 @@
#import "ARDVideoCallView.h"
#import <AVFoundation/AVFoundation.h>
+
+#import <WebRTC/RTCEAGLVideoView.h>
+#import <WebRTC/RTCMTLVideoView.h>
+
#import "UIImage+ARDUtilities.h"
+
kthelgason 2017/02/28 10:03:10 nit: empty line
static CGFloat const kButtonPadding = 16;
static CGFloat const kButtonSize = 48;
static CGFloat const kLocalVideoViewSize = 120;
@@ -38,8 +43,15 @@ static CGFloat const kStatusBarHeight = 20;
- (instancetype)initWithFrame:(CGRect)frame {
if (self = [super initWithFrame:frame]) {
- _remoteVideoView = [[RTCEAGLVideoView alloc] initWithFrame:CGRectZero];
- _remoteVideoView.delegate = self;
+
+#if defined(RTC_SUPPORTS_METAL) && RTC_SUPPORTS_METAL
kthelgason 2017/02/28 10:03:10 just #if RTC_SUPPORTS_METAL should be enough.
+ _remoteVideoView = [[RTCMTLVideoView alloc] initWithFrame:CGRectZero];
+#else
+ RTCEAGLVideoView *remoteView = [[RTCEAGLVideoView alloc] initWithFrame:CGRectZero];
kthelgason 2017/02/28 10:03:10 this temp variable looks unnecessary, can we assig
daniela-webrtc 2017/02/28 14:27:12 The temp is to avoid casting.
+ remoteView.delegate = self;
+ _remoteVideoView = remoteView;
+#endif
+
[self addSubview:_remoteVideoView];
_localVideoView = [[RTCCameraPreviewView alloc] initWithFrame:CGRectZero];

Powered by Google App Engine
This is Rietveld 408576698