CBaseReferenceClock::AdviseTime

 
Microsoft DirectShow 9.0

CBaseReferenceClock::AdviseTime

The AdviseTime method creates a one-shot advise request. This method implements the IReferenceClock::AdviseTime method.

Syntax

  HRESULT AdviseTime(
    REFERENCE_TIME baseTime,
    REFERENCE_TIME streamTime,
    HEVENT hEvent,
    DWORD_PTR *pdwAdviseToken
);

Parameters

baseTime

Base reference time, in 100-nanosecond units.

streamTime

Stream offset time, in 100-nanosecond units.

hEvent

Handle to an event, 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.

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

Remarks

This method creates a one-shot advise request for the reference time baseTime + streamTime. 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 CBaseReferenceClock::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

**  Header:** Declared in Refclock.h; include Streams.h.

**  Library:** Use Strmbase.lib (retail builds) or Strmbasd.lib (debug builds).

See Also