DirectShow Animated Header -- Stream Control Architecture DirectShow Animated Header -- Stream Control Architecture* Microsoft DirectShow SDK
*Index  *Topic Contents
*Previous Topic: Filters and Pins
*Next Topic: Quality-Control Management

Stream Control Architecture


The stream architecture allows applications to communicate with the filter graph manager; it also allows the filter graph manager to communicate with individual filters to control the movement of the data through the filter graph. Using the stream architecture, filters can post events that the application can retrieve, so an application can, for example, retrieve status information about a special filter it has installed.

The filter graph manager exposes media control and media positioning interfaces to the application. The media control interface, IMediaControl, allows the application to issue commands to run, pause, and stop the stream. The positioning interface, IMediaSeeking, lets the application specify which section of the stream to play.

Individual filters expose an IBaseFilter interface so that the filter graph manager can issue the run, pause, and stop control commands. The filter graph manager is responsible for calling these methods in the correct order on all the filters in the filter graph. (The application should not do this directly.)

For position commands, the filter graph manager is called by the application to, for example, play a specified length of media stream starting at some specified stream time. However, unlike the IBaseFilter interface, only the renderer filter exposes an IMediaSeeking interface. Therefore, the filter graph manager calls only the renderer filter with positioning information. The renderer then passes this position control information upstream through IMediaSeeking interfaces exposed on the pins, which simply pass it on. The positioning of the media stream is actually handled by the output pin on the filter that is able to seek to a particular position, usually a parser filter such as the AVI splitter.

Position information is passed serially upstream because there might be filters between the renderer and the source filter that require position information. Consider a transform filter that is written to perform some video or audio modification only during the first 10 seconds of a video clip (for example, increasing the volume or fading in the video). This filter probably needs to have information about where the stream is starting so that it can determine its correct behavior. For example, it should not perform if the start time is after the first 10 seconds, or it should adjust accordingly if the start time is within this duration.

Filters also get position information from the IPin::NewSegment method which provides the media start and stop times for the next set of samples and the rate to be associated with those samples.

© 1998 Microsoft Corporation. All rights reserved. Terms of Use.

*Top of Page