IMediaSeeking::SetPositions (Windows Embedded Compact 7)
This method sets current and stop positions and applies flags to both.
HRESULT SetPositions( LONGLONG* pCurrent, DWORD dwCurrentFlags, LONGLONG* pStop, DWORD dwStopFlags );
- 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
-
This flag only applies to the dwStopFlags. The pCurrent parameter must be set to a valid position.
- 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 pCurrent and 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.
Returns an HRESULT value. The following table shows some of the possible return values.
| Value | Description |
|---|---|
|
NOERROR |
Method succeeded. |
|
E_INVALIDARG |
One or more parameters is out of range. |
|
E_POINTER |
pCurrent is NULL and the corresponding dwCurrentFlags is not set to AM_SEEKING_NoPositioning. pStop is NULL and the corresponding dwStopFlags is not set to AM_SEEKING_NoPositioning. pStop is relative to pCurrent and pCurrent is not set to a valid start position. |
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;
}