[vlc-commits] vout:win32: read the picture pool size indirectly
Steve Lhomme
git at videolan.org
Tue Aug 7 09:12:50 CEST 2018
vlc/vlc-3.0 | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Wed Aug 1 15:03:23 2018 +0200| [6f51b19abfa7ea811ef679c13e050c5b9554e998] | committer: Steve Lhomme
vout:win32: read the picture pool size indirectly
This allows overriding if the internal size is not set in vd->fmt (to avoid
a converter being added if some padding is added internally).
> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=6f51b19abfa7ea811ef679c13e050c5b9554e998
---
modules/video_output/win32/common.c | 16 ++++++++++++++--
modules/video_output/win32/common.h | 2 ++
2 files changed, 16 insertions(+), 2 deletions(-)
diff --git a/modules/video_output/win32/common.c b/modules/video_output/win32/common.c
index f4787d20c3..ca7c5401e6 100644
--- a/modules/video_output/win32/common.c
+++ b/modules/video_output/win32/common.c
@@ -61,6 +61,16 @@ static bool GetRect(const vout_display_sys_t *sys, RECT *out)
}
#endif
+static unsigned int GetPictureWidth(const vout_display_t *vd)
+{
+ return vd->fmt.i_width;
+}
+
+static unsigned int GetPictureHeight(const vout_display_t *vd)
+{
+ return vd->fmt.i_height;
+}
+
/* */
int CommonInit(vout_display_t *vd)
{
@@ -74,6 +84,8 @@ int CommonInit(vout_display_t *vd)
sys->is_first_display = true;
sys->is_on_top = false;
+ sys->pf_GetPictureWidth = GetPictureWidth;
+ sys->pf_GetPictureHeight = GetPictureHeight;
#if !VLC_WINSTORE_APP
sys->pf_GetRect = GetRect;
SetRectEmpty(&sys->rect_display);
@@ -267,8 +279,8 @@ void UpdateRects(vout_display_t *vd,
/* src image dimensions */
rect_src.left = 0;
rect_src.top = 0;
- rect_src.right = vd->fmt.i_width;
- rect_src.bottom = vd->fmt.i_height;
+ rect_src.right = sys->pf_GetPictureWidth(vd);
+ rect_src.bottom = sys->pf_GetPictureHeight(vd);
/* Clip the source image */
rect_src_clipped.left = source->i_x_offset +
diff --git a/modules/video_output/win32/common.h b/modules/video_output/win32/common.h
index 0fb4e93c02..f3e912845b 100644
--- a/modules/video_output/win32/common.h
+++ b/modules/video_output/win32/common.h
@@ -80,6 +80,8 @@ typedef struct vout_display_sys_win32_t
int i_align_dest_size;
bool (*pf_GetRect)(const struct vout_display_sys_win32_t *p_sys, RECT *out);
+ unsigned int (*pf_GetPictureWidth) (const vout_display_t *);
+ unsigned int (*pf_GetPictureHeight)(const vout_display_t *);
} vout_display_sys_win32_t;
More information about the vlc-commits
mailing list