Segregate vout window types
authorRémi Denis-Courmont <rdenis@simphalempin.com>
Sat, 31 Jan 2009 18:40:17 +0000 (20:40 +0200)
committerRémi Denis-Courmont <rdenis@simphalempin.com>
Sat, 31 Jan 2009 18:40:17 +0000 (20:40 +0200)
include/vlc_window.h
modules/gui/maemo/maemo.c
modules/gui/qt4/qt4.cpp
modules/video_output/msw/events.c
modules/video_output/omapfb.c
modules/video_output/x11/xcommon.c
modules/video_output/xcb/window.c
modules/video_output/xcb/xcb.c
src/video_output/vout_intf.c

index a0fe0ec..a002f3a 100644 (file)
@@ -51,8 +51,22 @@ struct vout_window_t
     int (*control) (struct vout_window_t *, int, va_list);
 };
 
-VLC_EXPORT( vout_window_t *, vout_RequestWindow, ( vout_thread_t *, int *, int *, unsigned int *, unsigned int * ) );
+VLC_EXPORT( vout_window_t *, vout_RequestWindow, ( vout_thread_t *, const char *, int *, int *, unsigned int *, unsigned int * ) );
 VLC_EXPORT( void,   vout_ReleaseWindow, ( vout_window_t * ) );
 VLC_EXPORT( int, vout_ControlWindow, ( vout_window_t *, int, va_list ) );
 
+static inline vout_window_t *
+vout_RequestXWindow (vout_thread_t *vout,
+                     int *x, int *y, unsigned *w, unsigned *h)
+{
+    return vout_RequestWindow (vout, "xwindow", x, y, w, h);
+}
+
+static inline vout_window_t *
+vout_RequestHWND (vout_thread_t *vout,
+                  int *x, int *y, unsigned *w, unsigned *h)
+{
+    return vout_RequestWindow (vout, "hwnd", x, y, w, h);
+}
+
 #endif /* !LIBVLCCORE_WINDOW_H */
index 7ed5c39..0690062 100644 (file)
@@ -70,7 +70,7 @@ vlc_module_begin();
     add_shortcut( "maemo" );
 
     add_submodule();
-        set_capability( "vout_window", 50 );
+        set_capability( "xwindow", 50 );
         set_callbacks( OpenWindow, CloseWindow );
 vlc_module_end();
 
index 6ea3520..816076a 100644 (file)
@@ -231,9 +231,16 @@ vlc_module_begin ()
 
         set_callbacks( OpenDialogs, Close )
 
+#if defined (Q_WS_X11)
+# define WID_CAPABILITY "xwindow"
+#elif defined (WIN32)
+# define WID_CAPABILITY "hwnd"
+#endif
+#ifdef WID_CAPABILITY
     add_submodule ()
-        set_capability( "vout_window", 50 )
+        set_capability( WID_CAPABILITY, 50 )
         set_callbacks( WindowOpen, WindowClose )
+#endif
 
 vlc_module_end ()
 
index 3e7a7a6..221e4dd 100644 (file)
@@ -418,7 +418,7 @@ static int DirectXCreateWindow( vout_thread_t *p_vout )
 
     /* If an external window was specified, we'll draw in it. */
     p_vout->p_sys->parent_window =
-        vout_RequestWindow( p_vout, &p_vout->p_sys->i_window_x,
+        vout_RequestHWND( p_vout, &p_vout->p_sys->i_window_x,
                             &p_vout->p_sys->i_window_y,
                             &p_vout->p_sys->i_window_width,
                             &p_vout->p_sys->i_window_height );
index f992700..df72a10 100644 (file)
@@ -669,7 +669,7 @@ static int InitWindow( vout_thread_t *p_vout )
 
         // Request window from interface
         p_sys->owner_window =
-            vout_RequestWindow( p_vout,
+            vout_RequestXWindow( p_vout,
                                 &p_sys->embedded_window.i_x,
                                 &p_sys->embedded_window.i_y,
                                 &p_sys->embedded_window.i_width,
index 3d103ce..e15dd6c 100644 (file)
@@ -1619,7 +1619,7 @@ static int CreateWindow( vout_thread_t *p_vout, x11_window_t *p_win )
 
     if( !p_vout->b_fullscreen )
     {
-        p_win->owner_window = vout_RequestWindow( p_vout, &p_win->i_x,
+        p_win->owner_window = vout_RequestXWindow( p_vout, &p_win->i_x,
                               &p_win->i_y, &p_win->i_width, &p_win->i_height );
         xsize_hints.base_width  = xsize_hints.width = p_win->i_width;
         xsize_hints.base_height = xsize_hints.height = p_win->i_height;
index 0dac44f..f5289c7 100644 (file)
@@ -50,7 +50,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 ("xwindow", 10)
     set_callbacks (Open, Close)
 
     add_string ("x11-display", NULL, NULL,
@@ -114,7 +114,7 @@ static void Close (vlc_object_t *obj)
 {
     vout_window_t *wnd = (vout_window_t *)obj;
     xcb_connection_t *conn = wnd->p_sys;
-    xcb_window_t window = (uintptr_t)wnd->handle;
+    xcb_window_t window = wnd->handle.xid;
 
     xcb_unmap_window (conn, window);
     xcb_destroy_window (conn, window);
index 035311a..e39257c 100644 (file)
@@ -370,7 +370,7 @@ static int Init (vout_thread_t *vout)
     }
     else
     {
-        p_sys->embed = vout_RequestWindow (vout, &(int){ 0 }, &(int){ 0 },
+        p_sys->embed = vout_RequestXWindow (vout, &(int){ 0 }, &(int){ 0 },
                                             &width, &height);
         if (p_sys->embed == NULL)
         {
index 89cc527..219d030 100644 (file)
@@ -89,6 +89,7 @@ static int TitlePositionCallback( vlc_object_t *, char const *,
  * video within the resulting window, while in windowed mode.
  *
  * @param p_vout video output thread to create a window for
+ * @param psz_cap VLC module capability (window system type)
  * @param pi_x_hint pointer to store the recommended horizontal position [OUT]
  * @param pi_y_hint pointer to store the recommended vertical position [OUT]
  * @param pi_width_hint pointer to store the recommended width [OUT]
@@ -97,7 +98,7 @@ static int TitlePositionCallback( vlc_object_t *, char const *,
  * @return a vout_window_t object, or NULL in case of failure.
  * The window is released with vout_ReleaseWindow().
  */
-vout_window_t *vout_RequestWindow( vout_thread_t *p_vout,
+vout_window_t *vout_RequestWindow( vout_thread_t *p_vout, const char *psz_cap,
                           int *pi_x_hint, int *pi_y_hint,
                           unsigned int *pi_width_hint,
                           unsigned int *pi_height_hint )
@@ -125,10 +126,10 @@ vout_window_t *vout_RequestWindow( vout_thread_t *p_vout,
     wnd->pos_y = *pi_y_hint;
     vlc_object_attach (wnd, p_vout);
 
-    wnd->module = module_need (wnd, "vout_window", NULL, false);
+    wnd->module = module_need (wnd, psz_cap, NULL, false);
     if (wnd->module == NULL)
     {
-        msg_Dbg (wnd, "no window provider available");
+        msg_Dbg (wnd, "no \"%s\" window provider available", psz_cap);
         vlc_object_release (wnd);
         return NULL;
     }