How to use/install custom Directshow filter
I have custom compiled directshow filter - filter.DLL - but how to use, or install th开发者_如何学编程is filter in system?
Usually you register the directshow filter into system by calling (from an elevated command prompt window on windows vista/7) regsvr32 filter.dll
.
After the registration process you can use your filter with a directshow graph viewing application:
- GraphEdit (graphedt.exe), installed by Windows SDK (ex. "c:\Program Files\Microsoft SDKs\Windows\v6.0A\bin\graphedt.exe" )
- GraphStudio
After testing your filter with the above programs you can use it in a C++/C# client application.
The main way would be to register the filter file with regsvr32 filter.dll
and than create the filter with it's CLSID in your application.
If the filter are in the same codebase as the application, you can just create the filter with new
and use it.
I prefer to load the filter.dll with CoLoadLibrary
to get the IClassFactory of the filter and create the filter. You can test this with GraphStudioNext. You can find sample source code to load a filter this way here.
Like Cristian said, people typically register the filter on the system. But I prefer not to do this for a few reasons. In particular, see the section on "Registering Filters with the Operating System."
I think nine times out of ten, you're better off instantiating with new. See AppFilter on Geraint Davis' page for an example.
精彩评论