[vlc-devel] commit: Split back window module providers by type. (Laurent Aimar )
git version control
git at videolan.org
Sat Aug 1 13:47:56 CEST 2009
vlc | branch: master | Laurent Aimar <fenrir at videolan.org> | Sat Aug 1 13:44:47 2009 +0200| [0926bbb6104aa6bbb10918f753a8cc677a796f9b] | committer: Laurent Aimar
Split back window module providers by type.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=0926bbb6104aa6bbb10918f753a8cc677a796f9b
---
include/vlc_vout_window.h | 2 +-
modules/gui/maemo/maemo.c | 5 ++---
modules/gui/qt4/qt4.cpp | 14 +++++---------
modules/gui/skins2/src/skin_main.cpp | 6 +++++-
modules/video_output/drawable.c | 4 ++--
modules/video_output/omapfb.c | 2 +-
modules/video_output/x11/xcommon.c | 2 +-
modules/video_output/xcb/common.c | 2 +-
modules/video_output/xcb/window.c | 5 +----
src/video_output/window.c | 14 +++++++++++++-
10 files changed, 32 insertions(+), 24 deletions(-)
diff --git a/include/vlc_vout_window.h b/include/vlc_vout_window.h
index 0500a5f..58eaf4e 100644
--- a/include/vlc_vout_window.h
+++ b/include/vlc_vout_window.h
@@ -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,
};
diff --git a/modules/gui/maemo/maemo.c b/modules/gui/maemo/maemo.c
index 9500c56..d323e77 100644
--- a/modules/gui/maemo/maemo.c
+++ b/modules/gui/maemo/maemo.c
@@ -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);
diff --git a/modules/gui/qt4/qt4.cpp b/modules/gui/qt4/qt4.cpp
index 325b15a..bce9dcd 100644
--- a/modules/gui/qt4/qt4.cpp
+++ b/modules/gui/qt4/qt4.cpp
@@ -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;
diff --git a/modules/gui/skins2/src/skin_main.cpp b/modules/gui/skins2/src/skin_main.cpp
index 5d1c7c9..759a1eb 100644
--- a/modules/gui/skins2/src/skin_main.cpp
+++ b/modules/gui/skins2/src/skin_main.cpp
@@ -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 ()
diff --git a/modules/video_output/drawable.c b/modules/video_output/drawable.c
index a7c91c0..a3c7668 100644
--- a/modules/video_output/drawable.c
+++ b/modules/video_output/drawable.c
@@ -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;
diff --git a/modules/video_output/omapfb.c b/modules/video_output/omapfb.c
index bf3effd..9d316de 100644
--- a/modules/video_output/omapfb.c
+++ b/modules/video_output/omapfb.c
@@ -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;
diff --git a/modules/video_output/x11/xcommon.c b/modules/video_output/x11/xcommon.c
index 65b522d..0391683 100644
--- a/modules/video_output/x11/xcommon.c
+++ b/modules/video_output/x11/xcommon.c
@@ -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;
diff --git a/modules/video_output/xcb/common.c b/modules/video_output/xcb/common.c
index 6bfd35f..6e4fe84 100644
--- a/modules/video_output/xcb/common.c
+++ b/modules/video_output/xcb/common.c
@@ -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;
diff --git a/modules/video_output/xcb/window.c b/modules/video_output/xcb/window.c
index 0f8a4b3..4c34d51 100644
--- a/modules/video_output/xcb/window.c
+++ b/modules/video_output/xcb/window.c
@@ -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;
diff --git a/src/video_output/window.c b/src/video_output/window.c
index de464d3..737edba 100644
--- a/src/video_output/window.c
+++ b/src/video_output/window.c
@@ -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);
More information about the vlc-devel
mailing list