# srcfilter - DirectShow SourceFilter tester

## FAQ

### What does srcfilter do?

srcfilter.exe loads a DLL containing a DirectShow SourceFilter, and pulls a source file through the DLL, saving it to a destination file. For example, to test the URL File Source Filter that ships with DirectX, you could pull a URL through the DLL, and compare the results against the same file written to disk by other URL fetching tools like curl or wget.

### Does srcfilter work under Linux?

Yes. srcfilter was originally designed to run under Wine. A side benefit is that it also works under native Windows. The general purpose is to test Windows SourceFilter DLLs under Linux.

### How does srcfilter work?

srcfilter simply uses the published DirectShow APIs too open, load, and process a file using a IFileSourceFilter class contained in a DLL. There's absolutely nothing fancy about the implementation. Thanks to many people working on MPlayer and Wine, all of these interfaces are available on Linux as well.

### Don't you feel dirty writing code against these Windows APIs?

You have no idea. But hey, it works, and it works in Wine.

## Build

To build srcfilter yourself, download the source code and Makefile above. Modify the Makefile for your installation of mingw32, and run make srcfilter.exe

## Run

To test a SourceFilter DLL, you will need:

- the CLSID for the SourceFilter (e.g. {01234567-0123-0123-0123-456789ABCDEF}) if one is not already registered for your source file extension
- the DLL containing the SourceFilter to be tested if one is not already registered for your CLSID
- a source file or URI

For example:

> srcfilter.exe -f SomeFilter.DLL -c '{01234567-0123-0123-0123-456789ABCDEF}' -o /tmp/somewhere -x outext SomeTestFile.inext

This will read SomeTestFile.inext through the SourceFilter with the CLSID {01234567-0123-0123-0123-456789ABCDEF} found in the DLL SomeFilter.DLL, writing all output to the file /tmp/somewhere/SomeTestFile.outext