On Tue Apr 2 20:53:17 2024 +0000, Brendan McGrath wrote:
I hit this when testing MS Flight Simulator. It it using the Media Engine in rendering mode (which in turn uses media session). But I can't say I've seen similar on Windows; though I haven't really looked. I'm not sure of a great way to test it tbh. If you do have any ideas, I'll give it a go.
What I suspect happens is that winegstreamer is using a single thread pool for its queue. You can check if replacing it with e.g. MFAllocateWorkQueueEx(MF_MULTITHREADED_WORKQUEUE) gives the same result. I see now that it's internal detail rather than something visible or testable, because one of the functions is to block at wait_on_sample().
So yes, maybe having a thread per stream is fine. On Windows the source is likely much lighter and returns samples quicker.