Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mpc-hc/LAVFilters.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHendrik Leppkes <h.leppkes@gmail.com>2017-08-12 21:30:34 +0300
committerHendrik Leppkes <h.leppkes@gmail.com>2017-08-12 21:30:34 +0300
commite81d5cf81eb41db7abf9505115a0e0211217d2e2 (patch)
tree08b0b270403bb4ccef5afc1366d476534c0105a7
parentc35d40830a253a594fa739fb729db753cc88b41e (diff)
d3d11: implement the Check method to verify if D3D11 is available
-rw-r--r--decoder/LAVVideo/decoders/d3d11va.cpp10
-rw-r--r--decoder/LAVVideo/decoders/d3d11va.h1
2 files changed, 10 insertions, 1 deletions
diff --git a/decoder/LAVVideo/decoders/d3d11va.cpp b/decoder/LAVVideo/decoders/d3d11va.cpp
index 31565d20..0946c2fd 100644
--- a/decoder/LAVVideo/decoders/d3d11va.cpp
+++ b/decoder/LAVVideo/decoders/d3d11va.cpp
@@ -90,6 +90,7 @@ STDMETHODIMP CDecD3D11::DestroyDecoder(bool bFull, bool bNoAVCodec)
return S_OK;
}
+// ILAVDecoder
STDMETHODIMP CDecD3D11::Init()
{
dx.d3d11lib = LoadLibrary(L"d3d11.dll");
@@ -123,7 +124,14 @@ STDMETHODIMP CDecD3D11::Init()
return S_OK;
}
-// ILAVDecoder
+STDMETHODIMP CDecD3D11::Check()
+{
+ // attempt creating a hardware device with video support
+ // by passing nullptr to the device parameter, no actual device will be created and only support will be checked
+ HRESULT hr = dx.mD3D11CreateDevice(nullptr, D3D_DRIVER_TYPE_HARDWARE, nullptr, D3D11_CREATE_DEVICE_VIDEO_SUPPORT, nullptr, 0, D3D11_SDK_VERSION, nullptr, nullptr, nullptr);
+ return hr;
+}
+
STDMETHODIMP CDecD3D11::InitAllocator(IMemAllocator **ppAlloc)
{
HRESULT hr = S_OK;
diff --git a/decoder/LAVVideo/decoders/d3d11va.h b/decoder/LAVVideo/decoders/d3d11va.h
index 965de0ec..b20570fb 100644
--- a/decoder/LAVVideo/decoders/d3d11va.h
+++ b/decoder/LAVVideo/decoders/d3d11va.h
@@ -43,6 +43,7 @@ public:
virtual ~CDecD3D11(void);
// ILAVDecoder
+ STDMETHODIMP Check();
STDMETHODIMP InitDecoder(AVCodecID codec, const CMediaType *pmt);
STDMETHODIMP GetPixelFormat(LAVPixelFormat *pPix, int *pBpp);
STDMETHODIMP Flush();