Microsoft Windows CE 3.0  

IMediaPosition Interface

Important:
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.

It is recommended that the IMediaSeekinginterface be used instead of IMediaPosition. This depreciated interface is no longer fully supported.

Applications communicating with the filter graph can call methods on the IMediaPositioninterface to set or retrieve properties such as the duration of the stream, the start and stop times, the preroll time, the rate, and the current position. The filter graph uses these properties on seekable filters to control the playback of streams within the graph; where there are multiple streams, the filter graph sets them all to play in parallel, beginning at the same position, and will report the duration as being the duration of the longest stream. The REFTIME parameters used in this interface are double value, representing a fractional number of seconds. Internally, filters will store time to an accuracy of 100 nanoseconds.

When to Implement

The filter graph manager exposes the IMediaPositioninterface if any of the filters within the graph are seekable (can seek to an arbitrary position in the stream). This normally means a seekable file source filter. Filters, such as a file source filter, will expose IMediaPositionif they can seek their data or if their output pin represents a seekable stream. The renderer filter should also expose this interface. Output pins of transform filters expose this interface to pass the positioning information upstream from the renderer through each intermediate filter to the seekable filter.

Use the CMediaPositionclass to help implement this interface on a filter. Use the CPosPassThrubase class to implement this interface on output pins of transform filters used to pass media positioning information upstream. This is enabled by default in the pin base classes.

When to Use

Applications can use this interface to set or retrieve media positioning properties. Most commonly, an application will use the methods on this interface to play a media stream for some duration starting at some set position in the stream (for example, 10 seconds from the start).

Methods in Vtable Order

IUnknown methods Description
QueryInterface Returns pointers to supported interfaces.
AddRef Increments the reference count.
Release Decrements the reference count.
IDispatch methods Description
GetTypeInfoCount Determines whether there is type information available for this dispinterface.
GetTypeInfo Retrieves the type information for this dispinterface if GetTypeInfoCountreturned successfully.
GetIDsOfNames Converts text names of properties and methods (including arguments) to their corresponding DISPIDs.
Invoke Calls a method or accesses a property in this dispinterface if given a DISPID and any other necessary parameters.
IMediaPosition methods Description
get_Duration Retrieves the total duration of the media stream.
put_CurrentPosition Sets the time that the media stream begins.
get_CurrentPosition Retrieves the current position in terms of the total length of the media stream.
get_StopTime Retrieves the position within the media stream at which playback should stop.
put_StopTime Sets the position within the media stream at which playback should stop.
get_PrerollTime Retrieves the time prior to the start position that the filter graph begins any nonrandom access device rolling.
put_PrerollTime Sets the time prior to the start position that the filter graph begins any nonrandom access device rolling.
put_Rate Sets the playback rate, relative to normal playback of the media stream.
get_Rate Retrieves the playback rate, relative to normal playback of the media stream.
CanSeekForward Determines if the current position can be moved forward in the media stream.
CanSeekBackward Determines if the current position can be moved backward in the media stream.