[vlc-commits] direct3d11: use the source visible area directly

Steve Lhomme git at videolan.org
Mon Apr 1 12:03:39 CEST 2019


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Fri Mar 22 13:51:57 2019 +0100| [03ecbeeb5568e9a7df0156088627c1717725903b] | committer: Steve Lhomme

direct3d11: use the source visible area directly

Instead of using rect_src_clipped.

The positioning of the quad doesn't depend on the display width, even if it's
zero.

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

 modules/video_output/win32/direct3d11.c | 19 ++++++++++++++++---
 1 file changed, 16 insertions(+), 3 deletions(-)

diff --git a/modules/video_output/win32/direct3d11.c b/modules/video_output/win32/direct3d11.c
index c9460d5e16..8e566cd26f 100644
--- a/modules/video_output/win32/direct3d11.c
+++ b/modules/video_output/win32/direct3d11.c
@@ -215,7 +215,13 @@ static void UpdateSize(vout_display_t *vd)
 
     UpdatePicQuadPosition(vd);
 
-    D3D11_UpdateQuadPosition(vd, &sys->d3d_dev, &sys->picQuad, &sys->sys.rect_src_clipped,
+    RECT source_rect = {
+        .left   = vd->source.i_x_offset,
+        .right  = vd->source.i_x_offset + vd->source.i_visible_width,
+        .top    = vd->source.i_y_offset,
+        .bottom = vd->source.i_y_offset + vd->source.i_visible_height,
+    };
+    D3D11_UpdateQuadPosition(vd, &sys->d3d_dev, &sys->picQuad, &source_rect,
                              vd->source.orientation);
 
     d3d11_device_unlock( &sys->d3d_dev );
@@ -1485,8 +1491,15 @@ static int Direct3D11CreateFormatResources(vout_display_t *vd, const video_forma
        return VLC_EGENERIC;
     }
 
-    if (D3D11_SetupQuad( vd, &sys->d3d_dev, &surface_fmt, &sys->picQuad, &sys->display, &sys->sys.rect_src_clipped,
-                   vd->source.orientation ) != VLC_SUCCESS) {
+    RECT source_rect = {
+        .left   = vd->source.i_x_offset,
+        .right  = vd->source.i_x_offset + vd->source.i_visible_width,
+        .top    = vd->source.i_y_offset,
+        .bottom = vd->source.i_y_offset + vd->source.i_visible_height,
+    };
+    if (D3D11_SetupQuad( vd, &sys->d3d_dev, &surface_fmt, &sys->picQuad, &sys->display,
+                         &source_rect,
+                         vd->source.orientation ) != VLC_SUCCESS) {
         msg_Err(vd, "Could not Create the main quad picture.");
         return VLC_EGENERIC;
     }



More information about the vlc-commits mailing list