mfplat: Return properties for system time source.

Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Nikolay Sivov 2019-05-20 15:25:57 +03:00 committed by Alexandre Julliard
parent 9f89464e0e
commit ac2038ef30
3 changed files with 33 additions and 2 deletions

View File

@ -6633,9 +6633,17 @@ static HRESULT WINAPI system_time_source_GetState(IMFPresentationTimeSource *ifa
static HRESULT WINAPI system_time_source_GetProperties(IMFPresentationTimeSource *iface, MFCLOCK_PROPERTIES *props) static HRESULT WINAPI system_time_source_GetProperties(IMFPresentationTimeSource *iface, MFCLOCK_PROPERTIES *props)
{ {
FIXME("%p, %p.\n", iface, props); TRACE("%p, %p.\n", iface, props);
return E_NOTIMPL; if (!props)
return E_POINTER;
memset(props, 0, sizeof(*props));
props->qwClockFrequency = MFCLOCK_FREQUENCY_HNS;
props->dwClockTolerance = MFCLOCK_TOLERANCE_UNKNOWN;
props->dwClockJitter = 1;
return S_OK;
} }
static HRESULT WINAPI system_time_source_GetUnderlyingClock(IMFPresentationTimeSource *iface, IMFClock **clock) static HRESULT WINAPI system_time_source_GetUnderlyingClock(IMFPresentationTimeSource *iface, IMFClock **clock)

View File

@ -2542,6 +2542,7 @@ static void test_system_time_source(void)
}; };
IMFPresentationTimeSource *time_source; IMFPresentationTimeSource *time_source;
IMFClockStateSink *statesink; IMFClockStateSink *statesink;
MFCLOCK_PROPERTIES props;
MFCLOCK_STATE state; MFCLOCK_STATE state;
unsigned int i; unsigned int i;
DWORD value; DWORD value;
@ -2595,6 +2596,22 @@ static void test_system_time_source(void)
IMFClockStateSink_Release(statesink); IMFClockStateSink_Release(statesink);
/* Properties. */
hr = IMFPresentationTimeSource_GetProperties(time_source, NULL);
ok(hr == E_POINTER, "Unexpected hr %#x.\n", hr);
hr = IMFPresentationTimeSource_GetProperties(time_source, &props);
ok(hr == S_OK, "Failed to get clock properties, hr %#x.\n", hr);
ok(props.qwCorrelationRate == 0, "Unexpected correlation rate %s.\n",
wine_dbgstr_longlong(props.qwCorrelationRate));
ok(IsEqualGUID(&props.guidClockId, &GUID_NULL), "Unexpected clock id %s.\n", wine_dbgstr_guid(&props.guidClockId));
ok(props.dwClockFlags == 0, "Unexpected flags %#x.\n", props.dwClockFlags);
ok(props.qwClockFrequency == MFCLOCK_FREQUENCY_HNS, "Unexpected frequency %s.\n",
wine_dbgstr_longlong(props.qwClockFrequency));
ok(props.dwClockTolerance == MFCLOCK_TOLERANCE_UNKNOWN, "Unexpected tolerance %u.\n", props.dwClockTolerance);
ok(props.dwClockJitter == 1, "Unexpected jitter %u.\n", props.dwClockJitter);
IMFPresentationTimeSource_Release(time_source); IMFPresentationTimeSource_Release(time_source);
} }

View File

@ -47,6 +47,12 @@ typedef enum MF_OBJECT_TYPE
MF_OBJECT_INVALID MF_OBJECT_INVALID
} MF_OBJECT_TYPE; } MF_OBJECT_TYPE;
cpp_quote("#define MFCLOCK_FREQUENCY_HNS 10000000")
cpp_quote("#define MFCLOCK_TOLERANCE_UNKNOWN 50000")
cpp_quote("#define MFCLOCK_JITTER_ISR 1000")
cpp_quote("#define MFCLOCK_JITTER_DPC 4000")
cpp_quote("#define MFCLOCK_JITTER_PASSIVE 10000")
typedef struct _MFCLOCK_PROPERTIES typedef struct _MFCLOCK_PROPERTIES
{ {
unsigned __int64 qwCorrelationRate; unsigned __int64 qwCorrelationRate;