3 ms·
> The best way for video is to use the hardware decoder and hardware compositor. Not according to Microsoft, see that page https://learn.microsoft.com/en-us/wi
by Const-me 3y ago
> The best way for video is to use the hardware decoder and hardware compositor.
Not according to Microsoft, see that page https://learn.microsoft.com/en-us/windows/win32/medfound/how-to-write-an-evr-presenter https://learn.microsoft.com/en-us/windows/win32/medfound/how...
Microsoft strongly recommends that new code use MediaPlayer or the lower level IMFMediaEngine APIs to play video media in Windows instead of the EVR, when possible. Microsoft suggests that existing code that uses the legacy APIs be rewritten to use the new APIs if possible.
That lower level IMFMediaEngine API they recommend for Win10+ delivers uncompressed video frames in D3D11 textures.
- charcircuit 3y ago>That lower level IMFMediaEngine API they recommend for Win10+ delivers uncompressed video frames in D3D11 textures. Which in the best case is done via hardware decoding as I said.
- Const-me 3y agoYes, but note no hardware composition is involved. The composition is done by the 3D GPU like I said. Either in your app if you render that video yourself, or if you supply a swap chain’s back buffer to IMFMediaEngine.TransferVideoFrame method, dwm.exe will do it.
- charcircuit 3y agoIt's the compositor's job to composite in the most efficient way possible which in the best case would be using hardware compositing layers, if the hardware does not have enough layers than the compositor will use 3D graphics to combine layers together. Just because a GPU includes a 3D graphics pipeline that doesn't mean that everything has to go through it.
- Const-me 3y ago> Just because a GPU includes a 3D graphics pipeline that doesn't mean that everything has to go through it. That’s how modern Windows does that in practice. Everything does go through the 3D graphics pipeline, and starting from Win8 it’s impossible to disable. I’m not even sure modern PC hardware supports these hardware layers, except for one small extra layer for hardware mouse cursor. On my computer D3DCAPS_OVERLAY and DDCAPS_OVERLAY flags are unset. The driver reports to the OS the hardware doesn’t support any hardware overlay surfaces.
- charcircuit 3y ago>I'm not even sure modern PC hardware supports these hardware layers Yes, they do. I'm guessing you may be using an older nvidia gpu. In the case no overlay is available the video can become fullscreen and to take the only layer from dwm. For pcs the benefit is less about performance / power and more about lower latency.
- Const-me 3y ago> Yes, they do. Why are you so certain? > you may be using an older nvidia gpu. Tested AMD Vega 7 inside Ryzen 5 5600U, and nVidia 1080Ti — dxcapsviewer.exe shows the same result, no overlays are supported. Only the D3DCURSORCAPS_COLOR hardware cursor is there. > the video can become fullscreen and to take the only layer from dwm Indeed, exclusive D3D full-screen mode allows to bypass dwm.exe compositor, even on modern Windows. But I don’t think it’s evidence of any hardware composition being used.
- charcircuit 3y ago>Why are you so certain? Look at documentation from GPU manufacturers, look at GPUs that support multiplane overlay on windows. >But I don’t think it’s evidence of any hardware composition being used. It's not, but it doesn't require using 3D graphics to put the texture on the display.
- Const-me 3y ago