Microsoft Docs doesn't give the example, I try to obtained from ID3D12Device, But Failed: https://paste.ubuntu.com/p/7c5tKm9YZH/
Asked
Active
Viewed 231 times
1 Answers
4
You obtain the ID3D12VideoDevice
interface from your ID3D12Device
instance.
HRESULT hr = pD3D12Device->QueryInterface(IID_PPV_ARGS((void**)&pD3D12VideoDevice));
if (FAILED(hr))
{
// Driver or Windows doesn't support DirectX 12 Video.
}
or if you are using the Microsoft::WRL::ComPtr smart-pointer:
using Microsoft::WRL::ComPtr;
ComPtr<ID3D12Device> pDevice;
// Create the Direct3D 12 device using D3D12CreateDevice
ComPtr<ID3D12DeviceVideo> pVideoDevice;
HRESULT hr = pDevice->As(&pVideoDevice);
if (FAILED(hr))
{
// Driver or Windows doesn't support DirectX 12 Video.
}
For details on creating as ID3D12Device
, see this blog post.

Chuck Walbourn
- 38,259
- 2
- 58
- 81
-
However, following your answer, why ID3D12VideoDevice is NULL ?https://paste.ubuntu.com/p/7c5tKm9YZH/ – DGAF Aug 14 '22 at 02:26
-
What HRESULT did you get back from ``As``? – Chuck Walbourn Aug 15 '22 at 10:12
-
E_NOINTERFACE No such interface supported. @Chuck Walbourn – DGAF Aug 16 '22 at 00:58
-
1Then your driver doesn't support DirectX 12 video. – Chuck Walbourn Aug 16 '22 at 20:11