views:

194

answers:

0

I'm trying to blit YUV hardware surface to the primary surface in WinMobile. Everything works: creation of the surfaces, I test that the passed FourCC code is actually used by querying the surface description, I set puffer pointer (correctly, according to lPitch and width/height of the surface). I verified that it all works properly on PC, but the same code kind of fails on Windows Mobile. The reason I'm saying that it "kind of" fails is that it all works except that the result is not correct, the final picture is corrupted (however, it resembles the original picture).

After testing all what I could, I came to conclusion that even though I create YUV surface, underlying HW treats it as if it was the same format as the primary surface (R565 in my case). There is also WinCE specific parameter lXPitch inside DDSURFACEDESC. In my case, even though DDSURFACEDESC.ddpfPixelFormat.dwYUVBitCount is 12, the lXPitch is set to 2, which doesn't make sence for planar YUV (1 byte per pixel for the Y plane). I also tested multiple devices, and I always get the same behavior. So, the questions is: what's wrong with YUV support in windows mobile, or I can't blit YUV surface on non-YUV in winMo?

Bellow, see the screenshot from the mobile of the resulting picture (initially, on creation I filled the surface with some shade of pink, that why it's all pink.

Result output screenshot