DirectShow Filters

DirectShow applications use a graph of filters to process multimedia data. Typically, the multimedia data flows through the graph from a source file to a destination device or window with the application controlling the operation, but in some cases the application itself will want to supply or receive the data rather than just providing control.

Below is a typical playback graph for an mpeg movie file. It shows

diagram of DirectShow filter graph

Filters are COM objects that provide a set of COM interfaces, principally IBaseFilter. They can have any number of input and output pins (sub-objects obtained through IBaseFilter::EnumPins) which support a set of pin interfaces including IPin. When two filters connect their pins together the pins agree a media type that defines the data to be exchanged, and obtain interfaces on each other which they will use to exchange data.

To play back a file using DirectShow, an application would create a filter graph manager, and ask this object to create a graph for the file. The application can then use the IMediaControl interface to start and stop playback of the file.

DirectShow filters are all user-mode code. For equivalent functionality in kernel mode, you should use WDM Streaming