| 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..80282f0b0b49dfefa1d59ec7a22caf2f9e5b5364 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,23 @@
|
| - (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) {
|
| + RTCLogError(@"Failed to create EAGLContext");
|
| + return NO;
|
| + }
|
| _glContext = glContext;
|
|
|
| // GLKView manages a framebuffer for us.
|
| @@ -176,6 +184,7 @@
|
| [strongSelf displayLinkTimerDidFire];
|
| }];
|
| [self setupGL];
|
| + return YES;
|
| }
|
|
|
| - (void)dealloc {
|
|
|