Commit daed9da9 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

vout_window: use custom entry callback

parent b7de335c
...@@ -79,11 +79,6 @@ typedef struct { ...@@ -79,11 +79,6 @@ typedef struct {
struct vout_window_t { struct vout_window_t {
VLC_COMMON_MEMBERS VLC_COMMON_MEMBERS
/* Initial state (reserved).
* Once the open function is called, it will be set to NULL
*/
const vout_window_cfg_t *cfg;
/* window handle (mandatory) /* window handle (mandatory)
* *
* It must be filled in the open function. * It must be filled in the open function.
......
...@@ -47,13 +47,13 @@ ...@@ -47,13 +47,13 @@
/***************************************************************************** /*****************************************************************************
* Local prototypes * Local prototypes
*****************************************************************************/ *****************************************************************************/
static int Open ( vlc_object_t * ); static int Open ( vlc_object_t * );
static void Close ( vlc_object_t * ); static void Close ( vlc_object_t * );
static void *Thread ( void * ); static void *Thread ( void * );
static int OpenWindow ( vlc_object_t * ); static int OpenWindow ( vout_window_t *, const vout_window_cfg_t * );
static void CloseWindow ( vlc_object_t * ); static void CloseWindow ( vout_window_t * );
static int ControlWindow ( vout_window_t *, int, va_list ); static int ControlWindow ( vout_window_t *, int, va_list );
static gboolean interface_ready ( gpointer ); static gboolean interface_ready ( gpointer );
/***************************************************************************** /*****************************************************************************
* Module descriptor * Module descriptor
...@@ -283,13 +283,12 @@ static void *Thread( void *obj ) ...@@ -283,13 +283,12 @@ static void *Thread( void *obj )
/** /**
* Video output window provider * Video output window provider
*/ */
static int OpenWindow (vlc_object_t *p_obj) static int OpenWindow (vout_window_t *p_wnd, const vout_window_cfg_t *cfg)
{ {
vout_window_t *p_wnd = (vout_window_t *)p_obj;
intf_thread_t *p_intf; intf_thread_t *p_intf;
vlc_value_t val; vlc_value_t val;
if (p_wnd->cfg->is_standalone) if (cfg->is_standalone)
return VLC_EGENERIC; return VLC_EGENERIC;
if( var_Get( p_obj->p_libvlc, "hildon-iface", &val ) ) if( var_Get( p_obj->p_libvlc, "hildon-iface", &val ) )
...@@ -343,9 +342,8 @@ static int ControlWindow (vout_window_t *p_wnd, int query, va_list args) ...@@ -343,9 +342,8 @@ static int ControlWindow (vout_window_t *p_wnd, int query, va_list args)
} }
} }
static void CloseWindow (vlc_object_t *p_obj) static void CloseWindow (vout_window_t *p_wnd)
{ {
vout_window_t *p_wnd = (vout_window_t *)p_obj;
intf_thread_t *p_intf = (intf_thread_t *)p_wnd->sys; intf_thread_t *p_intf = (intf_thread_t *)p_wnd->sys;
if( p_intf->p_sys->b_fullscreen ) if( p_intf->p_sys->b_fullscreen )
......
...@@ -46,6 +46,7 @@ ...@@ -46,6 +46,7 @@
#include "../../../share/icons/32x32/vlc.xpm" #include "../../../share/icons/32x32/vlc.xpm"
#include "../../../share/icons/32x32/vlc-xmas.xpm" #include "../../../share/icons/32x32/vlc-xmas.xpm"
#include <vlc_plugin.h> #include <vlc_plugin.h>
#include <vlc_vout_window.h>
#ifdef WIN32 /* For static builds */ #ifdef WIN32 /* For static builds */
#include <QtPlugin> #include <QtPlugin>
...@@ -60,8 +61,8 @@ static int OpenIntf ( vlc_object_t * ); ...@@ -60,8 +61,8 @@ static int OpenIntf ( vlc_object_t * );
static int OpenDialogs ( vlc_object_t * ); static int OpenDialogs ( vlc_object_t * );
static int Open ( vlc_object_t *, bool ); static int Open ( vlc_object_t *, bool );
static void Close ( vlc_object_t * ); static void Close ( vlc_object_t * );
static int WindowOpen ( vlc_object_t * ); static int WindowOpen ( vout_window_t *, const vout_window_cfg_t * );
static void WindowClose ( vlc_object_t * ); static void WindowClose ( vout_window_t * );
static void *Thread ( void * ); static void *Thread ( void * );
static void ShowDialog ( intf_thread_t *, int, int, intf_dialog_args_t * ); static void ShowDialog ( intf_thread_t *, int, int, intf_dialog_args_t * );
...@@ -607,31 +608,23 @@ static void ShowDialog( intf_thread_t *p_intf, int i_dialog_event, int i_arg, ...@@ -607,31 +608,23 @@ static void ShowDialog( intf_thread_t *p_intf, int i_dialog_event, int i_arg,
* *
* TODO move it out of here ? * TODO move it out of here ?
*/ */
#include <vlc_vout_window.h>
static int WindowControl( vout_window_t *, int i_query, va_list ); static int WindowControl( vout_window_t *, int i_query, va_list );
static int WindowOpen( vlc_object_t *p_obj ) static int WindowOpen( vout_window_t *p_wnd, const vout_window_cfg_t *cfg )
{ {
vout_window_t *p_wnd = (vout_window_t*)p_obj;
/* */ /* */
if( p_wnd->cfg->is_standalone ) if( cfg->is_standalone )
return VLC_EGENERIC; return VLC_EGENERIC;
#if defined (Q_WS_X11) #if defined (Q_WS_X11)
if( var_InheritBool( p_obj, "video-wallpaper" ) ) if( var_InheritBool( p_wnd, "video-wallpaper" ) )
return VLC_EGENERIC; return VLC_EGENERIC;
#endif #endif
vlc_value_t val; intf_thread_t *p_intf =
if( var_Inherit( p_obj, "qt4-iface", VLC_VAR_ADDRESS, &val ) ) (intf_thread_t *)var_InheritAddress( p_wnd, "qt4-iface" );
val.p_address = NULL;
intf_thread_t *p_intf = (intf_thread_t *)val.p_address;
if( !p_intf ) if( !p_intf )
{ /* If another interface is used, this plugin cannot work */ { /* If another interface is used, this plugin cannot work */
msg_Dbg( p_obj, "Qt4 interface not found" ); msg_Dbg( p_wnd, "Qt4 interface not found" );
return VLC_EGENERIC; return VLC_EGENERIC;
} }
...@@ -640,12 +633,12 @@ static int WindowOpen( vlc_object_t *p_obj ) ...@@ -640,12 +633,12 @@ static int WindowOpen( vlc_object_t *p_obj )
return VLC_EGENERIC; return VLC_EGENERIC;
MainInterface *p_mi = p_intf->p_sys->p_mi; MainInterface *p_mi = p_intf->p_sys->p_mi;
msg_Dbg( p_obj, "requesting video..." ); msg_Dbg( p_wnd, "requesting video..." );
int i_x = p_wnd->cfg->x; int i_x = cfg->x;
int i_y = p_wnd->cfg->y; int i_y = cfg->y;
unsigned i_width = p_wnd->cfg->width; unsigned i_width = cfg->width;
unsigned i_height = p_wnd->cfg->height; unsigned i_height = cfg->height;
#if defined (Q_WS_X11) #if defined (Q_WS_X11)
p_wnd->handle.xid = p_mi->getVideo( &i_x, &i_y, &i_width, &i_height ); p_wnd->handle.xid = p_mi->getVideo( &i_x, &i_y, &i_width, &i_height );
...@@ -684,9 +677,8 @@ static int WindowControl( vout_window_t *p_wnd, int i_query, va_list args ) ...@@ -684,9 +677,8 @@ static int WindowControl( vout_window_t *p_wnd, int i_query, va_list args )
return p_mi->controlVideo( i_query, args ); return p_mi->controlVideo( i_query, args );
} }
static void WindowClose( vlc_object_t *p_obj ) static void WindowClose( vout_window_t *p_wnd )
{ {
vout_window_t *p_wnd = (vout_window_t*)p_obj;
MainInterface *p_mi = (MainInterface *)p_wnd->sys; MainInterface *p_mi = (MainInterface *)p_wnd->sys;
QMutexLocker locker (&lock); QMutexLocker locker (&lock);
...@@ -701,9 +693,9 @@ static void WindowClose( vlc_object_t *p_obj ) ...@@ -701,9 +693,9 @@ static void WindowClose( vlc_object_t *p_obj )
* XCB and Xlib-XCB are fine with that. Plain Xlib wouldn't, */ * XCB and Xlib-XCB are fine with that. Plain Xlib wouldn't, */
if (unlikely(!active)) if (unlikely(!active))
{ {
msg_Warn (p_obj, "video already released"); msg_Warn (p_wnd, "video already released");
return; return;
} }
msg_Dbg (p_obj, "releasing video..."); msg_Dbg (p_wnd, "releasing video...");
p_mi->releaseVideo(); p_mi->releaseVideo();
} }
...@@ -316,10 +316,8 @@ end: ...@@ -316,10 +316,8 @@ end:
static vlc_mutex_t serializer = VLC_STATIC_MUTEX; static vlc_mutex_t serializer = VLC_STATIC_MUTEX;
// Callbacks for vout requests // Callbacks for vout requests
static int WindowOpen( vlc_object_t *p_this ) static int WindowOpen( vout_window_t *pWnd, const vout_window_cfg_t *cfg )
{ {
vout_window_t *pWnd = (vout_window_t *)p_this;
vlc_mutex_lock( &skin_load.mutex ); vlc_mutex_lock( &skin_load.mutex );
intf_thread_t *pIntf = skin_load.intf; intf_thread_t *pIntf = skin_load.intf;
if( pIntf ) if( pIntf )
...@@ -331,7 +329,7 @@ static int WindowOpen( vlc_object_t *p_this ) ...@@ -331,7 +329,7 @@ static int WindowOpen( vlc_object_t *p_this )
if( !vlc_object_alive( pIntf ) || if( !vlc_object_alive( pIntf ) ||
!var_InheritBool( pIntf, "skinned-video") || !var_InheritBool( pIntf, "skinned-video") ||
pWnd->cfg->is_standalone ) cfg->is_standalone )
{ {
vlc_object_release( pIntf ); vlc_object_release( pIntf );
return VLC_EGENERIC; return VLC_EGENERIC;
...@@ -357,9 +355,8 @@ static int WindowOpen( vlc_object_t *p_this ) ...@@ -357,9 +355,8 @@ static int WindowOpen( vlc_object_t *p_this )
} }
} }
static void WindowClose( vlc_object_t *p_this ) static void WindowClose( vout_window_t *pWnd )
{ {
vout_window_t *pWnd = (vout_window_t *)p_this;
intf_thread_t *pIntf = (intf_thread_t *)pWnd->sys; intf_thread_t *pIntf = (intf_thread_t *)pWnd->sys;
vlc_mutex_lock( &serializer ); vlc_mutex_lock( &serializer );
......
...@@ -31,8 +31,8 @@ ...@@ -31,8 +31,8 @@
#include <vlc_plugin.h> #include <vlc_plugin.h>
#include <vlc_vout_window.h> #include <vlc_vout_window.h>
static int Open (vlc_object_t *); static int Open (vout_window_t *, const vout_window_cfg_t *);
static void Close(vlc_object_t *); static void Close(vout_window_t *);
/* /*
* Module descriptor * Module descriptor
...@@ -54,23 +54,22 @@ static vlc_mutex_t serializer = VLC_STATIC_MUTEX; ...@@ -54,23 +54,22 @@ static vlc_mutex_t serializer = VLC_STATIC_MUTEX;
/** /**
* Find the drawable set by libvlc application. * Find the drawable set by libvlc application.
*/ */
static int Open (vlc_object_t *obj) static int Open (vout_window_t *wnd)
{ {
vout_window_t *wnd = (vout_window_t *)obj;
void **used, *val; void **used, *val;
size_t n = 0; size_t n = 0;
if (var_Create (obj->p_libvlc, "hwnd-in-use", VLC_VAR_ADDRESS) if (var_Create (wnd->p_libvlc, "hwnd-in-use", VLC_VAR_ADDRESS)
|| var_Create (obj, "drawable-hwnd", VLC_VAR_DOINHERIT | VLC_VAR_ADDRESS)) || var_Create (wnd, "drawable-hwnd", VLC_VAR_DOINHERIT | VLC_VAR_ADDRESS))
return VLC_ENOMEM; return VLC_ENOMEM;
val = var_GetAddress (obj, "drawable-hwnd"); val = var_GetAddress (wnd, "drawable-hwnd");
var_Destroy (obj, "drawable-hwnd"); var_Destroy (wnd, "drawable-hwnd");
/* Keep a list of busy drawables, so we don't overlap videos if there are /* Keep a list of busy drawables, so we don't overlap videos if there are
* more than one video track in the stream. */ * more than one video track in the stream. */
vlc_mutex_lock (&serializer); vlc_mutex_lock (&serializer);
used = var_GetAddress (obj->p_libvlc, "hwnd-in-use"); used = var_GetAddress (wnd->p_libvlc, "hwnd-in-use");
if (used != NULL) if (used != NULL)
{ {
while (used[n] != NULL) while (used[n] != NULL)
...@@ -86,7 +85,7 @@ static int Open (vlc_object_t *obj) ...@@ -86,7 +85,7 @@ static int Open (vlc_object_t *obj)
{ {
used[n] = val; used[n] = val;
used[n + 1] = NULL; used[n + 1] = NULL;
var_SetAddress (obj->p_libvlc, "hwnd-in-use", used); var_SetAddress (wnd->p_libvlc, "hwnd-in-use", used);
} }
else else
{ {
...@@ -108,15 +107,14 @@ skip: ...@@ -108,15 +107,14 @@ skip:
/** /**
* Release the drawable. * Release the drawable.
*/ */
static void Close (vlc_object_t *obj) static void Close (vout_window_t *wnd)
{ {
vout_window_t *wnd = (vout_window_t *)obj;
void **used, *val = wnd->sys; void **used, *val = wnd->sys;
size_t n = 0; size_t n = 0;
/* Remove this drawable from the list of busy ones */ /* Remove this drawable from the list of busy ones */
vlc_mutex_lock (&serializer); vlc_mutex_lock (&serializer);
used = var_GetAddress (obj->p_libvlc, "hwnd-in-use"); used = var_GetAddress (wnd->p_libvlc, "hwnd-in-use");
assert (used); assert (used);
while (used[n] != val) while (used[n] != val)
{ {
...@@ -128,13 +126,13 @@ static void Close (vlc_object_t *obj) ...@@ -128,13 +126,13 @@ static void Close (vlc_object_t *obj)
while (used[++n] != NULL); while (used[++n] != NULL);
if (n == 0) if (n == 0)
var_SetAddress (obj->p_libvlc, "hwnd-in-use", NULL); var_SetAddress (wnd->p_libvlc, "hwnd-in-use", NULL);
vlc_mutex_unlock (&serializer); vlc_mutex_unlock (&serializer);
if (n == 0) if (n == 0)
free (used); free (used);
/* Variables are reference-counted... */ /* Variables are reference-counted... */
var_Destroy (obj->p_libvlc, "hwnd-in-use"); var_Destroy (wnd->p_libvlc, "hwnd-in-use");
} }
......
...@@ -45,10 +45,10 @@ typedef xcb_atom_t Atom; ...@@ -45,10 +45,10 @@ typedef xcb_atom_t Atom;
"VLC can embed its video output in an existing X11 window. " \ "VLC can embed its video output in an existing X11 window. " \
"This is the X identifier of that window (0 means none).") "This is the X identifier of that window (0 means none).")
static int Open (vlc_object_t *); static int Open (vout_window_t *, const vout_window_cfg_t *);
static void Close (vlc_object_t *); static void Close (vout_window_t *);
static int EmOpen (vlc_object_t *); static int EmOpen (vout_window_t *, const vout_window_cfg_t *);
static void EmClose (vlc_object_t *); static void EmClose (vout_window_t *);
/* /*
* Module descriptor * Module descriptor
...@@ -208,9 +208,8 @@ static void CacheAtoms (vout_window_sys_t *p_sys) ...@@ -208,9 +208,8 @@ static void CacheAtoms (vout_window_sys_t *p_sys)
/** /**
* Create an X11 window. * Create an X11 window.
*/ */
static int Open (vlc_object_t *obj) static int Open (vout_window_t *wnd, const vout_window_cfg_t *cfg)
{ {
vout_window_t *wnd = (vout_window_t *)obj;
xcb_generic_error_t *err; xcb_generic_error_t *err;
xcb_void_cookie_t ck; xcb_void_cookie_t ck;
...@@ -257,8 +256,7 @@ static int Open (vlc_object_t *obj) ...@@ -257,8 +256,7 @@ static int Open (vlc_object_t *obj)
xcb_window_t window = xcb_generate_id (conn); xcb_window_t window = xcb_generate_id (conn);
ck = xcb_create_window_checked (conn, scr->root_depth, window, scr->root, ck = xcb_create_window_checked (conn, scr->root_depth, window, scr->root,
wnd->cfg->x, wnd->cfg->y, cfg->x, cfg->y, cfg->width, cfg->height, 0,
wnd->cfg->width, wnd->cfg->height, 0,
XCB_WINDOW_CLASS_INPUT_OUTPUT, XCB_WINDOW_CLASS_INPUT_OUTPUT,
scr->root_visual, mask, values); scr->root_visual, mask, values);
err = xcb_request_check (conn, ck); err = xcb_request_check (conn, ck);
...@@ -275,8 +273,8 @@ static int Open (vlc_object_t *obj) ...@@ -275,8 +273,8 @@ static int Open (vlc_object_t *obj)
wnd->sys = p_sys; wnd->sys = p_sys;
p_sys->conn = conn; p_sys->conn = conn;
if (var_InheritBool (obj, "keyboard-events")) if (var_InheritBool (wnd, "keyboard-events"))
p_sys->keys = CreateKeyHandler (obj, conn); p_sys->keys = CreateKeyHandler (VLC_OBJECT(wnd), conn);
else else
p_sys->keys = NULL; p_sys->keys = NULL;
p_sys->root = scr->root; p_sys->root = scr->root;
...@@ -342,7 +340,7 @@ static int Open (vlc_object_t *obj) ...@@ -342,7 +340,7 @@ static int Open (vlc_object_t *obj)
/* Make the window visible */ /* Make the window visible */
xcb_map_window (conn, window); xcb_map_window (conn, window);
if (var_InheritBool (obj, "video-wallpaper")) if (var_InheritBool (wnd, "video-wallpaper"))
{ {
vout_window_SetState (wnd, VOUT_WINDOW_STATE_BELOW); vout_window_SetState (wnd, VOUT_WINDOW_STATE_BELOW);
vout_window_SetFullScreen (wnd, true); vout_window_SetFullScreen (wnd, true);
...@@ -373,9 +371,8 @@ error: ...@@ -373,9 +371,8 @@ error:
/** /**
* Destroys the X11 window. * Destroys the X11 window.
*/ */
static void Close (vlc_object_t *obj) static void Close (vout_window_t *wnd)
{ {
vout_window_t *wnd = (vout_window_t *)obj;
vout_window_sys_t *p_sys = wnd->sys; vout_window_sys_t *p_sys = wnd->sys;
xcb_connection_t *conn = p_sys->conn; xcb_connection_t *conn = p_sys->conn;
...@@ -607,15 +604,13 @@ static void ReleaseDrawable (vlc_object_t *obj, xcb_window_t window) ...@@ -607,15 +604,13 @@ static void ReleaseDrawable (vlc_object_t *obj, xcb_window_t window)
/** /**
* Wrap an existing X11 window to embed the video. * Wrap an existing X11 window to embed the video.
*/ */
static int EmOpen (vlc_object_t *obj) static int EmOpen (vout_window_t *wnd, const vout_window_cfg_t *cfg)
{ {
vout_window_t *wnd = (vout_window_t *)obj; xcb_window_t window = var_InheritInteger (wnd, "drawable-xid");
xcb_window_t window = var_InheritInteger (obj, "drawable-xid");
if (window == 0) if (window == 0)
return VLC_EGENERIC; return VLC_EGENERIC;
if (AcquireDrawable (obj, window)) if (AcquireDrawable (VLC_OBJECT(wnd), window))
return VLC_EGENERIC; return VLC_EGENERIC;
vout_window_sys_t *p_sys = malloc (sizeof (*p_sys)); vout_window_sys_t *p_sys = malloc (sizeof (*p_sys));
...@@ -635,15 +630,15 @@ static int EmOpen (vlc_object_t *obj) ...@@ -635,15 +630,15 @@ static int EmOpen (vlc_object_t *obj)
xcb_get_geometry_reply (conn, xcb_get_geometry (conn, window), NULL); xcb_get_geometry_reply (conn, xcb_get_geometry (conn, window), NULL);
if (geo == NULL) if (geo == NULL)
{ {
msg_Err (obj, "bad X11 window 0x%08"PRIx8, window); msg_Err (wnd, "bad X11 window 0x%08"PRIx8, window);
goto error; goto error;
} }
p_sys->root = geo->root; p_sys->root = geo->root;
free (geo); free (geo);
if (var_InheritBool (obj, "keyboard-events")) if (var_InheritBool (wnd, "keyboard-events"))
{ {
p_sys->keys = CreateKeyHandler (obj, conn); p_sys->keys = CreateKeyHandler (VLC_OBJECT(wnd), conn);
if (p_sys->keys != NULL) if (p_sys->keys != NULL)
{ {
const uint32_t mask = XCB_CW_EVENT_MASK; const uint32_t mask = XCB_CW_EVENT_MASK;
...@@ -660,21 +655,20 @@ static int EmOpen (vlc_object_t *obj) ...@@ -660,21 +655,20 @@ static int EmOpen (vlc_object_t *obj)
DestroyKeyHandler (p_sys->keys); DestroyKeyHandler (p_sys->keys);
xcb_flush (conn); xcb_flush (conn);
(void) cfg;
return VLC_SUCCESS; return VLC_SUCCESS;
error: error:
xcb_disconnect (conn); xcb_disconnect (conn);
free (p_sys); free (p_sys);
ReleaseDrawable (obj, window); ReleaseDrawable (VLC_OBJECT(wnd), window);
return VLC_EGENERIC; return VLC_EGENERIC;
} }
static void EmClose (vlc_object_t *obj) static void EmClose (vout_window_t *wnd)
{ {
vout_window_t *wnd = (vout_window_t *)obj;
xcb_window_t window = wnd->handle.xid; xcb_window_t window = wnd->handle.xid;
Close (obj); Close (wnd);
ReleaseDrawable (obj, window); ReleaseDrawable (VLC_OBJECT(wnd), window);
} }
...@@ -42,6 +42,15 @@ typedef struct ...@@ -42,6 +42,15 @@ typedef struct
vlc_inhibit_t *inhibit; vlc_inhibit_t *inhibit;
} window_t; } window_t;
static int vout_window_start(void *func, va_list ap)
{
int (*activate)(vout_window_t *, const vout_window_cfg_t *) = func;
vout_window_t *wnd = va_arg(ap, vout_window_t *);
const vout_window_cfg_t *cfg = va_arg(ap, const vout_window_cfg_t *);
return activate(wnd, cfg);
}
vout_window_t *vout_window_New(vlc_object_t *obj, vout_window_t *vout_window_New(vlc_object_t *obj,
const char *module, const char *module,
const vout_window_cfg_t *cfg) const vout_window_cfg_t *cfg)
...@@ -50,7 +59,6 @@ vout_window_t *vout_window_New(vlc_object_t *obj, ...@@ -50,7 +59,6 @@ vout_window_t *vout_window_New(vlc_object_t *obj,
window_t *w = vlc_custom_create(obj, sizeof(*w), VLC_OBJECT_GENERIC, name); window_t *w = vlc_custom_create(obj, sizeof(*w), VLC_OBJECT_GENERIC, name);
vout_window_t *window = &w->wnd; vout_window_t *window = &w->wnd;
window->cfg = cfg;
memset(&window->handle, 0, sizeof(window->handle)); memset(&window->handle, 0, sizeof(window->handle));
window->control = NULL; window->control = NULL;
window->sys = NULL; window->sys = NULL;
...@@ -80,7 +88,8 @@ vout_window_t *vout_window_New(vlc_object_t *obj, ...@@ -80,7 +88,8 @@ vout_window_t *vout_window_New(vlc_object_t *obj,
assert(0); assert(0);
} }
w->module = module_need(window, type, module, module && *module != '\0'); w->module = vlc_module_load(window, type, module, module && *module,
vout_window_start, window, cfg);
if (!w->module) { if (!w->module) {
vlc_object_release(window); vlc_object_release(window);
return NULL; return NULL;
...@@ -100,6 +109,14 @@ vout_window_t *vout_window_New(vlc_object_t *obj, ...@@ -100,6 +109,14 @@ vout_window_t *vout_window_New(vlc_object_t *obj,
return window; return window;
} }
static void vout_window_stop(void *func, va_list ap)
{
int (*deactivate)(vout_window_t *) = func;
vout_window_t *wnd = va_arg(ap, vout_window_t *);
deactivate(wnd);
}
void vout_window_Delete(vout_window_t *window) void vout_window_Delete(vout_window_t *window)
{ {
if (!window) if (!window)
...@@ -112,8 +129,7 @@ void vout_window_Delete(vout_window_t *window) ...@@ -112,8 +129,7 @@ void vout_window_Delete(vout_window_t *window)
vlc_inhibit_Destroy (w->inhibit); vlc_inhibit_Destroy (w->inhibit);
} }
module_unneed(window, w->module); vlc_module_unload(w->module, vout_window_stop, window);
vlc_object_release(window); vlc_object_release(window);
} }
......
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