- (id)initWithVout:(vout_thread_t *)_p_vout frame:(NSRect *)s_frame
{
- [self setReleasedWhenClosed: YES];
+ int i_timeout;
p_vout = _p_vout;
+ /* Wait for a MacOS X interface to appear. Timeout is 2 seconds. */
+ for( i_timeout = 20 ; i_timeout-- ; )
+ {
+ if( NSApp == NULL )
+ {
+ msleep( INTF_IDLE_SLEEP );
+ }
+ }
+
+ if( NSApp == NULL )
+ {
+ /* No MacOS X intf, unable to communicate with MT */
+ msg_Err( p_vout, "no MacOS X interface present" );
+ return NULL;
+ }
+
/* p_real_vout: the vout we have to use to check for video-on-top
and a few other things. If we are the QuickTime output, it's us.
It we are the OpenGL provider, it is our parent. */
[self updateTitle];
[self makeKeyAndOrderFront: nil];
+ [self setReleasedWhenClosed: YES];
/* We'll catch mouse events */
[self setAcceptsMouseMovedEvents: YES];
{
if( p_fullscreen_state )
{
- EndFullScreen( p_fullscreen_state, NULL );
+ EndFullScreen( p_fullscreen_state, 0 );
}
[super close];
}
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
- *
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
int E_(OpenVideoGL) ( vlc_object_t * p_this )
{
vout_thread_t * p_vout = (vout_thread_t *) p_this;
- int i_timeout;
-
-/* OpenGL interface disabled until
- * - the green line is gone
- * - other problems?????
- */
if( !CGDisplayUsesOpenGLAcceleration( kCGDirectMainDisplay ) )
{
memset( p_vout->p_sys, 0, sizeof( vout_sys_t ) );
- /* Wait for a MacOS X interface to appear. Timeout is 2 seconds. */
- for( i_timeout = 20 ; i_timeout-- ; )
- {
- if( NSApp == NULL )
- {
- msleep( INTF_IDLE_SLEEP );
- }
- }
-
- if( NSApp == NULL )
- {
- /* No MacOS X intf, unable to communicate with MT */
- msg_Err( p_vout, "no MacOS X interface present" );
- return VLC_EGENERIC;
- }
-
- p_vout->pf_init = Init;
- p_vout->pf_end = End;
- p_vout->pf_manage = Manage;
- p_vout->pf_control= Control;
- p_vout->pf_swap = Swap;
-
p_vout->p_sys->o_pool = [[NSAutoreleasePool alloc] init];
/* Spawn window */
p_vout->p_sys->b_got_frame = VLC_FALSE;
p_vout->p_sys->o_window = [[VLCWindow alloc] initWithVout: p_vout
frame: nil];
-
+ if( !p_vout->p_sys->o_window )
+ {
+ return VLC_EGENERIC;
+ }
+
/* Add OpenGL view */
#define o_glview p_vout->p_sys->o_glview
o_glview = [[VLCGLView alloc] initWithFrame:
[o_glview autorelease];
#undef o_glview
+ p_vout->pf_init = Init;
+ p_vout->pf_end = End;
+ p_vout->pf_manage = Manage;
+ p_vout->pf_control= Control;
+ p_vout->pf_swap = Swap;
+
return VLC_SUCCESS;
}
int E_(CloseVideoGL) ( vlc_object_t * p_this )
{
vout_thread_t * p_vout = (vout_thread_t *) p_this;
- NSAutoreleasePool *o_pool = [[NSAutoreleasePool alloc] init];
+ NSAutoreleasePool *o_pool = [[NSAutoreleasePool alloc] init];
[p_vout->p_sys->o_window close];
if( p_vout->i_changes & VOUT_FULLSCREEN_CHANGE )
{
NSAutoreleasePool *o_pool = [[NSAutoreleasePool alloc] init];
-
+
if( !p_vout->b_fullscreen )
{
/* Save window size and position */
- (id) initWithFrame: (NSRect) frame vout: (vout_thread_t*) _p_vout
{
p_vout = _p_vout;
-
+
NSOpenGLPixelFormatAttribute attribs[] =
{
NSOpenGLPFAAccelerated,
{
vout_thread_t * p_vout = (vout_thread_t *)p_this;
OSErr err;
- int i_timeout;
p_vout->p_sys = malloc( sizeof( vout_sys_t ) );
if( p_vout->p_sys == NULL )
memset( p_vout->p_sys, 0, sizeof( vout_sys_t ) );
- /* Wait for a MacOS X interface to appear. Timeout is 2 seconds. */
- for( i_timeout = 20 ; i_timeout-- ; )
- {
- if( NSApp == NULL )
- {
- msleep( INTF_IDLE_SLEEP );
- }
- }
-
- if( NSApp == NULL )
- {
- /* no MacOS X intf, unable to communicate with MT */
- msg_Err( p_vout, "no MacOS X interface present" );
- free( p_vout->p_sys );
- return( 1 );
- }
+ p_vout->p_sys->o_pool = [[NSAutoreleasePool alloc] init];
p_vout->pf_init = InitVideo;
p_vout->pf_end = EndVideo;
p_vout->pf_display = DisplayVideo;
p_vout->pf_control = ControlVideo;
- p_vout->p_sys->o_pool = [[NSAutoreleasePool alloc] init];
+ /* Spawn window */
+ p_vout->p_sys->o_window =
+ [[VLCWindow alloc] initWithVout: p_vout frame: nil];
+ if( !p_vout->p_sys->o_window )
+ {
+ return VLC_EGENERIC;
+ }
p_vout->p_sys->b_altivec = p_vout->p_libvlc->i_cpu & CPU_CAPABILITY_ALTIVEC;
msg_Dbg( p_vout, "We do%s have Altivec", p_vout->p_sys->b_altivec ? "" : "n't" );
return VLC_EGENERIC;
}
- /* Spawn window */
- p_vout->p_sys->o_window =
- [[VLCWindow alloc] initWithVout: p_vout frame: nil];
-
#define o_qtview p_vout->p_sys->o_qtview
o_qtview = [[VLCQTView alloc] initWithVout: p_vout];
[p_vout->p_sys->o_window setContentView: o_qtview];
var_Create( p_vout, "opengl-effect", VLC_VAR_STRING | VLC_VAR_DOINHERIT );
+ p_sys->i_index = 0;
#ifdef SYS_DARWIN
p_sys->i_tex_width = p_vout->render.i_width;
p_sys->i_tex_height = p_vout->render.i_height;