https://bugs.winehq.org/show_bug.cgi?id=55891
Bug ID: 55891 Summary: mfmediaengine - Frame server mode is implemented incorrectly Product: Wine Version: 8.20 Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: mfplat Assignee: wine-bugs@winehq.org Reporter: besentv@gmail.com Distribution: ---
Today, Wine's implementation of media engine plays back the video stream at full speed in frame server mode potentially skipping frames. Windows does in fact play back the video stream at full speed as well, however it uses a custom sink that only requests more frames from the pipeline, when OnVideoStreamTick() was called.
The used sink is a private interface which can be created using the activate interface with UUID 4d4dedaa-43c5-480d-9ee0-1464f9f4ff4b (CLSID_SVRActivate) .
Additionally Windows prerolls 2 frames by scrubbing at postition 0 (0 rate playback) before actual playback in media engine is started by a call to OnVideoStreamTick(). Even though it seems illogical, the Play() function just generally allows OnVideoStreamTick() to start playback.
To properly implement this we seem to be (partially) blocked by the following issues:
- No implementation of this custom Sink in Wine. - Scrubbing at 0 rate seems to be broken at the moment. - Need to manually copy frame data from CPU to GPU instead of just passing Samples from the sink to the user program. To fix this, we need to detach decoding from the media source and move it into the pipeline with decoder MFTs. This also needs a minor rewrite of the topo resolving logic.
I wrote an extension to the effect test, which better shows the general issue, which is available here: https://gitlab.winehq.org/wine/wine/-/merge_requests/4379