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

Segregate vout window types

parent 4de1d766
......@@ -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 */
......@@ -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();
......
......@@ -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 ()
......
......@@ -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 );
......
......@@ -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,
......
......@@ -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;
......
......@@ -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);
......
......@@ -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)
{
......
......@@ -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;
}
......
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