Add initWithCoder to RTCEAGLVideoView.

Allows for proper OpenGL initialization if view is created from
storyboard.

BUG=3896
R=jiayl@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/34549004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@7970 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
tkchin@webrtc.org 2014-12-19 20:47:35 +00:00
parent ae643ce280
commit 7ce4a584aa

View File

@ -108,6 +108,19 @@
- (instancetype)initWithFrame:(CGRect)frame {
if (self = [super initWithFrame:frame]) {
[self configure];
}
return self;
}
- (instancetype)initWithCoder:(NSCoder *)aDecoder {
if (self = [super initWithCoder:aDecoder]) {
[self configure];
}
return self;
}
- (void)configure {
EAGLContext* glContext =
[[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES2];
_glRenderer = [[RTCOpenGLVideoRenderer alloc] initWithContext:glContext];
@ -151,8 +164,6 @@
[strongSelf.glkView setNeedsDisplay];
}];
[self setupGL];
}
return self;
}
- (void)dealloc {