Comment 4 for bug 162664

Revision history for this message
Bogdan Butnaru (bogdanb) wrote :

Yes and no.

On the one hand, the video drivers (intel, nvidia, ati) all behave the same way in the situation described above. They actually do what the software tells them to do, so they're not technically buggy. And technically so does Compiz:

The Xvideo method by definition works using an overlay color, with the video superimposed in hardware just before being sent to the screen. That's AFAIK beyond Compiz' ability to affect behavior, and other than disabling all effects on windows that are using it it's impossible to avoid the nasty artifacts.

The X11 method should (and does) work, since the video frames are rendered in a normal X window that Compiz can correctly transform. However, none of the applications I've tried (MPlayer, VLC, Totem and Xine) have nice scaling when that's used. I think this is because it's a relatively slow display method, and applications didn't bother to use a smart software scaler for that case. (There might be some technical limitations I'm not aware of, though.) I think this could be solved by including a good scaler in _each_ applications output plugin, but see below.

The OpenGL method should work, but I have yet to see an OpenGL app working correctly in a window under Compiz (on my machine, I've seen it in demos though). This is probably the only case where Compiz is broken, but I don't think there's a quick fix for that. Also, I think it'd be slightly inefficient even if it worked.

In conclusion, as far as I can tell, Xvideo can't work under Compiz by definition, simple X11 output would work but would be slow and needs all applications to fix their output plugins, and OpenGL is hard to fix.

On the other hand, Compiz does have a video output plugin which is very nice: it's really efficient speed- and memory-wise, does nice scaling and (on some cards) YUV-conversion in hardware, and also has some nice quality implications that are technically impossible for the other modes. According to the first link I posted, this is supposedly relatively easy to implement by modifying an existing plugin. So, seeing that all applications need to update their video output plugins to work correctly in Compiz (see above), they might as well modify them to use Compiz. (The patch for MPlayer that was linked above even features instant switching between Compiz and Xvideo while running.)

I know this should be reported upstream, too (and I think it is, actually), but it can't hurt to track it here, too. Also, there might be an Ubuntu developer or two who want to work on this, at least for Totem.