Microsoft DirectX 8.1 (C++)

IMediaSeeking::SetPositions

The SetPositions method sets the current position and the stop position.

Syntax

HRESULT SetPositions(
  LONGLONG *pCurrent,
  DWORD dwCurrentFlags,
  LONGLONG *pStop,
  DWORD dwStopFlags
);

Parameters

pCurrent

[in,out] Pointer to a variable that specifies the current position, in units of the current time format.

dwCurrentFlags

[in] Bitwise combination of flags. See Remarks.

pStop

[in,out] Pointer to a variable that specifies the stop time, in units of the current time format.

dwStopFlags

[in] Bitwise combination of flags. See Remarks.

Return Value

Returns an HRESULT value. Possible values include the following.

Value Description
S_FALSE No position change. (Both flags specify no seeking.)
S_OK Success.
E_INVALIDARG Invalid argument.
E_NOTIMPL Method is not supported.
E_POINTER NULL pointer argument.

Remarks

The dwCurrentFlags and dwStopFlags parameters define the type of seek. The following flags are defined:

Positioning Flags Description
AM_SEEKING_NoPositioning No change in position. (The time parameter can be NULL.)
AM_SEEKING_AbsolutePositioning The specified position is absolute.
AM_SEEKING_RelativePositioning The specified position is relative to the previous value.
AM_SEEKING_IncrementalPositioning The stop position (pStop) is relative to the current position (pCurrent).
Modifier Flags Description
AM_SEEKING_SeekToKeyFrame Seek to the nearest key frame. This might be faster, but less accurate.
AM_SEEKING_ReturnTime Return the equivalent reference times.
AM_SEEKING_Segment Use segment seeking.
AM_SEEKING_NoFlush Do not flush.

For each parameter, use one positioning flag. Optionally, include one or more modifier flags.

If the AM_SEEKING_ReturnTime flag is specified, the method converts the position value to a reference time and returns it in the pCurrent or pStop variable. This flag is useful if you are using another time format, such as frames.

The AM_SEEKING_Segment and AM_SEEKING_NoFlush flags support seamless looping:

To perform looping, the graph must report AM_SEEKING_CanDoSegments in the IMediaSeeking::GetCapabilities method. Currently, only the WAVE Parser Filter supports this feature.

See Also