ValveSoftware / wine

Wine with a bit of extra spice
Other
1.3k stars 244 forks source link

mfmediaengine: Remove Y-flip in TransferVideoFrame #157

Closed Fraxul closed 2 years ago

Fraxul commented 2 years ago

This fixes inverted videos on some players in VRChat (https://github.com/ValveSoftware/Proton/issues/1199). Players using IMFMediaEngine::TransferVideoFrame to populate a DXGI surface were showing inverted video, while players that use IMF2DBuffer::ContiguousCopyFrom to copy video data were showing correctly-oriented video.

As stated in the commit message, I'm pretty sure this issue was introduced in https://github.com/ValveSoftware/wine/commit/d552e54dc4bc8cea60058aba95ca27d27ba2d796 when the video frames supplied to MediaFoundation by winegstreamer stopped being Y-flipped. The video was un-inverted in that commit, so we need to stop inverting it again in the pixel shader here to match.

kisak-valve commented 2 years ago

Hello @Fraxul, can you send this upstream as well with a note to pair it with d552e54dc4bc8cea60058aba95ca27d27ba2d796? (https://gitlab.winehq.org/wine/wine/-/blob/master/dlls/mfmediaengine/main.c#L287)

Fraxul commented 2 years ago

Sure, I can probably manage that. I should wait until after it's accepted here to do that, right?

GloriousEggroll commented 2 years ago

this fixes upside down videos for some games but not all. e.g. endless space 2 gets fixed but secret of mana doesnt

rbernon commented 2 years ago

Oh well I completely missed this, and worked on the same fix. It should be fixed now, including in upstream Wine.

rbernon commented 2 years ago

I'm closing this as a similar fix is now included. Thanks for working on this and sorry for having missed it.

Fraxul commented 2 years ago

No worries, just glad to hear it's fixed!