Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/mf/session.c | 48 ++++++++++++++++++++++++++++++++++--------- dlls/mf/tests/mf.c | 51 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 89 insertions(+), 10 deletions(-)
diff --git a/dlls/mf/session.c b/dlls/mf/session.c index 5034255339c..af58a47ed7a 100644 --- a/dlls/mf/session.c +++ b/dlls/mf/session.c @@ -319,12 +319,19 @@ struct presentation_clock BOOL is_shut_down; };
+enum quality_manager_state +{ + QUALITY_MANAGER_READY = 0, + QUALITY_MANAGER_SHUT_DOWN, +}; + struct quality_manager { IMFQualityManager IMFQualityManager_iface; LONG refcount;
IMFPresentationClock *clock; + unsigned int state; CRITICAL_SECTION cs; };
@@ -4794,24 +4801,35 @@ static HRESULT WINAPI standard_quality_manager_NotifyTopology(IMFQualityManager return S_OK; }
+static void standard_quality_manager_release_clock(struct quality_manager *manager) +{ + if (manager->clock) + IMFPresentationClock_Release(manager->clock); + manager->clock = NULL; +} + static HRESULT WINAPI standard_quality_manager_NotifyPresentationClock(IMFQualityManager *iface, IMFPresentationClock *clock) { struct quality_manager *manager = impl_from_IMFQualityManager(iface); + HRESULT hr = S_OK;
TRACE("%p, %p.\n", iface, clock);
- if (!clock) - return E_POINTER; - EnterCriticalSection(&manager->cs); - if (manager->clock) - IMFPresentationClock_Release(manager->clock); - manager->clock = clock; - IMFPresentationClock_AddRef(manager->clock); + if (manager->state == QUALITY_MANAGER_SHUT_DOWN) + hr = MF_E_SHUTDOWN; + else if (!clock) + hr = E_POINTER; + else + { + standard_quality_manager_release_clock(manager); + manager->clock = clock; + IMFPresentationClock_AddRef(manager->clock); + } LeaveCriticalSection(&manager->cs);
- return S_OK; + return hr; }
static HRESULT WINAPI standard_quality_manager_NotifyProcessInput(IMFQualityManager *iface, IMFTopologyNode *node, @@ -4840,9 +4858,19 @@ static HRESULT WINAPI standard_quality_manager_NotifyQualityEvent(IMFQualityMana
static HRESULT WINAPI standard_quality_manager_Shutdown(IMFQualityManager *iface) { - FIXME("%p stub.\n", iface); + struct quality_manager *manager = impl_from_IMFQualityManager(iface);
- return E_NOTIMPL; + TRACE("%p.\n", iface); + + EnterCriticalSection(&manager->cs); + if (manager->state != QUALITY_MANAGER_SHUT_DOWN) + { + standard_quality_manager_release_clock(manager); + manager->state = QUALITY_MANAGER_SHUT_DOWN; + } + LeaveCriticalSection(&manager->cs); + + return S_OK; }
static IMFQualityManagerVtbl standard_quality_manager_vtbl = diff --git a/dlls/mf/tests/mf.c b/dlls/mf/tests/mf.c index 846d311c877..aad1564c3f0 100644 --- a/dlls/mf/tests/mf.c +++ b/dlls/mf/tests/mf.c @@ -3647,16 +3647,67 @@ failed:
static void test_quality_manager(void) { + IMFPresentationClock *clock; IMFQualityManager *manager; HRESULT hr;
+ hr = MFStartup(MF_VERSION, MFSTARTUP_FULL); + ok(hr == S_OK, "Startup failure, hr %#x.\n", hr); + + hr = MFCreatePresentationClock(&clock); + ok(hr == S_OK, "Failed to create presentation clock, hr %#x.\n", hr); + hr = MFCreateStandardQualityManager(&manager); ok(hr == S_OK, "Failed to create quality manager, hr %#x.\n", hr);
+ check_interface(manager, &IID_IMFQualityManager, TRUE); +todo_wine + check_interface(manager, &IID_IMFClockStateSink, TRUE); + hr = IMFQualityManager_NotifyPresentationClock(manager, NULL); ok(hr == E_POINTER, "Unexpected hr %#x.\n", hr);
+ /* Set clock, then shutdown. */ + EXPECT_REF(clock, 1); + EXPECT_REF(manager, 1); + hr = IMFQualityManager_NotifyPresentationClock(manager, clock); + ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + EXPECT_REF(clock, 2); +todo_wine + EXPECT_REF(manager, 2); + + hr = IMFQualityManager_Shutdown(manager); + ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + EXPECT_REF(clock, 1); + + hr = IMFQualityManager_NotifyPresentationClock(manager, clock); + ok(hr == MF_E_SHUTDOWN, "Unexpected hr %#x.\n", hr); + + hr = IMFQualityManager_NotifyPresentationClock(manager, NULL); + ok(hr == MF_E_SHUTDOWN, "Unexpected hr %#x.\n", hr); + + hr = IMFQualityManager_Shutdown(manager); + ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + + IMFQualityManager_Release(manager); + + /* Set clock, then release without shutting down. */ + hr = MFCreateStandardQualityManager(&manager); + ok(hr == S_OK, "Failed to create quality manager, hr %#x.\n", hr); + + EXPECT_REF(clock, 1); + hr = IMFQualityManager_NotifyPresentationClock(manager, clock); + ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + EXPECT_REF(clock, 2); + IMFQualityManager_Release(manager); +todo_wine + EXPECT_REF(clock, 2); + + IMFPresentationClock_Release(clock); + + hr = MFShutdown(); + ok(hr == S_OK, "Shutdown failure, hr %#x.\n", hr); }
static void test_sar(void)
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/mf/session.c | 92 +++++++++++++++++++++++++++++++++++++++++++--- dlls/mf/tests/mf.c | 3 -- 2 files changed, 87 insertions(+), 8 deletions(-)
diff --git a/dlls/mf/session.c b/dlls/mf/session.c index af58a47ed7a..36e0c901d80 100644 --- a/dlls/mf/session.c +++ b/dlls/mf/session.c @@ -328,6 +328,7 @@ enum quality_manager_state struct quality_manager { IMFQualityManager IMFQualityManager_iface; + IMFClockStateSink IMFClockStateSink_iface; LONG refcount;
IMFPresentationClock *clock; @@ -425,6 +426,11 @@ static struct quality_manager *impl_from_IMFQualityManager(IMFQualityManager *if return CONTAINING_RECORD(iface, struct quality_manager, IMFQualityManager_iface); }
+static struct quality_manager *impl_from_qm_IMFClockStateSink(IMFClockStateSink *iface) +{ + return CONTAINING_RECORD(iface, struct quality_manager, IMFClockStateSink_iface); +} + static struct topo_node *impl_node_from_IMFVideoSampleAllocatorNotify(IMFVideoSampleAllocatorNotify *iface) { return CONTAINING_RECORD(iface, struct topo_node, u.sink.notify_cb); @@ -4751,19 +4757,28 @@ HRESULT WINAPI MFCreatePresentationClock(IMFPresentationClock **clock)
static HRESULT WINAPI standard_quality_manager_QueryInterface(IMFQualityManager *iface, REFIID riid, void **out) { + struct quality_manager *manager = impl_from_IMFQualityManager(iface); + TRACE("%p, %s, %p.\n", iface, debugstr_guid(riid), out);
if (IsEqualIID(riid, &IID_IMFQualityManager) || IsEqualIID(riid, &IID_IUnknown)) { *out = iface; - IMFQualityManager_AddRef(iface); - return S_OK; + } + else if (IsEqualIID(riid, &IID_IMFClockStateSink)) + { + *out = &manager->IMFClockStateSink_iface; + } + else + { + WARN("Unsupported %s.\n", debugstr_guid(riid)); + *out = NULL; + return E_NOINTERFACE; }
- WARN("Unsupported %s.\n", debugstr_guid(riid)); - *out = NULL; - return E_NOINTERFACE; + IUnknown_AddRef((IUnknown *)*out); + return S_OK; }
static ULONG WINAPI standard_quality_manager_AddRef(IMFQualityManager *iface) @@ -4804,7 +4819,10 @@ static HRESULT WINAPI standard_quality_manager_NotifyTopology(IMFQualityManager static void standard_quality_manager_release_clock(struct quality_manager *manager) { if (manager->clock) + { + IMFPresentationClock_RemoveClockStateSink(manager->clock, &manager->IMFClockStateSink_iface); IMFPresentationClock_Release(manager->clock); + } manager->clock = NULL; }
@@ -4826,6 +4844,8 @@ static HRESULT WINAPI standard_quality_manager_NotifyPresentationClock(IMFQualit standard_quality_manager_release_clock(manager); manager->clock = clock; IMFPresentationClock_AddRef(manager->clock); + if (FAILED(IMFPresentationClock_AddClockStateSink(manager->clock, &manager->IMFClockStateSink_iface))) + WARN("Failed to set state sink.\n"); } LeaveCriticalSection(&manager->cs);
@@ -4886,6 +4906,67 @@ static IMFQualityManagerVtbl standard_quality_manager_vtbl = standard_quality_manager_Shutdown, };
+static HRESULT WINAPI standard_quality_manager_sink_QueryInterface(IMFClockStateSink *iface, + REFIID riid, void **obj) +{ + struct quality_manager *manager = impl_from_qm_IMFClockStateSink(iface); + return IMFQualityManager_QueryInterface(&manager->IMFQualityManager_iface, riid, obj); +} + +static ULONG WINAPI standard_quality_manager_sink_AddRef(IMFClockStateSink *iface) +{ + struct quality_manager *manager = impl_from_qm_IMFClockStateSink(iface); + return IMFQualityManager_AddRef(&manager->IMFQualityManager_iface); +} + +static ULONG WINAPI standard_quality_manager_sink_Release(IMFClockStateSink *iface) +{ + struct quality_manager *manager = impl_from_qm_IMFClockStateSink(iface); + return IMFQualityManager_Release(&manager->IMFQualityManager_iface); +} + +static HRESULT WINAPI standard_quality_manager_sink_OnClockStart(IMFClockStateSink *iface, + MFTIME systime, LONGLONG offset) +{ + return S_OK; +} + +static HRESULT WINAPI standard_quality_manager_sink_OnClockStop(IMFClockStateSink *iface, + MFTIME systime) +{ + return S_OK; +} + +static HRESULT WINAPI standard_quality_manager_sink_OnClockPause(IMFClockStateSink *iface, + MFTIME systime) +{ + return S_OK; +} + +static HRESULT WINAPI standard_quality_manager_sink_OnClockRestart(IMFClockStateSink *iface, + MFTIME systime) +{ + return S_OK; +} + +static HRESULT WINAPI standard_quality_manager_sink_OnClockSetRate(IMFClockStateSink *iface, + MFTIME systime, float rate) +{ + return S_OK; +} + +static const IMFClockStateSinkVtbl standard_quality_manager_sink_vtbl = +{ + standard_quality_manager_sink_QueryInterface, + standard_quality_manager_sink_AddRef, + standard_quality_manager_sink_Release, + standard_quality_manager_sink_OnClockStart, + standard_quality_manager_sink_OnClockStop, + standard_quality_manager_sink_OnClockPause, + standard_quality_manager_sink_OnClockRestart, + standard_quality_manager_sink_OnClockSetRate, +}; + HRESULT WINAPI MFCreateStandardQualityManager(IMFQualityManager **manager) { struct quality_manager *object; @@ -4897,6 +4978,7 @@ HRESULT WINAPI MFCreateStandardQualityManager(IMFQualityManager **manager) return E_OUTOFMEMORY;
object->IMFQualityManager_iface.lpVtbl = &standard_quality_manager_vtbl; + object->IMFClockStateSink_iface.lpVtbl = &standard_quality_manager_sink_vtbl; object->refcount = 1; InitializeCriticalSection(&object->cs);
diff --git a/dlls/mf/tests/mf.c b/dlls/mf/tests/mf.c index aad1564c3f0..ba313adc15c 100644 --- a/dlls/mf/tests/mf.c +++ b/dlls/mf/tests/mf.c @@ -3661,7 +3661,6 @@ static void test_quality_manager(void) ok(hr == S_OK, "Failed to create quality manager, hr %#x.\n", hr);
check_interface(manager, &IID_IMFQualityManager, TRUE); -todo_wine check_interface(manager, &IID_IMFClockStateSink, TRUE);
hr = IMFQualityManager_NotifyPresentationClock(manager, NULL); @@ -3673,7 +3672,6 @@ todo_wine hr = IMFQualityManager_NotifyPresentationClock(manager, clock); ok(hr == S_OK, "Unexpected hr %#x.\n", hr); EXPECT_REF(clock, 2); -todo_wine EXPECT_REF(manager, 2);
hr = IMFQualityManager_Shutdown(manager); @@ -3701,7 +3699,6 @@ todo_wine EXPECT_REF(clock, 2);
IMFQualityManager_Release(manager); -todo_wine EXPECT_REF(clock, 2);
IMFPresentationClock_Release(clock);
Hi,
While running your changed tests, 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=84820
Your paranoid android.
=== wvistau64 (64 bit report) ===
mf: mf: Timeout
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/mf/session.c | 29 +++++++++++++++++++++++++-- dlls/mf/tests/mf.c | 49 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 76 insertions(+), 2 deletions(-)
diff --git a/dlls/mf/session.c b/dlls/mf/session.c index 36e0c901d80..94454cd2f2a 100644 --- a/dlls/mf/session.c +++ b/dlls/mf/session.c @@ -331,6 +331,7 @@ struct quality_manager IMFClockStateSink IMFClockStateSink_iface; LONG refcount;
+ IMFTopology *topology; IMFPresentationClock *clock; unsigned int state; CRITICAL_SECTION cs; @@ -4802,6 +4803,8 @@ static ULONG WINAPI standard_quality_manager_Release(IMFQualityManager *iface) { if (manager->clock) IMFPresentationClock_Release(manager->clock); + if (manager->topology) + IMFTopology_Release(manager->topology); DeleteCriticalSection(&manager->cs); heap_free(manager); } @@ -4809,11 +4812,32 @@ static ULONG WINAPI standard_quality_manager_Release(IMFQualityManager *iface) return refcount; }
+static void standard_quality_manager_set_topology(struct quality_manager *manager, IMFTopology *topology) +{ + if (manager->topology) + IMFTopology_Release(manager->topology); + manager->topology = topology; + if (manager->topology) + IMFTopology_AddRef(manager->topology); +} + static HRESULT WINAPI standard_quality_manager_NotifyTopology(IMFQualityManager *iface, IMFTopology *topology) { - FIXME("%p, %p stub.\n", iface, topology); + struct quality_manager *manager = impl_from_IMFQualityManager(iface); + HRESULT hr = S_OK;
- return S_OK; + TRACE("%p, %p.\n", iface, topology); + + EnterCriticalSection(&manager->cs); + if (manager->state == QUALITY_MANAGER_SHUT_DOWN) + hr = MF_E_SHUTDOWN; + else + { + standard_quality_manager_set_topology(manager, topology); + } + LeaveCriticalSection(&manager->cs); + + return hr; }
static void standard_quality_manager_release_clock(struct quality_manager *manager) @@ -4886,6 +4910,7 @@ static HRESULT WINAPI standard_quality_manager_Shutdown(IMFQualityManager *iface if (manager->state != QUALITY_MANAGER_SHUT_DOWN) { standard_quality_manager_release_clock(manager); + standard_quality_manager_set_topology(manager, NULL); manager->state = QUALITY_MANAGER_SHUT_DOWN; } LeaveCriticalSection(&manager->cs); diff --git a/dlls/mf/tests/mf.c b/dlls/mf/tests/mf.c index ba313adc15c..9bbf82c97e7 100644 --- a/dlls/mf/tests/mf.c +++ b/dlls/mf/tests/mf.c @@ -3649,6 +3649,7 @@ static void test_quality_manager(void) { IMFPresentationClock *clock; IMFQualityManager *manager; + IMFTopology *topology; HRESULT hr;
hr = MFStartup(MF_VERSION, MFSTARTUP_FULL); @@ -3666,6 +3667,9 @@ static void test_quality_manager(void) hr = IMFQualityManager_NotifyPresentationClock(manager, NULL); ok(hr == E_POINTER, "Unexpected hr %#x.\n", hr);
+ hr = IMFQualityManager_NotifyTopology(manager, NULL); + ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + /* Set clock, then shutdown. */ EXPECT_REF(clock, 1); EXPECT_REF(manager, 1); @@ -3681,6 +3685,9 @@ static void test_quality_manager(void) hr = IMFQualityManager_NotifyPresentationClock(manager, clock); ok(hr == MF_E_SHUTDOWN, "Unexpected hr %#x.\n", hr);
+ hr = IMFQualityManager_NotifyTopology(manager, NULL); + ok(hr == MF_E_SHUTDOWN, "Unexpected hr %#x.\n", hr); + hr = IMFQualityManager_NotifyPresentationClock(manager, NULL); ok(hr == MF_E_SHUTDOWN, "Unexpected hr %#x.\n", hr);
@@ -3703,6 +3710,48 @@ static void test_quality_manager(void)
IMFPresentationClock_Release(clock);
+ /* Set topology. */ + hr = MFCreateStandardQualityManager(&manager); + ok(hr == S_OK, "Failed to create quality manager, hr %#x.\n", hr); + + hr = MFCreateTopology(&topology); + ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + + EXPECT_REF(topology, 1); + hr = IMFQualityManager_NotifyTopology(manager, topology); + ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + EXPECT_REF(topology, 2); + + hr = IMFQualityManager_NotifyTopology(manager, NULL); + ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + EXPECT_REF(topology, 1); + + hr = IMFQualityManager_NotifyTopology(manager, topology); + ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + + EXPECT_REF(topology, 2); + hr = IMFQualityManager_Shutdown(manager); + ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + EXPECT_REF(topology, 1); + + hr = IMFQualityManager_NotifyTopology(manager, topology); + ok(hr == MF_E_SHUTDOWN, "Unexpected hr %#x.\n", hr); + + IMFQualityManager_Release(manager); + + hr = MFCreateStandardQualityManager(&manager); + ok(hr == S_OK, "Failed to create quality manager, hr %#x.\n", hr); + + EXPECT_REF(topology, 1); + hr = IMFQualityManager_NotifyTopology(manager, topology); + ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + EXPECT_REF(topology, 2); + + IMFQualityManager_Release(manager); + EXPECT_REF(topology, 1); + + IMFTopology_Release(topology); + hr = MFShutdown(); ok(hr == S_OK, "Shutdown failure, hr %#x.\n", hr); }
Hi,
While running your changed tests, 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=84821
Your paranoid android.
=== wvistau64 (64 bit report) ===
mf: mf: Timeout
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/mfplat/main.c | 8 ++++++++ include/mftransform.idl | 10 +++++++++- 2 files changed, 17 insertions(+), 1 deletion(-)
diff --git a/dlls/mfplat/main.c b/dlls/mfplat/main.c index 54bd70a2fff..3d294ad45f0 100644 --- a/dlls/mfplat/main.c +++ b/dlls/mfplat/main.c @@ -1615,6 +1615,7 @@ const char *debugstr_attr(const GUID *guid) X(MF_MT_PALETTE), X(MF_DEVSOURCE_ATTRIBUTE_SOURCE_TYPE_VIDCAP_PROVIDER_DEVICE_ID), X(MF_TOPOLOGY_STATIC_PLAYBACK_OPTIMIZATIONS), + X(MF_SA_D3D11_USAGE), X(MF_MEDIA_ENGINE_NEEDKEY_CALLBACK), X(MF_MT_GEOMETRIC_APERTURE), X(MF_MT_ORIGINAL_WAVE_FORMAT_TAG), @@ -1630,6 +1631,7 @@ const char *debugstr_attr(const GUID *guid) X(MF_MT_SPATIAL_AUDIO_MAX_DYNAMIC_OBJECTS), X(MF_MT_DECODER_MAX_DPB_COUNT), X(MFSampleExtension_ForwardedDecodeUnits), + X(MF_SA_D3D11_SHARED_WITHOUT_MUTEX), X(MF_MT_DV_AAUX_CTRL_PACK_0), X(MF_MT_YUV_MATRIX), X(MF_EVENT_SOURCE_TOPOLOGY_CANCELED), @@ -1664,6 +1666,7 @@ const char *debugstr_attr(const GUID *guid) X(MF_MEDIA_ENGINE_PLAYBACK_VISUAL), X(MF_MT_VIDEO_CHROMA_SITING), X(MF_AUDIO_RENDERER_ATTRIBUTE_STREAM_CATEGORY), + X(MF_SA_BUFFERS_PER_SAMPLE), X(MFSampleExtension_3DVideo_SampleFormat), X(MF_MT_H264_RESOLUTION_SCALING), X(MF_MT_VIDEO_LEVEL), @@ -1736,6 +1739,7 @@ const char *debugstr_attr(const GUID *guid) X(MF_TOPONODE_RATELESS), X(MF_EVENT_STREAM_METADATA_CONTENT_KEYIDS), X(MF_TOPONODE_DISABLE_PREROLL), + X(MF_SA_D3D11_ALLOW_DYNAMIC_YUV_TEXTURE), X(MF_MT_VIDEO_3D_FORMAT), X(MF_EVENT_STREAM_METADATA_KEYDATA), X(MF_SINK_WRITER_D3D_MANAGER), @@ -1751,6 +1755,7 @@ const char *debugstr_attr(const GUID *guid) X(MFT_ENUM_HARDWARE_URL_Attribute), X(MF_SOURCE_READER_ASYNC_CALLBACK), X(MF_MT_OUTPUT_BUFFER_NUM), + X(MF_SA_D3D11_BINDFLAGS), X(MFT_ENCODER_SUPPORTS_CONFIG_EVENT), X(MF_MT_AUDIO_FLAC_MAX_BLOCK_SIZE), X(MFT_FRIENDLY_NAME_Attribute), @@ -1772,10 +1777,12 @@ const char *debugstr_attr(const GUID *guid) X(MF_MT_SPATIAL_AUDIO_OBJECT_METADATA_LENGTH), X(MF_MT_SPATIAL_AUDIO_OBJECT_METADATA_FORMAT_ID), X(MF_SAMPLEGRABBERSINK_IGNORE_CLOCK), + X(MF_SA_D3D11_SHARED), X(MF_MT_PAN_SCAN_ENABLED), X(MF_AUDIO_RENDERER_ATTRIBUTE_ENDPOINT_ID), X(MF_MT_DV_VAUX_CTRL_PACK), X(MFSampleExtension_ForwardedDecodeUnitType), + X(MF_SA_D3D11_AWARE), X(MF_MT_AUDIO_AVG_BYTES_PER_SECOND), X(MF_SOURCE_READER_MEDIASOURCE_CHARACTERISTICS), X(MF_MT_SPATIAL_AUDIO_MIN_METADATA_ITEM_OFFSET_SPACING), @@ -1802,6 +1809,7 @@ const char *debugstr_attr(const GUID *guid) X(MF_MT_H264_RATE_CONTROL_MODES), X(MF_DEVSOURCE_ATTRIBUTE_SOURCE_TYPE_VIDCAP_SYMBOLIC_LINK), X(MF_READWRITE_D3D_OPTIONAL), + X(MF_SA_D3D11_HW_PROTECTED), X(MF_MEDIA_ENGINE_DXGI_MANAGER), X(MF_READWRITE_MMCSS_CLASS_AUDIO), X(MF_MEDIA_ENGINE_COREWINDOW), diff --git a/include/mftransform.idl b/include/mftransform.idl index 3f4b5500204..e49c7200185 100644 --- a/include/mftransform.idl +++ b/include/mftransform.idl @@ -198,7 +198,15 @@ interface IMFTransform : IUnknown
cpp_quote("HRESULT WINAPI MFCreateTransformActivate(IMFActivate **activate);")
-cpp_quote("EXTERN_GUID(MF_SA_D3D_AWARE, 0xeaa35c29, 0x775e, 0x488e, 0x9b, 0x61, 0xb3, 0x28, 0x3e, 0x49, 0x58, 0x3b);") +cpp_quote("EXTERN_GUID(MF_SA_BUFFERS_PER_SAMPLE, 0x873c5171, 0x1e3d, 0x4e25, 0x98, 0x8d, 0xb4, 0x33, 0xce, 0x04, 0x19, 0x83);") +cpp_quote("EXTERN_GUID(MF_SA_D3D_AWARE, 0xeaa35c29, 0x775e, 0x488e, 0x9b, 0x61, 0xb3, 0x28, 0x3e, 0x49, 0x58, 0x3b);") +cpp_quote("EXTERN_GUID(MF_SA_D3D11_ALLOW_DYNAMIC_YUV_TEXTURE, 0xce06d49f, 0x0613, 0x4b9d, 0x86, 0xa6, 0xd8, 0xc4, 0xf9, 0xc1, 0x00, 0x75);") +cpp_quote("EXTERN_GUID(MF_SA_D3D11_AWARE, 0x206b4fc8, 0xfcf9, 0x4c51, 0xaf, 0xe3, 0x97, 0x64, 0x36, 0x9e, 0x33, 0xa0);") +cpp_quote("EXTERN_GUID(MF_SA_D3D11_BINDFLAGS, 0xeacf97ad, 0x065c, 0x4408, 0xbe, 0xe3, 0xfd, 0xcb, 0xfd, 0x12, 0x8b, 0xe2);") +cpp_quote("EXTERN_GUID(MF_SA_D3D11_HW_PROTECTED, 0x3a8ba9d9, 0x92ca, 0x4307, 0xa3, 0x91, 0x69, 0x99, 0xdb, 0xf3, 0xb6, 0xce);") +cpp_quote("EXTERN_GUID(MF_SA_D3D11_SHARED, 0x7b8f32c3, 0x6d96, 0x4b89, 0x92, 0x03, 0xdd, 0x38, 0xb6, 0x14, 0x14, 0xf3);") +cpp_quote("EXTERN_GUID(MF_SA_D3D11_SHARED_WITHOUT_MUTEX, 0x39dbd44d, 0x2e44, 0x4931, 0xa4, 0xc8, 0x35, 0x2d, 0x3d, 0xc4, 0x21, 0x15);") +cpp_quote("EXTERN_GUID(MF_SA_D3D11_USAGE, 0xe85fe442, 0x2ca3, 0x486e, 0xa9, 0xc7, 0x10, 0x9d, 0xda, 0x60, 0x98, 0x80);") cpp_quote("EXTERN_GUID(MF_SA_REQUIRED_SAMPLE_COUNT, 0x18802c61, 0x324b, 0x4952, 0xab, 0xd0, 0x17, 0x6f, 0xf5, 0xc6, 0x96, 0xff);") cpp_quote("EXTERN_GUID(MF_TRANSFORM_ASYNC, 0xf81a699a, 0x649a, 0x497d, 0x8c, 0x73, 0x29, 0xf8, 0xfe, 0xd6, 0xad, 0x7a);") cpp_quote("EXTERN_GUID(MF_TRANSFORM_ASYNC_UNLOCK, 0xe5666d6b, 0x3422, 0x4eb6, 0xa4, 0x21, 0xda, 0x7d, 0xb1, 0xf8, 0xe2, 0x07);")
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/mf/tests/mf.c | 25 ++++++++--- include/mfidl.idl | 106 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 125 insertions(+), 6 deletions(-)
diff --git a/dlls/mf/tests/mf.c b/dlls/mf/tests/mf.c index 9bbf82c97e7..11eff78b645 100644 --- a/dlls/mf/tests/mf.c +++ b/dlls/mf/tests/mf.c @@ -3347,7 +3347,7 @@ static void test_video_processor(void) IMFTransform *transform; IMFMediaBuffer *buffer; IMFMediaEvent *event; - IUnknown *unk; + unsigned int value; HRESULT hr; GUID guid;
@@ -3362,15 +3362,28 @@ static void test_video_processor(void) goto failed; }
- hr = IMFTransform_QueryInterface(transform, &IID_IMFMediaEventGenerator, (void **)&unk); - ok(hr == E_NOINTERFACE, "Unexpected hr %#x.\n", hr); - - hr = IMFTransform_QueryInterface(transform, &IID_IMFShutdown, (void **)&unk); - ok(hr == E_NOINTERFACE, "Unexpected hr %#x.\n", hr); +todo_wine + check_interface(transform, &IID_IMFVideoProcessorControl, TRUE); +todo_wine + check_interface(transform, &IID_IMFRealTimeClientEx, TRUE); + check_interface(transform, &IID_IMFMediaEventGenerator, FALSE); + check_interface(transform, &IID_IMFShutdown, FALSE);
/* Transform global attributes. */ hr = IMFTransform_GetAttributes(transform, &attributes); ok(hr == S_OK, "Failed to get attributes, hr %#x.\n", hr); + + hr = IMFAttributes_GetCount(attributes, &count); + ok(hr == S_OK, "Unexpected hr %#x.\n", hr); +todo_wine + ok(!!count, "Unexpected attribute count %u.\n", count); + + value = 0; + hr = IMFAttributes_GetUINT32(attributes, &MF_SA_D3D11_AWARE, &value); +todo_wine { + ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(value == 1, "Unexpected attribute value %u.\n", value); +} hr = IMFTransform_GetAttributes(transform, &attributes2); ok(hr == S_OK, "Failed to get attributes, hr %#x.\n", hr); ok(attributes == attributes2, "Unexpected instance.\n"); diff --git a/include/mfidl.idl b/include/mfidl.idl index dd5de8d0d2f..46c715a3752 100644 --- a/include/mfidl.idl +++ b/include/mfidl.idl @@ -1163,6 +1163,112 @@ interface IMFVideoSampleAllocatorEx : IMFVideoSampleAllocator ); }
+typedef enum _MF_VIDEO_PROCESSOR_MIRROR +{ + MIRROR_NONE, + MIRROR_HORIZONTAL, + MIRROR_VERTICAL +} MF_VIDEO_PROCESSOR_MIRROR; + +typedef enum _MF_VIDEO_PROCESSOR_ROTATION +{ + ROTATION_NONE, + ROTATION_NORMAL +} MF_VIDEO_PROCESSOR_ROTATION; + +[ + object, + uuid(a3f675d5-6119-4f7f-a100-1d8b280f0efb), + local, + pointer_default(unique) +] +interface IMFVideoProcessorControl : IUnknown +{ + HRESULT SetBorderColor( + [in] MFARGB *color + ); + + HRESULT SetSourceRectangle( + [in] RECT *rect + ); + + HRESULT SetDestinationRectangle( + [in] RECT *rect + ); + + HRESULT SetMirror( + [in] MF_VIDEO_PROCESSOR_MIRROR mirror + ); + + HRESULT SetRotation( + [in] MF_VIDEO_PROCESSOR_ROTATION rotation + ); + + HRESULT SetConstrictionSize( + [in] SIZE *size + ); +} + +[ + object, + uuid(bde633d3-e1dc-4a7f-a693-bbae399c4a20), + local, + pointer_default(unique) +] +interface IMFVideoProcessorControl2 : IMFVideoProcessorControl +{ + HRESULT SetRotationOverride( + [in] UINT rotation + ); + + HRESULT EnableHardwareEffects( + [in] BOOL enabled + ); + + HRESULT GetSupportedHardwareEffects( + [out, retval] UINT *support + ); +} + +[ + object, + uuid(2347d60b-3fb5-480c-8803-8df3adcd3ef0), + local +] +interface IMFRealTimeClient : IUnknown +{ + HRESULT RegisterThreads( + [in] DWORD task_index, + [in] LPCWSTR classname + ); + + HRESULT UnregisterThreads(); + + HRESULT SetWorkQueue( + [in] DWORD queue_id + ); +} + +[ + object, + uuid(03910848-ab16-4611-b100-17b88ae2f248), +] +interface IMFRealTimeClientEx : IUnknown +{ + HRESULT RegisterThreadsEx( + [in, out] DWORD *task_index, + [in] LPCWSTR classname, + [in] LONG basepriority + ); + + HRESULT UnregisterThreads( ); + + HRESULT SetWorkQueueEx( + [in] DWORD mtqueue_id, + [in] LONG base_priority + ); +} + enum { MF_ACTIVATE_CUSTOM_MIXER_ALLOWFAIL = 0x00000001,
Hi,
While running your changed tests, 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=84823
Your paranoid android.
=== wvistau64 (64 bit report) ===
mf: mf: Timeout
Hi,
While running your changed tests, 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=84819
Your paranoid android.
=== wvistau64 (64 bit report) ===
mf: mf: Timeout