IMediaFilter::GetSyncSource 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.]

The GetSyncSource method retrieves the current reference clock.

Syntax

HRESULT GetSyncSource(
  [out] IReferenceClock **pClock
);

Parameters

[out] pClock

Receives a pointer to the clock's IReferenceClock interface. The caller must release the interface.

Return value

Returns an HRESULT value. Possible values include those shown in the following table.

Return code Description
S_OK
Success
E_POINTER
NULL pointer argument

Remarks

This method returns the same reference clock as the last call to IMediaFilter::SetSyncSource. If there is no reference clock, pClock receives the value NULL. When the method returns, if *pClock is non-NULL, the IReferenceClock interface has an outstanding reference count. Be sure to release it when you are done.

You can also call this method on the Filter Graph Manager to determine the current reference clock.

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)
Library Strmiids.lib

See also

Error and Success Codes

IMediaFilter Interface