[vlc-commits] [Git][videolan/vlc][master] display: don't pass the vout_display_cfg_t on Open

Steve Lhomme (@robUx4) gitlab at videolan.org
Mon Jul 12 07:35:15 UTC 2021



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
2721256e by Steve Lhomme at 2021-07-12T09:21:55+02:00
display: don't pass the vout_display_cfg_t on Open

It's already set as a read-only pointer in vd->cfg before calling Open().

- - - - -


26 changed files:

- include/vlc_vout_display.h
- modules/hw/mmal/vout.c
- modules/hw/vdpau/display.c
- modules/video_output/android/display.c
- modules/video_output/caca.c
- modules/video_output/caopengllayer.m
- modules/video_output/decklink.cpp
- modules/video_output/fb.c
- modules/video_output/flaschen.c
- modules/video_output/kms.c
- modules/video_output/kva.c
- modules/video_output/libplacebo/display.c
- modules/video_output/macosx.m
- modules/video_output/opengl/display.c
- modules/video_output/splitter.c
- modules/video_output/vdummy.c
- modules/video_output/vmem.c
- modules/video_output/wayland/shm.c
- modules/video_output/win32/direct3d11.cpp
- modules/video_output/win32/direct3d9.c
- modules/video_output/win32/glwin32.c
- modules/video_output/win32/wingdi.c
- modules/video_output/xcb/render.c
- modules/video_output/xcb/x11.c
- modules/video_output/yuv.c
- src/video_output/display.c


Changes:

=====================================
include/vlc_vout_display.h
=====================================
@@ -215,7 +215,6 @@ 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,
                                     video_format_t *fmtp,
                                     vlc_video_context *context);
 


=====================================
modules/hw/mmal/vout.c
=====================================
@@ -63,8 +63,7 @@
 #define PHASE_OFFSET_TARGET ((double)0.25)
 #define PHASE_CHECK_INTERVAL 100
 
-static int OpenMmalVout(vout_display_t *, const vout_display_cfg_t *,
-                video_format_t *, vlc_video_context *);
+static int OpenMmalVout(vout_display_t *, video_format_t *, vlc_video_context *);
 
 #define SUBS_MAX 4
 
@@ -1094,7 +1093,7 @@ static const struct vlc_display_operations ops = {
     .reset_pictures = vd_reset_pictures,
 };
 
-static int OpenMmalVout(vout_display_t *vd, const vout_display_cfg_t *cfg,
+static int OpenMmalVout(vout_display_t *vd,
                         video_format_t *fmtp, vlc_video_context *vctx)
 {
     vout_display_sys_t *sys;
@@ -1122,7 +1121,7 @@ static int OpenMmalVout(vout_display_t *vd, const vout_display_cfg_t *cfg,
     }
 
     if (sys->dec_dev == NULL)
-        sys->dec_dev = vlc_decoder_device_Create(VLC_OBJECT(vd), cfg->window);
+        sys->dec_dev = vlc_decoder_device_Create(VLC_OBJECT(vd), vd->cfg->window);
     if (sys->dec_dev == NULL || sys->dec_dev->type != VLC_DECODER_DEVICE_MMAL)
     {
         msg_Err(vd, "Missing decoder device");


=====================================
modules/hw/vdpau/display.c
=====================================
@@ -37,8 +37,7 @@
 #include "vlc_vdpau.h"
 #include "events.h"
 
-static int Open(vout_display_t *vd, const vout_display_cfg_t *cfg,
-                video_format_t *fmtp, vlc_video_context *context);
+static int Open(vout_display_t *vd, video_format_t *fmtp, vlc_video_context *context);
 static void Close(vout_display_t *vd);
 
 vlc_module_begin()
@@ -293,7 +292,7 @@ static const struct vlc_display_operations ops = {
     .reset_pictures = ResetPictures,
 };
 
-static int Open(vout_display_t *vd, const vout_display_cfg_t *cfg,
+static int Open(vout_display_t *vd,
                 video_format_t *fmtp, vlc_video_context *context)
 {
     vout_display_sys_t *sys = malloc(sizeof (*sys));
@@ -301,7 +300,7 @@ static int Open(vout_display_t *vd, const vout_display_cfg_t *cfg,
         return VLC_ENOMEM;
 
     const xcb_screen_t *screen;
-    if (vlc_xcb_parent_Create(vd, cfg->window, &sys->conn, &screen) != VLC_SUCCESS)
+    if (vlc_xcb_parent_Create(vd, vd->cfg->window, &sys->conn, &screen) != VLC_SUCCESS)
     {
         free(sys);
         return VLC_EGENERIC;
@@ -435,12 +434,12 @@ static int Open(vout_display_t *vd, const vout_display_cfg_t *cfg,
         };
         vout_display_place_t place;
 
-        vout_display_PlacePicture(&place, vd->source, cfg);
+        vout_display_PlacePicture(&place, vd->source, vd->cfg);
         sys->window = xcb_generate_id(sys->conn);
 
         xcb_void_cookie_t c =
             xcb_create_window_checked(sys->conn, screen->root_depth,
-                sys->window, cfg->window->handle.xid, place.x, place.y,
+                sys->window, vd->cfg->window->handle.xid, place.x, place.y,
                 place.width, place.height, 0, XCB_WINDOW_CLASS_INPUT_OUTPUT,
                 screen->root_visual, mask, values);
         if (vlc_xcb_error_Check(vd, sys->conn, "window creation failure", c))


=====================================
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,
                 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);
@@ -484,13 +484,13 @@ static const struct vlc_display_operations ops = {
     .set_viewpoint = NULL,
 };
 
-static int Open(vout_display_t *vd, const vout_display_cfg_t *cfg,
+static int Open(vout_display_t *vd,
                 video_format_t *fmtp, vlc_video_context *context)
 {
     vout_display_sys_t *sys;
     video_format_t fmt, sub_fmt;
 
-    vout_window_t *embed = cfg->window;
+    vout_window_t *embed = vd->cfg->window;
     if (embed->type != VOUT_WINDOW_TYPE_ANDROID_NATIVE)
         return VLC_EGENERIC;
 
@@ -508,8 +508,8 @@ static int Open(vout_display_t *vd, const vout_display_cfg_t *cfg,
     sys->p_awh = p_awh;
     sys->anw = AWindowHandler_getANativeWindowAPI(sys->p_awh);
 
-    sys->i_display_width = cfg->display.width;
-    sys->i_display_height = cfg->display.height;
+    sys->i_display_width = vd->cfg->display.width;
+    sys->i_display_height = vd->cfg->display.height;
 
     fmt = *fmtp;
     if (fmt.i_chroma != VLC_CODEC_ANDROID_OPAQUE) {


=====================================
modules/video_output/caca.c
=====================================
@@ -380,14 +380,14 @@ static const struct vlc_display_operations ops = {
 /**
  * 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,
                 video_format_t *fmtp, vlc_video_context *context)
 {
     vout_display_sys_t *sys;
 
     (void) context;
 
-    if (vout_display_cfg_IsWindowed(cfg))
+    if (vout_display_cfg_IsWindowed(vd->cfg))
         return VLC_EGENERIC;
 #if !defined(__APPLE__) && !defined(_WIN32)
 # ifndef X_DISPLAY_MISSING
@@ -456,7 +456,7 @@ static int Open(vout_display_t *vd, const vout_display_cfg_t *cfg,
         goto error;
     }
 
-    sys->window = cfg->window;
+    sys->window = vd->cfg->window;
     const char *driver = NULL;
 #ifdef __APPLE__
     // Make sure we don't try to open a window.


=====================================
modules/video_output/caopengllayer.m
=====================================
@@ -49,8 +49,7 @@
 /*****************************************************************************
  * Vout interface
  *****************************************************************************/
-static int Open(vout_display_t *vd, const vout_display_cfg_t *cfg,
-                video_format_t *fmt, vlc_video_context *context);
+static int Open(vout_display_t *vd, video_format_t *fmt, vlc_video_context *context);
 static void Close(vout_display_t *vd);
 
 vlc_module_begin()
@@ -125,12 +124,12 @@ static const struct vlc_display_operations ops = {
 /*****************************************************************************
  * 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,
                  video_format_t *fmt, vlc_video_context *context)
 {
     vout_display_sys_t *sys;
 
-    if (cfg->window->type != VOUT_WINDOW_TYPE_NSOBJECT)
+    if (vd->cfg->window->type != VOUT_WINDOW_TYPE_NSOBJECT)
         return VLC_EGENERIC;
 
     /* Allocate structure */
@@ -141,7 +140,7 @@ static int Open (vout_display_t *vd, const vout_display_cfg_t *cfg,
     @autoreleasepool {
         id container = var_CreateGetAddress(vd, "drawable-nsobject");
         if (!container) {
-            sys->embed = cfg->window;
+            sys->embed = vd->cfg->window;
             container = sys->embed->handle.nsobject;
 
             if (!container) {
@@ -202,7 +201,7 @@ static int Open (vout_display_t *vd, const vout_display_cfg_t *cfg,
         const vlc_fourcc_t *subpicture_chromas;
         if (!OpenglLock(sys->gl)) {
             sys->vgl = vout_display_opengl_New(fmt, &subpicture_chromas,
-                                               sys->gl, &cfg->viewpoint, context);
+                                               sys->gl, &vd->cfg->viewpoint, context);
             OpenglUnlock(sys->gl);
         } else
             sys->vgl = NULL;


=====================================
modules/video_output/decklink.cpp
=====================================
@@ -228,7 +228,7 @@ struct decklink_sys_t
  * Local prototypes.
  *****************************************************************************/
 
-static int  OpenVideo           (vout_display_t *, const vout_display_cfg_t *,
+static int  OpenVideo           (vout_display_t *,
                                  video_format_t *, vlc_video_context *);
 static void CloseVideo          (vout_display_t *);
 static int  OpenAudio           (vlc_object_t *);
@@ -765,10 +765,10 @@ static const struct vlc_display_operations ops = {
     CloseVideo, PrepareVideo, NULL, ControlVideo, NULL, NULL,
 };
 
-static int OpenVideo(vout_display_t *vd, const vout_display_cfg_t *cfg,
+static int OpenVideo(vout_display_t *vd,
                      video_format_t *fmtp, vlc_video_context *context)
 {
-    VLC_UNUSED(cfg); VLC_UNUSED(context);
+    VLC_UNUSED(context);
     decklink_sys_t *sys = HoldDLSys(VLC_OBJECT(vd), VIDEO_ES);
     if(!sys)
         return VLC_ENOMEM;


=====================================
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,
                 video_format_t *fmtp, vlc_video_context *context);
 static void Close(vout_display_t *vd);
 
@@ -168,12 +168,12 @@ static const struct vlc_display_operations ops = {
 /**
  * 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,
                 video_format_t *fmtp, vlc_video_context *context)
 {
     vout_display_sys_t *sys;
 
-    if (vout_display_cfg_IsWindowed(cfg))
+    if (vout_display_cfg_IsWindowed(vd->cfg))
         return VLC_EGENERIC;
 
     /* Allocate instance and initialize some members */


=====================================
modules/video_output/flaschen.c
=====================================
@@ -54,7 +54,7 @@
 #define T_HEIGHT N_("Height")
 #define LT_HEIGHT NULL
 
-static int Open(vout_display_t *vd, const vout_display_cfg_t *cfg,
+static int Open(vout_display_t *vd,
                 video_format_t *fmtp, vlc_video_context *context);
 static void Close(vout_display_t *vd);
 
@@ -90,7 +90,7 @@ static const struct vlc_display_operations ops = {
 /*****************************************************************************
  * 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,
                 video_format_t *fmtp, vlc_video_context *context)
 {
     vout_display_sys_t *sys;
@@ -146,7 +146,7 @@ static int Open(vout_display_t *vd, const vout_display_cfg_t *cfg,
 
     vd->ops = &ops;
 
-    (void) cfg; (void) context;
+    (void) context;
     return VLC_SUCCESS;
 }
 


=====================================
modules/video_output/kms.c
=====================================
@@ -676,7 +676,7 @@ static const struct vlc_display_operations ops = {
 /**
  * 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,
                 video_format_t *fmtp, vlc_video_context *context)
 {
     vout_display_sys_t *sys;
@@ -685,7 +685,7 @@ static int Open(vout_display_t *vd, const vout_display_cfg_t *cfg,
     video_format_t fmt = {};
     char *chroma;
 
-    if (vout_display_cfg_IsWindowed(cfg))
+    if (vout_display_cfg_IsWindowed(vd->cfg))
         return VLC_EGENERIC;
 
     /*


=====================================
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 *,
                    video_format_t *, vlc_video_context * );
 static void Close( vout_display_t * );
 
@@ -310,7 +310,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,
                   video_format_t *fmtp, vlc_video_context *context )
 {
     vout_display_sys_t *sys;
@@ -326,7 +326,7 @@ static int Open ( vout_display_t *vd, const vout_display_cfg_t *cfg,
 
     sys->b_fixt23 = var_CreateGetBool( vd, "kva-fixt23");
 
-    if( !sys->b_fixt23 && cfg->window->type != VOUT_WINDOW_TYPE_HWND )
+    if( !sys->b_fixt23 && vd->cfg->window->type != VOUT_WINDOW_TYPE_HWND )
     {
         free( sys );
         return VLC_EBADVAR;


=====================================
modules/video_output/libplacebo/display.c
=====================================
@@ -95,7 +95,7 @@ static const struct vlc_display_operations ops = {
     .control = Control,
 };
 
-static int Open(vout_display_t *vd, const vout_display_cfg_t *cfg,
+static int Open(vout_display_t *vd,
                 video_format_t *fmt, vlc_video_context *context)
 {
     vout_display_sys_t *sys = vd->sys =
@@ -110,7 +110,7 @@ static int Open(vout_display_t *vd, const vout_display_cfg_t *cfg,
     }
 
     char *name = var_InheritString(vd, "pl-gpu");
-    sys->pl = vlc_placebo_Create(cfg, name);
+    sys->pl = vlc_placebo_Create(vd->cfg, name);
     free(name);
     if (sys->pl == NULL)
         goto error;
@@ -165,7 +165,7 @@ static int Open(vout_display_t *vd, const vout_display_cfg_t *cfg,
     vd->ops = &ops;
 
     UpdateParams(vd);
-    (void) cfg; (void) context;
+    (void) context;
     return VLC_SUCCESS;
 
 error:


=====================================
modules/video_output/macosx.m
=====================================
@@ -53,7 +53,7 @@
 /**
  * Forward declarations
  */
-static int Open(vout_display_t *vd, const vout_display_cfg_t *cfg,
+static int Open(vout_display_t *vd,
                 video_format_t *fmt, vlc_video_context *context);
 static void Close(vout_display_t *vd);
 
@@ -141,17 +141,17 @@ static const struct vlc_display_operations ops = {
     Close, PictureRender, PictureDisplay, Control, NULL, SetViewpoint,
 };
 
-static int Open (vout_display_t *vd, const vout_display_cfg_t *cfg,
+static int Open (vout_display_t *vd,
                  video_format_t *fmt, vlc_video_context *context)
 {
     vout_display_sys_t *sys = calloc (1, sizeof(*sys));
 
-    if (cfg->window->type != VOUT_WINDOW_TYPE_NSOBJECT)
+    if (vd->cfg->window->type != VOUT_WINDOW_TYPE_NSOBJECT)
         return VLC_EGENERIC;
 
     if (!sys)
         return VLC_ENOMEM;
-    sys->cfg = *cfg;
+    sys->cfg = *vd->cfg;
 
     @autoreleasepool {
         if (!CGDisplayUsesOpenGLAcceleration (kCGDirectMainDisplay))
@@ -165,7 +165,7 @@ static int Open (vout_display_t *vd, const vout_display_cfg_t *cfg,
         /* Get the drawable object */
         id container = var_CreateGetAddress (vd, "drawable-nsobject");
         if (!container) {
-            sys->embed = cfg->window;
+            sys->embed = vd->cfg->window;
             container = sys->embed->handle.nsobject;
 
             if (!container) {
@@ -237,7 +237,7 @@ static int Open (vout_display_t *vd, const vout_display_cfg_t *cfg,
             goto error;
         }
         sys->vgl = vout_display_opengl_New (fmt, &subpicture_chromas, sys->gl,
-                                            &cfg->viewpoint, context);
+                                            &vd->cfg->viewpoint, context);
         vlc_gl_ReleaseCurrent(sys->gl);
         if (!sys->vgl) {
             msg_Err(vd, "Error while initializing opengl display.");


=====================================
modules/video_output/opengl/display.c
=====================================
@@ -37,7 +37,7 @@
 #include "renderer.h"
 
 /* Plugin callbacks */
-static int Open(vout_display_t *vd, const vout_display_cfg_t *cfg,
+static int Open(vout_display_t *vd,
                 video_format_t *fmtp, vlc_video_context *context);
 static void Close(vout_display_t *vd);
 
@@ -114,7 +114,7 @@ FlipVerticalAlign(vout_display_cfg_t *cfg)
 /**
  * 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,
                 video_format_t *fmt, vlc_video_context *context)
 {
     vout_display_sys_t *sys = malloc (sizeof (*sys));
@@ -123,7 +123,7 @@ static int Open(vout_display_t *vd, const vout_display_cfg_t *cfg,
 
     sys->gl = NULL;
 
-    vout_window_t *surface = cfg->window;
+    vout_window_t *surface = vd->cfg->window;
     char *gl_name = var_InheritString(surface, MODULE_VARNAME);
 
     /* VDPAU GL interop works only with GLX. Override the "gl" option to force
@@ -152,17 +152,17 @@ static int Open(vout_display_t *vd, const vout_display_cfg_t *cfg,
     }
 #endif
 
-    sys->gl = vlc_gl_Create(cfg, API, gl_name);
+    sys->gl = vlc_gl_Create(vd->cfg, API, gl_name);
     free(gl_name);
     if (sys->gl == NULL)
         goto error;
 
 
-    vout_display_cfg_t flipped_cfg = *cfg;
+    vout_display_cfg_t flipped_cfg = *vd->cfg;
     FlipVerticalAlign(&flipped_cfg);
     vout_display_PlacePicture(&sys->place, vd->source, &flipped_cfg);
     sys->place_changed = true;
-    vlc_gl_Resize (sys->gl, cfg->display.width, cfg->display.height);
+    vlc_gl_Resize (sys->gl, vd->cfg->display.width, vd->cfg->display.height);
 
     /* Initialize video display */
     const vlc_fourcc_t *spu_chromas;
@@ -171,7 +171,7 @@ static int Open(vout_display_t *vd, const vout_display_cfg_t *cfg,
         goto error;
 
     sys->vgl = vout_display_opengl_New (fmt, &spu_chromas, sys->gl,
-                                        &cfg->viewpoint, context);
+                                        &vd->cfg->viewpoint, context);
     vlc_gl_ReleaseCurrent (sys->gl);
 
     if (sys->vgl == NULL)


=====================================
modules/video_output/splitter.c
=====================================
@@ -231,12 +231,11 @@ static const struct vlc_display_operations ops = {
 };
 
 static int vlc_vidsplit_Open(vout_display_t *vd,
-                             const vout_display_cfg_t *cfg,
                              video_format_t *fmtp, vlc_video_context *ctx)
 {
     vlc_object_t *obj = VLC_OBJECT(vd);
 
-    if (vout_display_cfg_IsWindowed(cfg))
+    if (vout_display_cfg_IsWindowed(vd->cfg))
         return VLC_EGENERIC;
 
     char *name = var_InheritString(obj, "video-splitter");


=====================================
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,
                      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,
                      video_format_t *fmtp, vlc_video_context *context);
 
 vlc_module_begin ()
@@ -88,10 +88,10 @@ static const struct vlc_display_operations ops_dummy = {
     .control = Control,
 };
 
-static int OpenDummy(vout_display_t *vd, const vout_display_cfg_t *cfg,
+static int OpenDummy(vout_display_t *vd,
                      video_format_t *fmtp, vlc_video_context *context)
 {
-    (void) cfg; (void) context;
+    (void) context;
     Open(vd, fmtp);
     vd->ops = &ops_dummy;
     return VLC_SUCCESS;
@@ -102,10 +102,10 @@ static const struct vlc_display_operations ops_stats = {
     .control = Control,
 };
 
-static int OpenStats(vout_display_t *vd, const vout_display_cfg_t *cfg,
+static int OpenStats(vout_display_t *vd,
                      video_format_t *fmtp, vlc_video_context *context)
 {
-    (void) cfg; (void) context;
+    (void) context;
     Open(vd, fmtp);
     vd->ops = &ops_stats;
     return VLC_SUCCESS;


=====================================
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,
                 video_format_t *fmtp, vlc_video_context *context);
 static void Close(vout_display_t *vd);
 
@@ -114,7 +114,7 @@ static const struct vlc_display_operations ops = {
  *****************************************************************************
  * 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,
                 video_format_t *fmtp, vlc_video_context *context)
 {
     vout_display_sys_t *sys = malloc(sizeof(*sys));
@@ -222,7 +222,7 @@ static int Open(vout_display_t *vd, const vout_display_cfg_t *cfg,
     vd->sys     = sys;
     vd->ops     = &ops;
 
-    (void) cfg; (void) context;
+    (void) context;
     return VLC_SUCCESS;
 }
 


=====================================
modules/video_output/wayland/shm.c
=====================================
@@ -270,10 +270,10 @@ static const struct vlc_display_operations ops = {
     .reset_pictures = ResetPictures,
 };
 
-static int Open(vout_display_t *vd, const vout_display_cfg_t *cfg,
+static int Open(vout_display_t *vd,
                 video_format_t *fmtp, vlc_video_context *context)
 {
-    if (cfg->window->type != VOUT_WINDOW_TYPE_WAYLAND)
+    if (vd->cfg->window->type != VOUT_WINDOW_TYPE_WAYLAND)
         return VLC_EGENERIC;
 
     vout_display_sys_t *sys = malloc(sizeof (*sys));
@@ -285,11 +285,11 @@ static int Open(vout_display_t *vd, const vout_display_cfg_t *cfg,
     sys->eventq = NULL;
     sys->shm = NULL;
     sys->active_buffers = 0;
-    sys->display_width = cfg->display.width;
-    sys->display_height = cfg->display.height;
+    sys->display_width = vd->cfg->display.width;
+    sys->display_height = vd->cfg->display.height;
 
     /* Get window */
-    sys->embed = cfg->window;
+    sys->embed = vd->cfg->window;
     assert(sys->embed != NULL);
 
     struct wl_display *display = sys->embed->display.wl;


=====================================
modules/video_output/win32/direct3d11.cpp
=====================================
@@ -63,7 +63,7 @@
 
 using Microsoft::WRL::ComPtr;
 
-static int  Open(vout_display_t *, const vout_display_cfg_t *,
+static int  Open(vout_display_t *,
                  video_format_t *, vlc_video_context *);
 static void Close(vout_display_t *);
 
@@ -355,7 +355,7 @@ static const struct vlc_display_operations ops = {
     .set_viewpoint = SetViewpoint,
 };
 
-static int Open(vout_display_t *vd, const vout_display_cfg_t *cfg,
+static int Open(vout_display_t *vd,
                 video_format_t *fmtp, vlc_video_context *context)
 {
     vout_display_sys_t *sys = new (std::nothrow) vout_display_sys_t();
@@ -394,7 +394,7 @@ static int Open(vout_display_t *vd, const vout_display_cfg_t *cfg,
     if ( sys->swapCb == NULL || sys->startEndRenderingCb == NULL || sys->updateOutputCb == NULL )
     {
 #if !VLC_WINSTORE_APP
-        if (cfg->window->type == VOUT_WINDOW_TYPE_HWND)
+        if (vd->cfg->window->type == VOUT_WINDOW_TYPE_HWND)
         {
             if (CommonWindowInit(vd, &sys->area, &sys->sys,
                        vd->source->projection_mode != PROJECTION_MODE_RECTANGULAR))
@@ -405,8 +405,11 @@ static int Open(vout_display_t *vd, const vout_display_cfg_t *cfg,
 
         /* use our internal swapchain callbacks */
 #if defined(HAVE_DCOMP_H) && !VLC_WINSTORE_APP
-        if (cfg->window->type == VOUT_WINDOW_TYPE_DCOMP)
-            sys->outside_opaque      = D3D11_CreateLocalSwapchainHandleDComp(VLC_OBJECT(vd), cfg->window->display.dcomp_device, cfg->window->handle.dcomp_visual, sys->d3d_dev);
+        if (vd->cfg->window->type == VOUT_WINDOW_TYPE_DCOMP)
+            sys->outside_opaque =
+                D3D11_CreateLocalSwapchainHandleDComp(VLC_OBJECT(vd),
+                                                      vd->cfg->window->display.dcomp_device,
+                                                      vd->cfg->window->handle.dcomp_visual, sys->d3d_dev);
         else
 #endif
             sys->outside_opaque      = D3D11_CreateLocalSwapchainHandleHwnd(VLC_OBJECT(vd), sys->sys.hvideownd, sys->d3d_dev);
@@ -429,7 +432,7 @@ static int Open(vout_display_t *vd, const vout_display_cfg_t *cfg,
         goto error;
     }
 
-    vout_window_SetTitle(cfg->window, VOUT_TITLE " (Direct3D11 output)");
+    vout_window_SetTitle(vd->cfg->window, VOUT_TITLE " (Direct3D11 output)");
     msg_Dbg(vd, "Direct3D11 display adapter successfully initialized");
 
     vd->info.can_scale_spu        = true;


=====================================
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 *,
                  video_format_t *, vlc_video_context *);
 static void Close(vout_display_t *);
 
@@ -1774,7 +1774,7 @@ static const struct vlc_display_operations ops = {
 /**
  * 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,
                 video_format_t *fmtp, vlc_video_context *context)
 {
     vout_display_sys_t *sys;
@@ -1884,7 +1884,7 @@ static int Open(vout_display_t *vd, const vout_display_cfg_t *cfg,
     vd->ops = &ops;
 
     /* Change the window title bar text */
-    vout_window_SetTitle(cfg->window, VOUT_TITLE " (Direct3D9 output)");
+    vout_window_SetTitle(vd->cfg->window, VOUT_TITLE " (Direct3D9 output)");
 
     return VLC_SUCCESS;
 error:


=====================================
modules/video_output/win32/glwin32.c
=====================================
@@ -43,7 +43,7 @@
 /*****************************************************************************
  * Module descriptor
  *****************************************************************************/
-static int  Open (vout_display_t *, const vout_display_cfg_t *,
+static int  Open (vout_display_t *,
                   video_format_t *, vlc_video_context *);
 static void Close(vout_display_t *);
 
@@ -119,7 +119,7 @@ static const struct vlc_display_operations ops = {
 /**
  * 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,
                 video_format_t *fmtp, vlc_video_context *context)
 {
     vout_display_sys_t *sys;
@@ -142,9 +142,9 @@ static int Open(vout_display_t *vd, const vout_display_cfg_t *cfg,
     if (vd->source->projection_mode != PROJECTION_MODE_RECTANGULAR)
         sys->p_sensors = HookWindowsSensors(vd, sys->sys.hvideownd);
 
-    vout_window_SetTitle(cfg->window, VOUT_TITLE " (OpenGL output)");
+    vout_window_SetTitle(vd->cfg->window, VOUT_TITLE " (OpenGL output)");
 
-    vout_display_cfg_t embed_cfg = *cfg;
+    vout_display_cfg_t embed_cfg = *vd->cfg;
     embed_cfg.window = EmbedVideoWindow_Create(vd);
     if (!embed_cfg.window)
         goto error;
@@ -158,13 +158,13 @@ static int Open(vout_display_t *vd, const vout_display_cfg_t *cfg,
         goto error;
     }
 
-    vlc_gl_Resize (sys->gl, cfg->display.width, cfg->display.height);
+    vlc_gl_Resize (sys->gl, vd->cfg->display.width, vd->cfg->display.height);
 
     const vlc_fourcc_t *subpicture_chromas;
     if (vlc_gl_MakeCurrent (sys->gl))
         goto error;
     sys->vgl = vout_display_opengl_New(fmtp, &subpicture_chromas, sys->gl,
-                                       &cfg->viewpoint, context);
+                                       &vd->cfg->viewpoint, context);
     vlc_gl_ReleaseCurrent (sys->gl);
     if (!sys->vgl)
         goto error;


=====================================
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 *,
                   video_format_t *, vlc_video_context *);
 static void Close(vout_display_t *);
 
@@ -111,7 +111,7 @@ static const struct vlc_display_operations ops = {
 };
 
 /* */
-static int Open(vout_display_t *vd, const vout_display_cfg_t *cfg,
+static int Open(vout_display_t *vd,
                 video_format_t *fmtp, vlc_video_context *context)
 {
     VLC_UNUSED(context);
@@ -132,7 +132,7 @@ static int Open(vout_display_t *vd, const vout_display_cfg_t *cfg,
     if (Init(vd, fmtp))
         goto error;
 
-    vout_window_SetTitle(cfg->window, VOUT_TITLE " (WinGDI output)");
+    vout_window_SetTitle(vd->cfg->window, VOUT_TITLE " (WinGDI output)");
 
     /* */
     vd->ops = &ops;


=====================================
modules/video_output/xcb/render.c
=====================================
@@ -265,7 +265,7 @@ static void Display(vout_display_t *vd, picture_t *pic)
     (void) pic;
 }
 
-static void CreateBuffers(vout_display_t *vd, const vout_display_cfg_t *cfg)
+static void CreateBuffers(vout_display_t *vd)
 {
     const video_format_t *fmt = vd->source;
     vout_display_sys_t *sys = vd->sys;
@@ -274,14 +274,14 @@ static void CreateBuffers(vout_display_t *vd, const vout_display_cfg_t *cfg)
     xcb_create_pixmap(conn, 32, sys->drawable.crop, sys->root,
                       fmt->i_visible_width, fmt->i_visible_height);
     xcb_create_pixmap(conn, 32, sys->drawable.scale, sys->root,
-                      cfg->display.width, cfg->display.height);
+                      vd->cfg->display.width, vd->cfg->display.height);
     xcb_render_create_picture(conn, sys->picture.crop, sys->drawable.crop,
                               sys->format.argb, 0, NULL);
     xcb_render_create_picture(conn, sys->picture.scale, sys->drawable.scale,
                               sys->format.argb, 0, NULL);
 
     vout_display_place_t *place = &sys->place;
-    vout_display_PlacePicture(place, fmt, cfg);
+    vout_display_PlacePicture(place, fmt, vd->cfg);
 
     /* Homogeneous coordinates transform from destination(place)
      * to source(fmt) */
@@ -368,7 +368,7 @@ static int Control(vout_display_t *vd, int query)
 
             xcb_configure_window(sys->conn, sys->drawable.dest, mask, values);
             DeleteBuffers(vd);
-            CreateBuffers(vd, vd->cfg);
+            CreateBuffers(vd);
             xcb_flush(sys->conn);
             return VLC_SUCCESS;
         }
@@ -550,7 +550,7 @@ static const struct vlc_display_operations ops = {
 /**
  * Probe the X server.
  */
-static int Open(vout_display_t *vd, const vout_display_cfg_t *cfg,
+static int Open(vout_display_t *vd,
                 video_format_t *fmtp, vlc_video_context *ctx)
 {
     vlc_object_t *obj = VLC_OBJECT(vd);
@@ -565,7 +565,7 @@ static int Open(vout_display_t *vd, const vout_display_cfg_t *cfg,
     xcb_connection_t *conn;
     const xcb_screen_t *screen;
 
-    if (vlc_xcb_parent_Create(vd, cfg->window, &conn, &screen) != VLC_SUCCESS)
+    if (vlc_xcb_parent_Create(vd, vd->cfg->window, &conn, &screen) != VLC_SUCCESS)
         return VLC_EGENERIC;
 
     sys->conn = conn;
@@ -675,14 +675,14 @@ static int Open(vout_display_t *vd, const vout_display_cfg_t *cfg,
     xcb_create_pixmap(conn, 32, sys->drawable.source, screen->root,
                       vd->source->i_width, vd->source->i_height);
     xcb_create_gc(conn, sys->gc, sys->drawable.source, 0, NULL);
-    xcb_create_window(conn, 32, sys->drawable.dest, cfg->window->handle.xid,
-                      0, 0, cfg->display.width, cfg->display.height, 0,
+    xcb_create_window(conn, 32, sys->drawable.dest, vd->cfg->window->handle.xid,
+                      0, 0, vd->cfg->display.width, vd->cfg->display.height, 0,
                       XCB_WINDOW_CLASS_INPUT_OUTPUT, visual, cw_mask, cw_list);
     xcb_render_create_picture(conn, sys->picture.source, sys->drawable.source,
                               sys->format.argb, 0, NULL);
     xcb_render_create_picture(conn, sys->picture.dest, sys->drawable.dest,
                               sys->format.argb, 0, NULL);
-    CreateBuffers(vd, cfg);
+    CreateBuffers(vd);
     xcb_map_window(conn, sys->drawable.dest);
 
     sys->spu_chromas[0] = fmtp->i_chroma;


=====================================
modules/video_output/xcb/x11.c
=====================================
@@ -261,7 +261,7 @@ static const struct vlc_display_operations ops = {
 /**
  * Probe the X server.
  */
-static int Open (vout_display_t *vd, const vout_display_cfg_t *cfg,
+static int Open (vout_display_t *vd,
                  video_format_t *fmtp, vlc_video_context *context)
 {
     vout_display_sys_t *sys = malloc (sizeof (*sys));
@@ -273,7 +273,7 @@ static int Open (vout_display_t *vd, const vout_display_cfg_t *cfg,
     /* Get window, connect to X server */
     xcb_connection_t *conn;
     const xcb_screen_t *scr;
-    if (vlc_xcb_parent_Create(vd, cfg->window, &conn, &scr) != VLC_SUCCESS)
+    if (vlc_xcb_parent_Create(vd, vd->cfg->window, &conn, &scr) != VLC_SUCCESS)
     {
         free (sys);
         return VLC_EGENERIC;
@@ -321,11 +321,11 @@ static int Open (vout_display_t *vd, const vout_display_cfg_t *cfg,
     };
     vout_display_place_t place;
 
-    vout_display_PlacePicture(&place, vd->source, cfg);
+    vout_display_PlacePicture(&place, vd->source, vd->cfg);
     sys->window = xcb_generate_id (conn);
     sys->gc = xcb_generate_id (conn);
 
-    xcb_create_window(conn, sys->depth, sys->window, cfg->window->handle.xid,
+    xcb_create_window(conn, sys->depth, sys->window, vd->cfg->window->handle.xid,
         place.x, place.y, place.width, place.height, 0,
         XCB_WINDOW_CLASS_INPUT_OUTPUT, vid, mask, values);
     xcb_map_window(conn, sys->window);


=====================================
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,
                 video_format_t *fmtp, vlc_video_context *context);
 static void Close(vout_display_t *vd);
 
@@ -93,7 +93,7 @@ static const struct vlc_display_operations ops = {
 };
 
 /* */
-static int Open(vout_display_t *vd, const vout_display_cfg_t *cfg,
+static int Open(vout_display_t *vd,
                 video_format_t *fmtp, vlc_video_context *context)
 {
     vout_display_sys_t *sys;
@@ -157,7 +157,7 @@ static int Open(vout_display_t *vd, const vout_display_cfg_t *cfg,
     *fmtp = fmt;
     vd->ops = &ops;
 
-    (void) cfg; (void) context;
+    (void) context;
     return VLC_SUCCESS;
 }
 


=====================================
src/video_output/display.c
=====================================
@@ -283,7 +283,6 @@ static int vout_display_start(void *func, bool forced, va_list ap)
 {
     vout_display_open_cb activate = func;
     vout_display_priv_t *osys = va_arg(ap, vout_display_priv_t *);
-    const vout_display_cfg_t *cfg = &osys->cfg;
     vout_display_t *vd = &osys->display;
     vlc_video_context *context = osys->src_vctx;
 
@@ -291,7 +290,7 @@ static int vout_display_start(void *func, bool forced, va_list ap)
     video_format_Copy(&osys->display_fmt, vd->source);
     vd->obj.force = forced; /* TODO: pass to activate() instead? */
 
-    int ret = activate(vd, cfg, &osys->display_fmt, context);
+    int ret = activate(vd, &osys->display_fmt, context);
     if (ret != VLC_SUCCESS) {
         video_format_Clean(&osys->display_fmt);
         vlc_objres_clear(VLC_OBJECT(vd));



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/2721256e9bee998db4d4fd880987be225e246078

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/2721256e9bee998db4d4fd880987be225e246078
You're receiving this email because of your account on code.videolan.org.




More information about the vlc-commits mailing list