Microsoft DirectX 8.1 (C++)

IMediaFilter::SetSyncSource

The SetSyncSource method sets the reference clock.

Syntax

HRESULT SetSyncSource(
  IReferenceClock *pClock
);

Parameters

pClock

[in] Pointer to the clock's IReferenceClock interface, or NULL.

Return Value

Returns S_OK if successful, or an HRESULT value indicating the cause of the error.

Remarks

All the filters in the filter graph should 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.

Normally the Filter Graph Manager selects the reference clock. It notifies all of the filters in the graph by calling their SetSyncSource methods. Filters should store the IReferenceClock pointer and increment the reference count. Before the filter is removed from the graph, the Filter Graph Manager calls SetSyncSource again with the value NULL.

An application can override the default clock by calling SetSyncSource on the Filter Graph Manager. Only do this if you have a particular reason to prefer another clock. You can also set the graph not to use a reference clock, by calling SetSyncSource with the value NULL. You might do this to process samples as quickly as possible, for example.

See Also