IReferenceClock::AdvisePeriodic method (strmif.h)
The AdvisePeriodic method creates a periodic advise request.
Syntax
HRESULT AdvisePeriodic(
[in] REFERENCE_TIME startTime,
[in] REFERENCE_TIME periodTime,
[in] HSEMAPHORE hSemaphore,
[out] DWORD_PTR *pdwAdviseCookie
);
Parameters
[in] startTime
Time of the first notification, in 100-nanosecond units. Must be greater than zero and less than MAX_TIME.
[in] periodTime
Time between notifications, in 100-nanosecond units. Must be greater than zero.
[in] hSemaphore
Handle to a semaphore, created by the caller.
[out] pdwAdviseCookie
Pointer to a variable that receives an identifier for the advise request.
Return value
Returns an HRESULT value. Possible values include the following.
| Return code | Description |
|---|---|
|
Success. |
|
Invalid time values. |
|
Failure. |
|
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 IReferenceClock::Unadvise and pass the pdwAdviseToken value returned from this call.
The following code example creates an advise request that signals five seconds from the time it is created, and again every second thereafter:
| C++ |
|---|
IReferenceClock *pRefClock = NULL; // Get an IReferenceClock pointer (not shown). |
Requirements
| Minimum supported client | Windows 2000 Professional [desktop apps only] |
| Minimum supported server | Windows 2000 Server [desktop apps only] |
| Target Platform | Windows |
| Header | strmif.h (include Dshow.h) |
| Library | Strmiids.lib |