[vlc-devel] [PATCH 13/20] display: allow the display modules to change the vout_display_cfg_t

Steve Lhomme robux4 at ycbcr.xyz
Tue Aug 25 09:30:01 CEST 2020


For example OpenGL flips vertical alignment.
---
 include/vlc_vout_display.h              |  2 +-
 modules/hw/mmal/vout.c                  |  4 ++--
 modules/hw/vdpau/display.c              |  4 ++--
 modules/video_output/android/display.c  |  4 ++--
 modules/video_output/caca.c             |  2 +-
 modules/video_output/caopengllayer.m    |  4 ++--
 modules/video_output/decklink.cpp       |  4 ++--
 modules/video_output/fb.c               |  4 ++--
 modules/video_output/flaschen.c         |  4 ++--
 modules/video_output/ios.m              |  4 ++--
 modules/video_output/kms.c              |  2 +-
 modules/video_output/kva.c              |  4 ++--
 modules/video_output/macosx.m           |  4 ++--
 modules/video_output/opengl/display.c   |  4 ++--
 modules/video_output/splitter.c         |  2 +-
 modules/video_output/vdummy.c           |  8 ++++----
 modules/video_output/vmem.c             |  4 ++--
 modules/video_output/vulkan/display.c   |  2 +-
 modules/video_output/wayland/shm.c      |  2 +-
 modules/video_output/win32/direct3d11.c |  4 ++--
 modules/video_output/win32/direct3d9.c  |  4 ++--
 modules/video_output/win32/glwin32.c    |  4 ++--
 modules/video_output/win32/wingdi.c     |  4 ++--
 modules/video_output/xcb/render.c       |  2 +-
 modules/video_output/xcb/x11.c          |  2 +-
 modules/video_output/yuv.c              |  4 ++--
 src/video_output/display.c              | 14 ++++++++++++--
 27 files changed, 58 insertions(+), 48 deletions(-)

diff --git a/include/vlc_vout_display.h b/include/vlc_vout_display.h
index cdc06fb9f55..483efc9816e 100644
--- a/include/vlc_vout_display.h
+++ b/include/vlc_vout_display.h
@@ -255,7 +255,7 @@ struct vout_display_owner_t {
  * @return VLC_SUCCESS or a VLC error code
  */
 typedef int (*vout_display_open_cb)(vout_display_t *vd,
-                                    const vout_display_cfg_t *cfg,
+                                    vout_display_cfg_t *cfg,
                                     video_format_t *fmtp,
                                     vlc_video_context *context);
 
diff --git a/modules/hw/mmal/vout.c b/modules/hw/mmal/vout.c
index 8af3329ba45..d7d6faeafbc 100644
--- a/modules/hw/mmal/vout.c
+++ b/modules/hw/mmal/vout.c
@@ -64,7 +64,7 @@
 #define PHASE_OFFSET_TARGET ((double)0.25)
 #define PHASE_CHECK_INTERVAL 100
 
-static int OpenMmalVout(vout_display_t *, const vout_display_cfg_t *,
+static int OpenMmalVout(vout_display_t *, vout_display_cfg_t *,
                 video_format_t *, vlc_video_context *);
 
 #define SUBS_MAX 4
@@ -1091,7 +1091,7 @@ static int find_display_num(const char * name)
     return display_name_to_num[i].num;
 }
 
-static int OpenMmalVout(vout_display_t *vd, const vout_display_cfg_t *cfg,
+static int OpenMmalVout(vout_display_t *vd, vout_display_cfg_t *cfg,
                         video_format_t *fmtp, vlc_video_context *vctx)
 {
     vout_display_sys_t *sys;
diff --git a/modules/hw/vdpau/display.c b/modules/hw/vdpau/display.c
index 772553b8971..92dac1cb8dc 100644
--- a/modules/hw/vdpau/display.c
+++ b/modules/hw/vdpau/display.c
@@ -37,7 +37,7 @@
 #include "vlc_vdpau.h"
 #include "events.h"
 
-static int Open(vout_display_t *vd, const vout_display_cfg_t *cfg,
+static int Open(vout_display_t *vd, vout_display_cfg_t *cfg,
                 video_format_t *fmtp, vlc_video_context *context);
 static void Close(vout_display_t *vd);
 
@@ -281,7 +281,7 @@ static int Control(vout_display_t *vd, int query, va_list ap)
     return VLC_SUCCESS;
 }
 
-static int Open(vout_display_t *vd, const vout_display_cfg_t *cfg,
+static int Open(vout_display_t *vd, vout_display_cfg_t *cfg,
                 video_format_t *fmtp, vlc_video_context *context)
 {
     vout_display_sys_t *sys = malloc(sizeof (*sys));
diff --git a/modules/video_output/android/display.c b/modules/video_output/android/display.c
index 4423bb87584..2665f9fe8bc 100644
--- a/modules/video_output/android/display.c
+++ b/modules/video_output/android/display.c
@@ -50,7 +50,7 @@
     "Force use of a specific chroma for output. Default is RGB32."
 
 #define CFG_PREFIX "android-display-"
-static int Open(vout_display_t *vd, const vout_display_cfg_t *cfg,
+static int Open(vout_display_t *vd, vout_display_cfg_t *cfg,
                 video_format_t *fmtp, vlc_video_context *context);
 static void Close(vout_display_t *vd);
 static void SubpicturePrepare(vout_display_t *vd, subpicture_t *subpicture);
@@ -476,7 +476,7 @@ static void SetRGBMask(video_format_t *p_fmt)
     }
 }
 
-static int Open(vout_display_t *vd, const vout_display_cfg_t *cfg,
+static int Open(vout_display_t *vd, vout_display_cfg_t *cfg,
                 video_format_t *fmtp, vlc_video_context *context)
 {
     vout_display_sys_t *sys;
diff --git a/modules/video_output/caca.c b/modules/video_output/caca.c
index abc9c6d9f81..f54a832cfc9 100644
--- a/modules/video_output/caca.c
+++ b/modules/video_output/caca.c
@@ -375,7 +375,7 @@ static void Close(vout_display_t *vd)
 /**
  * This function initializes libcaca vout method.
  */
-static int Open(vout_display_t *vd, const vout_display_cfg_t *cfg,
+static int Open(vout_display_t *vd, vout_display_cfg_t *cfg,
                 video_format_t *fmtp, vlc_video_context *context)
 {
     vout_display_sys_t *sys;
diff --git a/modules/video_output/caopengllayer.m b/modules/video_output/caopengllayer.m
index 029517b4ab6..e81f8210117 100644
--- a/modules/video_output/caopengllayer.m
+++ b/modules/video_output/caopengllayer.m
@@ -47,7 +47,7 @@
 /*****************************************************************************
  * Vout interface
  *****************************************************************************/
-static int Open(vout_display_t *vd, const vout_display_cfg_t *cfg,
+static int Open(vout_display_t *vd, vout_display_cfg_t *cfg,
                 video_format_t *fmt, vlc_video_context *context);
 static void Close(vout_display_t *vd);
 
@@ -105,7 +105,7 @@ struct gl_sys
 /*****************************************************************************
  * Open: This function allocates and initializes the OpenGL vout method.
  *****************************************************************************/
-static int Open (vout_display_t *vd, const vout_display_cfg_t *cfg,
+static int Open (vout_display_t *vd, vout_display_cfg_t *cfg,
                  video_format_t *fmt, vlc_video_context *context)
 {
     vout_display_sys_t *sys;
diff --git a/modules/video_output/decklink.cpp b/modules/video_output/decklink.cpp
index d5049e826e3..d5007c456a0 100644
--- a/modules/video_output/decklink.cpp
+++ b/modules/video_output/decklink.cpp
@@ -234,7 +234,7 @@ struct decklink_sys_t
  * Local prototypes.
  *****************************************************************************/
 
-static int  OpenVideo           (vout_display_t *, const vout_display_cfg_t *,
+static int  OpenVideo           (vout_display_t *, vout_display_cfg_t *,
                                  video_format_t *, vlc_video_context *);
 static void CloseVideo          (vout_display_t *);
 static int  OpenAudio           (vlc_object_t *);
@@ -768,7 +768,7 @@ static int ControlVideo(vout_display_t *vd, int query, va_list args)
     return VLC_EGENERIC;
 }
 
-static int OpenVideo(vout_display_t *vd, const vout_display_cfg_t *cfg,
+static int OpenVideo(vout_display_t *vd, vout_display_cfg_t *cfg,
                      video_format_t *fmtp, vlc_video_context *context)
 {
     VLC_UNUSED(cfg); VLC_UNUSED(context);
diff --git a/modules/video_output/fb.c b/modules/video_output/fb.c
index d8dcf8646a6..b4eebd17c7f 100644
--- a/modules/video_output/fb.c
+++ b/modules/video_output/fb.c
@@ -71,7 +71,7 @@
 #define CHROMA_TEXT N_("Image format (default RGB)")
 #define CHROMA_LONGTEXT N_("Chroma fourcc used by the framebuffer. Default is RGB since the fb device has no way to report its chroma.")
 
-static int Open(vout_display_t *vd, const vout_display_cfg_t *cfg,
+static int Open(vout_display_t *vd, vout_display_cfg_t *cfg,
                 video_format_t *fmtp, vlc_video_context *context);
 static void Close(vout_display_t *vd);
 
@@ -164,7 +164,7 @@ static void ClearScreen(vout_display_sys_t *sys)
 /**
  * This function allocates and initializes a FB vout method.
  */
-static int Open(vout_display_t *vd, const vout_display_cfg_t *cfg,
+static int Open(vout_display_t *vd, vout_display_cfg_t *cfg,
                 video_format_t *fmtp, vlc_video_context *context)
 {
     vout_display_sys_t *sys;
diff --git a/modules/video_output/flaschen.c b/modules/video_output/flaschen.c
index 00e1e66a349..d57ba30e628 100644
--- a/modules/video_output/flaschen.c
+++ b/modules/video_output/flaschen.c
@@ -54,7 +54,7 @@
 #define T_HEIGHT N_("Height")
 #define LT_HEIGHT N_("Video height")
 
-static int Open(vout_display_t *vd, const vout_display_cfg_t *cfg,
+static int Open(vout_display_t *vd, vout_display_cfg_t *cfg,
                 video_format_t *fmtp, vlc_video_context *context);
 static void Close(vout_display_t *vd);
 
@@ -84,7 +84,7 @@ static int             Control(vout_display_t *, int, va_list);
 /*****************************************************************************
  * Open: activates flaschen vout display method
  *****************************************************************************/
-static int Open(vout_display_t *vd, const vout_display_cfg_t *cfg,
+static int Open(vout_display_t *vd, vout_display_cfg_t *cfg,
                 video_format_t *fmtp, vlc_video_context *context)
 {
     vout_display_sys_t *sys;
diff --git a/modules/video_output/ios.m b/modules/video_output/ios.m
index 87a0787aa72..8200f40de0d 100644
--- a/modules/video_output/ios.m
+++ b/modules/video_output/ios.m
@@ -50,7 +50,7 @@
 /**
  * Forward declarations
  */
-static int Open(vout_display_t *vd, const vout_display_cfg_t *cfg,
+static int Open(vout_display_t *vd, vout_display_cfg_t *cfg,
                 video_format_t *fmt, vlc_video_context *context);
 static void Close(vout_display_t *vd);
 
@@ -139,7 +139,7 @@ static void *OurGetProcAddress(vlc_gl_t *gl, const char *name)
     return dlsym(RTLD_DEFAULT, name);
 }
 
-static int Open(vout_display_t *vd, const vout_display_cfg_t *cfg,
+static int Open(vout_display_t *vd, vout_display_cfg_t *cfg,
                 video_format_t *fmt, vlc_video_context *context)
 {
     if (vout_display_cfg_IsWindowed(cfg))
diff --git a/modules/video_output/kms.c b/modules/video_output/kms.c
index 3e686e1414a..e1eb5011f1e 100644
--- a/modules/video_output/kms.c
+++ b/modules/video_output/kms.c
@@ -665,7 +665,7 @@ static void Close(vout_display_t *vd)
 /**
  * This function allocates and initializes a KMS vout method.
  */
-static int Open(vout_display_t *vd, const vout_display_cfg_t *cfg,
+static int Open(vout_display_t *vd, vout_display_cfg_t *cfg,
                 video_format_t *fmtp, vlc_video_context *context)
 {
     vout_display_sys_t *sys;
diff --git a/modules/video_output/kva.c b/modules/video_output/kva.c
index 9e4d67d7315..f05ffb27ba0 100644
--- a/modules/video_output/kva.c
+++ b/modules/video_output/kva.c
@@ -42,7 +42,7 @@
 /*****************************************************************************
  * Module descriptor
  *****************************************************************************/
-static int  Open ( vout_display_t *, const vout_display_cfg_t *,
+static int  Open ( vout_display_t *, vout_display_cfg_t *,
                    video_format_t *, vlc_video_context * );
 static void Close( vlc_object_t * );
 
@@ -320,7 +320,7 @@ exit_frame :
 /**
  * This function initializes KVA vout method.
  */
-static int Open ( vout_display_t *vd, const vout_display_cfg_t *cfg,
+static int Open ( vout_display_t *vd, vout_display_cfg_t *cfg,
                   video_format_t *fmtp, vlc_video_context *context )
 {
     vout_display_sys_t *sys;
diff --git a/modules/video_output/macosx.m b/modules/video_output/macosx.m
index 9201c491d82..80247f1f29a 100644
--- a/modules/video_output/macosx.m
+++ b/modules/video_output/macosx.m
@@ -51,7 +51,7 @@
 /**
  * Forward declarations
  */
-static int Open(vout_display_t *vd, const vout_display_cfg_t *cfg,
+static int Open(vout_display_t *vd, vout_display_cfg_t *cfg,
                 video_format_t *fmt, vlc_video_context *context);
 static void Close(vout_display_t *vd);
 
@@ -126,7 +126,7 @@ static void *OurGetProcAddress(vlc_gl_t *gl, const char *name)
     return dlsym(RTLD_DEFAULT, name);
 }
 
-static int Open (vout_display_t *vd, const vout_display_cfg_t *cfg,
+static int Open (vout_display_t *vd, vout_display_cfg_t *cfg,
                  video_format_t *fmt, vlc_video_context *context)
 {
     vout_display_sys_t *sys = calloc (1, sizeof(*sys));
diff --git a/modules/video_output/opengl/display.c b/modules/video_output/opengl/display.c
index 9350e64814c..2ef8df9910b 100644
--- a/modules/video_output/opengl/display.c
+++ b/modules/video_output/opengl/display.c
@@ -34,7 +34,7 @@
 #include "vout_helper.h"
 
 /* Plugin callbacks */
-static int Open(vout_display_t *vd, const vout_display_cfg_t *cfg,
+static int Open(vout_display_t *vd, vout_display_cfg_t *cfg,
                 video_format_t *fmtp, vlc_video_context *context);
 static void Close(vout_display_t *vd);
 
@@ -84,7 +84,7 @@ static int Control (vout_display_t *, int, va_list);
 /**
  * Allocates a surface and an OpenGL context for video output.
  */
-static int Open(vout_display_t *vd, const vout_display_cfg_t *cfg,
+static int Open(vout_display_t *vd, vout_display_cfg_t *cfg,
                 video_format_t *fmt, vlc_video_context *context)
 {
     vout_display_sys_t *sys = malloc (sizeof (*sys));
diff --git a/modules/video_output/splitter.c b/modules/video_output/splitter.c
index 71ceda46748..f9987920584 100644
--- a/modules/video_output/splitter.c
+++ b/modules/video_output/splitter.c
@@ -220,7 +220,7 @@ static vout_window_t *video_splitter_CreateWindow(vlc_object_t *obj,
 }
 
 static int vlc_vidsplit_Open(vout_display_t *vd,
-                             const vout_display_cfg_t *cfg,
+                             vout_display_cfg_t *cfg,
                              video_format_t *fmtp, vlc_video_context *ctx)
 {
     vlc_object_t *obj = VLC_OBJECT(vd);
diff --git a/modules/video_output/vdummy.c b/modules/video_output/vdummy.c
index 664723740fb..953e2cc409c 100644
--- a/modules/video_output/vdummy.c
+++ b/modules/video_output/vdummy.c
@@ -38,9 +38,9 @@
     "format instead of trying to improve performances by using the most " \
     "efficient one.")
 
-static int OpenDummy(vout_display_t *vd, const vout_display_cfg_t *cfg,
+static int OpenDummy(vout_display_t *vd, vout_display_cfg_t *cfg,
                      video_format_t *fmtp, vlc_video_context *context);
-static int OpenStats(vout_display_t *vd, const vout_display_cfg_t *cfg,
+static int OpenStats(vout_display_t *vd, vout_display_cfg_t *cfg,
                      video_format_t *fmtp, vlc_video_context *context);
 
 vlc_module_begin ()
@@ -90,14 +90,14 @@ static int Open(vout_display_t *vd, video_format_t *fmt,
     return VLC_SUCCESS;
 }
 
-static int OpenDummy(vout_display_t *vd, const vout_display_cfg_t *cfg,
+static int OpenDummy(vout_display_t *vd, vout_display_cfg_t *cfg,
                      video_format_t *fmtp, vlc_video_context *context)
 {
     (void) cfg; (void) context;
     return Open(vd, fmtp, NULL);
 }
 
-static int OpenStats(vout_display_t *vd, const vout_display_cfg_t *cfg,
+static int OpenStats(vout_display_t *vd, vout_display_cfg_t *cfg,
                      video_format_t *fmtp, vlc_video_context *context)
 {
     (void) cfg; (void) context;
diff --git a/modules/video_output/vmem.c b/modules/video_output/vmem.c
index 7463fb1a7b9..b6743a52c0a 100644
--- a/modules/video_output/vmem.c
+++ b/modules/video_output/vmem.c
@@ -51,7 +51,7 @@
 #define LT_CHROMA N_("Output chroma for the memory image as a 4-character " \
                       "string, eg. \"RV32\".")
 
-static int Open(vout_display_t *vd, const vout_display_cfg_t *cfg,
+static int Open(vout_display_t *vd, vout_display_cfg_t *cfg,
                 video_format_t *fmtp, vlc_video_context *context);
 static void Close(vout_display_t *vd);
 
@@ -110,7 +110,7 @@ static int            Control(vout_display_t *, int, va_list);
  *****************************************************************************
  * This function allocates and initializes a vout method.
  *****************************************************************************/
-static int Open(vout_display_t *vd, const vout_display_cfg_t *cfg,
+static int Open(vout_display_t *vd, vout_display_cfg_t *cfg,
                 video_format_t *fmtp, vlc_video_context *context)
 {
     vout_display_sys_t *sys = malloc(sizeof(*sys));
diff --git a/modules/video_output/vulkan/display.c b/modules/video_output/vulkan/display.c
index fea90eed82d..837c63a0a02 100644
--- a/modules/video_output/vulkan/display.c
+++ b/modules/video_output/vulkan/display.c
@@ -77,7 +77,7 @@ static void Close(vout_display_t *);
 static void UpdateParams(vout_display_t *);
 
 // Allocates a Vulkan surface and instance for video output.
-static int Open(vout_display_t *vd, const vout_display_cfg_t *cfg,
+static int Open(vout_display_t *vd, vout_display_cfg_t *cfg,
                 video_format_t *fmt, vlc_video_context *context)
 {
     vout_display_sys_t *sys = vd->sys =
diff --git a/modules/video_output/wayland/shm.c b/modules/video_output/wayland/shm.c
index 4ec6664bd6c..f98814804bf 100644
--- a/modules/video_output/wayland/shm.c
+++ b/modules/video_output/wayland/shm.c
@@ -260,7 +260,7 @@ static void Close(vout_display_t *vd)
     free(sys);
 }
 
-static int Open(vout_display_t *vd, const vout_display_cfg_t *cfg,
+static int Open(vout_display_t *vd, vout_display_cfg_t *cfg,
                 video_format_t *fmtp, vlc_video_context *context)
 {
     if (cfg->window->type != VOUT_WINDOW_TYPE_WAYLAND)
diff --git a/modules/video_output/win32/direct3d11.c b/modules/video_output/win32/direct3d11.c
index 3ce14bb3681..7aaef5701ce 100644
--- a/modules/video_output/win32/direct3d11.c
+++ b/modules/video_output/win32/direct3d11.c
@@ -59,7 +59,7 @@
 #include "common.h"
 #include "../../video_chroma/copy.h"
 
-static int  Open(vout_display_t *, const vout_display_cfg_t *,
+static int  Open(vout_display_t *, vout_display_cfg_t *,
                  video_format_t *, vlc_video_context *);
 static void Close(vout_display_t *);
 
@@ -285,7 +285,7 @@ static void UpdateSize(vout_display_t *vd)
     d3d11_device_unlock( sys->d3d_dev );
 }
 
-static int Open(vout_display_t *vd, const vout_display_cfg_t *cfg,
+static int Open(vout_display_t *vd, vout_display_cfg_t *cfg,
                 video_format_t *fmtp, vlc_video_context *context)
 {
     vout_display_sys_t *sys = vd->sys = vlc_obj_calloc(VLC_OBJECT(vd), 1, sizeof(vout_display_sys_t));
diff --git a/modules/video_output/win32/direct3d9.c b/modules/video_output/win32/direct3d9.c
index 1b2ba2ff152..920b462902a 100644
--- a/modules/video_output/win32/direct3d9.c
+++ b/modules/video_output/win32/direct3d9.c
@@ -67,7 +67,7 @@
 /*****************************************************************************
  * Module descriptor
  *****************************************************************************/
-static int  Open(vout_display_t *, const vout_display_cfg_t *,
+static int  Open(vout_display_t *, vout_display_cfg_t *,
                  video_format_t *, vlc_video_context *);
 static void Close(vout_display_t *);
 
@@ -1775,7 +1775,7 @@ static void LocalSwapchainSwap( void *opaque )
 /**
  * It creates a Direct3D vout display.
  */
-static int Open(vout_display_t *vd, const vout_display_cfg_t *cfg,
+static int Open(vout_display_t *vd, vout_display_cfg_t *cfg,
                 video_format_t *fmtp, vlc_video_context *context)
 {
     vout_display_sys_t *sys;
diff --git a/modules/video_output/win32/glwin32.c b/modules/video_output/win32/glwin32.c
index 064aa4ce0aa..83183c52608 100644
--- a/modules/video_output/win32/glwin32.c
+++ b/modules/video_output/win32/glwin32.c
@@ -41,7 +41,7 @@
 /*****************************************************************************
  * Module descriptor
  *****************************************************************************/
-static int  Open (vout_display_t *, const vout_display_cfg_t *,
+static int  Open (vout_display_t *, vout_display_cfg_t *,
                   video_format_t *, vlc_video_context *);
 static void Close(vout_display_t *);
 
@@ -105,7 +105,7 @@ static vout_window_t *EmbedVideoWindow_Create(vout_display_t *vd)
 /**
  * It creates an OpenGL vout display.
  */
-static int Open(vout_display_t *vd, const vout_display_cfg_t *cfg,
+static int Open(vout_display_t *vd, vout_display_cfg_t *cfg,
                 video_format_t *fmtp, vlc_video_context *context)
 {
     vout_display_sys_t *sys;
diff --git a/modules/video_output/win32/wingdi.c b/modules/video_output/win32/wingdi.c
index ef7655571b7..ff524e01f68 100644
--- a/modules/video_output/win32/wingdi.c
+++ b/modules/video_output/win32/wingdi.c
@@ -42,7 +42,7 @@
 /*****************************************************************************
  * Module descriptor
  *****************************************************************************/
-static int  Open (vout_display_t *, const vout_display_cfg_t *,
+static int  Open (vout_display_t *, vout_display_cfg_t *,
                   video_format_t *, vlc_video_context *);
 static void Close(vout_display_t *);
 
@@ -105,7 +105,7 @@ static int Control(vout_display_t *vd, int query, va_list args)
 }
 
 /* */
-static int Open(vout_display_t *vd, const vout_display_cfg_t *cfg,
+static int Open(vout_display_t *vd, vout_display_cfg_t *cfg,
                 video_format_t *fmtp, vlc_video_context *context)
 {
     VLC_UNUSED(context);
diff --git a/modules/video_output/xcb/render.c b/modules/video_output/xcb/render.c
index 07ab5285d8d..f6da29a82d8 100644
--- a/modules/video_output/xcb/render.c
+++ b/modules/video_output/xcb/render.c
@@ -545,7 +545,7 @@ FindVisual(const xcb_setup_t *setup, const xcb_screen_t *scr,
 /**
  * Probe the X server.
  */
-static int Open(vout_display_t *vd, const vout_display_cfg_t *cfg,
+static int Open(vout_display_t *vd, vout_display_cfg_t *cfg,
                 video_format_t *fmtp, vlc_video_context *ctx)
 {
     vlc_object_t *obj = VLC_OBJECT(vd);
diff --git a/modules/video_output/xcb/x11.c b/modules/video_output/xcb/x11.c
index d36fa149b63..8a20c992b68 100644
--- a/modules/video_output/xcb/x11.c
+++ b/modules/video_output/xcb/x11.c
@@ -249,7 +249,7 @@ static xcb_visualid_t ScreenToFormat(const xcb_setup_t *setup,
 /**
  * Probe the X server.
  */
-static int Open (vout_display_t *vd, const vout_display_cfg_t *cfg,
+static int Open (vout_display_t *vd, vout_display_cfg_t *cfg,
                  video_format_t *fmtp, vlc_video_context *context)
 {
     vout_display_sys_t *sys = malloc (sizeof (*sys));
diff --git a/modules/video_output/yuv.c b/modules/video_output/yuv.c
index c20b93d133b..f58af703cbd 100644
--- a/modules/video_output/yuv.c
+++ b/modules/video_output/yuv.c
@@ -49,7 +49,7 @@
 
 #define CFG_PREFIX "yuv-"
 
-static int Open(vout_display_t *vd, const vout_display_cfg_t *cfg,
+static int Open(vout_display_t *vd, vout_display_cfg_t *cfg,
                 video_format_t *fmtp, vlc_video_context *context);
 static void Close(vout_display_t *vd);
 
@@ -87,7 +87,7 @@ struct vout_display_sys_t {
 };
 
 /* */
-static int Open(vout_display_t *vd, const vout_display_cfg_t *cfg,
+static int Open(vout_display_t *vd, vout_display_cfg_t *cfg,
                 video_format_t *fmtp, vlc_video_context *context)
 {
     vout_display_sys_t *sys;
diff --git a/src/video_output/display.c b/src/video_output/display.c
index 5ff0400dad5..dcd6bbc4f00 100644
--- a/src/video_output/display.c
+++ b/src/video_output/display.c
@@ -80,7 +80,7 @@ static int vout_display_start(void *func, bool forced, va_list ap)
 {
     vout_display_open_cb activate = func;
     vout_display_t *vd = va_arg(ap, vout_display_t *);
-    const vout_display_cfg_t *cfg = va_arg(ap, const vout_display_cfg_t *);
+    vout_display_cfg_t *cfg = va_arg(ap, vout_display_cfg_t *);
     vlc_video_context *context = va_arg(ap, vlc_video_context *);
 
     /* Picture buffer does not have the concept of aspect ratio */
@@ -803,11 +803,21 @@ vout_display_t *vout_display_New(vlc_object_t *parent,
 
     vout_display_PlacePicture(&osys->place, &vd->source, &osys->cfg);
 
+    vout_display_cfg_t init_cfg = osys->cfg;
+
     if (vlc_module_load(vd, "vout display", module, module && *module != '\0',
-                        vout_display_start, vd, &osys->cfg,
+                        vout_display_start, vd, &init_cfg,
                         osys->src_vctx) == NULL)
         goto error;
 
+    if (memcmp(&osys->cfg, &init_cfg, sizeof(osys->cfg)) != 0)
+    {
+        // changes detected in the config, update the placement
+        // we assume the module also applied this change
+        osys->cfg = init_cfg;
+        vout_display_PlacePicture(&osys->place, &vd->source, vd->cfg);
+    }
+
 #if defined(__OS2__)
     if ((var_GetBool(parent, "fullscreen")
       || var_GetBool(parent, "video-wallpaper"))
-- 
2.26.2



More information about the vlc-devel mailing list