Add YUV SwapChain support to hardware decoded video
Categories
(Core :: Graphics: WebRender, enhancement)
Tracking
()
Tracking | Status | |
---|---|---|
firefox98 | --- | fixed |
People
(Reporter: sotaro, Assigned: sotaro)
References
(Blocks 2 open bugs)
Details
Attachments
(1 file)
YUV SwapChain might provide better performance than RGB SwapChain for hardware decoded video.
Assignee | ||
Updated•3 years ago
|
Updated•3 years ago
|
Comment 1•3 years ago
|
||
This sample app has good GPU performance on my Skylake desktop machine. (I adjusted the sample to do bilinear filtering)
This machine supports DXGI_FORMAT_YUY2 overlays but not DXGI_FORMAT_NV12 ones. The sample app seems to try use a DXGI_FORMAT_YUY2 SwapChain but then seems to switch to DXGI_FORMAT_B8G8R8A8_UNORM based on the results of IDXGISwapChainMedia::GetFrameStatisticsMedia
Assignee | ||
Comment 2•3 years ago
|
||
:jrmuizel, how do you get IDXGISwapChainMedia? I could not find an API to get it.
Comment 3•3 years ago
|
||
It looks like you can QueryInterface as IDXGIDecodeSwapChain: https://source.chromium.org/chromium/chromium/src/+/main:ui/gl/swap_chain_presenter.cc;l=1628?q=GetSwapChainMedia&ss=chromium
Assignee | ||
Comment 4•3 years ago
•
|
||
:jrmuizel, thank you for the info! I have one more question. How did you get a SwapChain to QueryInterface? The sample code dose not get the SwapChain directly. It get SurfaceHandle by calling mediaEngineEx->GetVideoSwapchainHandle(). Is there an API to get the SwapChain?
https://github.com/microsoft/media-foundation/blob/master/samples/MediaEngineDCompWin32Sample/src/media/MediaEngineWrapper.cpp#L281
Comment 5•3 years ago
|
||
It looks like Chrome does something similar:
https://source.chromium.org/chromium/chromium/src/+/main:ui/gl/swap_chain_presenter.cc;l=1149;drc=fab2b93d31954030689e2b3eafff4ca810914d58
they track the kind of Presentation here: https://source.chromium.org/chromium/chromium/src/+/main:ui/gl/swap_chain_presenter.cc;l=213;drc=fab2b93d31954030689e2b3eafff4ca810914d58
and do the switching here: https://source.chromium.org/chromium/chromium/src/+/main:ui/gl/swap_chain_presenter.cc;l=285;drc=fab2b93d31954030689e2b3eafff4ca810914d58
Assignee | ||
Comment 6•3 years ago
•
|
||
(In reply to Jeff Muizelaar [:jrmuizel] from comment #1)
This machine supports DXGI_FORMAT_YUY2 overlays but not DXGI_FORMAT_NV12 ones. The sample app seems to try use a DXGI_FORMAT_YUY2 SwapChain but then seems to switch to DXGI_FORMAT_B8G8R8A8_UNORM based on the results of
IDXGISwapChainMedia::GetFrameStatisticsMedia
Taking on riot with :jrmuizel. It was got from GPUView.
I misunderstood the comment as the SwapChain was got by modifying the sample app :(
Assignee | ||
Comment 7•3 years ago
|
||
When Video processor was used for video presentation, it seemed that "Direct3d11 ID3D11VideoContext_VideoProcessorBltParameters" could be used to check video color conversion.
Assignee | ||
Comment 8•3 years ago
|
||
With GPUView, I tested the sample app and chrome on 2 Win10 PC(NV12 support and YUY2 support).
- Win10 PC(NV12 support): VideoProcessorBltParameters was DXGI_FORMAT_NV12 to DXGI_FORMAT_NV12
- Win10 PC(YUY2 support ): VideoProcessorBltParameters was DXGI_FORMAT_NV12 to DXGI_FORMAT_YUY2
Assignee | ||
Updated•3 years ago
|
Assignee | ||
Comment 9•3 years ago
|
||
Comment 10•3 years ago
|
||
Comment 11•3 years ago
|
||
bugherder |
Description
•