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.
A version of this page is also available for
4/8/2010

This method retrieves the current position in terms of the total length of the media stream.

Syntax

HRESULT GetCurrentPosition(
  LONGLONG* 
pCurrent
);

Parameters

pCurrent

[out] Current position in current time format units.

Return Value

Returns an HRESULTvalue that depends on the implementation of the interface.

The default DirectShow implementation returns E_POINTER if the pointer argument is NULL, or another COM return code otherwise.

Remarks

The current position is the position that playback has reached. It is a value between zero and the duration. If the filter graph is paused, this is the position at which it will restart.

Because IMediaSeekinguses media times for its time parameters, the current position value is independent of any rate or start position that might have been set.

When the filter graph is stopped or paused, this method returns the position at which playback will recommence.

When the filter graph is running, the filter graph manager returns the position according to the data arriving at the renderer.

If an individual filter implements this method, it should return the media time of the sample it is processing when paused or running.

After stopping or pausing, a run command causes playback to begin at the current position. This will be where playback stopped or paused, unless there has been an IMediaSeeking::SetPositionscall in the meantime to reset the start position.

Requirements

Windows Embedded CE Windows CE 2.12 and later
Windows Mobile Pocket PC for Windows Mobile Version 5.0 and later, Smartphone for Windows Mobile Version 5.0 and later
Note Microsoft DirectShow applications and DirectShow filters have different include file and Library requirements
For more information, see Setting Up the Build Environment,
Version 2.12 requires DXPAK 1.0 or later

See Also