Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(333)

Issue 922003002: Support H.264 video decoding on Windows 8+ using DX11 (Closed)

Created:
5 years, 10 months ago by ananta
Modified:
5 years, 9 months ago
CC:
chromium-reviews, posciak+watch_chromium.org, jam, mcasas+watch_chromium.org, feature-media-reviews_chromium.org, darin-cc_chromium.org, piman+watch_chromium.org, wjia+watch_chromium.org, watk
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Add support for DX11 based H/W video decoding on Windows 8+ This is only available on Windows 8+ because the media foundation API which exposes the device manager to be pased to the decoder MFCreateDXGIDeviceManager only exists on Windows 8+. Changes in this patch are mostly around using DX11 or D3D wherever needed. These are as below:- 1. In the initialization code path where we use D3D or DX11 based on whether we are on Windows 8+ and ANGLE and the decoder say they support DX11. 2. The output frame processing code where we extract the DX11 texture and copy it out to ANGLE. One change here is that DX11 does not provide an automatic way for format conversion for textures. The decoder outputs YUV12 textures and ANGLE expects RGB. We can achieve this by setting a shader for conversion. That seemed like too much work. Thankfully there is a video processor media foundation transform on Windows which does the conversion for us on the GPU. We use this object to convert the output frame and copy it out to ANGLE. 3. We pass the GL context to the decoder to enable us to query ANGLE to see if it is using D3D or DX11. BUG=456418 Committed: https://crrev.com/3b01db9b22725d4e7d6422d8dadf48dce8ac4794 Cr-Commit-Position: refs/heads/master@{#318560}

Patch Set 1 #

Patch Set 2 : Support DX11 decoding #

Patch Set 3 : Fixed logs #

Patch Set 4 : Pass the GLContext to the decoder #

Patch Set 5 : Refactor and cleanup #

Patch Set 6 : Fixed comment #

Patch Set 7 : Rebased to tip #

Patch Set 8 : Fix build redness #

Patch Set 9 : Experimental support for Windows 7 DX11 #

Total comments: 11

Patch Set 10 : Address review comments #

Patch Set 11 : Fix build error #

Total comments: 12

Patch Set 12 : Address review comments #

Total comments: 2

Patch Set 13 : Move debug alias to under FAILED(hr) #

Patch Set 14 : Add alias calls to other places which have CHECKs #

Total comments: 2

Patch Set 15 : Use the ID3D11Query interface to poll the device context to see when the texture copy completes #

Patch Set 16 : Added a CHECK to catch GetData failures #

Unified diffs Side-by-side diffs Delta from patch set Stats (+717 lines, -135 lines) Patch
M content/common/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +2 lines, -0 lines 0 comments Download
M content/common/gpu/media/dxva_video_decode_accelerator.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 8 chunks +63 lines, -2 lines 0 comments Download
M content/common/gpu/media/dxva_video_decode_accelerator.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 31 chunks +645 lines, -131 lines 0 comments Download
M content/common/gpu/media/gpu_video_decode_accelerator.cc View 1 2 3 1 chunk +2 lines, -1 line 0 comments Download
M content/common/gpu/media/video_decode_accelerator_unittest.cc View 1 2 3 4 5 6 7 1 chunk +3 lines, -1 line 0 comments Download
M content/content_common.gypi View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +2 lines, -0 lines 0 comments Download

Messages

Total messages: 28 (6 generated)
ananta
5 years, 10 months ago (2015-02-25 02:57:47 UTC) #2
ananta
5 years, 10 months ago (2015-02-25 02:59:32 UTC) #4
DaleCurtis
Hmm, I'm surprised we can only use this on Windows 8+. What performs better after ...
5 years, 10 months ago (2015-02-25 03:05:52 UTC) #5
ananta
On 2015/02/25 03:05:52, DaleCurtis wrote: > Hmm, I'm surprised we can only use this on ...
5 years, 10 months ago (2015-02-25 03:19:52 UTC) #6
cpu_(ooo_6.6-7.5)
The issue was explained to me. ATI folks reached to the GPU folks saying that ...
5 years, 10 months ago (2015-02-25 23:03:36 UTC) #7
cpu_(ooo_6.6-7.5)
please change the patch description D3D --> DX9
5 years, 10 months ago (2015-02-25 23:04:57 UTC) #8
cpu_(ooo_6.6-7.5)
https://codereview.chromium.org/922003002/diff/160001/content/common/gpu/media/dxva_video_decode_accelerator.cc File content/common/gpu/media/dxva_video_decode_accelerator.cc (right): https://codereview.chromium.org/922003002/diff/160001/content/common/gpu/media/dxva_video_decode_accelerator.cc#newcode354 content/common/gpu/media/dxva_video_decode_accelerator.cc:354: // TODO(dshwang): after moving to D3D11, use RGBA surface. ...
5 years, 10 months ago (2015-02-25 23:44:30 UTC) #9
rvargas (doing something else)
random drive-by. https://codereview.chromium.org/922003002/diff/160001/content/common/gpu/media/dxva_video_decode_accelerator.h File content/common/gpu/media/dxva_video_decode_accelerator.h (right): https://codereview.chromium.org/922003002/diff/160001/content/common/gpu/media/dxva_video_decode_accelerator.h#newcode40 content/common/gpu/media/dxva_video_decode_accelerator.h:40: IMFDXGIDeviceManager** device_manager); On 2015/02/25 23:44:30, cpu wrote: ...
5 years, 10 months ago (2015-02-26 02:09:56 UTC) #11
ananta
Sadly the hack to get DX11 decoding to work on Windows 7 does not work. ...
5 years, 10 months ago (2015-02-26 02:18:34 UTC) #12
DaleCurtis
I defer to cpu, rvargas for a lot of the Windows specific bits, but overall ...
5 years, 10 months ago (2015-02-26 22:32:22 UTC) #13
ananta
https://codereview.chromium.org/922003002/diff/200001/content/common/BUILD.gn File content/common/BUILD.gn (right): https://codereview.chromium.org/922003002/diff/200001/content/common/BUILD.gn#newcode413 content/common/BUILD.gn:413: "d3d11.lib", On 2015/02/26 22:32:22, DaleCurtis wrote: > Needs the ...
5 years, 10 months ago (2015-02-26 23:32:57 UTC) #14
cpu_(ooo_6.6-7.5)
https://codereview.chromium.org/922003002/diff/160001/content/common/gpu/media/dxva_video_decode_accelerator.h File content/common/gpu/media/dxva_video_decode_accelerator.h (right): https://codereview.chromium.org/922003002/diff/160001/content/common/gpu/media/dxva_video_decode_accelerator.h#newcode40 content/common/gpu/media/dxva_video_decode_accelerator.h:40: IMFDXGIDeviceManager** device_manager); On 2015/02/26 02:18:34, ananta wrote: > On ...
5 years, 10 months ago (2015-02-26 23:42:09 UTC) #15
cpu_(ooo_6.6-7.5)
lgtm please have an owner on content\gpu , possibly john bauman give a quick review.
5 years, 10 months ago (2015-02-27 00:02:06 UTC) #16
DaleCurtis
https://codereview.chromium.org/922003002/diff/220001/content/common/gpu/media/dxva_video_decode_accelerator.cc File content/common/gpu/media/dxva_video_decode_accelerator.cc (right): https://codereview.chromium.org/922003002/diff/220001/content/common/gpu/media/dxva_video_decode_accelerator.cc#newcode703 content/common/gpu/media/dxva_video_decode_accelerator.cc:703: base::debug::Alias(&hr); Why not under FAILED()? Also will hr be ...
5 years, 10 months ago (2015-02-27 00:42:55 UTC) #17
ananta
https://codereview.chromium.org/922003002/diff/220001/content/common/gpu/media/dxva_video_decode_accelerator.cc File content/common/gpu/media/dxva_video_decode_accelerator.cc (right): https://codereview.chromium.org/922003002/diff/220001/content/common/gpu/media/dxva_video_decode_accelerator.cc#newcode703 content/common/gpu/media/dxva_video_decode_accelerator.cc:703: base::debug::Alias(&hr); On 2015/02/27 00:42:55, DaleCurtis wrote: > Why not ...
5 years, 10 months ago (2015-02-27 01:49:07 UTC) #18
DaleCurtis
lgtm
5 years, 10 months ago (2015-02-27 01:55:03 UTC) #19
jbauman
https://codereview.chromium.org/922003002/diff/260001/content/common/gpu/media/dxva_video_decode_accelerator.cc File content/common/gpu/media/dxva_video_decode_accelerator.cc (right): https://codereview.chromium.org/922003002/diff/260001/content/common/gpu/media/dxva_video_decode_accelerator.cc#newcode1817 content/common/gpu/media/dxva_video_decode_accelerator.cc:1817: input_buffer_id)); I think you need something like DXVAVideoDecodeAccelerator::FlushDecoder with ...
5 years, 10 months ago (2015-02-27 02:08:34 UTC) #21
ananta
https://codereview.chromium.org/922003002/diff/260001/content/common/gpu/media/dxva_video_decode_accelerator.cc File content/common/gpu/media/dxva_video_decode_accelerator.cc (right): https://codereview.chromium.org/922003002/diff/260001/content/common/gpu/media/dxva_video_decode_accelerator.cc#newcode1817 content/common/gpu/media/dxva_video_decode_accelerator.cc:1817: input_buffer_id)); On 2015/02/27 02:08:34, jbauman wrote: > I think ...
5 years, 9 months ago (2015-02-27 23:18:33 UTC) #22
jbauman
lgtm. Thanks for figuring all of this out.
5 years, 9 months ago (2015-02-27 23:23:18 UTC) #23
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/922003002/300001
5 years, 9 months ago (2015-02-27 23:47:46 UTC) #26
commit-bot: I haz the power
Committed patchset #16 (id:300001)
5 years, 9 months ago (2015-02-28 00:39:28 UTC) #27
commit-bot: I haz the power
5 years, 9 months ago (2015-02-28 00:40:14 UTC) #28
Message was sent while issue was closed.
Patchset 16 (id:??) landed as
https://crrev.com/3b01db9b22725d4e7d6422d8dadf48dce8ac4794
Cr-Commit-Position: refs/heads/master@{#318560}

Powered by Google App Engine
This is Rietveld 408576698