CSourceSeeking.SetPositions method

[The feature associated with this page, DirectShow, is a legacy feature. It has been superseded by MediaPlayer, IMFMediaEngine, and Audio/Video Capture in Media Foundation. Those features have been optimized for Windows 10 and Windows 11. Microsoft strongly recommends that new code use MediaPlayer, IMFMediaEngine and Audio/Video Capture in Media Foundation instead of DirectShow, when possible. Microsoft suggests that existing code that uses the legacy APIs be rewritten to use the new APIs if possible.]

The SetPositions method sets the current position and the stop position. This method implements the IMediaSeeking::SetPositions method.

Syntax

HRESULT SetPositions(
   LONGLONG *pCurrent,
   DWORD    CurrentFlags,
   LONGLONG *pStop,
   DWORD    StopFlags
);

Parameters

pCurrent

Pointer to a variable that specifies the current position.

CurrentFlags

Bitwise combination of flags. See Remarks.

pStop

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

StopFlags

Bitwise combination of flags. See Remarks.

Return value

Returns an HRESULT value. Possible values include those listed in the following table.

Return code Description
S_OK
Success
E_INVALIDARG
Invalid flags
E_POINTER
NULL pointer argument

Remarks

The following flags are supported:

  • AM_SEEKING_NoPositioning
  • AM_SEEKING_AbsolutePositioning
  • AM_SEEKING_RelativePositioning
  • AM_SEEKING_IncrementalPositioning (pStop only)

For more information, see IMediaSeeking::SetPositions.

This method updates the values of the CSourceSeeking::m_rtStart and CSourceSeeking::m_rtStop member variables, and then calls the pure virtual methods CSourceSeeking::ChangeStart and CSourceSeeking::ChangeStop.

Requirements

Requirement Value
Header
Ctlutil.h (include Streams.h)
Library
Strmbase.lib (retail builds);
Strmbasd.lib (debug builds)

See also

CSourceSeeking Class