[vlc-commits] vout:win32: read the picture pool size indirectly
Steve Lhomme
git at videolan.org
Wed Aug 1 15:16:37 CEST 2018
vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Wed Aug 1 15:03:23 2018 +0200| [43296cebc3a8f3951a8c641c7cb8aada4c6a274d] | 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.git/?a=commit;h=43296cebc3a8f3951a8c641c7cb8aada4c6a274d
---
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 2caccc6ad1..625b128ce7 100644
--- a/modules/video_output/win32/common.c
+++ b/modules/video_output/win32/common.c
@@ -56,6 +56,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)
{
@@ -69,6 +79,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);
@@ -264,8 +276,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