September 28, 2008

How to mute an Audio Capture Filter of webcam in DirectShow?

If you want to mute an audio capture of webcam, you have to query IAMAudioInputMixer interface on its INPUT PIN, and then use put_Enable method to disable it.

Both the audio capture filter itself and its input pin have IAMAudioInputMixer interface, but the put_Enable / get_Enable methods are implemented on input pin only.

Reference in MSDN:
http://msdn.microsoft.com/en-us/library/ms783820.aspx

September 07, 2008

How to get the string from GUID in DirectShow?

There is a very useful global array that contains strings representing the GUIDs defined in Uuids.h

char* GuidNames[guid]

Example:
const char* GetMajorTypeString(CMediaType* pMediaType)
{
  return GuidNames[*(pMediaType->Type())];
}

Reference:
http://msdn.microsoft.com/en-us/library/ms783758.aspx

September 06, 2008

Small, simple, cross-platform, free and fast C++ XML Parser

I prefer using this one of XML Parser. It is really simple and convenience. And it contains ONLY TWO files, including "xmlparser.cpp" and "xmlparser.h"

I can compile it without error on VC++ (Visual C++) 2003 and 2005, and it works very well.

You can get more detail information on author's web site.

Small, simple, cross-platform, free and fast C++ XML Parser
http://www.applied-mathematics.net/tools/xmlParser.html

September 05, 2008

The easiest way to toggle / next bookmark in Visual Studio

Shortcuts:
Toggle Bookmark: Ctrl + K Ctrl +K
Next Bookmark: Ctrl + K Ctrl + N

Tips:
You can find the above shortcuts on the bookmark menu, but it is NOT the easiest way to do that.

The other Shortcuts:
Toggle Bookmark: Ctrl + F2
Next Bookmark: F2
(The key mapping is "Visual C++")