summaryrefslogtreecommitdiffstats
path: root/libmpv/opengl_cb.h
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-09-24 21:07:16 +0200
committerwm4 <wm4@nowhere>2015-09-24 21:07:37 +0200
commitb14c9eb748d80cff3e362c2093a8fb26bce337cf (patch)
tree2ef8fd9173877597eba2146699e44c069c46d040 /libmpv/opengl_cb.h
parentcb1c0725345d4bf7e0226aceb934f06f40cc0ee1 (diff)
downloadmpv-b14c9eb748d80cff3e362c2093a8fb26bce337cf.tar.bz2
mpv-b14c9eb748d80cff3e362c2093a8fb26bce337cf.tar.xz
client API: rename GL_MP_D3D_interfaces
This is a pseudo-OpenGL extension for letting libmpv query native windowing system handles from the API user. (It uses the OpenGL extension mechanism because I'm lazy. In theory it would be nicer to let the user pass them with mpv_opengl_cb_init_gl(), but this would require a more intrusive API change to extend its argument list.) The naming of the extension and associated function was unnecessarily Windows specific (using "D3D"), even though it would work just fine for other platforms. So deprecate the old names and introduce new ones. The old ones still work.
Diffstat (limited to 'libmpv/opengl_cb.h')
-rw-r--r--libmpv/opengl_cb.h38
1 files changed, 28 insertions, 10 deletions
diff --git a/libmpv/opengl_cb.h b/libmpv/opengl_cb.h
index 2e031cd109..bd694b61d4 100644
--- a/libmpv/opengl_cb.h
+++ b/libmpv/opengl_cb.h
@@ -108,8 +108,26 @@ extern "C" {
* context must have been uninitialized. If this doesn't happen, undefined
* behavior will result.
*
- * Special D3D interop considerations
- * ----------------------------------
+ * Special windowing system interop considerations
+ * ------------------------------------------------
+ *
+ * In some cases, libmpv needs to have access to the windowing system's handles.
+ * This can be a pointer to a X11 "Display" for example. Usually this is needed
+ * only for hardware decoding.
+ *
+ * You can communicate these handles to libmpv by adding a pseudo-OpenGL
+ * extension "GL_MP_MPGetNativeDisplay" to the additional extension string when
+ * calling mpv_opengl_cb_init_gl(). The get_proc_address callback should resolve
+ * a function named "glMPGetNativeDisplay", which has the signature:
+ *
+ * void* GLAPIENTRY glMPGetNativeDisplay(const char* name)
+ *
+ * See below what names are defined. Usually, libmpv will use the native handle
+ * up until mpv_opengl_cb_uninit_gl() is called. If the name is not anything
+ * you know/expected, return NULL from the function.
+ *
+ * Windowing system interop on MS win32
+ * ------------------------------------
*
* 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
@@ -117,14 +135,14 @@ extern "C" {
* 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.
+ * You can provide glMPGetNativeDisplay as described in the previous section.
+ * If it is called with name set to "IDirect3DDevice9", it should return a
+ * IDirect3DDevice9 pointer (or NULL if not available). libmpv will release
+ * this interface when it is done with it.
+ *
+ * In previous libmpv releases, this used "GL_MP_D3D_interfaces" and
+ * "glMPGetD3DInterface". This is deprecated; use glMPGetNativeDisplay instead
+ * (the semantics are 100% compatible).
*/
/**