summaryrefslogtreecommitdiffstats
path: root/video/decode/d3d.h
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2016-05-17 11:57:28 +0200
committerwm4 <wm4@nowhere>2016-05-17 11:59:54 +0200
commita02d77ba0df747b60ffad7d2a5eacfc6528aabef (patch)
tree6e2187738fba74cb68c082cfe23663ac8d120c96 /video/decode/d3d.h
parent39b64fb176bf90d7146cf7f20c61ab3e7def4191 (diff)
downloadmpv-a02d77ba0df747b60ffad7d2a5eacfc6528aabef.tar.bz2
mpv-a02d77ba0df747b60ffad7d2a5eacfc6528aabef.tar.xz
d3d: simplify DLL loading
For some reason, the d3d9/dxva2/d3d11 DLLs are still optional. But we don't need to try so hard to keep exact references. In fact, there's no reason to unload them at all. So load them once in a central place. For simplicity, the d3d9/d3d11 backends both load all DLLs. (They will error out only if the required DLLs could not be loaded.) In theory, we could just call LoadLibrary multiple times (without calling FreeLibrary), but I'm slightly worried that this could be detected as a "bug", or that the reference count could even have a low static limit that could be hit soon.
Diffstat (limited to 'video/decode/d3d.h')
-rw-r--r--video/decode/d3d.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/video/decode/d3d.h b/video/decode/d3d.h
index 3f5b8aebe7..15c423ab8c 100644
--- a/video/decode/d3d.h
+++ b/video/decode/d3d.h
@@ -36,6 +36,12 @@ struct d3d_decoder_fmt {
const struct d3d_decoded_format *format;
};
+// Must call d3d_load_dlls() before accessing. Once this is done, the DLLs
+// remain loaded forever.
+extern HMODULE d3d11_dll, d3d9_dll, dxva2_dll;
+
+void d3d_load_dlls(void);
+
int d3d_probe_codec(const char *codec);
struct d3d_decoder_fmt d3d_select_decoder_mode(