[PATCH 0/4] MR9705: quartz/vmr7: Various small bits (resend).
Resend of !9701 without 1/5, which adds new failures on Helen. The rest seem correct. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/9705
From: Matteo Bruni <mbruni(a)codeweavers.com> --- dlls/quartz/vmr7_presenter.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/dlls/quartz/vmr7_presenter.c b/dlls/quartz/vmr7_presenter.c index d1170792455..2931dc4c36d 100644 --- a/dlls/quartz/vmr7_presenter.c +++ b/dlls/quartz/vmr7_presenter.c @@ -31,6 +31,8 @@ struct vmr7_presenter IVMRWindowlessControl IVMRWindowlessControl_iface; LONG refcount; + IVMRSurfaceAllocatorNotify *notify; + IDirectDraw7 *ddraw; IDirectDrawSurface7 *frontbuffer; IDirectDrawSurface7 *primary; @@ -275,7 +277,14 @@ static HRESULT WINAPI surface_allocator_PrepareSurface(IVMRSurfaceAllocator *ifa static HRESULT WINAPI surface_allocator_AdviseNotify(IVMRSurfaceAllocator *iface, IVMRSurfaceAllocatorNotify *notify) { - FIXME("iface %p, notify %p, stub!\n", iface, notify); + struct vmr7_presenter *presenter = impl_from_IVMRSurfaceAllocator(iface); + RECT rect = {0, 0, 0, 0}; + + TRACE("presenter %p, notify %p.\n", presenter, notify); + + presenter->notify = notify; + IVMRSurfaceAllocatorNotify_SetDDrawDevice(notify, presenter->ddraw, + MonitorFromRect(&rect, MONITOR_DEFAULTTOPRIMARY)); return S_OK; } -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/9705
From: Matteo Bruni <mbruni(a)codeweavers.com> --- dlls/quartz/vmr7.c | 1 + 1 file changed, 1 insertion(+) diff --git a/dlls/quartz/vmr7.c b/dlls/quartz/vmr7.c index e9834e300b0..cb38a1883d1 100644 --- a/dlls/quartz/vmr7.c +++ b/dlls/quartz/vmr7.c @@ -826,6 +826,7 @@ static HRESULT WINAPI filter_config_SetRenderingMode(IVMRFilterConfig *iface, DW } IUnknown_QueryInterface(default_presenter, &IID_IVMRSurfaceAllocator, (void **)&filter->allocator); IUnknown_QueryInterface(default_presenter, &IID_IVMRImagePresenter, (void **)&filter->presenter); + IVMRSurfaceAllocator_AdviseNotify(filter->allocator, &filter->IVMRSurfaceAllocatorNotify_iface); IUnknown_Release(default_presenter); break; -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/9705
From: Matteo Bruni <mbruni(a)codeweavers.com> --- dlls/quartz/tests/vmr7.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/dlls/quartz/tests/vmr7.c b/dlls/quartz/tests/vmr7.c index a77d02ade97..0e799efb960 100644 --- a/dlls/quartz/tests/vmr7.c +++ b/dlls/quartz/tests/vmr7.c @@ -3338,6 +3338,8 @@ static ULONG WINAPI allocator_Release(IVMRSurfaceAllocator *iface) return InterlockedDecrement(&presenter->refcount); } +static unsigned int allocatesurface_count; + static HRESULT WINAPI allocator_AllocateSurface(IVMRSurfaceAllocator *iface, DWORD_PTR cookie, VMRALLOCATIONINFO *info, DWORD *buffer_count, IDirectDrawSurface7 **surface) { @@ -3346,6 +3348,7 @@ static HRESULT WINAPI allocator_AllocateSurface(IVMRSurfaceAllocator *iface, HRESULT hr; if (winetest_debug > 1) trace("AllocateSurface()\n"); + ++allocatesurface_count; ok(!presenter->surfaces[0], "Surface should not already exist.\n"); @@ -3516,6 +3519,7 @@ static void test_renderless_formats(void) .IVMRImagePresenter_iface.lpVtbl = &presenter_vtbl, .refcount = 1, }; + unsigned int prev_allocatesurface_count; struct presenter presenter2 = presenter; IVMRSurfaceAllocatorNotify *notify; RECT rect = {0, 0, 640, 480}; @@ -3592,6 +3596,7 @@ static void test_renderless_formats(void) vih.bmiHeader.biBitCount = tests[i].depth; vih.bmiHeader.biCompression = tests[i].compression; + prev_allocatesurface_count = allocatesurface_count; hr = IFilterGraph2_ConnectDirect(graph, &source.source.pin.IPin_iface, pin, &req_mt); /* Wine currently creates surfaces during IPin::ReceiveConnection() * instead of IMemAllocator::SetProperties(), so accept those extra @@ -3600,6 +3605,9 @@ static void test_renderless_formats(void) ok(hr == VFW_E_TYPE_NOT_ACCEPTED, "Got hr %#lx.\n", hr); else ok(hr == S_OK || hr == VFW_E_TYPE_NOT_ACCEPTED, "Got hr %#lx.\n", hr); + todo_wine_if(i < 5) ok(allocatesurface_count == prev_allocatesurface_count, + "Got allocatesurface_count %u, prev_allocatesurface_count %u.\n", + allocatesurface_count, prev_allocatesurface_count); if (hr != S_OK) { if (!tests[i].must_fail) @@ -3607,7 +3615,6 @@ static void test_renderless_formats(void) winetest_pop_context(); continue; } - ok(hr == S_OK, "Got hr %#lx.\n", hr); hr = IMemInputPin_GetAllocator(input, &allocator); todo_wine ok(hr == S_OK, "Got hr %#lx.\n", hr); @@ -3617,6 +3624,7 @@ static void test_renderless_formats(void) hr = IMemInputPin_GetAllocator(input, &allocator); } + prev_allocatesurface_count = allocatesurface_count; req_props.cbBuffer = vih.bmiHeader.biWidth * vih.bmiHeader.biHeight * vih.bmiHeader.biBitCount / 8; hr = IMemAllocator_SetProperties(allocator, &req_props, &ret_props); if (hr != S_OK) @@ -3632,6 +3640,11 @@ static void test_renderless_formats(void) } ok(hr == S_OK, "Got hr %#lx.\n", hr); ok(!memcmp(&ret_props, &req_props, sizeof(req_props)), "Properties did not match.\n"); + + todo_wine ok(allocatesurface_count == prev_allocatesurface_count + 1, + "Got allocatesurface_count %u, prev_allocatesurface_count %u.\n", + allocatesurface_count, prev_allocatesurface_count); + hr = IMemAllocator_Commit(allocator); ok(hr == S_OK, "Got hr %#lx.\n", hr); -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/9705
From: Matteo Bruni <mbruni(a)codeweavers.com> --- include/vmrender.idl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/vmrender.idl b/include/vmrender.idl index c81a1acead3..16c8a870a5e 100644 --- a/include/vmrender.idl +++ b/include/vmrender.idl @@ -257,7 +257,7 @@ interface IVMRMonitorConfig : IUnknown typedef enum _VMRRenderPrefs { RenderPrefs_RestrictToInitialMonitor = 0x00, - RenderPrefs_ForceOffScreen = 0x01, + RenderPrefs_ForceOffscreen = 0x01, RenderPrefs_ForceOverlays = 0x02, RenderPrefs_AllowOverlays = 0x00, RenderPrefs_AllowOffscreen = 0x00, -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/9705
This merge request was approved by Elizabeth Figura. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/9705
participants (2)
-
Elizabeth Figura (@zfigura) -
Matteo Bruni