On Tue Apr 23 11:20:35 2024 +0000, Bernhard Kölbl wrote:
Yes, one can confirm this using dummy MFTs and looking at the processing quota. After the first call to OnVideoStreamTick, everything becomes really unreliable.
@nsivov That's a good point. Note that `IMFMediaEngineEx_OnVideoStreamTick` only returns `S_OK` though if `IMFMediaEngineEx_GetCurrentTime` is greater than the frames PTS. So the frame might be delivered to Media Engine, but it will still return `S_FALSE` until it's time to be presented.
So one way to guarantee this test will always pass is to check if `hr == S_FALSE || IMFMediaEngineEx_GetCurrentTime > PTS`; but then we might not be testing the right thing (i.e. I want to test hr == S_FALSE, but I might just be testing that our test is super slow). One way to mitigate this could be to use a video with a low FPS. As an extreme example, if I use 1 FPS, then it would need to take a whole second to complete `IMFMediaEngineEx_TransferVideoFrame` for hr != S_FALSE.