Microsoft DirectX 8.1 (C++)

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, as do individual filters. Applications should obtain this interface from the Filter Graph Manager, not from a filter. The Filter Graph Manager distributes method calls to all of the renderer filters. The renderer filters send the calls 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 more information about using this interface, see Seeking the Filter Graph.

This interface improves on the IMediaPosition interface. The IMediaPosition methods require time parameters in fractions of seconds, whereas the IMediaSeeking methods can accept arbitrary formats, such as frames, bytes, or 100-nanosecond units. Also, IMediaSeeking uses 64-bit integers (LONGLONG), providing for greater accuracy. On the other hand, IMediaSeeking is not compatible with Automation, so applications written in Microsoft� Visual Basic� must use IMediaPosition.

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.
QueryPreferredFormat Retrieves the preferred time format for the stream.
GetTimeFormat Retrieves the current time format.
IsUsingTimeFormat Determines whether a specified time format is the format currently in use.
SetTimeFormat Sets the time format.
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.