IReferenceClock::AdviseTime method (strmif.h)
[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 AdviseTime
method creates a one-shot advise request.
Syntax
HRESULT AdviseTime(
[in] REFERENCE_TIME baseTime,
[in] REFERENCE_TIME streamTime,
[in] HEVENT hEvent,
[out] DWORD_PTR *pdwAdviseCookie
);
Parameters
[in] baseTime
Base reference time, in 100-nanosecond units. See Remarks.
[in] streamTime
Stream offset time, in 100-nanosecond units. See Remarks.
[in] hEvent
Handle to an event, 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
This method creates a one-shot advise request for the reference time rtBaseTime + rtStreamTime. The sum must be greater than zero and less than MAX_TIME, or the method returns E_INVALIDARG. At the requested time, the clock signals the event specified in the hEvent parameter.
To cancel the notification before the time is reached, call the Unadvise method and pass the pdwAdviseToken value returned from this call. After the notification has occurred, the clock automatically clears it, so it is not necessary to call Unadvise. However, it is not an error to do so.
Requirements
Requirement | Value |
---|---|
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 |