Chromium Code Reviews| Index: webrtc/sdk/objc/Framework/Classes/UI/RTCEAGLVideoView.m |
| diff --git a/webrtc/sdk/objc/Framework/Classes/UI/RTCEAGLVideoView.m b/webrtc/sdk/objc/Framework/Classes/UI/RTCEAGLVideoView.m |
| index 89b7dfcc2ebe637ee3869c1e3b2d1380b1bf95a0..d2f28f71e358c2d53ca558eaea68895a8c4d0607 100644 |
| --- a/webrtc/sdk/objc/Framework/Classes/UI/RTCEAGLVideoView.m |
| +++ b/webrtc/sdk/objc/Framework/Classes/UI/RTCEAGLVideoView.m |
| @@ -121,7 +121,9 @@ |
| - (instancetype)initWithFrame:(CGRect)frame shader:(id<RTCVideoViewShading>)shader { |
| if (self = [super initWithFrame:frame]) { |
| _shader = shader; |
| - [self configure]; |
| + if (![self configure]) { |
| + return nil; |
| + } |
| } |
| return self; |
| } |
| @@ -129,17 +131,22 @@ |
| - (instancetype)initWithCoder:(NSCoder *)aDecoder shader:(id<RTCVideoViewShading>)shader { |
| if (self = [super initWithCoder:aDecoder]) { |
| _shader = shader; |
| - [self configure]; |
| + if (![self configure]) { |
| + return nil; |
| + } |
| } |
| return self; |
| } |
| -- (void)configure { |
| +- (BOOL)configure { |
| EAGLContext *glContext = |
| [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES3]; |
| if (!glContext) { |
| glContext = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES2]; |
| } |
| + if (!glContext) { |
| + return NO; |
|
tkchin_webrtc
2017/07/27 20:42:12
nit: add an error log
magjed_webrtc
2017/07/31 15:23:23
Done.
|
| + } |
| _glContext = glContext; |
| // GLKView manages a framebuffer for us. |
| @@ -176,6 +183,7 @@ |
| [strongSelf displayLinkTimerDidFire]; |
| }]; |
| [self setupGL]; |
| + return YES; |
| } |
| - (void)dealloc { |