summaryrefslogtreecommitdiffstats
path: root/video/out/vo_opengl.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-03-28 21:44:27 +0100
committerwm4 <wm4@nowhere>2013-03-28 21:46:17 +0100
commit8099cbe9dd64f48050918242e088a1f998c77a15 (patch)
tree76abcee94beef81308e3d9f871161f3595006a21 /video/out/vo_opengl.c
parent69c4baad91b953afbd0ea9b76b57a7040812bb24 (diff)
downloadmpv-8099cbe9dd64f48050918242e088a1f998c77a15.tar.bz2
mpv-8099cbe9dd64f48050918242e088a1f998c77a15.tar.xz
vo_opengl: add alpha output
Allows playing video with alpha information on X11, as long as the video contains alpha and the window manager does compositing. See vo.rst. Whether a window can be transparent is decided by the choice of the X Visual used for window creation. Unfortunately, there's no direct way to request such a Visual through the GLX or the X API, and use of the XRender extension is required to find out whether a Visual implies a framebuffer with alpha used by XRender (see for example [1]). Instead of depending on the XRender wrapper library (which would require annoying configure checks, even though XRender is virtually always supported), use a simple heuristics to find out whether a Visual has alpha. Since getting it wrong just means an optional feature will not work as expected, we consider this ok. [1] http://stackoverflow.com/questions/4052940/how-to-make-an-opengl- rendering-context-with-transparent-background/9215724#9215724
Diffstat (limited to 'video/out/vo_opengl.c')
-rw-r--r--video/out/vo_opengl.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/video/out/vo_opengl.c b/video/out/vo_opengl.c
index 6c0901eae6..ba31e0cbf5 100644
--- a/video/out/vo_opengl.c
+++ b/video/out/vo_opengl.c
@@ -133,6 +133,9 @@ static bool config_window(struct gl_priv *p, uint32_t d_width,
if (p->renderer_opts->stereo_mode == GL_3D_QUADBUFFER)
flags |= VOFLAG_STEREO;
+ if (p->renderer_opts->enable_alpha)
+ flags |= VOFLAG_ALPHA;
+
if (p->use_gl_debug)
flags |= VOFLAG_GL_DEBUG;