[vlc-devel] [PATCH 01/39] video_output: pass the video format to vout_SizeWindow()
Steve Lhomme
robux4 at ycbcr.xyz
Wed Oct 2 16:23:16 CEST 2019
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.
---
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 eb022fb2ac0..4b11d4c6de4 100644
--- a/src/video_output/video_output.c
+++ b/src/video_output/video_output.c
@@ -147,14 +147,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:
@@ -190,7 +192,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);
}
@@ -203,7 +205,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);
@@ -1954,7 +1956,7 @@ int vout_Request(const vout_configuration_t *cfg, input_thread_t *input)
};
VoutGetDisplayCfg(vout, &original, &sys->display_cfg);
- vout_SizeWindow(vout, &wcfg.width, &wcfg.height);
+ vout_SizeWindow(vout, &sys->original, &wcfg.width, &wcfg.height);
if (vout_window_Enable(sys->display_cfg.window, &wcfg)) {
vlc_mutex_unlock(&sys->window_lock);
--
2.17.1
More information about the vlc-devel
mailing list