Filter Graphs (Windows CE 5.0)
The basic building block of DirectShow is a unit of software called a filter. A filter generally performs a single operation on a multimedia stream. For example, there are DirectShow filters that do the following.
- Read files.
- Decode a particular stream format, such as MPEG-1 video.
- Pass data to the graphics or sound card.
Filters receive input and produce output. For example, if a filter decodes MPEG-1 video, the input is the MPEG-encoded stream and the output is an uncompressed RGB video stream.
To perform a given task, an application connects several filters so that the output from one filter becomes the input for another. A set of connected filters is called a filter graph.
Your application does not have to manage the individual filters in a filter graph. Instead, DirectShow provides a high-level helper called the Filter Graph Manager. The Filter Graph Manager controls the flow of data through the graph. Your application makes high-level API calls such as "Run" (to move data through the graph) or "Stop" (to stop the flow of data). If you require more direct control of stream operations, you can access the filters directly through COM interfaces. The Filter Graph Manager also passes event notifications to the application, so that your application can respond to events, such as the end of a stream.
In addition, the Filter Graph Manager simplifies the process of building a filter graph. For example, you can specify a file name, and the Filter Graph Manager will build a graph to play that file.
See Also
Introduction to DirectShow Application Programming | IGraphBuilder | IMediaControl | Writing DirectShow Filters
Send Feedback on this topic to the authors