summaryrefslogtreecommitdiffstats
path: root/libmpv/render_gl.h
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2018-03-22 17:05:01 +0100
committerwm4 <wm4@nowhere>2018-03-26 19:47:08 +0200
commit52dd38a48a4a94d1c477b62cebcd67b911eb27fa (patch)
treeff2449de78ae1a30af5fbb7c6e399172403549b4 /libmpv/render_gl.h
parent0b4120919aa1e4e70b49dd3f93af0acddd7ea4d3 (diff)
downloadmpv-52dd38a48a4a94d1c477b62cebcd67b911eb27fa.tar.bz2
mpv-52dd38a48a4a94d1c477b62cebcd67b911eb27fa.tar.xz
client API: add a new way to pass X11 Display etc. to render API
Hardware decoding things often need access to additional handles from the windowing system, such as the X11 or Wayland display when using vaapi. The opengl-cb had nothing dedicated for this, and used the weird GL_MP_MPGetNativeDisplay GL extension (which was mpv specific and not officially registered with OpenGL). This was awkward, and a pain due to having to emulate GL context behavior (like needing a TLS variable to store context for the pseudo GL extension function). In addition (and not inherently due to this), we could pass only one resource from mpv builtin context backends to hwdecs. It was also all GL specific. Replace this with a newer mechanism. It works for all RA backends, not just GL. the API user can explicitly pass the objects at init time via mpv_render_context_create(). Multiple resources are naturally possible. The API uses MPV_RENDER_PARAM_* defines, but internally we use strings. This is done for 2 reasons: 1. trying to leave libmpv and internal mechanisms decoupled, 2. not having to add public API for some of the internal resource types (especially D3D/GL interop stuff). To remain sane, drop support for obscure half-working opengl-cb things, like the DRM interop (was missing necessary things), the RPI window thing (nobody used it), and obscure D3D interop things (not needed with ANGLE, others were undocumented). In order not to break ABI and the C API, we don't remove the associated structs from opengl_cb.h. The parts which are still needed (in particular DRM interop) needs to be ported to the render API.
Diffstat (limited to 'libmpv/render_gl.h')
-rw-r--r--libmpv/render_gl.h9
1 files changed, 4 insertions, 5 deletions
diff --git a/libmpv/render_gl.h b/libmpv/render_gl.h
index 01c09e80df..a4872a066b 100644
--- a/libmpv/render_gl.h
+++ b/libmpv/render_gl.h
@@ -88,8 +88,9 @@ extern "C" {
* There may be certain requirements on the OpenGL implementation:
*
* - Windows: ANGLE is required (although in theory GL/DX interop could be used)
- * - Intel/Linux: EGL is required, and also a glMPGetNativeDisplay() callback
- * must be provided (see sections below)
+ * - Intel/Linux: EGL is required, and also the native display resource needs
+ * to be provided (e.g. MPV_RENDER_PARAM_X11_DISPLAY for X11 and
+ * MPV_RENDER_PARAM_WL_DISPLAY for Wayland)
* - nVidia/Linux: Both GLX and EGL should work (GLX is required if vdpau is
* used, e.g. due to old drivers.)
* - OSX: CGL is required (CGLGetCurrentContext() returning non-NULL)
@@ -118,9 +119,7 @@ typedef struct mpv_opengl_init_params {
*/
void *get_proc_address_ctx;
/**
- * This should not be used. The main purpose is signaling support for
- * "GL_MP_MPGetNativeDisplay", which is needed for compatibility with the
- * opengl_cb API only. Thus it's deprecated and will be removed or ignored
+ * This should not be used. It is deprecated and will be removed or ignored
* when the opengl_cb API is removed.
*/
const char *extra_exts;