[vlc-commits] d3d11_quad: add a function to set the Viewport

Steve Lhomme git at videolan.org
Mon May 28 13:25:41 CEST 2018


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Tue Jan  9 17:59:30 2018 +0100| [5e63c89381ba144818765c67ab5fc73d95fbd8bd] | committer: Steve Lhomme

d3d11_quad: add a function to set the Viewport

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

 modules/video_output/win32/d3d11_quad.c | 10 ++++++++++
 modules/video_output/win32/d3d11_quad.h |  2 ++
 2 files changed, 12 insertions(+)

diff --git a/modules/video_output/win32/d3d11_quad.c b/modules/video_output/win32/d3d11_quad.c
index 1a8567c7b6..cc986e650a 100644
--- a/modules/video_output/win32/d3d11_quad.c
+++ b/modules/video_output/win32/d3d11_quad.c
@@ -779,6 +779,8 @@ int D3D11_SetupQuad(vlc_object_t *o, d3d11_device_t *d3d_dev, const video_format
     if (!D3D11_UpdateQuadPosition(o, d3d_dev, quad, output, orientation))
         goto error;
 
+    quad->cropViewport.MinDepth = 0.0f;
+    quad->cropViewport.MaxDepth = 1.0f;
     quad->d3dvertexShader = d3dvertexShader;
     quad->pVertexLayout   = pVertexLayout;
     quad->resourceCount = DxgiResourceCount(quad->formatInfo);
@@ -789,3 +791,11 @@ error:
     D3D11_ReleaseQuad(quad);
     return VLC_EGENERIC;
 }
+
+void D3D11_UpdateViewport(d3d_quad_t *quad, const RECT *rect)
+{
+    quad->cropViewport.TopLeftX = rect->left;
+    quad->cropViewport.TopLeftY = rect->top;
+    quad->cropViewport.Width    = rect->right  - rect->left;
+    quad->cropViewport.Height   = rect->bottom - rect->top;
+}
diff --git a/modules/video_output/win32/d3d11_quad.h b/modules/video_output/win32/d3d11_quad.h
index a168baaeb6..db917f1ec2 100644
--- a/modules/video_output/win32/d3d11_quad.h
+++ b/modules/video_output/win32/d3d11_quad.h
@@ -82,6 +82,8 @@ bool D3D11_UpdateQuadPosition( vlc_object_t *, d3d11_device_t *, d3d_quad_t *,
                                const RECT *output, video_orientation_t );
 #define D3D11_UpdateQuadPosition(a,b,c,d,e)  D3D11_UpdateQuadPosition(VLC_OBJECT(a),b,c,d,e)
 
+void D3D11_UpdateViewport(d3d_quad_t *, const RECT *);
+
 void D3D11_UpdateQuadOpacity(vlc_object_t *, d3d11_device_t *, d3d_quad_t *, float opacity);
 #define D3D11_UpdateQuadOpacity(a,b,c,d)  D3D11_UpdateQuadOpacity(VLC_OBJECT(a),b,c,d)
 



More information about the vlc-commits mailing list