The macosx drawable variable that used to hold the drawable window reference is splitted up in two variables "drawable-agl" (used by macosx safari/mozilla plugin) and "drawable-gl" (used by macosx interface).
/*****************************************************************************
* vout.m: MacOS X video output module
*****************************************************************************
/*****************************************************************************
* vout.m: MacOS X video output module
*****************************************************************************
- * Copyright (C) 2001-2008 the VideoLAN team
+ * Copyright (C) 2001-2009 the VideoLAN team
* $Id$
*
* Authors: Colin Delacroix <colin@zoy.org>
* $Id$
*
* Authors: Colin Delacroix <colin@zoy.org>
vlc_object_release( p_input );
}
vlc_object_release( p_input );
}
- (void)setOnTop:(BOOL)b_on_top
{
if( b_on_top )
- (void)setOnTop:(BOOL)b_on_top
{
if( b_on_top )
+ (id)voutView: (vout_thread_t *)p_vout subView: (NSView *)view
frame: (NSRect *)s_frame
{
+ (id)voutView: (vout_thread_t *)p_vout subView: (NSView *)view
frame: (NSRect *)s_frame
{
- vlc_value_t value_drawable;
int i_timeout;
id o_return = nil;
int i_timeout;
id o_return = nil;
- var_Get( p_vout->p_libvlc, "drawable", &value_drawable );
+ i_drawable_gl = var_GetInteger( p_vout->p_libvlc, "drawable-gl" );
var_Create( p_vout, "macosx-vdev", VLC_VAR_INTEGER | VLC_VAR_DOINHERIT );
var_Create( p_vout, "macosx-stretch", VLC_VAR_BOOL | VLC_VAR_DOINHERIT );
var_Create( p_vout, "macosx-vdev", VLC_VAR_INTEGER | VLC_VAR_DOINHERIT );
var_Create( p_vout, "macosx-stretch", VLC_VAR_BOOL | VLC_VAR_DOINHERIT );
/* We only wait for NSApp to initialise if we're not embedded (as in the
* case of the Mozilla plugin). We can tell whether we're embedded or not
/* We only wait for NSApp to initialise if we're not embedded (as in the
* case of the Mozilla plugin). We can tell whether we're embedded or not
- * by examining the "drawable" value: if it's zero, we're running in the
+ * by examining the "drawable-gl" value: if it's zero, we're running in the
* main Mac intf; if it's non-zero, we're embedded. */
* main Mac intf; if it's non-zero, we're embedded. */
- if( value_drawable.i_int == 0 )
+ if( i_drawable_gl == 0 )
{
/* Wait for a MacOS X interface to appear. Timeout is 2 seconds. */
for( i_timeout = 20 ; i_timeout-- ; )
{
/* Wait for a MacOS X interface to appear. Timeout is 2 seconds. */
for( i_timeout = 20 ; i_timeout-- ; )
memset( p_vout->p_sys, 0, sizeof( vout_sys_t ) );
memset( p_vout->p_sys, 0, sizeof( vout_sys_t ) );
- var_Get( p_vout->p_libvlc, "drawable", &value_drawable );
+ var_Get( p_vout->p_libvlc, "drawable-agl", &value_drawable );
if( value_drawable.i_int != 0 )
{
static const GLint ATTRIBUTES[] = {
if( value_drawable.i_int != 0 )
{
static const GLint ATTRIBUTES[] = {
msg_Err( p_vout, "cannot create AGL context." );
return VLC_EGENERIC;
}
msg_Err( p_vout, "cannot create AGL context." );
return VLC_EGENERIC;
}
// tell opengl not to sync buffer swap with vertical retrace (too inefficient)
GLint param = 0;
aglSetInteger(p_vout->p_sys->agl_ctx, AGL_SWAP_INTERVAL, ¶m);
// tell opengl not to sync buffer swap with vertical retrace (too inefficient)
GLint param = 0;
aglSetInteger(p_vout->p_sys->agl_ctx, AGL_SWAP_INTERVAL, ¶m);
Rect viewBounds;
Rect clipBounds;
Rect viewBounds;
Rect clipBounds;
- var_Get( p_vout->p_libvlc, "drawable", &val );
+ var_Get( p_vout->p_libvlc, "drawable-agl", &val );
p_vout->p_sys->agl_drawable = (AGLDrawable)val.i_int;
aglSetDrawable(p_vout->p_sys->agl_ctx, p_vout->p_sys->agl_drawable);
p_vout->p_sys->agl_drawable = (AGLDrawable)val.i_int;
aglSetDrawable(p_vout->p_sys->agl_ctx, p_vout->p_sys->agl_drawable);
Rect viewBounds;
Rect clipBounds;
Rect viewBounds;
Rect clipBounds;
- var_Get( p_vout->p_libvlc, "drawable", &val );
+ var_Get( p_vout->p_libvlc, "drawable-agl", &val );
p_vout->p_sys->agl_drawable = (AGLDrawable)val.i_int;
aglSetDrawable(p_vout->p_sys->agl_ctx, p_vout->p_sys->agl_drawable);
p_vout->p_sys->agl_drawable = (AGLDrawable)val.i_int;
aglSetDrawable(p_vout->p_sys->agl_ctx, p_vout->p_sys->agl_drawable);
* a layer. The layer will register itself to the drawable object stored in
* the "drawable" variable.
*****************************************************************************
* a layer. The layer will register itself to the drawable object stored in
* the "drawable" variable.
*****************************************************************************
- * Copyright (C) 2004 the VideoLAN team
+ * Copyright (C) 2004-2009 the VideoLAN team
* $Id$
*
* Authors: Cyril Deguet <asmax@videolan.org>
* $Id$
*
* Authors: Cyril Deguet <asmax@videolan.org>
/* We do need a drawable to work properly */
vlc_value_t value_drawable;
/* We do need a drawable to work properly */
vlc_value_t value_drawable;
- var_Create( p_vout, "drawable", VLC_VAR_DOINHERIT );
- var_Get( p_vout, "drawable", &value_drawable );
+ var_Create( p_vout, "drawable-gl", VLC_VAR_DOINHERIT );
+ var_Get( p_vout, "drawable-gl", &value_drawable );
p_vout->p_sys->o_cocoa_container = (id) value_drawable.i_int;
p_vout->p_sys->o_cocoa_container = (id) value_drawable.i_int;
* libvlc_internal.h : Definition of opaque structures for libvlc exported API
* Also contains some internal utility functions
*****************************************************************************
* libvlc_internal.h : Definition of opaque structures for libvlc exported API
* Also contains some internal utility functions
*****************************************************************************
- * Copyright (C) 2005 the VideoLAN team
+ * Copyright (C) 2005-2009 the VideoLAN team
* $Id$
*
* Authors: Clément Stenac <zorglub@videolan.org>
* $Id$
*
* Authors: Clément Stenac <zorglub@videolan.org>
{
void *hwnd;
uint32_t xid;
{
void *hwnd;
uint32_t xid;
} drawable;
bool b_own_its_input_thread;
} drawable;
bool b_own_its_input_thread;
var_Destroy( p_input_thread, "drawable-hwnd" );
var_Destroy( p_input_thread, "drawable-xid" );
var_Destroy( p_input_thread, "drawable-hwnd" );
var_Destroy( p_input_thread, "drawable-xid" );
+ var_Destroy( p_input_thread, "drawable-agl" );
}
vlc_object_release( p_input_thread );
}
vlc_object_release( p_input_thread );
return NULL;
}
p_mi->p_md = NULL;
return NULL;
}
p_mi->p_md = NULL;
+ p_mi->drawable.agl = 0;
p_mi->drawable.xid = 0;
p_mi->drawable.hwnd = NULL;
p_mi->p_libvlc_instance = p_libvlc_instance;
p_mi->drawable.xid = 0;
p_mi->drawable.hwnd = NULL;
p_mi->p_libvlc_instance = p_libvlc_instance;
p_input_thread = p_mi->p_input_thread;
p_input_thread = p_mi->p_input_thread;
+ var_Create( p_input_thread, "drawable-agl", VLC_VAR_INTEGER );
+ if( p_mi->drawable.agl )
+ var_SetInteger( p_input_thread, "drawable-agl", p_mi->drawable.agl );
+
var_Create( p_input_thread, "drawable-xid", VLC_VAR_INTEGER );
if( p_mi->drawable.xid )
var_SetInteger( p_input_thread, "drawable-xid", p_mi->drawable.xid );
var_Create( p_input_thread, "drawable-xid", VLC_VAR_INTEGER );
if( p_mi->drawable.xid )
var_SetInteger( p_input_thread, "drawable-xid", p_mi->drawable.xid );
+/**************************************************************************
+ * set_agl
+ **************************************************************************/
+void libvlc_media_player_set_agl( libvlc_media_player_t *p_mi,
+ uint32_t drawable,
+ libvlc_exception_t *p_e )
+{
+ (void) p_e;
+ p_mi->drawable.agl = drawable;
+}
+
+/**************************************************************************
+ * get_agl
+ **************************************************************************/
+uint32_t libvlc_media_player_get_agl( libvlc_media_player_t *p_mi )
+{
+ return p_mi->drawable.agl;
+}
+
/**************************************************************************
* set_xwindow
**************************************************************************/
/**************************************************************************
* set_xwindow
**************************************************************************/
p_mi->drawable.hwnd = (HWND)drawable;
else
libvlc_exception_raise(p_e, "Operation not supported");
p_mi->drawable.hwnd = (HWND)drawable;
else
libvlc_exception_raise(p_e, "Operation not supported");
+#elif defined(__APPLE__)
+ p_mi->drawable.agl = drawable;
#else
p_mi->drawable.xid = drawable;
#endif
#else
p_mi->drawable.xid = drawable;
#endif
return (libvlc_drawable_t)p_mi->drawable.hwnd;
else
return 0;
return (libvlc_drawable_t)p_mi->drawable.hwnd;
else
return 0;
+#elif defined(__APPLE__)
+ return p_mi->drawable.agl;
#else
return p_mi->drawable.xid;
#endif
#else
return p_mi->drawable.xid;
#endif
return; /* BOOM! we told you not to use this function! */
val.p_address = (void *)(uintptr_t)d;
var_Set( p_instance->p_libvlc_int, "drawable-hwnd", val );
return; /* BOOM! we told you not to use this function! */
val.p_address = (void *)(uintptr_t)d;
var_Set( p_instance->p_libvlc_int, "drawable-hwnd", val );
+#elif defined(__APPLE__)
+ var_SetInteger( p_instance->p_libvlc_int, "drawable-agl", d );
#else
var_SetInteger( p_instance->p_libvlc_int, "drawable-xid", d );
#endif
#else
var_SetInteger( p_instance->p_libvlc_int, "drawable-xid", d );
#endif
return 0;
var_Get( p_instance->p_libvlc_int, "drawable-hwnd", &val );
return (uintptr_t)val.p_address;
return 0;
var_Get( p_instance->p_libvlc_int, "drawable-hwnd", &val );
return (uintptr_t)val.p_address;
+#elif defined(__APPLE__)
+ return var_GetInteger( p_instance->p_libvlc_int, "drawable-agl" );
#else
return var_GetInteger( p_instance->p_libvlc_int, "drawable-xid" );
#endif
}
#else
return var_GetInteger( p_instance->p_libvlc_int, "drawable-xid" );
#endif
}
void libvlc_video_set_size( libvlc_instance_t *p_instance, int width, int height,
libvlc_exception_t *p_e )
{
void libvlc_video_set_size( libvlc_instance_t *p_instance, int width, int height,
libvlc_exception_t *p_e )
{
*/
var_Create( p_libvlc, "drawable-xid", VLC_VAR_INTEGER );
var_Create( p_libvlc, "drawable-hwnd", VLC_VAR_ADDRESS );
*/
var_Create( p_libvlc, "drawable-xid", VLC_VAR_INTEGER );
var_Create( p_libvlc, "drawable-hwnd", VLC_VAR_ADDRESS );
-#ifdef __APPLE__
- var_Create( p_libvlc, "drawable", VLC_VAR_INTEGER );
-#endif
+ var_Create( p_libvlc, "drawable-agl", VLC_VAR_INTEGER );
+ var_Create( p_libvlc, "drawable-gl", VLC_VAR_INTEGER );
+
var_Create( p_libvlc, "drawable-view-top", VLC_VAR_INTEGER );
var_Create( p_libvlc, "drawable-view-left", VLC_VAR_INTEGER );
var_Create( p_libvlc, "drawable-view-bottom", VLC_VAR_INTEGER );
var_Create( p_libvlc, "drawable-view-top", VLC_VAR_INTEGER );
var_Create( p_libvlc, "drawable-view-left", VLC_VAR_INTEGER );
var_Create( p_libvlc, "drawable-view-bottom", VLC_VAR_INTEGER );