Closed Bug 1722987 Opened 4 years ago Closed 3 years ago

Use Compositor D3D11 device for hardware decoding

Categories

(Core :: Audio/Video: Playback, enhancement)

enhancement

Tracking

()

RESOLVED WORKSFORME

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.

Matt, do you recall anything about this?

Flags: needinfo?(matt.woodrow)
Blocks: video-perf

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.

Flags: needinfo?(matt.woodrow)
Blocks: 1723207

chromium seems to use ANGLE device for video decoding when "sharing the decoded NV12 textures" is enabled as in Bug 1724949 comment 7.

Depends on: 1745976
No longer blocks: 1723207
Depends on: 1766684
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.