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:
parent
ae643ce280
commit
7ce4a584aa
@ -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];
|
||||
@ -152,8 +165,6 @@
|
||||
}];
|
||||
[self setupGL];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)dealloc {
|
||||
[[NSNotificationCenter defaultCenter] removeObserver:self];
|
||||
|
Loading…
Reference in New Issue
Block a user