For Developers: HTC HD2 video capture rendered on a DirectX plane

Baldido has managed, after overcoming many obstacles to render video from the camera directly onto a 3D DirectX plane.

He writes:

After a long and bumpy road, I finally managed to create a camera preview and render the output on a Direct 3D plane.
Problems I had to deal with while developing this application:
– Camera capture is YV12 and rotated. Wrote a custom 90 degrees rotation routine. (not required for this demo, but handy for capturing movies).
– There is no hardware Direct 3D drivers supplied by HTC. Installed the HD2/Leo 3D Driver Patch v2.0. ( See:… ) Not sure if it sells with hardware OpenGL support, but if it does I’ll port it to OpenGL. Being required to install extra drivers sucks.
– DirectShow has no YV12 to RGB converter. No support for YV12 texture, so had to write a YV12 to RGB color space conversion. ( See:… )
– Had to write a custom DirectShow to Direct3D texture renderer. DirectX has no out of the box DirectShow texture renderer.
– HTC doesn’t seem to hand out the API to access the build in G-Sensors and Compass. Used code to directly hook into the HTC Sensors DLL.
– Had to optimize a lot of settings to get a near smooth performance.

While this was obviously quite an achievement, it seems rather a pity he has had to work so hard to manage what should be a basic feature of the API. Having done this now, the technique would be useful for augmented reality applications or games, and hopefully Baldido will share his code with the community soon.

See another video after the break.