summaryrefslogtreecommitdiffstats
path: root/libmpv
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-07-03 16:37:01 +0200
committerwm4 <wm4@nowhere>2015-07-03 16:38:12 +0200
commit561416597e33e2c314f0d69433e955c059ee24eb (patch)
treedcb24d4a797f6c737475cab79c44b347cb4a5b12 /libmpv
parentb85321d0573ba581694d2e6be1effafee74c11d1 (diff)
downloadmpv-561416597e33e2c314f0d69433e955c059ee24eb.tar.bz2
mpv-561416597e33e2c314f0d69433e955c059ee24eb.tar.xz
client API, dxva2: add a workaround for OpenGL fullscreen issues
This is basically a hack for drivers which prevent the mpv DXVA2 decoder glue from working if OpenGL is in fullscreen mode. Since it doesn't add any "hard" new API to the client API, some of the code would be required for a true zero-copy hw decoding pipeline, and sine it isn't too much code after all, this is probably acceptable.
Diffstat (limited to 'libmpv')
-rw-r--r--libmpv/opengl_cb.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/libmpv/opengl_cb.h b/libmpv/opengl_cb.h
index fd1409a253..1902268201 100644
--- a/libmpv/opengl_cb.h
+++ b/libmpv/opengl_cb.h
@@ -107,6 +107,24 @@ extern "C" {
* When the mpv core is destroyed (e.g. via mpv_terminate_destroy()), the OpenGL
* context must have been uninitialized. If this doesn't happen, undefined
* behavior will result.
+ *
+ * Special D3D interop considerations
+ * ----------------------------------
+ *
+ * If OpenGL switches to fullscreen, most players give it access GPU access,
+ * which means DXVA2 hardware decoding in mpv won't work. This can be worked
+ * around by giving mpv access to Direct3D device, which it will then use to
+ * create a decoder. The device can be either the real device used for display,
+ * or a "blank" device created before switching to fullscreen.
+ *
+ * You can do this by adding "GL_MP_D3D_interfaces" to the additional extension
+ * string when calling mpv_opengl_cb_init_gl(). The get_proc_address callback
+ * should resolve a function named "glMPGetD3DInterface", which has the
+ * signature: "void* __stdcall glMPGetD3DInterface(const char* name)". If
+ * name is "IDirect3DDevice9", it should return a IDirect3DDevice9 pointer
+ * (or NULL if not available). libmpv will release this interface when it is
+ * done with it (usually when mpv_opengl_cb_uninit_gl() is called). New
+ * interface names can be added in the future.
*/
/**