Fall-back to OpenGL renderer if mac hardware doesn't support Metal

BUG=webrtc:7782

Review-Url: https://codereview.webrtc.org/2927983002
Cr-Commit-Position: refs/heads/master@{#18539}
This commit is contained in:
adam.fedor
2017-06-12 07:32:02 -07:00
committed by Commit Bot
parent 84b4d2c1c2
commit 42742a56ef
3 changed files with 6 additions and 5 deletions

View File

@ -221,10 +221,12 @@ static NSUInteger const kBottomViewHeight = 200;
// 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 @@ static NSUInteger const kBottomViewHeight = 200;
local.delegate = self;
_localVideoView = local;
}
#pragma clang diagnostic pop
[_remoteVideoView setTranslatesAutoresizingMaskIntoConstraints:NO];
[self addSubview:_remoteVideoView];