Windows 8 Metro applications have the ability to add effects to media, such as video playback and live cameras. This is usually applied to the MediaElement class via the AddVideoEffect (or Audio) call. There are a few reasons you’d want to make these a/v effects. One being post-processing of video playback, the other is to be able to apply these effects as they are being encoded and recorded.
These media effects are created by implementing a MediaFoundation Transform. There is a fine example located here. Unfortunately that linked sample only shows how to do effects by processing pixels on the CPU. Since this isn’t the 80’s any more, where we modify pixels in system memory, I wanted to use the GPU and Direct3D and D2D to create GPU accelerated effects for video.
In the sample application I only have it displaying video in a MediaElement with a blur effect applied to it. But with not too much work I believe you can make this work in a D3D application with IMFMediaEngine and possibly even a WinJS application. You can also add it to a video capture and record it.
Keep in mind this is just a prototype and not sure it works in every situation (eg, does it need a software fallback? What about device loss?)
Download the application here (You may need the full version of VS11)
And special thanks for Shawn Hargreaves SpriteBatch!