Retrieves the last clock time that was correlated with system time.
public:
HRESULT GetCorrelatedTime(
DWORD dwReserved,
LONGLONG *pllClockTime,
MFTIME *phnsSystemTime
)
dwReserved
Type: DWORD
Reserved, must be zero.
pllClockTime
Type: LONGLONG *
[out] Receives the last known clock time, in units of the clock’s frequency.
phnsSystemTime
Type: MFTIME *
[out] Receives the system time that corresponds to the clock time returned in pllClockTime, in 100-nanosecond units.
Type: HRESULT
The method returns an HRESULT. Possible values include, but are not limited to, those in the following table.
| Return code | Description |
|---|---|
| S_OK | The method succeeded. |
| MF_E_CLOCK_NO_TIME_SOURCE | The clock does not have a time source. |
Refer to Media Foundation return codes.
At some fixed interval, a clock correlates its internal clock ticks with the system time. (The system time is the time returned by the high-resolution performance counter.) This method returns:
The clock time is returned in the pllClockTime parameter and is expressed in units of the clock’s frequency. If the clock’s IMFClock::GetClockCharacteristics method returns the MFCLOCK_CHARACTERISTICS_FLAG_FREQUENCY_10MHZ flag, the clock’s frequency is 10 MHz (each clock tick is 100 nanoseconds). Otherwise, you can get the clock’s frequency by calling IMFClock::GetProperties. The frequency is given in the qwClockFrequency member of the MFCLOCK_PROPERTIES structure returned by that method.
The system time is returned in the phnsSystemTime parameter, and is always expressed in 100-nanosecond units.
To find out how often the clock correlates its clock time with the system time, call GetProperties. The correlation interval is given in the qwCorrelationRate member of the MFCLOCK_PROPERTIES structure. If qwCorrelationRate is zero, it means the clock performs the correlation whenever GetCorrelatedTime is called. Otherwise, you can calculate the current clock time by extrapolating from the last correlated time.
Some clocks support rate changes through the IMFRateControl interface. If so, the clock time advances at a speed of frequency x current rate. If a clock does not expose the IMFRateControl interface, the rate is always 1.0.
For the presentation clock, the clock time is the presentation time, and is always relative to the starting time specified in IMFPresentationClock::Start. You can also get the presentation time by calling IMFPresentationClock::GetTime.
Header: Declared in mfidl.h.
Library: Use mfuuid.lib.