[vlc-devel] [PATCH] d3d11_deinterlace: set the surface area to deinterlace
Steve Lhomme
robux4 at videolabs.io
Mon Jul 3 12:37:00 CEST 2017
Fix green lines when the surface size is bigger than the actual display size.
---
modules/video_output/win32/d3d11_deinterlace.c | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/modules/video_output/win32/d3d11_deinterlace.c b/modules/video_output/win32/d3d11_deinterlace.c
index 6be55c600f..0b54cde18b 100644
--- a/modules/video_output/win32/d3d11_deinterlace.c
+++ b/modules/video_output/win32/d3d11_deinterlace.c
@@ -182,6 +182,22 @@ static int RenderPic( filter_t *p_filter, picture_t *p_outpic, picture_t *p_pic,
stream.pInputSurface = p_sys_src->processorInput;
}
+ D3D11_TEXTURE2D_DESC dstDesc;
+ ID3D11Texture2D_GetDesc(ActivePictureSys(p_pic)->texture[KNOWN_DXGI_INDEX], &dstDesc);
+
+ RECT sourceRECT;
+ sourceRECT.top = 0;
+ sourceRECT.left = 0;
+ sourceRECT.right = p_pic->format.i_x_offset + p_pic->format.i_visible_width;
+ sourceRECT.bottom = p_pic->format.i_y_offset + p_pic->format.i_visible_height;
+
+ ID3D11VideoContext_VideoProcessorSetStreamSourceRect(p_sys->d3dvidctx,
+ p_sys->videoProcessor,
+ 0, TRUE, &sourceRECT);
+ ID3D11VideoContext_VideoProcessorSetStreamDestRect(p_sys->d3dvidctx,
+ p_sys->videoProcessor,
+ 0, TRUE, &sourceRECT);
+
hr = ID3D11VideoContext_VideoProcessorBlt(p_sys->d3dvidctx, p_sys->videoProcessor,
p_sys->processorOutput,
0, 1, &stream);
@@ -421,6 +437,7 @@ static int Open(vlc_object_t *obj)
InitDeinterlacingContext( &sys->context );
+ msg_Dbg( filter, "using %s deinterlace method", p_mode->psz_mode );
sys->context.settings = p_mode->settings;
if (sys->context.settings.b_double_rate)
sys->context.pf_render_ordered = RenderPic;
--
2.12.1
More information about the vlc-devel
mailing list