[vlc-devel] [PATCH] Win32: use visible dimensions for all vouts

Felix Abecassis felix.abecassis at gmail.com
Wed Feb 26 19:33:38 CET 2014


Close #9645
---
 modules/video_output/msw/common.c   |    8 ++++----
 modules/video_output/msw/direct2d.c |    4 ++--
 modules/video_output/msw/direct3d.c |   10 +++++-----
 modules/video_output/msw/directx.c  |    4 ++--
 4 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/modules/video_output/msw/common.c b/modules/video_output/msw/common.c
index f4954b1..529db39 100644
--- a/modules/video_output/msw/common.c
+++ b/modules/video_output/msw/common.c
@@ -213,7 +213,7 @@ int CommonUpdatePicture(picture_t *picture, picture_t **fallback,
     /* fill in buffer info in first plane */
     picture->p->p_pixels = data;
     picture->p->i_pitch  = pitch;
-    picture->p->i_lines  = picture->format.i_height;
+    picture->p->i_lines  = picture->format.i_visible_height;
 
     /*  Fill chroma planes for planar YUV */
     if (picture->format.i_chroma == VLC_CODEC_I420 ||
@@ -226,7 +226,7 @@ int CommonUpdatePicture(picture_t *picture, picture_t **fallback,
 
             p->p_pixels = o->p_pixels + o->i_lines * o->i_pitch;
             p->i_pitch  = pitch / 2;
-            p->i_lines  = picture->format.i_height / 2;
+            p->i_lines  = picture->format.i_visible_height / 2;
         }
         /* The dx/d3d buffer is always allocated as YV12 */
         if (vlc_fourcc_AreUVPlanesSwapped(picture->format.i_chroma, VLC_CODEC_YV12)) {
@@ -403,8 +403,8 @@ void UpdateRects(vout_display_t *vd,
     /* src image dimensions */
     rect_src.left   = 0;
     rect_src.top    = 0;
-    rect_src.right  = source->i_width;
-    rect_src.bottom = source->i_height;
+    rect_src.right  = source->i_visible_width;
+    rect_src.bottom = source->i_visible_height;
 
     /* Clip the source image */
     rect_src_clipped.left = source->i_x_offset +
diff --git a/modules/video_output/msw/direct2d.c b/modules/video_output/msw/direct2d.c
index 6f5b28a..6fad178 100644
--- a/modules/video_output/msw/direct2d.c
+++ b/modules/video_output/msw/direct2d.c
@@ -347,8 +347,8 @@ static int D2D_CreateRenderTarget(vout_display_t *vd)
     };
 
     D2D1_SIZE_U bitmap_size = {
-        vd->fmt.i_width,
-        vd->fmt.i_height
+        vd->fmt.i_visible_width,
+        vd->fmt.i_visible_height
     };
 
     hr = ID2D1HwndRenderTarget_CreateBitmap(sys->d2_render_target,
diff --git a/modules/video_output/msw/direct3d.c b/modules/video_output/msw/direct3d.c
index ff0f601..059c6d6 100644
--- a/modules/video_output/msw/direct3d.c
+++ b/modules/video_output/msw/direct3d.c
@@ -972,8 +972,8 @@ static int Direct3DCreatePool(vout_display_t *vd, video_format_t *fmt)
     /* Create a surface */
     LPDIRECT3DSURFACE9 surface;
     HRESULT hr = IDirect3DDevice9_CreateOffscreenPlainSurface(d3ddev,
-                                                              fmt->i_width,
-                                                              fmt->i_height,
+                                                              fmt->i_visible_width,
+                                                              fmt->i_visible_height,
                                                               d3dfmt->format,
                                                               D3DPOOL_DEFAULT,
                                                               &surface,
@@ -996,7 +996,7 @@ static int Direct3DCreatePool(vout_display_t *vd, video_format_t *fmt)
 
     picture_resource_t resource = { .p_sys = picsys };
     for (int i = 0; i < PICTURE_PLANE_MAX; i++)
-        resource.p[i].i_lines = fmt->i_height / (i > 0 ? 2 : 1);
+        resource.p[i].i_lines = fmt->i_visible_height / (i > 0 ? 2 : 1);
 
     picture_t *picture = picture_NewFromResource(fmt, &resource);
     if (!picture) {
@@ -1055,8 +1055,8 @@ static int Direct3DCreateScene(vout_display_t *vd, const video_format_t *fmt)
      */
     LPDIRECT3DTEXTURE9 d3dtex;
     hr = IDirect3DDevice9_CreateTexture(d3ddev,
-                                        fmt->i_width,
-                                        fmt->i_height,
+                                        fmt->i_visible_width,
+                                        fmt->i_visible_height,
                                         1,
                                         D3DUSAGE_RENDERTARGET,
                                         sys->d3dpp.BackBufferFormat,
diff --git a/modules/video_output/msw/directx.c b/modules/video_output/msw/directx.c
index b65b145..4832fd0 100644
--- a/modules/video_output/msw/directx.c
+++ b/modules/video_output/msw/directx.c
@@ -850,8 +850,8 @@ static int DirectXCreateSurface(vout_display_t *vd,
     ddsd.dwSize   = sizeof(ddsd);
     ddsd.ddpfPixelFormat.dwSize = sizeof(ddsd.ddpfPixelFormat);
     ddsd.dwFlags  = DDSD_HEIGHT | DDSD_WIDTH;
-    ddsd.dwWidth  = fmt->i_width;
-    ddsd.dwHeight = fmt->i_height;
+    ddsd.dwWidth  = fmt->i_visible_width;
+    ddsd.dwHeight = fmt->i_visible_height;
     if (fourcc) {
         ddsd.dwFlags |= DDSD_PIXELFORMAT;
         ddsd.ddpfPixelFormat.dwFlags = DDPF_FOURCC;
-- 
1.7.10.4




More information about the vlc-devel mailing list