Index: webrtc/api/objc/RTCEAGLVideoView.m |
diff --git a/talk/app/webrtc/objc/RTCEAGLVideoView.m b/webrtc/api/objc/RTCEAGLVideoView.m |
similarity index 76% |
copy from talk/app/webrtc/objc/RTCEAGLVideoView.m |
copy to webrtc/api/objc/RTCEAGLVideoView.m |
index d19462c9d97576b841df86cd6f1872fc738de2ba..7c7d5ff59511738c30b0646d957e413ab1281f63 100644 |
--- a/talk/app/webrtc/objc/RTCEAGLVideoView.m |
+++ b/webrtc/api/objc/RTCEAGLVideoView.m |
@@ -1,34 +1,13 @@ |
/* |
- * libjingle |
- * Copyright 2014 Google Inc. |
+ * Copyright 2015 The WebRTC project authors. All Rights Reserved. |
* |
- * Redistribution and use in source and binary forms, with or without |
- * modification, are permitted provided that the following conditions are met: |
- * |
- * 1. Redistributions of source code must retain the above copyright notice, |
- * this list of conditions and the following disclaimer. |
- * 2. Redistributions in binary form must reproduce the above copyright notice, |
- * this list of conditions and the following disclaimer in the documentation |
- * and/or other materials provided with the distribution. |
- * 3. The name of the author may not be used to endorse or promote products |
- * derived from this software without specific prior written permission. |
- * |
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED |
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF |
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO |
- * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, |
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; |
- * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, |
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR |
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF |
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
+ * Use of this source code is governed by a BSD-style license |
+ * that can be found in the LICENSE file in the root of the source |
+ * tree. An additional intellectual property rights grant can be found |
+ * in the file PATENTS. All contributing project authors may |
+ * be found in the AUTHORS file in the root of the source tree. |
*/ |
-#if !defined(__has_feature) || !__has_feature(objc_arc) |
-#error "This file requires ARC support." |
-#endif |
- |
#import "RTCEAGLVideoView.h" |
#import <GLKit/GLKit.h> |
@@ -107,15 +86,15 @@ |
@interface RTCEAGLVideoView () <GLKViewDelegate> |
// |i420Frame| is set when we receive a frame from a worker thread and is read |
// from the display link callback so atomicity is required. |
-@property(atomic, strong) RTCI420Frame* i420Frame; |
-@property(nonatomic, readonly) GLKView* glkView; |
-@property(nonatomic, readonly) RTCOpenGLVideoRenderer* glRenderer; |
+@property(atomic, strong) RTCI420Frame *i420Frame; |
+@property(nonatomic, readonly) GLKView *glkView; |
+@property(nonatomic, readonly) RTCOpenGLVideoRenderer *glRenderer; |
@end |
@implementation RTCEAGLVideoView { |
- RTCDisplayLinkTimer* _timer; |
- GLKView* _glkView; |
- RTCOpenGLVideoRenderer* _glRenderer; |
+ RTCDisplayLinkTimer *_timer; |
+ GLKView *_glkView; |
+ RTCOpenGLVideoRenderer *_glRenderer; |
// This flag should only be set and read on the main thread (e.g. by |
// setNeedsDisplay) |
BOOL _isDirty; |
@@ -136,7 +115,7 @@ |
} |
- (void)configure { |
- EAGLContext* glContext = |
+ EAGLContext *glContext = |
[[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES3]; |
if (!glContext) { |
glContext = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES2]; |
@@ -171,9 +150,9 @@ |
// Frames are received on a separate thread, so we poll for current frame |
// using a refresh rate proportional to screen refresh frequency. This |
// occurs on the main thread. |
- __weak RTCEAGLVideoView* weakSelf = self; |
+ __weak RTCEAGLVideoView *weakSelf = self; |
_timer = [[RTCDisplayLinkTimer alloc] initWithTimerHandler:^{ |
- RTCEAGLVideoView* strongSelf = weakSelf; |
+ RTCEAGLVideoView *strongSelf = weakSelf; |
[strongSelf displayLinkTimerDidFire]; |
}]; |
[self setupGL]; |
@@ -210,7 +189,7 @@ |
// This method is called when the GLKView's content is dirty and needs to be |
// redrawn. This occurs on main thread. |
-- (void)glkView:(GLKView*)view drawInRect:(CGRect)rect { |
+- (void)glkView:(GLKView *)view drawInRect:(CGRect)rect { |
// The renderer will draw the frame to the framebuffer corresponding to the |
// one used by |view|. |
[_glRenderer drawFrame:self.i420Frame]; |
@@ -220,14 +199,14 @@ |
// These methods may be called on non-main thread. |
- (void)setSize:(CGSize)size { |
- __weak RTCEAGLVideoView* weakSelf = self; |
+ __weak RTCEAGLVideoView *weakSelf = self; |
dispatch_async(dispatch_get_main_queue(), ^{ |
- RTCEAGLVideoView* strongSelf = weakSelf; |
+ RTCEAGLVideoView *strongSelf = weakSelf; |
[strongSelf.delegate videoView:strongSelf didChangeVideoSize:size]; |
}); |
} |
-- (void)renderFrame:(RTCI420Frame*)frame { |
+- (void)renderFrame:(RTCI420Frame *)frame { |
self.i420Frame = frame; |
} |