Clutter-gst, now with 100% more shaders

Just committed shader support to clutter-gst. When your card supports it and gstreamer decides it's the format to use (often it picks rgb over yuv, I've no idea why this is), YUV decoding will now be handled by a pixel shader instead of the CPU. This should give a reasonable boost when it gets used (in terms of CPU use).

Even more interesting in my eyes, is the YV12 shader I've also committed. Normally YV12 hardware-assisted decoding would be done with 8-bit textures and multi-texturing. This is also the sensible way to do it, mind, and I do realise that... But also committed, is a YV12 shader that will decode YV12 uploaded into a 24-bit rgb texture. I've not seen a shader that does this before, probably because it's an insane thing to do, but if you build clutter-gst with USE_YV12_SHADER defined, YV12 decoding will be handled by the graphics card, using a single rgb texture. Note that this shader is completely untuned, however, and very experimental.

The win here is that not only are you offloading a lot of work from the CPU (most videos tend to be stored in YV12 format), but you're also halving the texture upload (YV12 has quarter-resolution chroma). I imagine I'll get back to this after guadec and implement it in the correct way. Patches welcome of course.

Richard Stellingwerff says:

I've always noticed that gstreamer (well, totem anyway) was struggling to play 720p vids on my box, while VLC and MPlayer have no problem with it at all. Does this shader make it perform as well as VLC and MPlayer? That would be good news.

I have an NVidia 8600GT using propietary drivers.

Chris Lord says:

@Richard: I couldn't comment on VLC, but I know mplayer has some pretty gross (but cool) optimisations and hacks to get the best performance out of whatever platform it's running on. I doubt gstreamer will ever stand up to it in terms of performance, unless you have a fully hardware-accelerated pipeline (not just colourspace conversion). That said, this may help slightly, at least, when I've had a chance to optimise it and add more supported formats.

Zeeshan Ali says:

Yay! I really wanted to do that but i don't a shit about shaders. :( I owe you a beer at GUADEC. :)

flowty says:

Wow, nice job :)

Any comments?