I'm trying to conquer VFW from my C# App. Most of the things were quite misty before, and after all I've reached the last point before it will be done.
When I initiate camera driver with group of messages like
- WM_CAP_GET_VIDEOFORMAT
- WM_CAP_SET_VIDEOFORMAT
then I receive pointer to BITMAPINFO structure on GET_VIDEOFORMAT where (as I suppose, because the webcamera doesn't have its native driver installed) one item in struct called biCompression with very strange value = 0x32595559 (844715353).
Always is the same value, and the RGBQUAD - all zeros.
Pls, see the shot where that value is in decimal format:
When I call out VFW Dialog with video format selection, I can see YUY2 (which is selectable and able to be set), and MJPG which is able to be selected, but that causes the black screen as video capture result.
When I call SET_VIDEOFORMAT and send to VFW the standard BMP RGB 640x480 format with no compression, it returns 0 (zero) on SendMessage, which means it can't be set. And, at the same time, sending the struct, with the strange compression value received on GET_VIDEOFORMAT, back to as SET_VIDEOFORMAT, returns 1, and it means that VFW accepted it.
So I'm wondering why is that? Either the OS (Win7) doesn't have a certain Codec for usual BMP uncompressed, or because the Web camera doesn't have its driver installed?
And the other question is: what means 0x32595559 value in the BITMAPINFO compression item?
I have already treated it as normal 24 bit YUV data, but the resulting image is B&W, no color, though during video streaming it's colored, and if I get it from Clipboard, it's also colored.
How to treat such collision, please, help me if you of cause know it. If you are very good with that, then I'd be happy to $$.
Thanks.
UPD. Wow, thanks to my spontaneous idea to transfer decimal data into hex (compression value) I found in Google its YUY2 codec kind of compression. Full table is here
Ok, but the question is still unanswered. If PC wouldn't contain a proper codec for RGB Bitmap uncompressed, then what actually happens in VFW BOX, when I send SET_VIDEOFORMAT? Does it search for proper codec and try to attach it to the existing Video streaming graph?
I think the answer to that question will help to get VFW understood for everyone.