Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/mfplat/queue.c | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/dlls/mfplat/queue.c b/dlls/mfplat/queue.c index 1b9ef38a4e..96dd6dec4d 100644 --- a/dlls/mfplat/queue.c +++ b/dlls/mfplat/queue.c @@ -185,6 +185,8 @@ static HRESULT grab_queue(DWORD queue_id, struct queue **ret) MFASYNC_WORKQUEUE_TYPE queue_type; struct queue_handle *entry;
+ *ret = NULL; + if (!system_queues[SYS_QUEUE_STANDARD].pool) return MF_E_SHUTDOWN;
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/mfplat/queue.c | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/dlls/mfplat/queue.c b/dlls/mfplat/queue.c index 96dd6dec4d..408526fec0 100644 --- a/dlls/mfplat/queue.c +++ b/dlls/mfplat/queue.c @@ -577,6 +577,8 @@ static HRESULT alloc_user_queue(MFASYNC_WORKQUEUE_TYPE queue_type, DWORD *queue_ else { LeaveCriticalSection(&queues_section); + heap_free(queue); + WARN("Out of user queue handles.\n"); return E_OUTOFMEMORY; }
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/mfplat/main.c | 215 +++++++++++++++++++++++++++++++++++++ dlls/mfplat/mfplat.spec | 2 +- dlls/mfplat/tests/mfplat.c | 34 ++++++ include/mfidl.idl | 8 ++ 4 files changed, 258 insertions(+), 1 deletion(-)
diff --git a/dlls/mfplat/main.c b/dlls/mfplat/main.c index 2d7e02e473..4ce97b1ffd 100644 --- a/dlls/mfplat/main.c +++ b/dlls/mfplat/main.c @@ -39,6 +39,23 @@ WINE_DEFAULT_DEBUG_CHANNEL(mfplat);
static LONG platform_lock;
+struct system_time_source +{ + IMFPresentationTimeSource IMFPresentationTimeSource_iface; + IMFClockStateSink IMFClockStateSink_iface; + LONG refcount; +}; + +static struct system_time_source *impl_from_IMFPresentationTimeSource(IMFPresentationTimeSource *iface) +{ + return CONTAINING_RECORD(iface, struct system_time_source, IMFPresentationTimeSource_iface); +} + +static struct system_time_source *impl_from_IMFClockStateSink(IMFClockStateSink *iface) +{ + return CONTAINING_RECORD(iface, struct system_time_source, IMFClockStateSink_iface); +} + static const WCHAR transform_keyW[] = {'M','e','d','i','a','F','o','u','n','d','a','t','i','o','n','\', 'T','r','a','n','s','f','o','r','m','s',0}; static const WCHAR categories_keyW[] = {'M','e','d','i','a','F','o','u','n','d','a','t','i','o','n','\', @@ -3023,3 +3040,201 @@ HRESULT WINAPI MFCreateMFByteStreamOnStreamEx(IUnknown *stream, IMFByteStream **
return E_NOTIMPL; } + +static HRESULT WINAPI system_time_source_QueryInterface(IMFPresentationTimeSource *iface, REFIID riid, void **obj) +{ + struct system_time_source *source = impl_from_IMFPresentationTimeSource(iface); + + TRACE("%p, %s, %p.\n", iface, debugstr_guid(riid), obj); + + if (IsEqualIID(riid, &IID_IMFPresentationTimeSource) || + IsEqualIID(riid, &IID_IUnknown)) + { + *obj = &source->IMFPresentationTimeSource_iface; + } + else if (IsEqualIID(riid, &IID_IMFClockStateSink)) + { + *obj = &source->IMFClockStateSink_iface; + } + else + { + WARN("Unsupported %s.\n", debugstr_guid(riid)); + *obj = NULL; + return E_NOINTERFACE; + } + + IUnknown_AddRef((IUnknown *)*obj); + return S_OK; +} + +static ULONG WINAPI system_time_source_AddRef(IMFPresentationTimeSource *iface) +{ + struct system_time_source *source = impl_from_IMFPresentationTimeSource(iface); + ULONG refcount = InterlockedIncrement(&source->refcount); + + TRACE("%p, refcount %u.\n", iface, refcount); + + return refcount; +} + +static ULONG WINAPI system_time_source_Release(IMFPresentationTimeSource *iface) +{ + struct system_time_source *source = impl_from_IMFPresentationTimeSource(iface); + ULONG refcount = InterlockedDecrement(&source->refcount); + + TRACE("%p, refcount %u.\n", iface, refcount); + + if (!refcount) + heap_free(source); + + return refcount; +} + +static HRESULT WINAPI system_time_source_GetClockCharacteristics(IMFPresentationTimeSource *iface, DWORD *flags) +{ + TRACE("%p, %p.\n", iface, flags); + + *flags = MFCLOCK_CHARACTERISTICS_FLAG_FREQUENCY_10MHZ | MFCLOCK_CHARACTERISTICS_FLAG_IS_SYSTEM_CLOCK; + + return S_OK; +} + +static HRESULT WINAPI system_time_source_GetCorrelatedTime(IMFPresentationTimeSource *iface, DWORD reserved, + LONGLONG *clock_time, MFTIME *system_time) +{ + FIXME("%p, %#x, %p, %p.\n", iface, reserved, clock_time, system_time); + + return E_NOTIMPL; +} + + +static HRESULT WINAPI system_time_source_GetContinuityKey(IMFPresentationTimeSource *iface, DWORD *key) +{ + TRACE("%p, %p.\n", iface, key); + + *key = 0; + + return S_OK; +} + +static HRESULT WINAPI system_time_source_GetState(IMFPresentationTimeSource *iface, DWORD reserved, + MFCLOCK_STATE *state) +{ + FIXME("%p, %#x, %p.\n", iface, reserved, state); + + return E_NOTIMPL; +} + +static HRESULT WINAPI system_time_source_GetProperties(IMFPresentationTimeSource *iface, MFCLOCK_PROPERTIES *props) +{ + FIXME("%p, %p.\n", iface, props); + + return E_NOTIMPL; +} + +static HRESULT WINAPI system_time_source_GetUnderlyingClock(IMFPresentationTimeSource *iface, IMFClock **clock) +{ + FIXME("%p, %p.\n", iface, clock); + + return E_NOTIMPL; +} + +static const IMFPresentationTimeSourceVtbl systemtimesourcevtbl = +{ + system_time_source_QueryInterface, + system_time_source_AddRef, + system_time_source_Release, + system_time_source_GetClockCharacteristics, + system_time_source_GetCorrelatedTime, + system_time_source_GetContinuityKey, + system_time_source_GetState, + system_time_source_GetProperties, + system_time_source_GetUnderlyingClock, +}; + +static HRESULT WINAPI system_time_source_sink_QueryInterface(IMFClockStateSink *iface, REFIID riid, void **out) +{ + struct system_time_source *source = impl_from_IMFClockStateSink(iface); + return IMFPresentationTimeSource_QueryInterface(&source->IMFPresentationTimeSource_iface, riid, out); +} + +static ULONG WINAPI system_time_source_sink_AddRef(IMFClockStateSink *iface) +{ + struct system_time_source *source = impl_from_IMFClockStateSink(iface); + return IMFPresentationTimeSource_AddRef(&source->IMFPresentationTimeSource_iface); +} + +static ULONG WINAPI system_time_source_sink_Release(IMFClockStateSink *iface) +{ + struct system_time_source *source = impl_from_IMFClockStateSink(iface); + return IMFPresentationTimeSource_Release(&source->IMFPresentationTimeSource_iface); +} + +static HRESULT WINAPI system_time_source_sink_OnClockStart(IMFClockStateSink *iface, MFTIME system_time, LONGLONG start_offset) +{ + FIXME("%p, %s, %s.\n", iface, wine_dbgstr_longlong(system_time), wine_dbgstr_longlong(start_offset)); + + return E_NOTIMPL; +} + +static HRESULT WINAPI system_time_source_sink_OnClockStop(IMFClockStateSink *iface, MFTIME system_time) +{ + FIXME("%p, %s.\n", iface, wine_dbgstr_longlong(system_time)); + + return E_NOTIMPL; +} + +static HRESULT WINAPI system_time_source_sink_OnClockPause(IMFClockStateSink *iface, MFTIME system_time) +{ + FIXME("%p, %s.\n", iface, wine_dbgstr_longlong(system_time)); + + return E_NOTIMPL; +} + +static HRESULT WINAPI system_time_source_sink_OnClockRestart(IMFClockStateSink *iface, MFTIME system_time) +{ + FIXME("%p, %s.\n", iface, wine_dbgstr_longlong(system_time)); + + return E_NOTIMPL; +} + +static HRESULT WINAPI system_time_source_sink_OnClockSetRate(IMFClockStateSink *iface, MFTIME system_time, float rate) +{ + FIXME("%p, %s, %f.\n", iface, wine_dbgstr_longlong(system_time), rate); + + return E_NOTIMPL; +} + +static const IMFClockStateSinkVtbl systemtimesourcesinkvtbl = +{ + system_time_source_sink_QueryInterface, + system_time_source_sink_AddRef, + system_time_source_sink_Release, + system_time_source_sink_OnClockStart, + system_time_source_sink_OnClockStop, + system_time_source_sink_OnClockPause, + system_time_source_sink_OnClockRestart, + system_time_source_sink_OnClockSetRate, +}; + +/*********************************************************************** + * MFCreateSystemTimeSource (mfplat.@) + */ +HRESULT WINAPI MFCreateSystemTimeSource(IMFPresentationTimeSource **time_source) +{ + struct system_time_source *object; + + TRACE("%p.\n", time_source); + + object = heap_alloc(sizeof(*object)); + if (!object) + return E_OUTOFMEMORY; + + object->IMFPresentationTimeSource_iface.lpVtbl = &systemtimesourcevtbl; + object->IMFClockStateSink_iface.lpVtbl = &systemtimesourcesinkvtbl; + object->refcount = 1; + + *time_source = &object->IMFPresentationTimeSource_iface; + + return S_OK; +} diff --git a/dlls/mfplat/mfplat.spec b/dlls/mfplat/mfplat.spec index 900efc3780..c47af72ed8 100644 --- a/dlls/mfplat/mfplat.spec +++ b/dlls/mfplat/mfplat.spec @@ -61,7 +61,7 @@ @ stub MFCreateSocketListener @ stdcall MFCreateSourceResolver(ptr) @ stdcall MFCreateStreamDescriptor(long long ptr ptr) -@ stub MFCreateSystemTimeSource +@ stdcall MFCreateSystemTimeSource(ptr) @ stub MFCreateSystemUnderlyingClock @ stub MFCreateTempFile @ stub MFCreateTransformActivate diff --git a/dlls/mfplat/tests/mfplat.c b/dlls/mfplat/tests/mfplat.c index 19ec6ec6d1..cb3f2a9e7d 100644 --- a/dlls/mfplat/tests/mfplat.c +++ b/dlls/mfplat/tests/mfplat.c @@ -1598,6 +1598,39 @@ static void test_presentation_descriptor(void) IMFMediaType_Release(media_type); }
+static void test_system_time_source(void) +{ + IMFPresentationTimeSource *time_source; + IMFClockStateSink *statesink; + MFCLOCK_STATE state; + DWORD value; + HRESULT hr; + + hr = MFCreateSystemTimeSource(&time_source); + ok(hr == S_OK, "Failed to create time source, hr %#x.\n", hr); + + hr = IMFPresentationTimeSource_GetClockCharacteristics(time_source, &value); + ok(hr == S_OK, "Failed to get flags, hr %#x.\n", hr); + ok(value == (MFCLOCK_CHARACTERISTICS_FLAG_FREQUENCY_10MHZ | MFCLOCK_CHARACTERISTICS_FLAG_IS_SYSTEM_CLOCK), + "Unexpected flags %#x.\n", value); + + value = 1; + hr = IMFPresentationTimeSource_GetContinuityKey(time_source, &value); + ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(value == 0, "Unexpected value %u.\n", value); + + hr = IMFPresentationTimeSource_GetState(time_source, 0, &state); +todo_wine { + ok(hr == S_OK, "Failed to get state, hr %#x.\n", hr); + ok(state == MFCLOCK_STATE_INVALID, "Unexpected state %d.\n", state); +} + hr = IMFPresentationTimeSource_QueryInterface(time_source, &IID_IMFClockStateSink, (void **)&statesink); + ok(hr == S_OK, "Failed to get state sink, hr %#x.\n", hr); + IMFClockStateSink_Release(statesink); + + IMFPresentationTimeSource_Release(time_source); +} + START_TEST(mfplat) { CoInitialize(NULL); @@ -1624,6 +1657,7 @@ START_TEST(mfplat) test_periodic_callback(); test_event_queue(); test_presentation_descriptor(); + test_system_time_source();
CoUninitialize(); } diff --git a/include/mfidl.idl b/include/mfidl.idl index 21157ee95d..252099e145 100644 --- a/include/mfidl.idl +++ b/include/mfidl.idl @@ -57,6 +57,13 @@ typedef struct _MFCLOCK_PROPERTIES DWORD dwClockJitter; } MFCLOCK_PROPERTIES;
+typedef enum _MFCLOCK_CHARACTERISTICS_FLAGS +{ + MFCLOCK_CHARACTERISTICS_FLAG_FREQUENCY_10MHZ = 0x00000002, + MFCLOCK_CHARACTERISTICS_FLAG_ALWAYS_RUNNING = 0x00000004, + MFCLOCK_CHARACTERISTICS_FLAG_IS_SYSTEM_CLOCK = 0x00000008, +} MFCLOCK_CHARACTERISTICS_FLAGS; + [ object, uuid(2eb1e945-18b8-4139-9b1a-d5d584818530), @@ -357,6 +364,7 @@ cpp_quote("HRESULT WINAPI MFCreateSequencerSource(IUnknown *reserved, IMFSequenc cpp_quote("HRESULT WINAPI MFCreateSourceResolver(IMFSourceResolver **resolver);") cpp_quote("HRESULT WINAPI MFCreateStreamDescriptor(DWORD identifier, DWORD cMediaTypes,") cpp_quote(" IMFMediaType **types, IMFStreamDescriptor **descriptor);") +cpp_quote("HRESULT WINAPI MFCreateSystemTimeSource(IMFPresentationTimeSource **time_source);") cpp_quote("HRESULT WINAPI MFCreateTopology(IMFTopology **topology);") cpp_quote("HRESULT WINAPI MFCreateTopologyNode(MF_TOPOLOGY_TYPE node_type, IMFTopologyNode **node);") cpp_quote("HRESULT WINAPI MFCreateTopoLoader(IMFTopoLoader **loader);")
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/mfplat/main.c | 112 ++++++++++++++++++++++++++++++++----- dlls/mfplat/tests/mfplat.c | 65 ++++++++++++++++++++- 2 files changed, 162 insertions(+), 15 deletions(-)
diff --git a/dlls/mfplat/main.c b/dlls/mfplat/main.c index 4ce97b1ffd..6bec41884e 100644 --- a/dlls/mfplat/main.c +++ b/dlls/mfplat/main.c @@ -1,5 +1,4 @@ /* - * * Copyright 2014 Austin English * * This library is free software; you can redistribute it and/or @@ -44,6 +43,8 @@ struct system_time_source IMFPresentationTimeSource IMFPresentationTimeSource_iface; IMFClockStateSink IMFClockStateSink_iface; LONG refcount; + MFCLOCK_STATE state; + CRITICAL_SECTION cs; };
static struct system_time_source *impl_from_IMFPresentationTimeSource(IMFPresentationTimeSource *iface) @@ -3085,7 +3086,10 @@ static ULONG WINAPI system_time_source_Release(IMFPresentationTimeSource *iface) TRACE("%p, refcount %u.\n", iface, refcount);
if (!refcount) + { + DeleteCriticalSection(&source->cs); heap_free(source); + }
return refcount; } @@ -3120,9 +3124,15 @@ static HRESULT WINAPI system_time_source_GetContinuityKey(IMFPresentationTimeSou static HRESULT WINAPI system_time_source_GetState(IMFPresentationTimeSource *iface, DWORD reserved, MFCLOCK_STATE *state) { - FIXME("%p, %#x, %p.\n", iface, reserved, state); + struct system_time_source *source = impl_from_IMFPresentationTimeSource(iface);
- return E_NOTIMPL; + TRACE("%p, %#x, %p.\n", iface, reserved, state); + + EnterCriticalSection(&source->cs); + *state = source->state; + LeaveCriticalSection(&source->cs); + + return S_OK; }
static HRESULT WINAPI system_time_source_GetProperties(IMFPresentationTimeSource *iface, MFCLOCK_PROPERTIES *props) @@ -3170,32 +3180,107 @@ static ULONG WINAPI system_time_source_sink_Release(IMFClockStateSink *iface) return IMFPresentationTimeSource_Release(&source->IMFPresentationTimeSource_iface); }
-static HRESULT WINAPI system_time_source_sink_OnClockStart(IMFClockStateSink *iface, MFTIME system_time, LONGLONG start_offset) +enum clock_command { - FIXME("%p, %s, %s.\n", iface, wine_dbgstr_longlong(system_time), wine_dbgstr_longlong(start_offset)); + CLOCK_CMD_START = 0, + CLOCK_CMD_STOP, + CLOCK_CMD_PAUSE, + CLOCK_CMD_RESTART, + CLOCK_CMD_MAX, +};
- return E_NOTIMPL; +static HRESULT system_time_source_change_state(struct system_time_source *source, enum clock_command command) +{ + static const BYTE state_change_is_allowed[MFCLOCK_STATE_PAUSED+1][CLOCK_CMD_MAX] = + { /* S S* P R */ + /* INVALID */ { 1, 0, 1, 0 }, + /* RUNNING */ { 1, 1, 1, 0 }, + /* STOPPED */ { 1, 1, 0, 0 }, + /* PAUSED */ { 1, 1, 0, 1 }, + }; + static const MFCLOCK_STATE states[CLOCK_CMD_MAX] = + { + /* CLOCK_CMD_START */ MFCLOCK_STATE_RUNNING, + /* CLOCK_CMD_STOP */ MFCLOCK_STATE_STOPPED, + /* CLOCK_CMD_PAUSE */ MFCLOCK_STATE_PAUSED, + /* CLOCK_CMD_RESTART */ MFCLOCK_STATE_RUNNING, + }; + + /* Special case that go against usual state change vs return value behavior. */ + if (source->state == MFCLOCK_STATE_INVALID && command == CLOCK_CMD_STOP) + return S_OK; + + if (!state_change_is_allowed[source->state][command]) + return MF_E_INVALIDREQUEST; + + source->state = states[command]; + + return S_OK; +} + +static HRESULT WINAPI system_time_source_sink_OnClockStart(IMFClockStateSink *iface, MFTIME system_time, + LONGLONG start_offset) +{ + struct system_time_source *source = impl_from_IMFClockStateSink(iface); + HRESULT hr; + + TRACE("%p, %s, %s.\n", iface, wine_dbgstr_longlong(system_time), wine_dbgstr_longlong(start_offset)); + + EnterCriticalSection(&source->cs); + hr = system_time_source_change_state(source, CLOCK_CMD_START); + LeaveCriticalSection(&source->cs); + + /* FIXME: update timestamps */ + + return hr; }
static HRESULT WINAPI system_time_source_sink_OnClockStop(IMFClockStateSink *iface, MFTIME system_time) { - FIXME("%p, %s.\n", iface, wine_dbgstr_longlong(system_time)); + struct system_time_source *source = impl_from_IMFClockStateSink(iface); + HRESULT hr;
- return E_NOTIMPL; + TRACE("%p, %s.\n", iface, wine_dbgstr_longlong(system_time)); + + EnterCriticalSection(&source->cs); + hr = system_time_source_change_state(source, CLOCK_CMD_STOP); + LeaveCriticalSection(&source->cs); + + /* FIXME: update timestamps */ + + return hr; }
static HRESULT WINAPI system_time_source_sink_OnClockPause(IMFClockStateSink *iface, MFTIME system_time) { - FIXME("%p, %s.\n", iface, wine_dbgstr_longlong(system_time)); + struct system_time_source *source = impl_from_IMFClockStateSink(iface); + HRESULT hr;
- return E_NOTIMPL; + TRACE("%p, %s.\n", iface, wine_dbgstr_longlong(system_time)); + + EnterCriticalSection(&source->cs); + hr = system_time_source_change_state(source, CLOCK_CMD_PAUSE); + LeaveCriticalSection(&source->cs); + + /* FIXME: update timestamps */ + + return hr; }
static HRESULT WINAPI system_time_source_sink_OnClockRestart(IMFClockStateSink *iface, MFTIME system_time) { - FIXME("%p, %s.\n", iface, wine_dbgstr_longlong(system_time)); + struct system_time_source *source = impl_from_IMFClockStateSink(iface); + HRESULT hr;
- return E_NOTIMPL; + TRACE("%p, %s.\n", iface, wine_dbgstr_longlong(system_time)); + + EnterCriticalSection(&source->cs); + hr = system_time_source_change_state(source, CLOCK_CMD_RESTART); + LeaveCriticalSection(&source->cs); + + /* FIXME: update timestamps */ + + return hr; }
static HRESULT WINAPI system_time_source_sink_OnClockSetRate(IMFClockStateSink *iface, MFTIME system_time, float rate) @@ -3226,13 +3311,14 @@ HRESULT WINAPI MFCreateSystemTimeSource(IMFPresentationTimeSource **time_source)
TRACE("%p.\n", time_source);
- object = heap_alloc(sizeof(*object)); + object = heap_alloc_zero(sizeof(*object)); if (!object) return E_OUTOFMEMORY;
object->IMFPresentationTimeSource_iface.lpVtbl = &systemtimesourcevtbl; object->IMFClockStateSink_iface.lpVtbl = &systemtimesourcesinkvtbl; object->refcount = 1; + InitializeCriticalSection(&object->cs);
*time_source = &object->IMFPresentationTimeSource_iface;
diff --git a/dlls/mfplat/tests/mfplat.c b/dlls/mfplat/tests/mfplat.c index cb3f2a9e7d..c4685a30fe 100644 --- a/dlls/mfplat/tests/mfplat.c +++ b/dlls/mfplat/tests/mfplat.c @@ -1598,11 +1598,46 @@ static void test_presentation_descriptor(void) IMFMediaType_Release(media_type); }
+enum clock_action +{ + CLOCK_START, + CLOCK_STOP, + CLOCK_PAUSE, + CLOCK_RESTART, +}; + static void test_system_time_source(void) { + static const struct clock_state_test + { + enum clock_action action; + MFCLOCK_STATE state; + BOOL is_invalid; + } + clock_state_change[] = + { + { CLOCK_STOP, MFCLOCK_STATE_INVALID }, + { CLOCK_RESTART, MFCLOCK_STATE_INVALID, TRUE }, + { CLOCK_PAUSE, MFCLOCK_STATE_PAUSED }, + { CLOCK_PAUSE, MFCLOCK_STATE_PAUSED, TRUE }, + { CLOCK_STOP, MFCLOCK_STATE_STOPPED }, + { CLOCK_STOP, MFCLOCK_STATE_STOPPED }, + { CLOCK_RESTART, MFCLOCK_STATE_STOPPED, TRUE }, + { CLOCK_START, MFCLOCK_STATE_RUNNING }, + { CLOCK_START, MFCLOCK_STATE_RUNNING }, + { CLOCK_RESTART, MFCLOCK_STATE_RUNNING, TRUE }, + { CLOCK_PAUSE, MFCLOCK_STATE_PAUSED }, + { CLOCK_START, MFCLOCK_STATE_RUNNING }, + { CLOCK_PAUSE, MFCLOCK_STATE_PAUSED }, + { CLOCK_RESTART, MFCLOCK_STATE_RUNNING }, + { CLOCK_RESTART, MFCLOCK_STATE_RUNNING, TRUE }, + { CLOCK_STOP, MFCLOCK_STATE_STOPPED }, + { CLOCK_PAUSE, MFCLOCK_STATE_STOPPED, TRUE }, + }; IMFPresentationTimeSource *time_source; IMFClockStateSink *statesink; MFCLOCK_STATE state; + unsigned int i; DWORD value; HRESULT hr;
@@ -1620,12 +1655,38 @@ static void test_system_time_source(void) ok(value == 0, "Unexpected value %u.\n", value);
hr = IMFPresentationTimeSource_GetState(time_source, 0, &state); -todo_wine { ok(hr == S_OK, "Failed to get state, hr %#x.\n", hr); ok(state == MFCLOCK_STATE_INVALID, "Unexpected state %d.\n", state); -} + hr = IMFPresentationTimeSource_QueryInterface(time_source, &IID_IMFClockStateSink, (void **)&statesink); ok(hr == S_OK, "Failed to get state sink, hr %#x.\n", hr); + + /* State changes. */ + for (i = 0; i < ARRAY_SIZE(clock_state_change); ++i) + { + switch (clock_state_change[i].action) + { + case CLOCK_STOP: + hr = IMFClockStateSink_OnClockStop(statesink, 0); + break; + case CLOCK_RESTART: + hr = IMFClockStateSink_OnClockRestart(statesink, 0); + break; + case CLOCK_PAUSE: + hr = IMFClockStateSink_OnClockPause(statesink, 0); + break; + case CLOCK_START: + hr = IMFClockStateSink_OnClockStart(statesink, 0, 0); + break; + default: + ; + } + ok(hr == (clock_state_change[i].is_invalid ? MF_E_INVALIDREQUEST : S_OK), "%u: unexpected hr %#x.\n", i, hr); + hr = IMFPresentationTimeSource_GetState(time_source, 0, &state); + ok(hr == S_OK, "%u: failed to get state, hr %#x.\n", i, hr); + ok(state == clock_state_change[i].state, "%u: unexpected state %d.\n", i, state); + } + IMFClockStateSink_Release(statesink);
IMFPresentationTimeSource_Release(time_source);
Hi,
While running your changed tests on Windows, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=48837
Your paranoid android.
=== wxppro (32 bit report) ===
mfplat: 0b40:mfplat: unhandled exception c0000005 at 0BF0B786
Report errors: mfplat:mfplat returned success despite having failures
On 3/6/19 1:35 PM, Marvin wrote:
Hi,
While running your changed tests on Windows, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=48837
Your paranoid android.
=== wxppro (32 bit report) ===
mfplat: 0b40:mfplat: unhandled exception c0000005 at 0BF0B786
Report errors: mfplat:mfplat returned success despite having failures
Unfortunately this crash does not reproduce consistently and is not related to the patch, I suspect it's something to do with event queue tests. I'll look into it after this batch is in, if it's okay.
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/mfplat/tests/mfplat.c | 2 -- include/mfapi.h | 15 +++++++++++++++ 2 files changed, 15 insertions(+), 2 deletions(-)
diff --git a/dlls/mfplat/tests/mfplat.c b/dlls/mfplat/tests/mfplat.c index c4685a30fe..2f4db9b219 100644 --- a/dlls/mfplat/tests/mfplat.c +++ b/dlls/mfplat/tests/mfplat.c @@ -55,8 +55,6 @@ DEFINE_GUID(MF_BYTESTREAM_CONTENT_TYPE, 0xfc358289,0x3cb6,0x460c,0xa4,0x24,0xb6,
DEFINE_GUID(MF_READWRITE_ENABLE_HARDWARE_TRANSFORMS, 0xa634a91c, 0x822b, 0x41b9, 0xa4, 0x94, 0x4d, 0xe4, 0x64, 0x36, 0x12, 0xb0);
-DEFINE_GUID(MFT_CATEGORY_OTHER, 0x90175d57,0xb7ea,0x4901,0xae,0xb3,0x93,0x3a,0x87,0x47,0x75,0x6f); - DEFINE_GUID(DUMMY_CLSID, 0x12345678,0x1234,0x1234,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19); DEFINE_GUID(DUMMY_GUID1, 0x12345678,0x1234,0x1234,0x21,0x21,0x21,0x21,0x21,0x21,0x21,0x21); DEFINE_GUID(DUMMY_GUID2, 0x12345678,0x1234,0x1234,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22); diff --git a/include/mfapi.h b/include/mfapi.h index 4062e2fd13..0c5162755d 100644 --- a/include/mfapi.h +++ b/include/mfapi.h @@ -76,6 +76,10 @@ typedef enum _EAllocationType eAllocationTypeIgnore } EAllocationType;
+#ifdef MF_INIT_GUIDS +#include <initguid.h> +#endif + DEFINE_GUID(MF_MT_AVG_BITRATE, 0x20332624, 0xfb0d, 0x4d9e, 0xbd, 0x0d, 0xcb, 0xf6, 0x78, 0x6c, 0x10, 0x2e); DEFINE_GUID(MF_MT_FRAME_RATE, 0xc459a2e8, 0x3d2c, 0x4e44, 0xb1, 0x32, 0xfe, 0xe5, 0x15, 0x6c, 0x7b, 0xb0); DEFINE_GUID(MF_MT_FRAME_SIZE, 0x1652c33d, 0xd6b2, 0x4012, 0xb8, 0x34, 0x72, 0x03, 0x08, 0x49, 0xa3, 0x7d); @@ -86,6 +90,17 @@ DEFINE_GUID(MF_MT_SUBTYPE, 0xf7e34c9a, 0x42e8, 0x4714, 0xb7, 0x4b, 0
DEFINE_GUID(MFMediaType_Video, 0x73646976, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
+DEFINE_GUID(MFT_CATEGORY_VIDEO_DECODER, 0xd6c02d4b, 0x6833, 0x45b4, 0x97, 0x1a, 0x05, 0xa4, 0xb0, 0x4b, 0xab, 0x91); +DEFINE_GUID(MFT_CATEGORY_VIDEO_ENCODER, 0xf79eac7d, 0xe545, 0x4387, 0xbd, 0xee, 0xd6, 0x47, 0xd7, 0xbd, 0xe4, 0x2a); +DEFINE_GUID(MFT_CATEGORY_VIDEO_EFFECT, 0x12e17c21, 0x532c, 0x4a6e, 0x8a, 0x1c, 0x40, 0x82, 0x5a, 0x73, 0x63, 0x97); +DEFINE_GUID(MFT_CATEGORY_MULTIPLEXER, 0x059c561e, 0x05ae, 0x4b61, 0xb6, 0x9d, 0x55, 0xb6, 0x1e, 0xe5, 0x4a, 0x7b); +DEFINE_GUID(MFT_CATEGORY_DEMULTIPLEXER, 0xa8700a7a, 0x939b, 0x44c5, 0x99, 0xd7, 0x76, 0x22, 0x6b, 0x23, 0xb3, 0xf1); +DEFINE_GUID(MFT_CATEGORY_AUDIO_DECODER, 0x9ea73fb4, 0xef7a, 0x4559, 0x8d, 0x5d, 0x71, 0x9d, 0x8f, 0x04, 0x26, 0xc7); +DEFINE_GUID(MFT_CATEGORY_AUDIO_ENCODER, 0x91c64bd0, 0xf91e, 0x4d8c, 0x92, 0x76, 0xdb, 0x24, 0x82, 0x79, 0xd9, 0x75); +DEFINE_GUID(MFT_CATEGORY_AUDIO_EFFECT, 0x11064c48, 0x3648, 0x4ed0, 0x93, 0x2e, 0x05, 0xce, 0x8a, 0xc8, 0x11, 0xb7); +DEFINE_GUID(MFT_CATEGORY_VIDEO_PROCESSOR, 0x302ea3fc, 0xaa5f, 0x47f9, 0x9f, 0x7a, 0xc2, 0x18, 0x8b, 0xb1, 0x63, 0x02); +DEFINE_GUID(MFT_CATEGORY_OTHER, 0x90175d57, 0xb7ea, 0x4901, 0xae, 0xb3, 0x93, 0x3a, 0x87, 0x47, 0x75, 0x6f); + typedef unsigned __int64 MFWORKITEM_KEY;
typedef enum