[vlc-commits] display: pass window via display configuration

Rémi Denis-Courmont git at videolan.org
Sun May 20 19:51:38 CEST 2018


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Wed May 16 22:32:20 2018 +0300| [0e119e3e3eca3e5662651930d7fa2e38afb44564] | committer: Rémi Denis-Courmont

display: pass window via display configuration

The window is created ahead of the display and cannot change (except
for being deleted) anyway.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=0e119e3e3eca3e5662651930d7fa2e38afb44564
---

 include/vlc_vout_display.h      | 1 +
 src/video_output/display.c      | 3 +--
 src/video_output/display.h      | 1 -
 src/video_output/video_output.c | 7 +------
 4 files changed, 3 insertions(+), 9 deletions(-)

diff --git a/include/vlc_vout_display.h b/include/vlc_vout_display.h
index c8b365c229..9859d7ef7d 100644
--- a/include/vlc_vout_display.h
+++ b/include/vlc_vout_display.h
@@ -66,6 +66,7 @@ typedef enum
  * Initial/Current configuration for a vout_display_t
  */
 typedef struct {
+    struct vout_window_t *window; /**< Window */
 #if defined(_WIN32) || defined(__OS2__)
     bool is_fullscreen VLC_DEPRECATED;  /* Is the display fullscreen */
 #endif
diff --git a/src/video_output/display.c b/src/video_output/display.c
index a979f01108..f8bea4c8a9 100644
--- a/src/video_output/display.c
+++ b/src/video_output/display.c
@@ -637,8 +637,7 @@ static void VoutDisplayEvent(vout_display_t *vd, int event, va_list args)
 
 static vout_window_t *VoutDisplayNewWindow(vout_display_t *vd, unsigned type)
 {
-    vout_display_owner_sys_t *osys = vd->owner.sys;
-    vout_window_t *window = vout_NewDisplayWindow(osys->vout);
+    vout_window_t *window = vd->cfg->window;
 
     if (window == NULL)
         return NULL;
diff --git a/src/video_output/display.h b/src/video_output/display.h
index aba2f17793..4ecc09ea90 100644
--- a/src/video_output/display.h
+++ b/src/video_output/display.h
@@ -33,7 +33,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 *);
 
-vout_window_t *vout_NewDisplayWindow(vout_thread_t *);
 void vout_DeleteDisplayWindow(vout_thread_t *);
 void vout_SetDisplayWindowSize(vout_thread_t *, unsigned, unsigned);
 
diff --git a/src/video_output/video_output.c b/src/video_output/video_output.c
index 0eff8dbeda..0a49390c3e 100644
--- a/src/video_output/video_output.c
+++ b/src/video_output/video_output.c
@@ -569,6 +569,7 @@ void vout_ControlChangeViewpoint(vout_thread_t *vout,
 static void VoutGetDisplayCfg(vout_thread_t *vout, vout_display_cfg_t *cfg, const char *title)
 {
     /* Load configuration */
+    cfg->window = vout->p->window;
 #if defined(_WIN32) || defined(__OS2__)
     cfg->is_fullscreen = var_GetBool(vout, "fullscreen")
                          || var_GetBool(vout, "video-wallpaper");
@@ -607,12 +608,6 @@ static void VoutGetDisplayCfg(vout_thread_t *vout, vout_display_cfg_t *cfg, cons
         cfg->align.vertical = VOUT_DISPLAY_ALIGN_BOTTOM;
 }
 
-vout_window_t *vout_NewDisplayWindow(vout_thread_t *vout)
-{
-    assert(vout->p->splitter_name == NULL);
-    return vout->p->window;
-}
-
 void vout_DeleteDisplayWindow(vout_thread_t *vout)
 {
     if (vout->p->window != NULL) {



More information about the vlc-commits mailing list