[vlc-commits] video_output: pass the video format to vout_SizeWindow()

Steve Lhomme git at videolan.org
Fri Oct 18 09:46:46 CEST 2019


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Fri Sep 27 11:13:10 2019 +0200| [9b7605bcfda855fe66929f500639a2113c67d938] | committer: Steve Lhomme

video_output: pass the video format to vout_SizeWindow()

This will be needed when the GetDevice call will create a window without setting
the sys->original which is only related to the display module.

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

 src/video_output/video_output.c | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

diff --git a/src/video_output/video_output.c b/src/video_output/video_output.c
index 76e415feee..72b7edab78 100644
--- a/src/video_output/video_output.c
+++ b/src/video_output/video_output.c
@@ -148,14 +148,16 @@ static void vout_display_SizeWindow(unsigned *restrict width,
     *height = (h * cfg->zoom.num) / cfg->zoom.den;
 }
 
-static void vout_SizeWindow(vout_thread_t *vout, unsigned *restrict width,
+static void vout_SizeWindow(vout_thread_t *vout,
+                            const video_format_t *original,
+                            unsigned *restrict width,
                             unsigned *restrict height)
 {
     vout_thread_sys_t *sys = vout->p;
-    unsigned w = sys->original.i_visible_width;
-    unsigned h = sys->original.i_visible_height;
-    unsigned sar_num = sys->original.i_sar_num;
-    unsigned sar_den = sys->original.i_sar_num;
+    unsigned w = original->i_visible_width;
+    unsigned h = original->i_visible_height;
+    unsigned sar_num = original->i_sar_num;
+    unsigned sar_den = original->i_sar_num;
 
     switch (sys->source.crop.mode) {
         case VOUT_CROP_NONE:
@@ -191,7 +193,7 @@ static void vout_SizeWindow(vout_thread_t *vout, unsigned *restrict width,
 
     /* If the vout thread is running, the window lock must be held here. */
     vout_display_SizeWindow(width, height, w, h, sar_num, sar_den,
-                            sys->original.orientation,
+                            original->orientation,
                             &sys->display_cfg);
 }
 
@@ -204,7 +206,7 @@ static void vout_UpdateWindowSizeLocked(vout_thread_t *vout)
 
     vlc_mutex_lock(&sys->display_lock);
     if (sys->display != NULL) {
-        vout_SizeWindow(vout, &width, &height);
+        vout_SizeWindow(vout, &sys->original, &width, &height);
         vlc_mutex_unlock(&sys->display_lock);
 
         msg_Dbg(vout, "requested window size: %ux%u", width, height);
@@ -1992,7 +1994,7 @@ static int vout_EnableWindow(const vout_configuration_t *cfg, vlc_decoder_device
         };
 
         VoutGetDisplayCfg(vout, &original, &sys->display_cfg);
-        vout_SizeWindow(vout, &wcfg.width, &wcfg.height);
+        vout_SizeWindow(vout, &original, &wcfg.width, &wcfg.height);
 
         if (vout_window_Enable(sys->display_cfg.window, &wcfg)) {
             vlc_mutex_unlock(&sys->window_lock);



More information about the vlc-commits mailing list