Closed Bug 1722447 Opened 3 years ago Closed 3 years ago

Add YUV SwapChain support to hardware decoded video

Categories

(Core :: Graphics: WebRender, enhancement)

Unspecified
Windows
enhancement

Tracking

()

RESOLVED FIXED
98 Branch
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: nobody → sotaro.ikeda.g

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

:jrmuizel, how do you get IDXGISwapChainMedia? I could not find an API to get it.

Flags: needinfo?(jmuizelaar)
Flags: needinfo?(jmuizelaar)

: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

Flags: needinfo?(jmuizelaar)

(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 :(

When Video processor was used for video presentation, it seemed that "Direct3d11 ID3D11VideoContext_VideoProcessorBltParameters" could be used to check video color conversion.

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
Blocks: 1663585
OS: Unspecified → Windows
Blocks: 1751144
Pushed by sikeda.birchill@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/a97943782c68 Add YUV SwapChain support to hardware decoded video r=gfx-reviewers,nical
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 98 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: