On 20 July 2016 at 06:37, Jan Schmidt jan@centricular.com wrote:
Invert images when copying to a Direct3D surface if they are provided bottom-up.
Is that observable behaviour? I.e., could you write a test that verifies where the data ends up in the surface? If it isn't, it may be better to just flip the image when presenting it.
On 20/07/16 18:47, Henri Verbeet wrote:
On 20 July 2016 at 06:37, Jan Schmidt jan@centricular.com wrote:
Invert images when copying to a Direct3D surface if they are provided bottom-up.
Is that observable behaviour? I.e., could you write a test that verifies where the data ends up in the surface?
I think one could construct a test. It'd be slightly elaborate - Configure a Quartz VMR9 renderer to use a custom D3D allocator / presenter, feeding a video buffer media sample to it, and then read the D3D surface contents and verify that the received D3D surface is the right way up.
I'm not entirely sure how to write that test yet though - I'm a GStreamer dev, and I've only ever looked at Wine code in the last 5 days.
If it isn't, it may be better to just flip the image when presenting it.
Do you mean when presenting inside D3D? I think achieving that would be tricky - you'd need to mark the surface as vertically inverted and handle that anywhere the contents might be accessed inside D3D, or when handing out pointers to the data via API like IDirect3DSurface9_LockRect. I'm guessing though - I don't really know much about D3D - I based this patch off https://msdn.microsoft.com/en-us/library/windows/desktop/aa473780(v=vs.85).a... which says "any image that is contained in a Direct3D surface must be top-down"
- Jan.
On 20 July 2016 at 11:48, Jan Schmidt jan@centricular.com wrote:
If it isn't, it may be better to just flip the image when presenting it.
Do you mean when presenting inside D3D?
I was thinking about VMR9_ImagePresenter_PresentTexture() and VMR9_ImagePresenter_PresentOffscreenSurface(), but reading up a bit about vmr9, those wouldn't be used in renderless mode. That also means this is likely the right way to handle this, although tests are still a good thing.
On 20/07/16 20:23, Henri Verbeet wrote:
On 20 July 2016 at 11:48, Jan Schmidt jan@centricular.com wrote:
If it isn't, it may be better to just flip the image when presenting it.
Do you mean when presenting inside D3D?
I was thinking about VMR9_ImagePresenter_PresentTexture() and VMR9_ImagePresenter_PresentOffscreenSurface(), but reading up a bit about vmr9, those wouldn't be used in renderless mode. That also means this is likely the right way to handle this, although tests are still a good thing.
Ah, right - yes.
J.