compiz composited video and alpha only GLX pixmaps

David Reveman davidr at
Mon Mar 5 03:12:04 PST 2007

I've added a simple plugin to compiz that provides a way to render video
efficiently on a composited desktop.

A video playback client basically copies video data to a pixmap and sets
an X property on a client window that describes the image format of the
data and where it should be rendered.

The compiz video plugin will scale and perform necessary colorspace
conversions when compositing the desktop.

It provides very efficient playback of video on a composited desktop and
it requires much less resources than e.g. XVideo as no intermediate
buffer is required and hence also no accelerated offscreen rendering.

RGB and YV12 image formats are currently supported but it's of course
very easy to add support for additional formats.

YV12 format requires GL_ARB_fragment_program and 8 bpp alpha only GLX
pixmap support. The server doesn't provide alpha only pixmaps today. The
attached patch adds an alternative PICT_a8 visual to composite and that
is enough for xgl to support alpha only GLX pixmaps (not sure it will
work with aiglx or nvidia's driver, I would guess not).

Adding an alpha only X visual might be a bad idea. It doesn't cause any
issues with the clients I've been running but I've seen that GDK thinks
the server is broken and spits out some warnings when it finds a visual
with masks set to 0. Might be a better idea to just add the fbconfig and
no visual but the current GLX code in the server relies on every
fbconfig having a matching X visual so it will need a bit more work and
I'd like some feedback before I start doing anything like that.

I've created a patch to mplayer's xv output code that makes it use
compiz video interface when available. Works pretty well and it even
dynamically detects when the compiz video interface isn't available
anymore and then switches to xv instead. Similar patches can easily be
created for other video playback clients, of course.

- David
-------------- next part --------------
A non-text attachment was scrubbed...
Name: xserver-composite-pict-a8-alt-visual.diff
Type: text/x-patch
Size: 799 bytes
Desc: not available
URL: <>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mplayer-xv-compiz-video-1.patch
Type: text/x-patch
Size: 15144 bytes
Desc: not available
URL: <>

More information about the xorg mailing list