Building DirectShow Filters
A version of this page is also available for
4/8/2010
To build a DirectShow filter, you must set up the proper environment and then follow the steps in this topic.
If you build a DirectShow filter, you must first set up your environment as described in Building DirectShow Applications in addition to performing the following steps:
Use the __stdcall calling convention.
Set the entry-point symbol to DllMainCRTStartup@12.
If you implement the filter as a DLL, include a definition (.def) file that exports the DLL functions. The following is an example of a definition file. The filter's output file is assumed to be Filter.dll.
LIBRARY FILTER.DLL DESCRIPTION 'Description of my filter' EXPORTS DllGetClassObject DllCanUnloadNow DllRegisterServer DllUnregisterServer
In addition, if you are using the DirectShow base classes, do the following:
Build the base class library.
Include the header file Streams.h.
For release builds, add the preprocessor flag RELEASE. For debug builds, add the preprocessor flag DEBUG.
Link to the following library files.
Library File Description Strmiids.lib
Exports class identifiers (CLSIDs) and interface identifiers (IIDs). All DirectShow applications require this library.
Ole32.lib Ole32auth.lib Uuid.lib
These are COM libraries that are typically required when building filters. Depending on the needs of you project, you may not need all these libraries.
See Also
Concepts
Building DirectShow Applications
Setting Up the Build Environment