summaryrefslogtreecommitdiffstats
path: root/video/out/opengl/hwdec_dxva2egl.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2016-06-28 20:04:16 +0200
committerwm4 <wm4@nowhere>2016-06-28 20:07:56 +0200
commit17c5738cb43382831407400312f0f0d4989d115c (patch)
treeb82531fa0f5925b01353d34d23ba78a420fc4f34 /video/out/opengl/hwdec_dxva2egl.c
parentd5615102d5bce7c506279a2578a34da25f91301f (diff)
downloadmpv-17c5738cb43382831407400312f0f0d4989d115c.tar.bz2
mpv-17c5738cb43382831407400312f0f0d4989d115c.tar.xz
d3d: merge angle_common.h into d3d.h
OK, this was dumb. The file didn't have much to do with ANGLE, and the functionality can simply be moved to d3d.c. That file contains helpers for decoding, but can always be present (on Windows) since it doesn't access any D3D specific libavcodec APIs. Thus it doesn't need to be conditionally built like the actual hwaccel wrappers.
Diffstat (limited to 'video/out/opengl/hwdec_dxva2egl.c')
-rw-r--r--video/out/opengl/hwdec_dxva2egl.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/video/out/opengl/hwdec_dxva2egl.c b/video/out/opengl/hwdec_dxva2egl.c
index d67a85bff5..f206b962d1 100644
--- a/video/out/opengl/hwdec_dxva2egl.c
+++ b/video/out/opengl/hwdec_dxva2egl.c
@@ -29,11 +29,11 @@
#include "osdep/windows_utils.h"
#include "hwdec.h"
#include "video/hwdec.h"
+#include "video/decode/d3d.h"
struct priv {
struct mp_hwdec_ctx hwctx;
- HMODULE d3d9_dll;
IDirect3D9Ex *d3d9ex;
IDirect3DDevice9Ex *device9ex;
IDirect3DQuery9 *query9;
@@ -89,9 +89,6 @@ static void destroy(struct gl_hwdec *hw)
if (p->d3d9ex)
IDirect3D9Ex_Release(p->d3d9ex);
-
- if (p->d3d9_dll)
- FreeLibrary(p->d3d9_dll);
}
static int create(struct gl_hwdec *hw)
@@ -99,6 +96,8 @@ static int create(struct gl_hwdec *hw)
if (!angle_load())
return -1;
+ d3d_load_dlls();
+
EGLDisplay egl_display = eglGetCurrentDisplay();
if (!egl_display)
return -1;
@@ -118,15 +117,14 @@ static int create(struct gl_hwdec *hw)
p->egl_display = egl_display;
- p->d3d9_dll = LoadLibraryW(L"d3d9.dll");
- if (!p->d3d9_dll) {
+ if (!d3d9_dll) {
MP_FATAL(hw, "Failed to load \"d3d9.dll\": %s\n",
mp_LastError_to_str());
goto fail;
}
HRESULT (WINAPI *Direct3DCreate9Ex)(UINT SDKVersion, IDirect3D9Ex **ppD3D);
- Direct3DCreate9Ex = (void *)GetProcAddress(p->d3d9_dll, "Direct3DCreate9Ex");
+ Direct3DCreate9Ex = (void *)GetProcAddress(d3d9_dll, "Direct3DCreate9Ex");
if (!Direct3DCreate9Ex) {
MP_FATAL(hw, "Direct3D 9Ex not supported\n");
goto fail;