Commit 0926bbb6 authored by Laurent Aimar's avatar Laurent Aimar
Browse files

Split back window module providers by type.

parent 592f40d6
......@@ -41,7 +41,7 @@ typedef struct vout_window_sys_t vout_window_sys_t;
* Window handle type
*/
enum {
VOUT_WINDOW_TYPE_XWINDOW,
VOUT_WINDOW_TYPE_XID,
VOUT_WINDOW_TYPE_HWND,
};
......
......@@ -70,7 +70,7 @@ vlc_module_begin();
add_shortcut( "maemo" );
add_submodule();
set_capability( "vout window", 50 );
set_capability( "vout window xid", 50 );
set_callbacks( OpenWindow, CloseWindow );
vlc_module_end();
......@@ -265,8 +265,7 @@ static int OpenWindow (vlc_object_t *obj)
{
vout_window_t *wnd = (vout_window_t *)obj;
if (wnd->cfg->type != VOUT_WINDOW_TYPE_XWINDOW ||
wnd->cfg->is_standalone)
if (wnd->cfg->is_standalone)
return VLC_EGENERIC;
intf_thread_t *intf = (intf_thread_t*)vlc_object_find_name (obj, "maemo", FIND_ANYWHERE);
......
......@@ -243,7 +243,11 @@ vlc_module_begin ()
#if defined(Q_WS_X11) || defined(WIN32)
add_submodule ()
set_capability( "vout window", 50 )
#if defined(Q_WS_X11)
set_capability( "vout window xid", 50 )
#elif defined(WIN32)
set_capability( "vout window hwnd", 50 )
#endif
set_callbacks( WindowOpen, WindowClose )
#endif
......@@ -518,14 +522,6 @@ static int WindowOpen( vlc_object_t *p_obj )
{
vout_window_t *p_wnd = (vout_window_t*)p_obj;
/* Check compatibility */
#if defined (Q_WS_X11)
if( p_wnd->cfg->type != VOUT_WINDOW_TYPE_XWINDOW )
#elif defined (WIN32)
if( p_wnd->cfg->type != VOUT_WINDOW_TYPE_HWND )
#endif
return VLC_EGENERIC;
/* */
if( p_wnd->cfg->is_standalone )
return VLC_EGENERIC;
......
......@@ -569,7 +569,11 @@ vlc_module_begin ()
add_shortcut( "skins" )
add_submodule ()
set_capability( "vout window", 51 )
#ifdef WIN32
set_capability( "vout window hwnd", 51 )
#else
set_capability( "vout window xid", 51 )
#endif
set_callbacks( WindowOpen, WindowClose )
add_submodule ()
......
......@@ -47,7 +47,7 @@ vlc_module_begin ()
set_description (N_("Embedded window video"))
set_category (CAT_VIDEO)
set_subcategory (SUBCAT_VIDEO_VOUT)
set_capability ("vout window", 70)
set_capability ("vout window xid", 70)
set_callbacks (Open, Close)
add_integer ("drawable-xid", 0, NULL, XID_TEXT, XID_LONGTEXT, true)
change_unsaveable ()
......@@ -77,7 +77,7 @@ static int Open (vlc_object_t *obj)
switch (wnd->cfg->type)
{
case VOUT_WINDOW_TYPE_XWINDOW:
case VOUT_WINDOW_TYPE_XID:
varname = "drawable-xid";
ptr = false;
break;
......
......@@ -668,7 +668,7 @@ static int InitWindow( vout_thread_t *p_vout )
vout_window_cfg_t wnd_cfg;
memset( &wnd_cfg, 0, sizeof(wnd_cfg) );
wnd_cfg.type = VOUT_WINDOW_TYPE_XWINDOW;
wnd_cfg.type = VOUT_WINDOW_TYPE_XID;
wnd_cfg.x = p_sys->embedded_window.i_x;
wnd_cfg.y = p_sys->embedded_window.i_y;
wnd_cfg.width = p_sys->embedded_window.i_width;
......
......@@ -1612,7 +1612,7 @@ static int CreateWindow( vout_thread_t *p_vout, x11_window_t *p_win )
{
vout_window_cfg_t wnd_cfg;
memset( &wnd_cfg, 0, sizeof(wnd_cfg) );
wnd_cfg.type = VOUT_WINDOW_TYPE_XWINDOW;
wnd_cfg.type = VOUT_WINDOW_TYPE_XID;
wnd_cfg.x = p_win->i_x;
wnd_cfg.y = p_win->i_y;
wnd_cfg.width = p_win->i_width;
......
......@@ -72,7 +72,7 @@ vout_window_t *GetWindow (vout_thread_t *obj,
vout_window_cfg_t wnd_cfg;
memset( &wnd_cfg, 0, sizeof(wnd_cfg) );
wnd_cfg.type = VOUT_WINDOW_TYPE_XWINDOW;
wnd_cfg.type = VOUT_WINDOW_TYPE_XID;
wnd_cfg.width = obj->i_window_width;
wnd_cfg.height = obj->i_window_height;
......
......@@ -56,7 +56,7 @@ vlc_module_begin ()
set_description (N_("(Experimental) XCB video window"))
set_category (CAT_VIDEO)
set_subcategory (SUBCAT_VIDEO_VOUT)
set_capability ("vout window", 10)
set_capability ("vout window xid", 10)
set_callbacks (Open, Close)
add_string ("x11-display", NULL, NULL,
......@@ -144,9 +144,6 @@ static int Open (vlc_object_t *obj)
xcb_generic_error_t *err;
xcb_void_cookie_t ck;
if (wnd->cfg->type != VOUT_WINDOW_TYPE_XWINDOW)
return VLC_EGENERIC;
vout_window_sys_t *p_sys = malloc (sizeof (*p_sys));
if (p_sys == NULL)
return VLC_ENOMEM;
......
......@@ -46,7 +46,19 @@ vout_window_t *vout_window_New(vlc_object_t *obj,
vlc_object_attach(window, obj);
window->module = module_need(window, "vout window",
const char *type;
switch (cfg->type) {
case VOUT_WINDOW_TYPE_HWND:
type = "vout window hwnd";
break;
default:
assert(0);
case VOUT_WINDOW_TYPE_XID:
type = "vout window xid";
break;
}
window->module = module_need(window, type,
module, module && *module != '\0');
if (!window->module) {
vlc_object_detach(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