Microsoft Windows CE 3.0  

IMediaSeeking::SetPositions

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.

Sets current and stop positions and applies flags to both.

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

Parameters

pCurrent
[in,out] Start position if stopped, or position from which to continue if paused.
dwCurrentFlags
[in] When seeking, one of these flags must be set to indicate the type of seek. The flags passed to this method should include one positioning value and (optionally) any of the nonpositioning values.
AM_SEEKING_NoPositioning No change in positioning.
AM_SEEKING_AbsolutePositioning Position supplied is absolute.
AM_SEEKING_RelativePositioning Position supplied is relative to the current position.
AM_SEEKING_IncrementalPositioning Stop position relative to current; useful for seeking when paused (only valid in conjunction with stop times).
AM_SEEKING_PositioningBitsMask Mask flag; determine if seeking is required by performing a bitwise AND of the four flags listed above and this mask. If the resulting value is nonzero, some form of seeking is required. Check the value of the last two bits to determine which of the above flags are set.
AM_SEEKING_SeekToKeyFrame Seek to the nearest key frame (not as accurate but quicker).
AM_SEEKING_ReturnTime Return the media time equivalents for pCurrentand pStop(overwriting these values with the returned values).
AM_SEEKING_Segment At the end of the segment call EC_ENDOFSEGMENT instead of EndOfStream.
AM_SEEKING_NoFlush Do not flush.
pStop
[in,out] Position in the stream at which to quit.
dwStopFlags
[in] Stop position seeking options to be applied. These are the same as listed for dwCurrentFlags.

Return Values

Returns an HRESULTvalue that depends on the implementation of the interface. The default DirectShow implementation returns E_POINTER if the pointer argument is NULL, NOERROR for success, E_INVALIDARG if a parameter is out of range, or another COM return code otherwise.

Remarks

The following code fragment checks for the type of seeking required.

switch ( dwFlags &
AM_SEEKING_PositioningBitsMask ) { case
AM_SEEKING_IncrementalPositioning: // Check this is on a stop time
// Get Current, add this delta, apply result as new stop time
break; case AM_SEEKING_RelativePositioning: // ... break; case
AM_SEEKING_AbsolutePositioning: // ... break; case
AM_SEEKING_NoPositioning: // Nothing to do. break; }