]> git.sesse.net Git - vlc/blobdiff - modules/video_output/opengllayer.m
Qt: Remove VolumeClickHandler Class... I never understood why zorglub did that in...
[vlc] / modules / video_output / opengllayer.m
index c41e80e41eb3de969ef7451b135660e770decb12..8536cd015524389dbf4b936e9b40475abfdf699d 100644 (file)
@@ -36,7 +36,7 @@
 # include "config.h"
 #endif
 
-#include <vlc/vlc.h>
+#include <vlc_common.h>
 #include <vlc_plugin.h>
 #include <vlc_vout.h>
 
@@ -44,8 +44,6 @@
 #import <Cocoa/Cocoa.h>
 #import <OpenGL/OpenGL.h>
 
-#ifdef CALayer
-
 /* On OS X, use GL_TEXTURE_RECTANGLE_EXT instead of GL_TEXTURE_2D.
    This allows sizes which are not powers of 2 */
 #define VLCGL_TARGET GL_TEXTURE_RECTANGLE_EXT
@@ -91,15 +89,15 @@ static int  Control      ( vout_thread_t *, int, va_list );
 
 static int InitTextures  ( vout_thread_t * );
 
-vlc_module_begin();
-    set_shortname( "OpenGLLayer" );
-    set_category( CAT_VIDEO );
-    set_subcategory( SUBCAT_VIDEO_VOUT );
-    set_description( _("Core Animation OpenGL Layer (Mac OS X)") );
-    set_capability( "video output", 20 );
-    add_shortcut( "opengllayer" );
-    set_callbacks( CreateVout, DestroyVout );
-vlc_module_end();
+vlc_module_begin ()
+    set_shortname( "OpenGLLayer" )
+    set_category( CAT_VIDEO )
+    set_subcategory( SUBCAT_VIDEO_VOUT )
+    set_description( N_("Core Animation OpenGL Layer (Mac OS X)") )
+    set_capability( "video output", 20 )
+    add_shortcut( "opengllayer" )
+    set_callbacks( CreateVout, DestroyVout )
+vlc_module_end ()
 
 @interface VLCVoutLayer : CAOpenGLLayer {
     vout_thread_t * p_vout;
@@ -142,12 +140,9 @@ static int CreateVout( vlc_object_t *p_this )
     char * psz;
 
     /* Allocate structure */
-    p_vout->p_sys = p_sys = calloc( sizeof( vout_sys_t ), 1 );
+    p_vout->p_sys = p_sys = calloc( 1, sizeof( vout_sys_t ) );
     if( p_sys == NULL )
-    {
-        msg_Err( p_vout, "out of memory" );
         return VLC_EGENERIC;
-    }
 
     p_sys->i_tex_width  = p_vout->fmt_in.i_width;
     p_sys->i_tex_height = p_vout->fmt_in.i_height;
@@ -206,10 +201,7 @@ static int Init( vout_thread_t *p_vout )
         p_sys->pp_buffer[i] =
             malloc( p_sys->i_tex_width * p_sys->i_tex_height * i_pixel_pitch );
         if( !p_sys->pp_buffer[i] )
-        {
-            msg_Err( p_vout, "out of memory" );
             return VLC_EGENERIC;
-        }
     }
     p_sys->b_frame_available = false;
     p_sys->i_index = 0;
@@ -518,5 +510,3 @@ static int InitTextures( vout_thread_t *p_vout )
     CGLUnlockContext( glContext );
 }
 @end
-
-#endif