[vlc-devel] [PATCH 28/41] direct3d11: use the source visible area directly
Steve Lhomme
robux4 at ycbcr.xyz
Fri Mar 22 16:14:06 CET 2019
Instead of using source_visible_rect.
The positioning of the quad doesn't depend on the display width, even if it's
zero.
---
modules/video_output/win32/direct3d11.c | 16 ++++++++++++++--
1 file changed, 14 insertions(+), 2 deletions(-)
diff --git a/modules/video_output/win32/direct3d11.c b/modules/video_output/win32/direct3d11.c
index 3a5245347f..7156d82872 100644
--- a/modules/video_output/win32/direct3d11.c
+++ b/modules/video_output/win32/direct3d11.c
@@ -212,7 +212,13 @@ static void UpdateSize(vout_display_t *vd)
UpdatePicQuadPosition(vd);
- D3D11_UpdateQuadPosition(vd, &sys->d3d_dev, &sys->picQuad, &sys->sys.area.source_visible_rect,
+ 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 );
@@ -1482,8 +1488,14 @@ static int Direct3D11CreateFormatResources(vout_display_t *vd, const video_forma
return VLC_EGENERIC;
}
+ 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,
- &sys->sys.area.source_visible_rect,
+ &source_rect,
vd->source.orientation ) != VLC_SUCCESS) {
msg_Err(vd, "Could not Create the main quad picture.");
return VLC_EGENERIC;
--
2.17.1
More information about the vlc-devel
mailing list