Microsoft Windows CE 3.0  

Media Control and Positioning Classes

This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.

Media control interfaces pass commands such as Run, Stop, or Pausefrom an application through the filter graph manager to the individual filters. From the filter's perspective, the only control interface necessary is IMediaFilter, which exposes methods to accept and implement these commands. The CBaseFilterclass implements this interface. All other interfaces that expose media control methods are handled by the filter graph manager and are therefore already implemented. Although a CMediaControlclass exists and implements the IMediaControlinterface, it is not often used because the filter graph manager is responsible for this functionality. The following illustration shows the relationship between these classes and interfaces.

Media positioning interfaces start the media stream at a specified position, play the stream for a specified period of time, or change the rate of the media stream. The IMediaPositioninterface is the primary interface supporting this functionality. The CMediaPositionclass implements this interface and serves as a base class for two other classes: CPosPassThruand CSourcePosition.

Typically, the filter graph manager calls the IMediaPositioninterface on the renderer filters when it wants to position the media stream. The renderer acknowledges the sample times that it will be expected to display and then passes the media positioning data upstream, destined for a seekable filter, such as a source file filter, that can provide the properly positioned source stream. To pass that information upstream, output pins must be able to receive the positioning information.

The CPosPassThruclass implements the IMediaPositioninterface and the IMediaSeekinginterface on the output pins of filters and, for the most part, does nothing but call the corresponding interface on the output pin of the next upstream filter, thereby passing through the positioning data. IMediaSeekingis different than IMediaPositionin that it allows the media stream to be seeked to units other than time, such as frames, samples, or indexed fields in an MPEG format. The CRendererPosPassThruclass, implemented on a video renderer, sets the start and end reference times on individual samples, so that samples can be queried at any time for this information. This is helpful when dealing with seeking using IMediaSeeking, which seeks to media time, and does not keep track of the sample's reference time.

The reason for serially informing every filter in the graph of the new position is to allow filters that might be concerned with media positioning to be prepared for the new position. Certain stream splitters, for example, might be splitting off streams with media positions relative to the main media stream. This is why the filter graph manager does not simply call the source filter's IMediaPositionor IMediaSeekinginterface directly.

CSourcePositionis the class that helps the source filter implement its IMediaPositioninterface.

The CSourceSeekingclass helps the source filter implement its IMediaSeekinginterface. This class enables a source filter to handle calls that change the start and stop positions in the media stream, and the playback rate.

The CBaseStreamControlclass helps the source filter implement its IAMStreamControlinterface. This class is used primarily by capture filters. The following illustration shows the relationship between CBaseStreamControland the interfaces from which it inherits.

 Last updated on Tuesday, May 18, 2004

© 2004 Microsoft Corporation. All rights reserved.