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

Unified Diff: webrtc/examples/objc/AppRTCMobile/mac/APPRTCViewController.m

Issue 2927983002: Fall-back to OpenGL renderer if mac hardware doesn't support Metal (Closed)
Patch Set: Implement +isMetalAvailable with a runtime check 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
« no previous file with comments | « no previous file | webrtc/sdk/objc/Framework/Classes/Metal/RTCMTLNSVideoView.m » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/examples/objc/AppRTCMobile/mac/APPRTCViewController.m
diff --git a/webrtc/examples/objc/AppRTCMobile/mac/APPRTCViewController.m b/webrtc/examples/objc/AppRTCMobile/mac/APPRTCViewController.m
index c23e0d59cd234e962fe00c1fa6dfc86789f6fd9b..d8ee1413f3a52ce83f966313e7bb184eaebc02d2 100644
--- a/webrtc/examples/objc/AppRTCMobile/mac/APPRTCViewController.m
+++ b/webrtc/examples/objc/AppRTCMobile/mac/APPRTCViewController.m
@@ -221,10 +221,12 @@ - (void)setupViews {
// If not we're providing sensible default.
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wpartial-availability"
- if ([RTCMTLNSVideoView class]) {
+ if ([RTCMTLNSVideoView class] && [RTCMTLNSVideoView isMetalAvailable]) {
_remoteVideoView = [[RTCMTLNSVideoView alloc] initWithFrame:NSZeroRect];
_localVideoView = [[RTCMTLNSVideoView alloc] initWithFrame:NSZeroRect];
- } else {
+ }
+#pragma clang diagnostic pop
+ if (_remoteVideoView == nil) {
NSOpenGLPixelFormatAttribute attributes[] = {
NSOpenGLPFADoubleBuffer,
NSOpenGLPFADepthSize, 24,
@@ -245,7 +247,6 @@ - (void)setupViews {
local.delegate = self;
_localVideoView = local;
}
-#pragma clang diagnostic pop
[_remoteVideoView setTranslatesAutoresizingMaskIntoConstraints:NO];
[self addSubview:_remoteVideoView];
« no previous file with comments | « no previous file | webrtc/sdk/objc/Framework/Classes/Metal/RTCMTLNSVideoView.m » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698