-/*****************************************************************************
- * vout_RequestWindow: Create/Get a video window if possible.
- *****************************************************************************
- * This function looks for the main interface and tries to request
- * a new video window. If it fails then the vout will still need to create the
- * window by itself.
- *****************************************************************************/
-void *vout_RequestWindow( vout_thread_t *p_vout,
- int *pi_x_hint, int *pi_y_hint,
- unsigned int *pi_width_hint,
- unsigned int *pi_height_hint )
-{
- /* Small kludge */
- if( !var_Type( p_vout, "aspect-ratio" ) ) vout_IntfInit( p_vout );
-
- /* Get requested coordinates */
- *pi_x_hint = var_GetInteger( p_vout, "video-x" );
- *pi_y_hint = var_GetInteger( p_vout, "video-y" );
-
- *pi_width_hint = p_vout->i_window_width;
- *pi_height_hint = p_vout->i_window_height;
-
- /* Check whether someone provided us with a window ID */
- int drawable = var_CreateGetInteger( p_vout, "drawable" );
- if( drawable ) return (void *)(intptr_t)drawable;
-
- vout_window_t *wnd = vlc_custom_create (VLC_OBJECT(p_vout), sizeof (*wnd),
- VLC_OBJECT_GENERIC, "window");
- if (wnd == NULL)
- return NULL;
-
- wnd->vout = p_vout;
- wnd->width = *pi_width_hint;
- wnd->height = *pi_height_hint;
- wnd->pos_x = *pi_x_hint;
- wnd->pos_y = *pi_y_hint;
- vlc_object_attach (wnd, p_vout);
-
- wnd->module = module_Need (wnd, "vout window", 0, 0);
- if (wnd->module == NULL)
- {
- msg_Dbg (wnd, "no window provider available");
- vlc_object_release (wnd);
- return NULL;
- }
- p_vout->p_window = wnd;
- *pi_width_hint = wnd->width;
- *pi_height_hint = wnd->height;
- *pi_x_hint = wnd->pos_x;
- *pi_y_hint = wnd->pos_y;
- return wnd->handle;
-}
-
-void vout_ReleaseWindow( vout_thread_t *p_vout, void *dummy )
-{
- vout_window_t *wnd = p_vout->p_window;
-
- if (wnd == NULL)
- return;
- p_vout->p_window = NULL;
-
- assert (wnd->module);
- module_Unneed (wnd, wnd->module);
-
- vlc_object_release (wnd);
- (void)dummy;
-}
-
-int vout_ControlWindow( vout_thread_t *p_vout, void *dummy,
- int i_query, va_list args )
-{
- (void)dummy;
- vout_window_t *wnd = p_vout->p_window;
-
- if (wnd == NULL)
- return VLC_EGENERIC;
-
- assert (wnd->control);
- return wnd->control (wnd, i_query, args);
-}
-