Module: wine Branch: master Commit: ac2038ef308557927500dfeae12a71c24ebbd916 URL: https://source.winehq.org/git/wine.git/?a=commit;h=ac2038ef308557927500dfeae...
Author: Nikolay Sivov nsivov@codeweavers.com Date: Mon May 20 15:25:57 2019 +0300
mfplat: Return properties for system time source.
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
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 e80408d..77edabe 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 7fa3ddd..4adfb1b8 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 c024e67..8855c9a 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;