IMediaFilter::SetSyncSource 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.]
SetSyncSource method sets the reference clock.
[in] IReferenceClock *pClock
Pointer to the clock's IReferenceClock interface, or NULL. If this parameter is NULL, the filter graph does not use a reference clock, and all filters run as quickly as possible.
Returns S_OK if successful, or an HRESULT value indicating the cause of the error.
All the filters in the filter graph share the same reference clock, in order to stay synchronized. Stream time is calculated from the reference clock. Renderer filters use the reference clock to schedule when they render samples. If there is no reference clock, a renderer filter renders every sample as soon as it arrives.
This method is implemented by all DirectShow filters, and also by the Filter Graph Manager.IReferenceClock pointer. Increment the reference count on the stored pointer. Before the filter is removed from the graph, the Filter Graph Manager calls SetSyncSource again with the value NULL. Release the stored pointer and set it to NULL.
Note that filters cannot use this method to select the graph clock. In filters, the only function of this method is to inform the filter of the clock that the graph is using. A filter can provide a reference clock by exposing the IReferenceClock interface. For more information, see Time and Clocks in DirectShow.Setting the Graph Clock.
Applications should never call this method on filters.
|Minimum supported client
|Windows 2000 Professional [desktop apps only]
|Minimum supported server
|Windows 2000 Server [desktop apps only]
|strmif.h (include Dshow.h)