X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=modules%2Fvideo_output%2Fopengllayer.m;h=aed86020f95703c612c0da1ab5d84059afe960f9;hb=32b31e87d90967549e5cc8bef18d5aae7e3b98c6;hp=eae27af2913cd390694f68fc84e8d76dc8532db7;hpb=aaf81c501771f97bd967d02f9d29b6da939c84b0;p=vlc diff --git a/modules/video_output/opengllayer.m b/modules/video_output/opengllayer.m index eae27af291..aed86020f9 100644 --- a/modules/video_output/opengllayer.m +++ b/modules/video_output/opengllayer.m @@ -32,7 +32,12 @@ *****************************************************************************/ #include /* ENOMEM */ -#include +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include +#include #include #import @@ -88,7 +93,7 @@ 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_description( N_("Core Animation OpenGL Layer (Mac OS X)") ); set_capability( "video output", 20 ); add_shortcut( "opengllayer" ); set_callbacks( CreateVout, DestroyVout ); @@ -112,7 +117,7 @@ struct vout_sys_t uint8_t *pp_buffer[2]; /* one last rendered, one to be rendered */ int i_index; - vlc_bool_t b_frame_available; + bool b_frame_available; CGLContextObj glContext; @@ -204,7 +209,7 @@ static int Init( vout_thread_t *p_vout ) return VLC_EGENERIC; } } - p_sys->b_frame_available = VLC_FALSE; + p_sys->b_frame_available = false; p_sys->i_index = 0; p_vout->p_picture[0].i_planes = 1; @@ -239,15 +244,9 @@ static void End( vout_thread_t *p_vout ) { vout_sys_t *p_sys = p_vout->p_sys; - p_vout->p_sys->b_frame_available = VLC_FALSE; - - [CATransaction performSelectorOnMainThread:@selector(begin) - withObject:nil waitUntilDone:YES]; + p_vout->p_sys->b_frame_available = false; - [p_sys->o_layer performSelectorOnMainThread:@selector(removeFromSuperlayer) - withObject:nil waitUntilDone:YES]; - [CATransaction performSelectorOnMainThread:@selector(commit) - withObject:nil waitUntilDone:YES]; + [p_vout->p_sys->o_cocoa_container performSelectorOnMainThread:@selector(removeVoutLayer:) withObject:p_vout->p_sys->o_layer waitUntilDone:YES]; // Should be done automatically [p_sys->o_layer release]; @@ -314,6 +313,8 @@ static void Render( vout_thread_t *p_vout, picture_t *p_pic ) p_sys->i_index = i_new_index; p_pic->p->p_pixels = p_sys->pp_buffer[p_sys->i_index]; CGLUnlockContext(p_sys->glContext); + + p_sys->b_frame_available = true; } } @@ -327,11 +328,9 @@ static void Render( vout_thread_t *p_vout, picture_t *p_pic ) static void DisplayVideo( vout_thread_t *p_vout, picture_t *p_pic ) { vout_sys_t *p_sys = p_vout->p_sys; - - [p_sys->o_layer performSelectorOnMainThread:@selector(setNeedsDisplay) - withObject:nil waitUntilDone:NO]; - - p_sys->b_frame_available = VLC_TRUE; + + [p_sys->o_layer performSelectorOnMainThread:@selector(display) + withObject:nil waitUntilDone:YES]; } /***************************************************************************** @@ -466,8 +465,6 @@ static int InitTextures( vout_thread_t *p_vout ) glFlush(); CGLUnlockContext( glContext ); - - p_vout->p_sys->b_frame_available = VLC_FALSE; } - (CGLContextObj)copyCGLContextForPixelFormat:(CGLPixelFormatObj)pixelFormat