From ac2038ef308557927500dfeae12a71c24ebbd916 Mon Sep 17 00:00:00 2001 From: Nikolay Sivov Date: Mon, 20 May 2019 15:25:57 +0300 Subject: [PATCH] mfplat: Return properties for system time source. Signed-off-by: Nikolay Sivov Signed-off-by: Alexandre Julliard --- dlls/mfplat/main.c | 12 ++++++++++-- dlls/mfplat/tests/mfplat.c | 17 +++++++++++++++++ include/mfidl.idl | 6 ++++++ 3 files changed, 33 insertions(+), 2 deletions(-) diff --git a/dlls/mfplat/main.c b/dlls/mfplat/main.c index e80408d2b2a..77edabec2cb 100644 --- a/dlls/mfplat/main.c +++ b/dlls/mfplat/main.c @@ -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) { - 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) diff --git a/dlls/mfplat/tests/mfplat.c b/dlls/mfplat/tests/mfplat.c index 7fa3ddd8764..4adfb1b8ad2 100644 --- a/dlls/mfplat/tests/mfplat.c +++ b/dlls/mfplat/tests/mfplat.c @@ -2542,6 +2542,7 @@ static void test_system_time_source(void) }; IMFPresentationTimeSource *time_source; IMFClockStateSink *statesink; + MFCLOCK_PROPERTIES props; MFCLOCK_STATE state; unsigned int i; DWORD value; @@ -2595,6 +2596,22 @@ static void test_system_time_source(void) 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); } diff --git a/include/mfidl.idl b/include/mfidl.idl index c024e67378b..8855c9a859e 100644 --- a/include/mfidl.idl +++ b/include/mfidl.idl @@ -47,6 +47,12 @@ typedef enum MF_OBJECT_TYPE MF_OBJECT_INVALID } 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 { unsigned __int64 qwCorrelationRate;