Wine-Devel
By thread
wine-devel@list.winehq.org
By month
Messages by month
- ----- 2026 -----
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2005 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2004 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2003 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2002 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2001 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
February 2021
- 81 participants
- 1707 messages
[PATCH 4/5] mfplat: Add a few MF_SA_* attributes for tracing.
by Nikolay Sivov
Signed-off-by: Nikolay Sivov <nsivov(a)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);")
--
2.30.0
Feb. 1, 2021
[PATCH 3/5] mf: Implement NotifyTopology() for the standard quality manager.
by Nikolay Sivov
Signed-off-by: Nikolay Sivov <nsivov(a)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);
}
--
2.30.0
Feb. 1, 2021
[PATCH 2/5] mf: Subscribe standard quality manager to clock state change events.
by Nikolay Sivov
Signed-off-by: Nikolay Sivov <nsivov(a)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);
--
2.30.0
Feb. 1, 2021
[PATCH 1/5] mf: Add shutdown state for the standard quality manager.
by Nikolay Sivov
Signed-off-by: Nikolay Sivov <nsivov(a)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)
--
2.30.0
Feb. 1, 2021
Re: [PATCH V3 1/2] msxml3/tests: Test mxwriter DOMDocument output.
by Nikolay Sivov
On Mon, Feb 1, 2021 at 1:07 PM Jefferson Carpenter <
jeffersoncarpenter2(a)gmail.com> wrote:
> On 2/1/2021 9:36 AM, Nikolay Sivov wrote:
> > This seems to be correct in assumption that document output is treated
> > separately. Quick testing shows that it's using some internal interface
> > that the document object implements. It might be used to lock/unlock
> > document while writer is populating it.
>
> Ok, sorry to change the topic / scope but do you think it would be
> better to write a custom class that implements IXMLDOMDocument (and
> IDispatch) and pass that to the mxwriter instead of instantiating a
> DOMDocument? That is, do it like test_saxreader.
>
> I think that's better because then we could gain some visibility into
> what interfaces the Microsoft msxml queries for, and how it locks and
> unlocks the document.
>
> I'll do it that way in the next version, and use call_entry /
> call_sequence structs like the saxreader tests.
>
> So to improve the tests I think it
> > would be interesting to see if written nodes appear right away on SAX
> > calls, and if modifying methods of IXMLDOMDocument are indeed disabled
> > during this process. Another case that's not tested is writing to
> non-empty
> > document. Also you can remove the part that uses attributes, I don't
> think
> > it's valuable.
> >
>
> Also, by checking that the correct call sequences are invoked by
> mxwriter, the nodes would appear right away by virtue of a correct wine
> DOMDocument implementation. (If they don't, that's a domdoc.c patch).
>
No, I don't think you should do a full match of calls that are made. It
would be enough to introduce some private interface for now, and reject
external document implementations. It does not have to be a COM interface.
>
> Should I commit a short test that's correct, or try to get the whole
> thing right in one go?
>
Feb. 1, 2021
Re: [PATCH V3 1/2] msxml3/tests: Test mxwriter DOMDocument output.
by Jefferson Carpenter
On 2/1/2021 9:36 AM, Nikolay Sivov wrote:
> This seems to be correct in assumption that document output is treated
> separately. Quick testing shows that it's using some internal interface
> that the document object implements. It might be used to lock/unlock
> document while writer is populating it.
Ok, sorry to change the topic / scope but do you think it would be
better to write a custom class that implements IXMLDOMDocument (and
IDispatch) and pass that to the mxwriter instead of instantiating a
DOMDocument? That is, do it like test_saxreader.
I think that's better because then we could gain some visibility into
what interfaces the Microsoft msxml queries for, and how it locks and
unlocks the document.
I'll do it that way in the next version, and use call_entry /
call_sequence structs like the saxreader tests.
So to improve the tests I think it
> would be interesting to see if written nodes appear right away on SAX
> calls, and if modifying methods of IXMLDOMDocument are indeed disabled
> during this process. Another case that's not tested is writing to non-empty
> document. Also you can remove the part that uses attributes, I don't think
> it's valuable.
>
Also, by checking that the correct call sequences are invoked by
mxwriter, the nodes would appear right away by virtue of a correct wine
DOMDocument implementation. (If they don't, that's a domdoc.c patch).
Should I commit a short test that's correct, or try to get the whole
thing right in one go?
Feb. 1, 2021
Re: [PATCH v3 2/3] windowscodecs: Add new WINCODECS_CUSTOM_UNIXLIB ifdef to guard default codecs.
by Rémi Bernon
On 2/1/21 10:49 AM, Alexandre Julliard wrote:
> Rémi Bernon <rbernon(a)codeweavers.com> writes:
>
>> Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com>
>> ---
>> dlls/windowscodecs/unix_lib.c | 2 ++
>> dlls/windowscodecs/wincodecs_private.h | 1 +
>> 2 files changed, 3 insertions(+)
>>
>> diff --git a/dlls/windowscodecs/unix_lib.c b/dlls/windowscodecs/unix_lib.c
>> index 268a1cd9d16..9255b3ed243 100644
>> --- a/dlls/windowscodecs/unix_lib.c
>> +++ b/dlls/windowscodecs/unix_lib.c
>> @@ -67,6 +67,7 @@ HRESULT CDECL stream_write(IStream *stream, const void *buffer, ULONG write, ULO
>> return win32_funcs->stream_write(stream, buffer, write, bytes_written);
>> }
>>
>> +#ifndef WINCODECS_CUSTOM_UNIXLIB
>> HRESULT CDECL decoder_create(const CLSID *decoder_clsid, struct decoder_info *info, struct decoder **result)
>> {
>> if (IsEqualGUID(decoder_clsid, &CLSID_WICPngDecoder))
>> @@ -97,6 +98,7 @@ HRESULT CDECL encoder_create(const CLSID *encoder_clsid, struct encoder_info *in
>>
>> return E_NOTIMPL;
>> }
>> +#endif /* WINCODECS_CUSTOM_UNIXLIB */
>
> That doesn't seem like an improvement. I don't see what you gain by
> sharing this file across dlls.
>
Well, it was initially duplicated and I changed it on request. I guess
it factors the windowscodecs unixlib interface a bit more, helping the
module maintenance? I personally don't have much preference here.
--
Rémi Bernon <rbernon(a)codeweavers.com>
Feb. 1, 2021
[PATCH] gdiplus/metafile: Fix copy-paste typo when setting resolution (Coverity).
by Nikolay Sivov
Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com>
---
dlls/gdiplus/metafile.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dlls/gdiplus/metafile.c b/dlls/gdiplus/metafile.c
index 3c2e8eb3aa2..d506d0dc8bf 100644
--- a/dlls/gdiplus/metafile.c
+++ b/dlls/gdiplus/metafile.c
@@ -4078,7 +4078,7 @@ GpStatus WINGDIPAPI GdipCreateMetafileFromEmf(HENHMETAFILE hemf, BOOL delete,
* If clear, metafile was recorded with a DC for a printer */
(*metafile)->printer_display = !(header.EmfPlusFlags & (1u << 31));
(*metafile)->logical_dpix = header.LogicalDpiX;
- (*metafile)->logical_dpix = header.LogicalDpiY;
+ (*metafile)->logical_dpiy = header.LogicalDpiY;
list_init(&(*metafile)->containers);
TRACE("<-- %p\n", *metafile);
--
2.30.0
Feb. 1, 2021
Re: [PATCH v3 2/3] windowscodecs: Add new WINCODECS_CUSTOM_UNIXLIB ifdef to guard default codecs.
by Alexandre Julliard
Rémi Bernon <rbernon(a)codeweavers.com> writes:
> Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com>
> ---
> dlls/windowscodecs/unix_lib.c | 2 ++
> dlls/windowscodecs/wincodecs_private.h | 1 +
> 2 files changed, 3 insertions(+)
>
> diff --git a/dlls/windowscodecs/unix_lib.c b/dlls/windowscodecs/unix_lib.c
> index 268a1cd9d16..9255b3ed243 100644
> --- a/dlls/windowscodecs/unix_lib.c
> +++ b/dlls/windowscodecs/unix_lib.c
> @@ -67,6 +67,7 @@ HRESULT CDECL stream_write(IStream *stream, const void *buffer, ULONG write, ULO
> return win32_funcs->stream_write(stream, buffer, write, bytes_written);
> }
>
> +#ifndef WINCODECS_CUSTOM_UNIXLIB
> HRESULT CDECL decoder_create(const CLSID *decoder_clsid, struct decoder_info *info, struct decoder **result)
> {
> if (IsEqualGUID(decoder_clsid, &CLSID_WICPngDecoder))
> @@ -97,6 +98,7 @@ HRESULT CDECL encoder_create(const CLSID *encoder_clsid, struct encoder_info *in
>
> return E_NOTIMPL;
> }
> +#endif /* WINCODECS_CUSTOM_UNIXLIB */
That doesn't seem like an improvement. I don't see what you gain by
sharing this file across dlls.
--
Alexandre Julliard
julliard(a)winehq.org
Feb. 1, 2021
Re: [PATCH V3 1/2] msxml3/tests: Test mxwriter DOMDocument output.
by Nikolay Sivov
This seems to be correct in assumption that document output is treated
separately. Quick testing shows that it's using some internal interface
that the document object implements. It might be used to lock/unlock
document while writer is populating it. So to improve the tests I think it
would be interesting to see if written nodes appear right away on SAX
calls, and if modifying methods of IXMLDOMDocument are indeed disabled
during this process. Another case that's not tested is writing to non-empty
document. Also you can remove the part that uses attributes, I don't think
it's valuable.
Feb. 1, 2021