GDCL Home About GDCL DirectShow WinNt & WDM

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

  • a source filter, responsible for reading data from a file (or a URL)
  • a parser filter that separates out chunks of audio and video data and supplies them to the appropriate decoder
  • decoders for audio and video that decompress the data
  • 'rendering filters' for both audio and video that take the decompressed data and draw or play it.

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

 DirectShow

An overview of the DirectShow filter architecture
The filter graph manager and plug-in distributors
How the filtergraph manager builds graphs
Media types
Data transports
A technical Q & A for developers
 

Related Topics

Component Object Model
WDM Streaming