IReferenceClock interface (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 IReferenceClock
interface provides the reference time for the filter graph.
Filters that can act as a reference clock can expose this interface. It is also exposed by the System Reference Clock. The filter graph manager uses this interface to synchronize the filter graph. Applications can use this interface to retrieve the current reference time, or to request notification of an elapsed time.
For more information, see Time and Clocks in DirectShow.
Filter developers: Implement this interface if you are writing a filter that generates reliable clock times. For example, audio renderers implement this interface, because audio sound boards usually contain a reference clock. Use the CBaseReferenceClock class to implement this interface.
To increase the chances that a non-rendering filter will be selected by the Filter Graph Manager as the reference close, follow these steps:
- Implement
IReferenceClock
in the filter. - Implement IAMFilterMiscFlags in the filter.
- Return AM_FILTER_MISC_FLAGS_IS_SOURCE from IAMFilterMiscFlags::GetMiscFlags.
- Implement IAMPushSource on all output pins.
- Return (* pFlags) = 0 from IAMPushSource::GetPushSourceFlags.
- You may return E_NOTIMPL from all other IAMPushSource methods.
Inheritance
The IReferenceClock interface inherits from the IUnknown interface. IReferenceClock also has these types of members:
Methods
The IReferenceClock interface has these methods.
IReferenceClock::AdvisePeriodic The AdvisePeriodic method creates a periodic advise request. |
IReferenceClock::AdviseTime The AdviseTime method creates a one-shot advise request. |
IReferenceClock::GetTime The GetTime method retrieves the current reference time. |
IReferenceClock::Unadvise The Unadvise method removes a pending advise request. |
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) |