March 10, 2009

Where can I find the list of installed ACM codecs on Vista?

It has moved to a strange place on Vista. Do the following steps to see the list:

1. Click on Windows Media Player 11 -> Help -> About -> Technical Support Information

2. It will generate "Support Information for Windows Media Player" and look under "Audio Codecs".

You can also see the information about windows media player binaries and the list of video codecs.

Reference:

March 04, 2009

error C3861: 'CoInitializeEx': identifier not found, even with argument-dependent lookup

You may get the following errors when trying to call CoInitializeEx(NULL, COINIT_MULTITHREADED).
 
error C2065: 'COINIT_MULTITHREADED' : undeclared identifier
error C3861: 'CoInitializeEx': identifier not found, even with argument-dependent lookup

The article in MSDN says "You must include the #define _WIN32_DCOM preprocessor directive at the beginning of your code to be able to use CoInitializeEx."

Look at the code snap in ObjBase.h:

#if (_WIN32_WINNT >= 0x0400 ) || defined(_WIN32_DCOM) // DCOM

WINOLEAPI  CoInitializeEx(IN LPVOID pvReserved, IN DWORD dwCoInit);
WINOLEAPI  CoGetCallerTID( LPDWORD lpdwTID );

#endif // DCOM

So, you need to follow the above rule if you want to call CoInitializeEx, of course you also need to include <objbase.h>.

Reference in MSDN:

March 01, 2009

Why is the media sample upside down after convert its buffer data from YUV to RGB?

Question
I converted the buffer of a media sample from YUY2 to RGB24 pixel by pixel, and then I got a upside-down image. What's wrong with it?

Answer
The definition of the biHeight field of BITMAPINFOHEADER depends the the biCompression field of BITMAPINFOHEADER.

If the bitmap is uncompressed RGB format, the positive biHeight value means the image is bottom-up image; if the bitmap is one of YUV formats such as YUY2, UYVY, and YV12, the image is top-down oriented and the sign of biHeight value must be ignored.

So, I need to do a vertical flip to get a correct image after convert buffer data from YUY2 to RGB24.

You can get more detail information in FOURCC.org: Bitmap Orientation and biHeight