July 8,2005
DirectShow filter 寫作
- DirectShow filter is a win32 DLL.
- Use regsvr32.exe to register filter, then u can find it in GraphEdit.
- For building a DirectShow filter
- First, build base classes of DirectShow in the "DXSDK/Sample/DirectShow/BaseClasses".
- Include <streams.h> in BaseClasses dir.
- Use __stdcall in "calling convention" of VC++ project setting.
- Use multithread rulltime library.
- Add a xxx.def file into your project dir. The fomat should like below:
LIBRARY xxx.ax
EXPORTS
DllMain PRIVATE
DllGetClassObject PRIVATE
DllCanUnloadNow PRIVATE
DllRegisterServer PRIVATE
DllUnregisterServer PRIVATE - Link these libraries to project.
Debug:
Strmbasd.lib, Msvcrtd.lib, Winmm.lib
Release:
Strmbas.lib, Msvcrtd.lib, Winmm.lib
- Choose "ignore default library" in linker options of project setting.
- Declear a DLL Entry as follow
extern "C" BOOL WINAPI DllEntryPoint(HINSTANCE, ULONG, LPVOID);
BOOL APIENTRY DllMain(HANDLE hModule, DWORD dwReason, LPVOID lpReserved)
{
return DllEntryPoint((HINSTANCE)(hModule), dwReason, lpReserved);
}
引用URL
http://cgi.blog.roodo.com/trackback/250808