# include "config.h"
#endif
-#include <vlc/vlc.h>
+#include <vlc_common.h>
+#include <vlc_plugin.h>
#include <vlc_vout.h>
#import <QuartzCore/QuartzCore.h>
#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
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;
*****************************************************************************/
static int CreateVout( vlc_object_t *p_this )
{
- /* This module is Leopard only */
-#ifdef __APPLE__
- long minorMacVersion;
- if( Gestalt( gestaltSystemVersionMinor, &minorMacVersion ) == noErr )
- {
- if( minorMacVersion < 6 )
- {
- msg_Warn( p_vout, "current osx version is 10.%ld, non-suitable for OpenglLayer video output", minorMacVersion );
- return VLC_ENOOBJ;
- }
- }
- else
- {
- msg_Warn( p_vout, "couldn't get OS version" );
- return VLC_EGENERIC;
- }
-#endif
-
vout_thread_t *p_vout = (vout_thread_t *)p_this;
vout_sys_t *p_sys;
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;
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;
CGLUnlockContext( glContext );
}
@end
-
-#endif