Compartilhar via


IMediaSeeking Interface

 
Microsoft DirectShow 9.0

IMediaSeeking Interface

The IMediaSeeking interface contains methods for seeking to a position within a stream, and for setting the playback rate. The Filter Graph Manager exposes this interface, and so do individual filters or pins. Applications should query the Filter Graph Manager for the interface.

The Filter Graph Manager distributes any IMediaSeeking call to each of the renderer filters in the graph. The renderer filters send the call upstream to the source filters. This sequence of events ensures that all streams remain synchronized. If any of the distributed calls returns an error, the Filter Graph Manager returns the first error value it received, even if some of the distributed calls succeed. An exception is E_NOTIMPL: the Filter Graph Manager does not return E_NOTIMPL unless it was returned by all of the distributed calls.

An application can seek the graph while the graph is in any state (running, paused or stopped). If the graph is running, the Filter Graph Manager pauses the graph before it issues the seek command. Then it runs the graph again. All seeking operations are independent of the current playback rate. Seeking operations cause any pending media data to be flushed from the graph.

For all IMediaSeeking parameters that specify time, the unit of time depends on the current time format. To set the time format, call the IMediaSeeking::SetTimeFormat method. Time formats are globally unique identifiers (GUIDs) defined in uuids.h. For more information, see Time Format GUIDs.

In addition to the methods inherited from IUnknown, the IMediaSeeking interface exposes the following methods.

Method Description
GetCapabilities Retrieves all the seeking capabilities of the stream.
CheckCapabilities Queries whether a stream has specified seeking capabilities.
IsFormatSupported Determines whether a specified time format is supported for seek operations.
QueryPreferredFormat Retrieves the preferred time format for seeking.
GetTimeFormat Retrieves the time format that is currently being used for seek operations.
IsUsingTimeFormat Determines whether seek operations are currently using a specified time format.
SetTimeFormat Sets the time format for subsequent seek operations.
GetDuration Retrieves the duration of the stream.
GetStopPosition Retrieves the time at which the playback will stop, relative to the duration of the stream.
GetCurrentPosition Retrieves the current position, relative to the total duration of the stream.
ConvertTimeFormat Converts from one time format to another.
SetPositions Sets the current position and the stop position.
GetPositions Retrieves the current position and the stop position, relative to the total duration of the stream.
GetAvailable Retrieves the range of times in which seeking is efficient.
SetRate Sets the playback rate.
GetRate Retrieves the playback rate.
GetPreroll Retrieves the amount of data that will be queued before the start position.

Requirements

Header: Declared in Strmif.h; include Dshow.h.

Library: Use Strmiids.lib.

See Also