[compiz] compiz composited video and alpha only GLX pixmaps

David Reveman davidr at novell.com
Thu Mar 29 04:04:52 PDT 2007


On Thu, 2007-03-15 at 02:54 +0100, Dennis Kasprzyk wrote:
> Am Montag, 5. März 2007 12:12 schrieb David Reveman:
> > 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
> 
> I don't know if this is possible, but could xvideo be extended to support 
> software generated xvideo adapters? If this would be possible compiz could 
> add itself as video adapter and the video players would not need to be 
> changed.

That might be what we want to do eventually but the difference between
regular xvideo adapters and the composited video adapter might be too
great. Normal xvideo adapters draw video contents to a window or the
screen while the composited video interface adds a video output node to
the compositing managers scene-graph and never really modifies the
window so video players might need to be aware of this anyhow.

- David



More information about the compiz mailing list