summaryrefslogtreecommitdiffstats
path: root/video/out/opengl/hwdec_d3d11eglrgb.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2016-06-09 11:17:06 +0200
committerwm4 <wm4@nowhere>2016-06-09 11:18:36 +0200
commit262ceca731487e009c3f5d90bd1fe1d9914f6ee2 (patch)
treed5a2e31d1b191477be76591fffab5e47af09e44e /video/out/opengl/hwdec_d3d11eglrgb.c
parent6fd7f5a111662ae023c44d8c96817efaac86ad85 (diff)
downloadmpv-262ceca731487e009c3f5d90bd1fe1d9914f6ee2.tar.bz2
mpv-262ceca731487e009c3f5d90bd1fe1d9914f6ee2.tar.xz
vo_opengl: fix d3d11 hardware decoding probing on Windows 7
Although D3D11 video decoding is unuspported on Windows 7, the associated APIs almost work. Where they fail is texture creation, where we try to create D3D11_BIND_DECODER surfaces. So specifically try to detect this situation. One issue is that once the hwdec interop is created, the damage is done, and it can't use another backend (because currently only 1 hwdec backend is supported). So that's where we prevent attempts to use it. It still can fail when trying to use d3d11va-copy (since that doesn't require an interop backend), but at that point we don't care anymore - dxva2(-copy) is tried before that anyway.
Diffstat (limited to 'video/out/opengl/hwdec_d3d11eglrgb.c')
-rw-r--r--video/out/opengl/hwdec_d3d11eglrgb.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/video/out/opengl/hwdec_d3d11eglrgb.c b/video/out/opengl/hwdec_d3d11eglrgb.c
index adb60ef4d2..9e83ac4b36 100644
--- a/video/out/opengl/hwdec_d3d11eglrgb.c
+++ b/video/out/opengl/hwdec_d3d11eglrgb.c
@@ -23,6 +23,7 @@
#include <EGL/egl.h>
#include <EGL/eglext.h>
+#include "angle_common.h"
#include "angle_dynamic.h"
#include "common/common.h"
@@ -154,6 +155,11 @@ static int create(struct gl_hwdec *hw)
ID3D10Multithread_SetMultithreadProtected(multithread, TRUE);
ID3D10Multithread_Release(multithread);
+ if (!d3d11_check_decoding(p->d3d11_device)) {
+ MP_VERBOSE(hw, "D3D11 video decoding not supported on this system.\n");
+ goto fail;
+ }
+
hr = ID3D11Device_QueryInterface(p->d3d11_device, &IID_ID3D11VideoDevice,
(void **)&p->video_dev);
if (FAILED(hr))