[vlc-commits] caopengllayer: cosmetics

Felix Paul Kühne git at videolan.org
Tue Oct 6 12:41:45 CEST 2015


vlc | branch: master | Felix Paul Kühne <fkuehne at videolan.org> | Tue Oct  6 12:30:28 2015 +0200| [993bc6c2840a486b851e04e0f1a815e683afd316] | committer: Felix Paul Kühne

caopengllayer: cosmetics

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=993bc6c2840a486b851e04e0f1a815e683afd316
---

 modules/video_output/caopengllayer.m |   55 +++++++++++++++++-----------------
 1 file changed, 27 insertions(+), 28 deletions(-)

diff --git a/modules/video_output/caopengllayer.m b/modules/video_output/caopengllayer.m
index 6637765..c8dfd65 100644
--- a/modules/video_output/caopengllayer.m
+++ b/modules/video_output/caopengllayer.m
@@ -1,7 +1,7 @@
 /*****************************************************************************
  * caopengllayer.m: CAOpenGLLayer (Mac OS X) video output
  *****************************************************************************
- * Copyright (C) 2014 VLC authors and VideoLAN
+ * Copyright (C) 2014-2015 VLC authors and VideoLAN
  * $Id$
  *
  * Authors: David Fuhrmann <david dot fuhrmann at googlemail dot com>
@@ -74,11 +74,10 @@ static void OpenglSwap         (vlc_gl_t *gl);
 - (CGSize)currentOutputSize;
 @end
 
- at interface VLCCAOpenGLLayer : CAOpenGLLayer {
-    vout_display_t *_vd;
-}
+ at interface VLCCAOpenGLLayer : CAOpenGLLayer
+
+ at property (nonatomic, readwrite) vout_display_t* voutDisplay;
 
-- (void)setVoutDisplay:(vout_display_t *)aVd;
 @end
 
 
@@ -407,7 +406,7 @@ static void *OurGetProcAddress (vlc_gl_t *gl, const char *name)
 
 - (void)setVoutDisplay:(vout_display_t *)aVd
 {
-    _vd = aVd;
+    _voutDisplay = aVd;
 }
 
 - (void)resizeWithOldSuperlayerSize:(CGSize)size
@@ -416,24 +415,24 @@ static void *OurGetProcAddress (vlc_gl_t *gl, const char *name)
 
     CGSize boundsSize = self.visibleRect.size;
 
-    if (_vd)
-        vout_display_SendEventDisplaySize(_vd, boundsSize.width, boundsSize.height);
+    if (_voutDisplay)
+        vout_display_SendEventDisplaySize(_voutDisplay, boundsSize.width, boundsSize.height);
 }
 
 - (BOOL)canDrawInCGLContext:(CGLContextObj)glContext pixelFormat:(CGLPixelFormatObj)pixelFormat forLayerTime:(CFTimeInterval)timeInterval displayTime:(const CVTimeStamp *)timeStamp
 {
     /* Only draw the frame if we have a frame that was previously rendered */
-    if (!_vd)
+    if (!_voutDisplay)
         return false;
 
-    return _vd->sys->b_frame_available;
+    return _voutDisplay->sys->b_frame_available;
 }
 
 - (void)drawInCGLContext:(CGLContextObj)glContext pixelFormat:(CGLPixelFormatObj)pixelFormat forLayerTime:(CFTimeInterval)timeInterval displayTime:(const CVTimeStamp *)timeStamp
 {
-    if (!_vd)
+    if (!_voutDisplay)
         return;
-    vout_display_sys_t *sys = _vd->sys;
+    vout_display_sys_t *sys = _voutDisplay->sys;
 
     if (!sys->vgl)
         return;
@@ -444,16 +443,16 @@ static void *OurGetProcAddress (vlc_gl_t *gl, const char *name)
     glViewport (sys->place.x, bounds.size.height - (sys->place.y + sys->place.height), sys->place.width, sys->place.height);
 
     // flush is also done by this method, no need to call super
-    vout_display_opengl_Display (sys->vgl, &_vd->source);
+    vout_display_opengl_Display (sys->vgl, &_voutDisplay->source);
     sys->b_frame_available = NO;
 }
 
 - (CGLContextObj)copyCGLContextForPixelFormat:(CGLPixelFormatObj)pixelFormat
 {
     // Only one opengl context is allowed for the module lifetime
-    if(_vd->sys->glContext) {
-        msg_Dbg(_vd, "Return existing context: %p", _vd->sys->glContext);
-        return _vd->sys->glContext;
+    if(_voutDisplay->sys->glContext) {
+        msg_Dbg(_voutDisplay, "Return existing context: %p", _voutDisplay->sys->glContext);
+        return _voutDisplay->sys->glContext;
     }
 
     CGLContextObj context = [super copyCGLContextForPixelFormat:pixelFormat];
@@ -467,7 +466,7 @@ static void *OurGetProcAddress (vlc_gl_t *gl, const char *name)
                      &params );
 
     @synchronized (self) {
-        _vd->sys->glContext = context;
+        _voutDisplay->sys->glContext = context;
     }
 
     return context;
@@ -481,13 +480,13 @@ static void *OurGetProcAddress (vlc_gl_t *gl, const char *name)
 - (void)mouseButtonDown:(int)buttonNumber
 {
     @synchronized (self) {
-        if (_vd) {
+        if (_voutDisplay) {
             if (buttonNumber == 0)
-                vout_display_SendEventMousePressed (_vd, MOUSE_BUTTON_LEFT);
+                vout_display_SendEventMousePressed (_voutDisplay, MOUSE_BUTTON_LEFT);
             else if (buttonNumber == 1)
-                vout_display_SendEventMousePressed (_vd, MOUSE_BUTTON_RIGHT);
+                vout_display_SendEventMousePressed (_voutDisplay, MOUSE_BUTTON_RIGHT);
             else
-                vout_display_SendEventMousePressed (_vd, MOUSE_BUTTON_CENTER);
+                vout_display_SendEventMousePressed (_voutDisplay, MOUSE_BUTTON_CENTER);
         }
     }
 }
@@ -495,13 +494,13 @@ static void *OurGetProcAddress (vlc_gl_t *gl, const char *name)
 - (void)mouseButtonUp:(int)buttonNumber
 {
     @synchronized (self) {
-        if (_vd) {
+        if (_voutDisplay) {
             if (buttonNumber == 0)
-                vout_display_SendEventMouseReleased (_vd, MOUSE_BUTTON_LEFT);
+                vout_display_SendEventMouseReleased (_voutDisplay, MOUSE_BUTTON_LEFT);
             else if (buttonNumber == 1)
-                vout_display_SendEventMouseReleased (_vd, MOUSE_BUTTON_RIGHT);
+                vout_display_SendEventMouseReleased (_voutDisplay, MOUSE_BUTTON_RIGHT);
             else
-                vout_display_SendEventMouseReleased (_vd, MOUSE_BUTTON_CENTER);
+                vout_display_SendEventMouseReleased (_voutDisplay, MOUSE_BUTTON_CENTER);
         }
     }
 }
@@ -509,12 +508,12 @@ static void *OurGetProcAddress (vlc_gl_t *gl, const char *name)
 - (void)mouseMovedToX:(double)xValue Y:(double)yValue
 {
     @synchronized (self) {
-        if (_vd) {
-            vout_display_SendMouseMovedDisplayCoordinates (_vd,
+        if (_voutDisplay) {
+            vout_display_SendMouseMovedDisplayCoordinates (_voutDisplay,
                                                            ORIENT_NORMAL,
                                                            xValue,
                                                            yValue,
-                                                           &_vd->sys->place);
+                                                           &_voutDisplay->sys->place);
         }
     }
 }



More information about the vlc-commits mailing list