|Microsoft DirectX 9.0|
The SetSyncSource method sets the reference clock.
HRESULT SetSyncSource( IReferenceClock *pClock );
[in] Pointer to the clock's IReferenceClock interface, or NULL.
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.
This method is implemented by all DirectShow filters, and also by the Filter Graph Manager.
When the graph runs, the Filter Graph manager calls this method on every filter in the graph, to notify them of the graph reference clock. Use this method to store the 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.
The CBaseFilter class implements this method; see CBaseFilter::SetSyncSource.
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.
An application can override the default clock by calling SetSyncSource on the Filter Graph Manager. Do not do this unless you have a particular reason to prefer another clock. You can also set the graph not to use any reference clock, by calling SetSyncSource with the value NULL. You might do this to process samples as quickly as possible. For more information, see Setting the Graph Clock.
Applications should never call this method on filters.