Use Compositor D3D11 device for hardware decoding
Categories
(Core :: Audio/Video: Playback, enhancement)
Tracking
()
People
(Reporter: jrmuizel, Unassigned)
References
(Blocks 1 open bug)
Details
This should let us avoid the copy that's happening here:
https://searchfox.org/mozilla-central/rev/9c91451cc2392d942a42493fc895f5aeeddde45d/dom/media/platforms/wmf/DXVA2Manager.cpp#911 along with the associated syncing.
Chrome does not share the device:
https://source.chromium.org/chromium/chromium/src/+/main:media/gpu/windows/d3d11_video_decoder.cc;l=356;drc=f89bfe45cdd483babc50358b1a4c482b1f895a87
I believe that historically there may have been thread safety issues that caused us to not do this. We may have to fix them or try to share the same thread.
| Reporter | ||
Comment 1•4 years ago
|
||
Matt, do you recall anything about this?
| Reporter | ||
Updated•4 years ago
|
Comment 2•4 years ago
|
||
Yeah indeed, we've had issues with threading in the past (which different between driver vendors, see DeviceManagerDx::CreateDecoderDevice()). That's not a reason not to try, but could be somewhat risky.
There's also an issue that the decoder allocates 3 surfaces internally, and will just block during the decode call if we haven't released at least one of them.
Given that all the lifetime management of decoded frames happens in the content process, it seems that it could be quite easy for us to frequently end up blocking the decoder. If the decoder is running on the same thread as would release the surface, then we deadlock and get extra sad.
| Reporter | ||
Comment 3•4 years ago
|
||
Looks like we already support using the same device on AMD hardware: https://searchfox.org/mozilla-central/rev/525ff01397317b4b24b1a2cc51fe4511ec49ac8b/gfx/thebes/DeviceManagerDx.cpp#888
Comment 4•4 years ago
|
||
chromium seems to use ANGLE device for video decoding when "sharing the decoded NV12 textures" is enabled as in Bug 1724949 comment 7.
Updated•3 years ago
|
Description
•