X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=modules%2Fgui%2Fmacosx%2Fvout.m;h=63cd013f568ec4023f7b211bcdef56d38905fedd;hb=1ce23b854fd7bf0805f1cdd5969ac8c2ead2d5c3;hp=85617e6f734fa9e8b77c3ca4a1aa2f0a13253888;hpb=aff2275604f2aba8da89b9ec6bffaed40dee02df;p=vlc diff --git a/modules/gui/macosx/vout.m b/modules/gui/macosx/vout.m index 85617e6f73..63cd013f56 100644 --- a/modules/gui/macosx/vout.m +++ b/modules/gui/macosx/vout.m @@ -91,6 +91,7 @@ int E_(OpenVideo) ( vlc_object_t *p_this ) vout_thread_t * p_vout = (vout_thread_t *)p_this; OSErr err; int i_timeout; + char *psz_vout_type; p_vout->p_sys = malloc( sizeof( vout_sys_t ) ); if( p_vout->p_sys == NULL ) @@ -146,8 +147,22 @@ int E_(OpenVideo) ( vlc_object_t *p_this ) p_vout->p_sys->s_rect.size.height = p_vout->i_window_height; /* Check if we should use QuickTime or OpenGL */ - p_vout->p_sys->i_opengl = config_GetInt( p_vout, "macosx-opengl" ); + psz_vout_type = config_GetPsz( p_vout, "macosx-vout" ); + if( !strncmp( psz_vout_type, "auto", 4 ) ) + { + p_vout->p_sys->i_opengl = CGDisplayUsesOpenGLAcceleration( kCGDirectMainDisplay ); + } + else if( !strncmp( psz_vout_type, "opengl", 6 ) ) + { + p_vout->p_sys->i_opengl = VLC_TRUE; + } + else + { + p_vout->p_sys->i_opengl = VLC_FALSE; + } + free( psz_vout_type ); + if( !p_vout->p_sys->i_opengl ) { /* Initialize QuickTime */ @@ -190,6 +205,11 @@ int E_(OpenVideo) ( vlc_object_t *p_this ) free( p_vout->p_sys ); return VLC_EGENERIC; } + msg_Dbg( p_vout, "using Quartz mode" ); + } + else + { + msg_Dbg( p_vout, "using OpenGL mode" ); } NSAutoreleasePool * o_pool = [[NSAutoreleasePool alloc] init]; @@ -1506,7 +1526,7 @@ static void QTFreePicture( vout_thread_t *p_vout, picture_t *p_pic ) NSOpenGLPFADepthSize, 24, NSOpenGLPFAFullScreen, NSOpenGLPFAScreenMask, - /* TODO handle macosxx-vdev */ + /* TODO handle macosx-vdev */ CGDisplayIDToOpenGLDisplayMask( kCGDirectMainDisplay ), 0 };