[vlc-devel] [PATCH] respect the x,y offset in Direct2D

Jean-Baptiste Kempf jb at videolan.org
Mon Mar 9 00:02:48 CET 2015


On 05 Mar, Steve Lhomme wrote :
> Looking further into video_output modules (on Windows) it seems none of them
> are actually ready to do some proper cropping.

No, some of them do. Imagine what would happen if the "c" function would not
work with a video...

> - Direct2D uses ID2D1Bitmap_CopyFromMemory() for blitting which doesn't take
> in account the horizontal stride corresponding to the visible part of the
> image. Thus copying data where it shouldn't, resulting in green bars.
> 
> Direct2D supports cropping in Win7+.
> https://msdn.microsoft.com/en-us/library/windows/desktop/hh706324%28v=vs.85%29.aspx

I think Direct2D is broken, indeed. It mistakes cropping and aspect
ratio.

> - Windows GDI uses BitBlt() and StretchBlt() which has no notion of
> stride/pitch. So no way to crop in there.

Crop works fine on GDI. Just tested on Windows 8.1.


> So it seems in general the code is not meant/ready to handle crop values on
> the planes coming from the decoders.

No, it crops afterwards, by cutting the texture, as it should.

Quick test on Windows shows me that D3D9, GDI, OpenGL, work fine :)
Direct2D is broken.

With my kindest regards,

-- 
Jean-Baptiste Kempf
http://www.jbkempf.com/ - +33 672 704 734
Sent from my Electronic Device



More information about the vlc-devel mailing list