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 {
|
- (instancetype)initWithFrame:(CGRect)frame {
|
||||||
if (self = [super initWithFrame: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* glContext =
|
||||||
[[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES2];
|
[[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES2];
|
||||||
_glRenderer = [[RTCOpenGLVideoRenderer alloc] initWithContext:glContext];
|
_glRenderer = [[RTCOpenGLVideoRenderer alloc] initWithContext:glContext];
|
||||||
@ -151,8 +164,6 @@
|
|||||||
[strongSelf.glkView setNeedsDisplay];
|
[strongSelf.glkView setNeedsDisplay];
|
||||||
}];
|
}];
|
||||||
[self setupGL];
|
[self setupGL];
|
||||||
}
|
|
||||||
return self;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)dealloc {
|
- (void)dealloc {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user