CBaseReferenceClock.AdvisePeriodic 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 AdvisePeriodic method creates a periodic advise request. This method implements the IReferenceClock::AdvisePeriodic method.

Syntax

HRESULT AdvisePeriodic(
   REFERENCE_TIME StartTime,
   REFERENCE_TIME PeriodTime,
   HSEMAPHORE     hSemaphore,
   DWORD_PTR      *pdwAdviseToken
);

Parameters

StartTime

Time of the first notification, in 100-nanosecond units. Must be greater than zero and less than MAX_TIME.

PeriodTime

Time between notifications, in 100-nanosecond units. Must be greater than zero.

hSemaphore

Handle to a semaphore, created by the caller.

pdwAdviseToken

Pointer to a variable that receives an identifier for the advise request.

Return value

Returns one of the HRESULT values shown in the following table.

Return code Description
S_OK
Success
E_INVALIDARG
Invalid time values
E_OUTOFMEMORY
Failure
E_POINTER
NULL pointer argument

Remarks

At each notification time, the clock releases the semaphore specified in the hSemaphore parameter. When no further notifications are required, call the CBaseReferenceClock::Unadvise method and pass the pdwAdviseToken value returned from this call.

Requirements

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

See also

CBaseReferenceClock Class