Commit 5563c33a authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

vout: assume/require a window

Since in the worst case, there will be the dummy.
parent c3ea303a
......@@ -391,8 +391,7 @@ static inline void vout_display_DeleteWindow(vout_display_t *vd)
static inline bool vout_display_IsWindowed(vout_display_t *vd)
{
return vd->cfg->window != NULL
&& vd->cfg->window->type != VOUT_WINDOW_TYPE_DUMMY;
return vd->cfg->window->type != VOUT_WINDOW_TYPE_DUMMY;
}
/**
......
......@@ -115,10 +115,7 @@ static vout_display_t *vout_display_New(vlc_object_t *obj,
vd->module = NULL;
}
if (cfg->window != NULL)
vout_window_SetSize(cfg->window,
cfg->display.width, cfg->display.height);
vout_window_SetSize(cfg->window, cfg->display.width, cfg->display.height);
return vd;
}
......@@ -636,9 +633,7 @@ static void VoutDisplayEvent(vout_display_t *vd, int event, va_list args)
static void VoutDisplayDelWindow(vout_display_t *vd)
{
vout_display_owner_sys_t *osys = vd->owner.sys;
vout_DeleteDisplayWindow(osys->vout);
(void) vd;
}
static void VoutDisplayFitWindow(vout_display_t *vd, bool default_size)
......@@ -1316,8 +1311,7 @@ static void SplitterClose(vout_display_t *vd)
vout_window_t *wnd = sys->display[i]->cfg->window;
vout_DeleteDisplay(sys->display[i], NULL);
if (wnd != NULL)
vout_display_window_Delete(wnd);
vout_display_window_Delete(wnd);
}
TAB_CLEAN(sys->count, sys->display);
free(sys->picture);
......@@ -1390,6 +1384,10 @@ vout_display_t *vout_NewSplitter(vout_thread_t *vout,
vout_display_GetDefaultDisplaySize(&cfg.width, &cfg.height,
source, &ostate.cfg);
ostate.cfg.window = vout_display_window_New(vout, &cfg);
if (unlikely(ostate.cfg.window == NULL)) {
vout_DeleteDisplay(wrapper, NULL);
return NULL;
}
vout_display_t *vd = DisplayNew(vout, &output->fmt, &ostate,
output->psz_module ? output->psz_module : module,
......
......@@ -32,7 +32,6 @@ vout_display_t *vout_NewSplitter(vout_thread_t *vout,
/* FIXME should not be there */
void vout_SendDisplayEventMouse(vout_thread_t *, const vlc_mouse_t *);
void vout_DeleteDisplayWindow(vout_thread_t *);
void vout_SetDisplayWindowSize(vout_thread_t *, unsigned, unsigned);
void vout_UpdateDisplaySourceProperties(vout_display_t *vd, const video_format_t *);
......@@ -177,13 +177,17 @@ static vout_thread_t *VoutCreate(vlc_object_t *object,
};
vout_window_t *window = vout_display_window_New(vout, &wcfg);
if (window != NULL)
{
if (var_InheritBool(vout, "video-wallpaper"))
vout_window_SetState(window, VOUT_WINDOW_STATE_BELOW);
else if (var_InheritBool(vout, "video-on-top"))
vout_window_SetState(window, VOUT_WINDOW_STATE_ABOVE);
if (unlikely(window == NULL)) {
spu_Destroy(vout->p->spu);
vlc_object_release(vout);
return NULL;
}
if (var_InheritBool(vout, "video-wallpaper"))
vout_window_SetState(window, VOUT_WINDOW_STATE_BELOW);
else if (var_InheritBool(vout, "video-on-top"))
vout_window_SetState(window, VOUT_WINDOW_STATE_ABOVE);
vout->p->window = window;
} else
vout->p->window = NULL;
......@@ -618,14 +622,6 @@ static void VoutGetDisplayCfg(vout_thread_t *vout, vout_display_cfg_t *cfg)
cfg->align.vertical = VOUT_DISPLAY_ALIGN_BOTTOM;
}
void vout_DeleteDisplayWindow(vout_thread_t *vout)
{
if (vout->p->window != NULL) {
vout_display_window_Delete(vout->p->window);
vout->p->window = NULL;
}
}
void vout_SetDisplayWindowSize(vout_thread_t *vout,
unsigned width, unsigned height)
{
......@@ -635,12 +631,6 @@ void vout_SetDisplayWindowSize(vout_thread_t *vout,
/* Request a resize of the window. If it fails, there is nothing to do.
* If it succeeds, the window will emit a resize event later. */
vout_window_SetSize(window, width, height);
else
if (vout->p->display.vd != NULL)
/* Force a resize of window-less display. This is not allowed to fail,
* although the display is allowed to ignore the size anyway. */
/* FIXME: remove this, fix MSW and OS/2 window providers */
vout_display_SendEventDisplaySize(vout->p->display.vd, width, height);
}
/* */
......@@ -1352,13 +1342,15 @@ static void ThreadChangeFullscreen(vout_thread_t *vout, bool fullscreen)
{
vout_window_t *window = vout->p->window;
if (window != NULL)
vout_window_SetFullScreen(window, fullscreen);
if (window == NULL)
return; /* splitter! */
vout_window_SetFullScreen(window, fullscreen);
#if defined(_WIN32) || defined(__OS2__)
/* FIXME: remove this event */
if (vout->p->display.vd != NULL)
vout_display_SendEventFullscreen(vout->p->display.vd, fullscreen,
window != NULL);
true);
#endif
}
......@@ -1366,13 +1358,10 @@ static void ThreadChangeWindowState(vout_thread_t *vout, unsigned state)
{
vout_window_t *window = vout->p->window;
if (window != NULL)
vout_window_SetState(window, state);
#if defined(_WIN32) || defined(__OS2__)
else /* FIXME: remove this event */
if (vout->p->display.vd != NULL)
vout_display_SendWindowState(vout->p->display.vd, state);
#endif
if (window == NULL)
return; /* splitter! */
vout_window_SetState(window, state);
}
static void ThreadTranslateMouseState(vout_thread_t *vout,
......
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