Commit 41db05f3 authored by Derk-Jan Hartman's avatar Derk-Jan Hartman

* Enable OpenGL without Acceleration on Mac OSX. (Fallback option)

parent 088dd2ed
...@@ -58,6 +58,7 @@ struct vout_sys_t ...@@ -58,6 +58,7 @@ struct vout_sys_t
VLCGLView * o_glview; VLCGLView * o_glview;
VLCVoutView * o_vout_view; VLCVoutView * o_vout_view;
vlc_bool_t b_saved_frame; vlc_bool_t b_saved_frame;
vlc_bool_t b_accelerated;
NSRect s_frame; NSRect s_frame;
vlc_bool_t b_got_frame; vlc_bool_t b_got_frame;
vlc_mutex_t lock; vlc_mutex_t lock;
...@@ -79,13 +80,6 @@ int E_(OpenVideoGL) ( vlc_object_t * p_this ) ...@@ -79,13 +80,6 @@ int E_(OpenVideoGL) ( vlc_object_t * p_this )
{ {
vout_thread_t * p_vout = (vout_thread_t *) p_this; vout_thread_t * p_vout = (vout_thread_t *) p_this;
if( !CGDisplayUsesOpenGLAcceleration( kCGDirectMainDisplay ) )
{
msg_Warn( p_vout, "no hardware acceleration" );
return( 1 );
}
msg_Dbg( p_vout, "display is Quartz Extreme accelerated" );
p_vout->p_sys = malloc( sizeof( vout_sys_t ) ); p_vout->p_sys = malloc( sizeof( vout_sys_t ) );
if( p_vout->p_sys == NULL ) if( p_vout->p_sys == NULL )
{ {
...@@ -95,6 +89,10 @@ int E_(OpenVideoGL) ( vlc_object_t * p_this ) ...@@ -95,6 +89,10 @@ int E_(OpenVideoGL) ( vlc_object_t * p_this )
memset( p_vout->p_sys, 0, sizeof( vout_sys_t ) ); memset( p_vout->p_sys, 0, sizeof( vout_sys_t ) );
p_vout->p_sys->b_accelerated = CGDisplayUsesOpenGLAcceleration( kCGDirectMainDisplay );
if( p_vout->p_sys->b_accelerated )
msg_Dbg( p_vout, "display is Quartz Extreme accelerated" );
p_vout->p_sys->o_pool = [[NSAutoreleasePool alloc] init]; p_vout->p_sys->o_pool = [[NSAutoreleasePool alloc] init];
vlc_mutex_init( p_vout, &p_vout->p_sys->lock ); vlc_mutex_init( p_vout, &p_vout->p_sys->lock );
...@@ -103,7 +101,6 @@ int E_(OpenVideoGL) ( vlc_object_t * p_this ) ...@@ -103,7 +101,6 @@ int E_(OpenVideoGL) ( vlc_object_t * p_this )
[p_vout->p_sys->o_glview autorelease]; [p_vout->p_sys->o_glview autorelease];
/* Spawn the window */ /* Spawn the window */
if( !(p_vout->p_sys->o_vout_view = [VLCVoutView getVoutView: p_vout if( !(p_vout->p_sys->o_vout_view = [VLCVoutView getVoutView: p_vout
subView: p_vout->p_sys->o_glview frame: nil]) ) subView: p_vout->p_sys->o_glview frame: nil]) )
{ {
...@@ -241,9 +238,8 @@ static void Unlock( vout_thread_t * p_vout ) ...@@ -241,9 +238,8 @@ static void Unlock( vout_thread_t * p_vout )
- (id) initWithVout: (vout_thread_t *) vout - (id) initWithVout: (vout_thread_t *) vout
{ {
p_vout = vout; NSOpenGLPixelFormat * fmt;
NSOpenGLPixelFormatAttribute attribs_accel[] =
NSOpenGLPixelFormatAttribute attribs[] =
{ {
NSOpenGLPFAAccelerated, NSOpenGLPFAAccelerated,
NSOpenGLPFANoRecovery, NSOpenGLPFANoRecovery,
...@@ -253,9 +249,21 @@ static void Unlock( vout_thread_t * p_vout ) ...@@ -253,9 +249,21 @@ static void Unlock( vout_thread_t * p_vout )
NSOpenGLPFAWindow, NSOpenGLPFAWindow,
0 0
}; };
NSOpenGLPixelFormatAttribute attribs[] =
{
NSOpenGLPFANoRecovery,
NSOpenGLPFAColorSize, 24,
NSOpenGLPFAAlphaSize, 8,
NSOpenGLPFADepthSize, 24,
NSOpenGLPFAWindow,
0
};
p_vout = vout;
NSOpenGLPixelFormat * fmt = [[NSOpenGLPixelFormat alloc] if( p_vout->p_sys->b_accelerated )
initWithAttributes: attribs]; fmt = [[NSOpenGLPixelFormat alloc] initWithAttributes: attribs_accel];
else fmt = [[NSOpenGLPixelFormat alloc] initWithAttributes: attribs];
if( !fmt ) if( !fmt )
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment