Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=47161 Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/quartz/tests/vmr9.c | 32 ++++++++++++++++++++++++++++++++ dlls/quartz/vmr9.c | 14 +++++++++++--- 2 files changed, 43 insertions(+), 3 deletions(-)
diff --git a/dlls/quartz/tests/vmr9.c b/dlls/quartz/tests/vmr9.c index dfa9dae73e5..b25b8df8cb7 100644 --- a/dlls/quartz/tests/vmr9.c +++ b/dlls/quartz/tests/vmr9.c @@ -3876,6 +3876,38 @@ out: DestroyWindow(window); }
+static void test_mixing_prefs(void) +{ + IBaseFilter *filter = create_vmr9(VMR9Mode_Windowed); + IVMRMixerControl9 *mixer_control; + DWORD flags; + HRESULT hr; + ULONG ref; + + set_mixing_mode(filter, 1); + + hr = IBaseFilter_QueryInterface(filter, &IID_IVMRMixerControl9, (void **)&mixer_control); + ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IVMRMixerControl9_GetMixingPrefs(mixer_control, &flags); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(flags == (MixerPref9_NoDecimation | MixerPref9_ARAdjustXorY | MixerPref9_BiLinearFiltering + | MixerPref9_RenderTargetRGB), "Got flags %#x.\n", flags); + + hr = IVMRMixerControl9_SetMixingPrefs(mixer_control, MixerPref9_NoDecimation + | MixerPref9_ARAdjustXorY | MixerPref9_BiLinearFiltering | MixerPref9_RenderTargetYUV); + ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IVMRMixerControl9_GetMixingPrefs(mixer_control, &flags); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(flags == (MixerPref9_NoDecimation | MixerPref9_ARAdjustXorY | MixerPref9_BiLinearFiltering + | MixerPref9_RenderTargetYUV), "Got flags %#x.\n", flags); + + IVMRMixerControl9_Release(mixer_control); + ref = IBaseFilter_Release(filter); + ok(!ref, "Got outstanding refcount %d.\n", ref); +} + START_TEST(vmr9) { IBaseFilter *filter; diff --git a/dlls/quartz/vmr9.c b/dlls/quartz/vmr9.c index 81e265f104a..a716a6e7128 100644 --- a/dlls/quartz/vmr9.c +++ b/dlls/quartz/vmr9.c @@ -84,6 +84,7 @@ struct quartz_vmr BOOL allocator_is_ex;
DWORD stream_count; + DWORD mixing_prefs;
/* * The Video Mixing Renderer supports 3 modes, renderless, windowless and windowed @@ -2227,7 +2228,10 @@ static HRESULT WINAPI mixer_control9_SetMixingPrefs(IVMRMixerControl9 *iface, DW
FIXME("filter %p, flags %#x, stub!\n", filter, flags);
- return E_NOTIMPL; + EnterCriticalSection(&filter->renderer.filter.csFilter); + filter->mixing_prefs = flags; + LeaveCriticalSection(&filter->renderer.filter.csFilter); + return S_OK; }
static HRESULT WINAPI mixer_control9_GetMixingPrefs(IVMRMixerControl9 *iface, DWORD *flags) @@ -2236,8 +2240,9 @@ static HRESULT WINAPI mixer_control9_GetMixingPrefs(IVMRMixerControl9 *iface, DW
FIXME("filter %p, flags %p, stub!\n", filter, flags);
- *flags = MixerPref9_NoDecimation | MixerPref9_ARAdjustXorY | MixerPref9_BiLinearFiltering | MixerPref9_RenderTargetRGB; - + EnterCriticalSection(&filter->renderer.filter.csFilter); + *flags = filter->mixing_prefs; + LeaveCriticalSection(&filter->renderer.filter.csFilter); return S_OK; }
@@ -2500,6 +2505,9 @@ static HRESULT vmr_create(IUnknown *outer, IUnknown **out, const CLSID *clsid)
object->run_event = CreateEventW(NULL, TRUE, FALSE, NULL);
+ object->mixing_prefs = MixerPref9_NoDecimation | MixerPref9_ARAdjustXorY + | MixerPref9_BiLinearFiltering | MixerPref9_RenderTargetRGB; + TRACE("Created VMR %p.\n", object); *out = &object->renderer.filter.IUnknown_inner; return S_OK;
From: Zebediah Figura zfigura@codeweavers.com
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/quartz/vmr9.c | 59 +++++++++++++++++++++++++--------------------- 1 file changed, 32 insertions(+), 27 deletions(-)
diff --git a/dlls/quartz/vmr9.c b/dlls/quartz/vmr9.c index a716a6e7128..7fca3550d1b 100644 --- a/dlls/quartz/vmr9.c +++ b/dlls/quartz/vmr9.c @@ -1699,17 +1699,18 @@ static HRESULT WINAPI VMR9WindowlessControl_SetVideoPosition(IVMRWindowlessContr return S_OK; }
-static HRESULT WINAPI VMR9WindowlessControl_GetVideoPosition(IVMRWindowlessControl9 *iface, RECT *source, RECT *dest) +static HRESULT WINAPI VMR9WindowlessControl_GetVideoPosition(IVMRWindowlessControl9 *iface, RECT *src, RECT *dst) { - struct quartz_vmr *This = impl_from_IVMRWindowlessControl9(iface); + struct quartz_vmr *filter = impl_from_IVMRWindowlessControl9(iface);
- if (source) - *source = This->window.src; + TRACE("filter %p, src %p, dst %p.\n", filter, src, dst);
- if (dest) - *dest = This->window.dst; + if (src) + *src = filter->window.src; + + if (dst) + *dst = filter->window.dst;
- FIXME("(%p/%p)->(%p/%p) stub\n", iface, This, source, dest); return S_OK; }
@@ -1955,42 +1956,46 @@ static ULONG WINAPI VMR9SurfaceAllocatorNotify_Release(IVMRSurfaceAllocatorNotif return refcount; }
-static HRESULT WINAPI VMR9SurfaceAllocatorNotify_AdviseSurfaceAllocator(IVMRSurfaceAllocatorNotify9 *iface, DWORD_PTR id, IVMRSurfaceAllocator9 *alloc) +static HRESULT WINAPI VMR9SurfaceAllocatorNotify_AdviseSurfaceAllocator( + IVMRSurfaceAllocatorNotify9 *iface, DWORD_PTR cookie, IVMRSurfaceAllocator9 *allocator) { - struct quartz_vmr *This = impl_from_IVMRSurfaceAllocatorNotify9(iface); + struct quartz_vmr *filter = impl_from_IVMRSurfaceAllocatorNotify9(iface);
- /* FIXME: This code is not tested!!! */ - FIXME("(%p/%p)->(...) stub\n", iface, This); - This->cookie = id; + TRACE("filter %p, cookie %#Ix, allocator %p.\n", filter, cookie, allocator);
- if (This->presenter) + filter->cookie = cookie; + + if (filter->presenter) return VFW_E_WRONG_STATE;
- if (FAILED(IVMRSurfaceAllocator9_QueryInterface(alloc, &IID_IVMRImagePresenter9, (void **)&This->presenter))) + if (FAILED(IVMRSurfaceAllocator9_QueryInterface(allocator, &IID_IVMRImagePresenter9, (void **)&filter->presenter))) return E_NOINTERFACE;
- if (SUCCEEDED(IVMRSurfaceAllocator9_QueryInterface(alloc, &IID_IVMRSurfaceAllocatorEx9, (void **)&This->allocator))) - This->allocator_is_ex = 1; + if (SUCCEEDED(IVMRSurfaceAllocator9_QueryInterface(allocator, + &IID_IVMRSurfaceAllocatorEx9, (void **)&filter->allocator))) + filter->allocator_is_ex = 1; else { - This->allocator = (IVMRSurfaceAllocatorEx9 *)alloc; - IVMRSurfaceAllocator9_AddRef(alloc); - This->allocator_is_ex = 0; + filter->allocator = (IVMRSurfaceAllocatorEx9 *)allocator; + IVMRSurfaceAllocator9_AddRef(allocator); + filter->allocator_is_ex = 0; }
return S_OK; }
-static HRESULT WINAPI VMR9SurfaceAllocatorNotify_SetD3DDevice(IVMRSurfaceAllocatorNotify9 *iface, IDirect3DDevice9 *device, HMONITOR monitor) +static HRESULT WINAPI VMR9SurfaceAllocatorNotify_SetD3DDevice(IVMRSurfaceAllocatorNotify9 *iface, + IDirect3DDevice9 *device, HMONITOR monitor) { - struct quartz_vmr *This = impl_from_IVMRSurfaceAllocatorNotify9(iface); + struct quartz_vmr *filter = impl_from_IVMRSurfaceAllocatorNotify9(iface);
- FIXME("(%p/%p)->(...) semi-stub\n", iface, This); - if (This->allocator_d3d9_dev) - IDirect3DDevice9_Release(This->allocator_d3d9_dev); - This->allocator_d3d9_dev = device; - IDirect3DDevice9_AddRef(This->allocator_d3d9_dev); - This->allocator_mon = monitor; + TRACE("filter %p, device %p, monitor %p.\n", filter, device, monitor); + + if (filter->allocator_d3d9_dev) + IDirect3DDevice9_Release(filter->allocator_d3d9_dev); + filter->allocator_d3d9_dev = device; + IDirect3DDevice9_AddRef(device); + filter->allocator_mon = monitor;
return S_OK; }
From: Zebediah Figura zfigura@codeweavers.com
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/quartz/tests/vmr9.c | 1 + dlls/quartz/vmr9.c | 33 ++++++++++++--------------------- 2 files changed, 13 insertions(+), 21 deletions(-)
diff --git a/dlls/quartz/tests/vmr9.c b/dlls/quartz/tests/vmr9.c index b25b8df8cb7..89515ad38f7 100644 --- a/dlls/quartz/tests/vmr9.c +++ b/dlls/quartz/tests/vmr9.c @@ -2852,6 +2852,7 @@ static HRESULT WINAPI allocator_QueryInterface(IVMRSurfaceAllocator9 *iface, REF IVMRImagePresenter9_AddRef(&presenter_iface); return S_OK; } + ok(!IsEqualGUID(iid, &IID_IVMRSurfaceAllocatorEx9), "Unexpected query for IVMRSurfaceAllocatorEx9.\n"); *out = NULL; return E_NOTIMPL; } diff --git a/dlls/quartz/vmr9.c b/dlls/quartz/vmr9.c index 7fca3550d1b..e02b642dbc1 100644 --- a/dlls/quartz/vmr9.c +++ b/dlls/quartz/vmr9.c @@ -79,9 +79,8 @@ struct quartz_vmr
IOverlay IOverlay_iface;
- IVMRSurfaceAllocatorEx9 *allocator; + IVMRSurfaceAllocator9 *allocator; IVMRImagePresenter9 *presenter; - BOOL allocator_is_ex;
DWORD stream_count; DWORD mixing_prefs; @@ -345,7 +344,7 @@ static HRESULT initialize_device(struct quartz_vmr *filter, VMR9AllocationInfo * HRESULT hr; DWORD i;
- if (FAILED(hr = IVMRSurfaceAllocatorEx9_InitializeDevice(filter->allocator, + if (FAILED(hr = IVMRSurfaceAllocator9_InitializeDevice(filter->allocator, filter->cookie, info, &count))) { WARN("Failed to initialize device (flags %#x), hr %#x.\n", info->dwFlags, hr); @@ -354,13 +353,13 @@ static HRESULT initialize_device(struct quartz_vmr *filter, VMR9AllocationInfo *
for (i = 0; i < count; ++i) { - if (FAILED(hr = IVMRSurfaceAllocatorEx9_GetSurface(filter->allocator, + if (FAILED(hr = IVMRSurfaceAllocator9_GetSurface(filter->allocator, filter->cookie, i, 0, &filter->surfaces[i]))) { ERR("Failed to get surface %u, hr %#x.\n", i, hr); while (i--) IDirect3DSurface9_Release(filter->surfaces[i]); - IVMRSurfaceAllocatorEx9_TerminateDevice(filter->allocator, filter->cookie); + IVMRSurfaceAllocator9_TerminateDevice(filter->allocator, filter->cookie); return hr; } } @@ -533,7 +532,7 @@ static HRESULT WINAPI VMR9_BreakConnect(struct strmbase_renderer *This) for (i = 0; i < pVMR9->num_surfaces; ++i) IDirect3DSurface9_Release(pVMR9->surfaces[i]); free(pVMR9->surfaces); - IVMRSurfaceAllocatorEx9_TerminateDevice(pVMR9->allocator, pVMR9->cookie); + IVMRSurfaceAllocator9_TerminateDevice(pVMR9->allocator, pVMR9->cookie); pVMR9->num_surfaces = 0; } return hr; @@ -558,8 +557,8 @@ static void vmr_destroy(struct strmbase_renderer *iface)
if (filter->allocator) { - IVMRSurfaceAllocatorEx9_TerminateDevice(filter->allocator, filter->cookie); - IVMRSurfaceAllocatorEx9_Release(filter->allocator); + IVMRSurfaceAllocator9_TerminateDevice(filter->allocator, filter->cookie); + IVMRSurfaceAllocator9_Release(filter->allocator); } if (filter->presenter) IVMRImagePresenter9_Release(filter->presenter); @@ -1353,7 +1352,7 @@ static HRESULT WINAPI VMR9FilterConfig_SetRenderingMode(IVMRFilterConfig9 *iface }
if (This->allocator) - IVMRSurfaceAllocatorEx9_Release(This->allocator); + IVMRSurfaceAllocator9_Release(This->allocator); if (This->presenter) IVMRImagePresenter9_Release(This->presenter);
@@ -1364,7 +1363,6 @@ static HRESULT WINAPI VMR9FilterConfig_SetRenderingMode(IVMRFilterConfig9 *iface { case VMR9Mode_Windowed: case VMR9Mode_Windowless: - This->allocator_is_ex = 0; This->cookie = ~0;
hr = VMR9DefaultAllocatorPresenterImpl_create(This, (LPVOID*)&This->presenter); @@ -1378,7 +1376,7 @@ static HRESULT WINAPI VMR9FilterConfig_SetRenderingMode(IVMRFilterConfig9 *iface This->presenter = NULL; } else - hr = IVMRSurfaceAllocatorEx9_AdviseNotify(This->allocator, &This->IVMRSurfaceAllocatorNotify9_iface); + hr = IVMRSurfaceAllocator9_AdviseNotify(This->allocator, &This->IVMRSurfaceAllocatorNotify9_iface); break; case VMR9Mode_Renderless: break; @@ -1971,15 +1969,8 @@ static HRESULT WINAPI VMR9SurfaceAllocatorNotify_AdviseSurfaceAllocator( if (FAILED(IVMRSurfaceAllocator9_QueryInterface(allocator, &IID_IVMRImagePresenter9, (void **)&filter->presenter))) return E_NOINTERFACE;
- if (SUCCEEDED(IVMRSurfaceAllocator9_QueryInterface(allocator, - &IID_IVMRSurfaceAllocatorEx9, (void **)&filter->allocator))) - filter->allocator_is_ex = 1; - else - { - filter->allocator = (IVMRSurfaceAllocatorEx9 *)allocator; - IVMRSurfaceAllocator9_AddRef(allocator); - filter->allocator_is_ex = 0; - } + filter->allocator = allocator; + IVMRSurfaceAllocator9_AddRef(allocator);
return S_OK; } @@ -2827,7 +2818,7 @@ static BOOL CreateRenderingWindow(struct default_presenter *This, VMR9Allocation
if (FAILED(hr)) { - IVMRSurfaceAllocatorEx9_TerminateDevice(This->pVMR9->allocator, This->pVMR9->cookie); + IVMRSurfaceAllocator9_TerminateDevice(This->pVMR9->allocator, This->pVMR9->cookie); return FALSE; }
From: Zebediah Figura zfigura@codeweavers.com
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/quartz/vmr9.c | 58 +++++++++++++++++++++++----------------------- 1 file changed, 29 insertions(+), 29 deletions(-)
diff --git a/dlls/quartz/vmr9.c b/dlls/quartz/vmr9.c index e02b642dbc1..bc03326599f 100644 --- a/dlls/quartz/vmr9.c +++ b/dlls/quartz/vmr9.c @@ -174,7 +174,7 @@ static inline struct quartz_vmr *impl_from_IVMRWindowlessControl9(IVMRWindowless struct default_presenter { IVMRImagePresenter9 IVMRImagePresenter9_iface; - IVMRSurfaceAllocatorEx9 IVMRSurfaceAllocatorEx9_iface; + IVMRSurfaceAllocator9 IVMRSurfaceAllocator9_iface;
LONG refCount;
@@ -195,9 +195,9 @@ static inline struct default_presenter *impl_from_IVMRImagePresenter9(IVMRImageP return CONTAINING_RECORD(iface, struct default_presenter, IVMRImagePresenter9_iface); }
-static inline struct default_presenter *impl_from_IVMRSurfaceAllocatorEx9(IVMRSurfaceAllocatorEx9 *iface) +static inline struct default_presenter *impl_from_IVMRSurfaceAllocator9(IVMRSurfaceAllocator9 *iface) { - return CONTAINING_RECORD(iface, struct default_presenter, IVMRSurfaceAllocatorEx9_iface); + return CONTAINING_RECORD(iface, struct default_presenter, IVMRSurfaceAllocator9_iface); }
static HRESULT VMR9DefaultAllocatorPresenterImpl_create(struct quartz_vmr *parent, LPVOID * ppv); @@ -1367,7 +1367,8 @@ static HRESULT WINAPI VMR9FilterConfig_SetRenderingMode(IVMRFilterConfig9 *iface
hr = VMR9DefaultAllocatorPresenterImpl_create(This, (LPVOID*)&This->presenter); if (SUCCEEDED(hr)) - hr = IVMRImagePresenter9_QueryInterface(This->presenter, &IID_IVMRSurfaceAllocatorEx9, (LPVOID*)&This->allocator); + hr = IVMRImagePresenter9_QueryInterface(This->presenter, + &IID_IVMRSurfaceAllocator9, (void **)&This->allocator); if (FAILED(hr)) { ERR("Unable to find Presenter interface\n"); @@ -2530,8 +2531,8 @@ static HRESULT WINAPI VMR9_ImagePresenter_QueryInterface(IVMRImagePresenter9 *if
if (IsEqualIID(riid, &IID_IUnknown) || IsEqualIID(riid, &IID_IVMRImagePresenter9)) *ppv = &This->IVMRImagePresenter9_iface; - else if (IsEqualIID(riid, &IID_IVMRSurfaceAllocatorEx9)) - *ppv = &This->IVMRSurfaceAllocatorEx9_iface; + else if (IsEqualIID(riid, &IID_IVMRSurfaceAllocator9)) + *ppv = &This->IVMRSurfaceAllocator9_iface;
if (*ppv) { @@ -2667,25 +2668,22 @@ static const IVMRImagePresenter9Vtbl VMR9_ImagePresenter = VMR9_ImagePresenter_PresentImage };
-static HRESULT WINAPI VMR9_SurfaceAllocator_QueryInterface(IVMRSurfaceAllocatorEx9 *iface, REFIID riid, LPVOID * ppv) +static HRESULT WINAPI VMR9_SurfaceAllocator_QueryInterface(IVMRSurfaceAllocator9 *iface, REFIID iid, void **out) { - struct default_presenter *This = impl_from_IVMRSurfaceAllocatorEx9(iface); - - return VMR9_ImagePresenter_QueryInterface(&This->IVMRImagePresenter9_iface, riid, ppv); + struct default_presenter *presenter = impl_from_IVMRSurfaceAllocator9(iface); + return IVMRImagePresenter9_QueryInterface(&presenter->IVMRImagePresenter9_iface, iid, out); }
-static ULONG WINAPI VMR9_SurfaceAllocator_AddRef(IVMRSurfaceAllocatorEx9 *iface) +static ULONG WINAPI VMR9_SurfaceAllocator_AddRef(IVMRSurfaceAllocator9 *iface) { - struct default_presenter *This = impl_from_IVMRSurfaceAllocatorEx9(iface); - - return VMR9_ImagePresenter_AddRef(&This->IVMRImagePresenter9_iface); + struct default_presenter *presenter = impl_from_IVMRSurfaceAllocator9(iface); + return IVMRImagePresenter9_AddRef(&presenter->IVMRImagePresenter9_iface); }
-static ULONG WINAPI VMR9_SurfaceAllocator_Release(IVMRSurfaceAllocatorEx9 *iface) +static ULONG WINAPI VMR9_SurfaceAllocator_Release(IVMRSurfaceAllocator9 *iface) { - struct default_presenter *This = impl_from_IVMRSurfaceAllocatorEx9(iface); - - return VMR9_ImagePresenter_Release(&This->IVMRImagePresenter9_iface); + struct default_presenter *presenter = impl_from_IVMRSurfaceAllocator9(iface); + return IVMRImagePresenter9_Release(&presenter->IVMRImagePresenter9_iface); }
static HRESULT VMR9_SurfaceAllocator_SetAllocationSettings(struct default_presenter *This, VMR9AllocationInfo *allocinfo) @@ -2827,9 +2825,10 @@ static BOOL CreateRenderingWindow(struct default_presenter *This, VMR9Allocation return TRUE; }
-static HRESULT WINAPI VMR9_SurfaceAllocator_InitializeDevice(IVMRSurfaceAllocatorEx9 *iface, DWORD_PTR id, VMR9AllocationInfo *allocinfo, DWORD *numbuffers) +static HRESULT WINAPI VMR9_SurfaceAllocator_InitializeDevice(IVMRSurfaceAllocator9 *iface, + DWORD_PTR cookie, VMR9AllocationInfo *allocinfo, DWORD *numbuffers) { - struct default_presenter *This = impl_from_IVMRSurfaceAllocatorEx9(iface); + struct default_presenter *This = impl_from_IVMRSurfaceAllocator9(iface);
This->info = *allocinfo;
@@ -2842,16 +2841,17 @@ static HRESULT WINAPI VMR9_SurfaceAllocator_InitializeDevice(IVMRSurfaceAllocato return S_OK; }
-static HRESULT WINAPI VMR9_SurfaceAllocator_TerminateDevice(IVMRSurfaceAllocatorEx9 *iface, DWORD_PTR id) +static HRESULT WINAPI VMR9_SurfaceAllocator_TerminateDevice(IVMRSurfaceAllocator9 *iface, DWORD_PTR cookie) { - TRACE("iface %p, id %#lx.\n", iface, id); + TRACE("iface %p, cookie %#lx.\n", iface, cookie);
return S_OK; }
-static HRESULT WINAPI VMR9_SurfaceAllocator_GetSurface(IVMRSurfaceAllocatorEx9 *iface, DWORD_PTR id, DWORD surfaceindex, DWORD flags, IDirect3DSurface9 **surface) +static HRESULT WINAPI VMR9_SurfaceAllocator_GetSurface(IVMRSurfaceAllocator9 *iface, + DWORD_PTR cookie, DWORD surfaceindex, DWORD flags, IDirect3DSurface9 **surface) { - struct default_presenter *This = impl_from_IVMRSurfaceAllocatorEx9(iface); + struct default_presenter *This = impl_from_IVMRSurfaceAllocator9(iface);
/* Update everything first, this is needed because the surface might be destroyed in the reset */ if (!This->d3d9_dev) @@ -2871,9 +2871,10 @@ static HRESULT WINAPI VMR9_SurfaceAllocator_GetSurface(IVMRSurfaceAllocatorEx9 * return S_OK; }
-static HRESULT WINAPI VMR9_SurfaceAllocator_AdviseNotify(IVMRSurfaceAllocatorEx9 *iface, IVMRSurfaceAllocatorNotify9 *allocnotify) +static HRESULT WINAPI VMR9_SurfaceAllocator_AdviseNotify(IVMRSurfaceAllocator9 *iface, + IVMRSurfaceAllocatorNotify9 *allocnotify) { - struct default_presenter *This = impl_from_IVMRSurfaceAllocatorEx9(iface); + struct default_presenter *This = impl_from_IVMRSurfaceAllocator9(iface);
TRACE("(%p/%p)->(...)\n", iface, This);
@@ -2882,7 +2883,7 @@ static HRESULT WINAPI VMR9_SurfaceAllocator_AdviseNotify(IVMRSurfaceAllocatorEx9 return S_OK; }
-static const IVMRSurfaceAllocatorEx9Vtbl VMR9_SurfaceAllocator = +static const IVMRSurfaceAllocator9Vtbl VMR9_SurfaceAllocator = { VMR9_SurfaceAllocator_QueryInterface, VMR9_SurfaceAllocator_AddRef, @@ -2891,7 +2892,6 @@ static const IVMRSurfaceAllocatorEx9Vtbl VMR9_SurfaceAllocator = VMR9_SurfaceAllocator_TerminateDevice, VMR9_SurfaceAllocator_GetSurface, VMR9_SurfaceAllocator_AdviseNotify, - NULL /* This isn't the SurfaceAllocatorEx type yet, working on it */ };
static IDirect3D9 *init_d3d9(HMODULE d3d9_handle) @@ -2940,7 +2940,7 @@ static HRESULT VMR9DefaultAllocatorPresenterImpl_create(struct quartz_vmr *paren }
object->IVMRImagePresenter9_iface.lpVtbl = &VMR9_ImagePresenter; - object->IVMRSurfaceAllocatorEx9_iface.lpVtbl = &VMR9_SurfaceAllocator; + object->IVMRSurfaceAllocator9_iface.lpVtbl = &VMR9_SurfaceAllocator;
object->refCount = 1; object->pVMR9 = parent;
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=72333
Your paranoid android.
=== debiant (32 bit Chinese:China report) ===
quartz: videorenderer.c:1053: Test failed: Got hr 0xdeadbeef. videorenderer.c:1054: Test failed: Got time e005a00000001.
From: Zebediah Figura zfigura@codeweavers.com
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/quartz/vmr9.c | 3 --- 1 file changed, 3 deletions(-)
diff --git a/dlls/quartz/vmr9.c b/dlls/quartz/vmr9.c index bc03326599f..6f699ce70fb 100644 --- a/dlls/quartz/vmr9.c +++ b/dlls/quartz/vmr9.c @@ -97,7 +97,6 @@ struct quartz_vmr
/* Presentation related members */ IDirect3DDevice9 *allocator_d3d9_dev; - HMONITOR allocator_mon; IDirect3DSurface9 **surfaces; DWORD num_surfaces; DWORD cur_surface; @@ -1987,7 +1986,6 @@ static HRESULT WINAPI VMR9SurfaceAllocatorNotify_SetD3DDevice(IVMRSurfaceAllocat IDirect3DDevice9_Release(filter->allocator_d3d9_dev); filter->allocator_d3d9_dev = device; IDirect3DDevice9_AddRef(device); - filter->allocator_mon = monitor;
return S_OK; } @@ -2001,7 +1999,6 @@ static HRESULT WINAPI VMR9SurfaceAllocatorNotify_ChangeD3DDevice(IVMRSurfaceAllo IDirect3DDevice9_Release(This->allocator_d3d9_dev); This->allocator_d3d9_dev = device; IDirect3DDevice9_AddRef(This->allocator_d3d9_dev); - This->allocator_mon = monitor;
return S_OK; }
From: Zebediah Figura zfigura@codeweavers.com
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/quartz/vmr9.c | 32 ++++++++++---------------------- 1 file changed, 10 insertions(+), 22 deletions(-)
diff --git a/dlls/quartz/vmr9.c b/dlls/quartz/vmr9.c index 6f699ce70fb..8ba82e8259c 100644 --- a/dlls/quartz/vmr9.c +++ b/dlls/quartz/vmr9.c @@ -2751,8 +2751,10 @@ static UINT d3d9_adapter_from_hwnd(IDirect3D9 *d3d9, HWND hwnd, HMONITOR *mon_ou return d3d9_adapter; }
-static BOOL CreateRenderingWindow(struct default_presenter *This, VMR9AllocationInfo *info, DWORD *numbuffers) +static HRESULT WINAPI VMR9_SurfaceAllocator_InitializeDevice(IVMRSurfaceAllocator9 *iface, + DWORD_PTR cookie, VMR9AllocationInfo *info, DWORD *numbuffers) { + struct default_presenter *This = impl_from_IVMRSurfaceAllocator9(iface); D3DPRESENT_PARAMETERS d3dpp; IDirect3DDevice9 *device; DWORD d3d9_adapter; @@ -2760,7 +2762,9 @@ static BOOL CreateRenderingWindow(struct default_presenter *This, VMR9Allocation HWND window; HRESULT hr;
- TRACE("(%p)->()\n", This); + TRACE("presenter %p, cookie %#Ix, info %p, numbuffers %p.\n", This, cookie, info, numbuffers); + + This->info = *info;
if (This->pVMR9->mode == VMR9Mode_Windowed) window = This->pVMR9->window.hwnd; @@ -2783,7 +2787,7 @@ static BOOL CreateRenderingWindow(struct default_presenter *This, VMR9Allocation if (FAILED(hr)) { ERR("Could not create device: %08x\n", hr); - return FALSE; + return hr; }
IDirect3DDevice9_GetDeviceCaps(device, &caps); @@ -2791,14 +2795,14 @@ static BOOL CreateRenderingWindow(struct default_presenter *This, VMR9Allocation { WARN("Device does not support blitting from textures.\n"); IDirect3DDevice9_Release(device); - return FALSE; + return VFW_E_DDRAW_CAPS_NOT_SUITABLE; }
This->d3d9_dev = device; IVMRSurfaceAllocatorNotify9_SetD3DDevice(This->SurfaceAllocatorNotify, This->d3d9_dev, This->hMon);
if (!(This->d3d9_surfaces = calloc(*numbuffers, sizeof(IDirect3DSurface9 *)))) - return FALSE; + return E_OUTOFMEMORY;
hr = VMR9_SurfaceAllocator_SetAllocationSettings(This, info); if (FAILED(hr)) @@ -2814,27 +2818,11 @@ static BOOL CreateRenderingWindow(struct default_presenter *This, VMR9Allocation if (FAILED(hr)) { IVMRSurfaceAllocator9_TerminateDevice(This->pVMR9->allocator, This->pVMR9->cookie); - return FALSE; + return hr; }
This->num_surfaces = *numbuffers;
- return TRUE; -} - -static HRESULT WINAPI VMR9_SurfaceAllocator_InitializeDevice(IVMRSurfaceAllocator9 *iface, - DWORD_PTR cookie, VMR9AllocationInfo *allocinfo, DWORD *numbuffers) -{ - struct default_presenter *This = impl_from_IVMRSurfaceAllocator9(iface); - - This->info = *allocinfo; - - if (!CreateRenderingWindow(This, allocinfo, numbuffers)) - { - ERR("Failed to create rendering window, expect no output!\n"); - return VFW_E_WRONG_STATE; - } - return S_OK; }
From: Zebediah Figura zfigura@codeweavers.com
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/quartz/vmr9.c | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-)
diff --git a/dlls/quartz/vmr9.c b/dlls/quartz/vmr9.c index 8ba82e8259c..4ea3b483a75 100644 --- a/dlls/quartz/vmr9.c +++ b/dlls/quartz/vmr9.c @@ -2583,19 +2583,21 @@ static ULONG WINAPI VMR9_ImagePresenter_Release(IVMRImagePresenter9 *iface) return refCount; }
-static HRESULT WINAPI VMR9_ImagePresenter_StartPresenting(IVMRImagePresenter9 *iface, DWORD_PTR id) +static HRESULT WINAPI VMR9_ImagePresenter_StartPresenting(IVMRImagePresenter9 *iface, DWORD_PTR cookie) { - struct default_presenter *This = impl_from_IVMRImagePresenter9(iface); + struct default_presenter *presenter = impl_from_IVMRImagePresenter9(iface); + + TRACE("presenter %p, cookie %#Ix.\n", presenter, cookie);
- TRACE("(%p/%p/%p)->(...) stub\n", iface, This,This->pVMR9); return S_OK; }
-static HRESULT WINAPI VMR9_ImagePresenter_StopPresenting(IVMRImagePresenter9 *iface, DWORD_PTR id) +static HRESULT WINAPI VMR9_ImagePresenter_StopPresenting(IVMRImagePresenter9 *iface, DWORD_PTR cookie) { - struct default_presenter *This = impl_from_IVMRImagePresenter9(iface); + struct default_presenter *presenter = impl_from_IVMRImagePresenter9(iface); + + TRACE("presenter %p, cookie %#Ix.\n", presenter, cookie);
- TRACE("(%p/%p/%p)->(...) stub\n", iface, This,This->pVMR9); return S_OK; }
@@ -2619,13 +2621,14 @@ static HRESULT VMR9_ImagePresenter_PresentOffscreenSurface(struct default_presen return hr; }
-static HRESULT WINAPI VMR9_ImagePresenter_PresentImage(IVMRImagePresenter9 *iface, DWORD_PTR id, VMR9PresentationInfo *info) +static HRESULT WINAPI VMR9_ImagePresenter_PresentImage(IVMRImagePresenter9 *iface, + DWORD_PTR cookie, VMR9PresentationInfo *info) { struct default_presenter *This = impl_from_IVMRImagePresenter9(iface); HRESULT hr; BOOL render = FALSE;
- TRACE("(%p/%p/%p)->(...) stub\n", iface, This, This->pVMR9); + TRACE("presenter %p, cookie %#Ix, info %p.\n", This, cookie, info);
/* This might happen if we don't have active focus (eg on a different virtual desktop) */ if (!This->d3d9_dev) @@ -2857,14 +2860,14 @@ static HRESULT WINAPI VMR9_SurfaceAllocator_GetSurface(IVMRSurfaceAllocator9 *if }
static HRESULT WINAPI VMR9_SurfaceAllocator_AdviseNotify(IVMRSurfaceAllocator9 *iface, - IVMRSurfaceAllocatorNotify9 *allocnotify) + IVMRSurfaceAllocatorNotify9 *notify) { - struct default_presenter *This = impl_from_IVMRSurfaceAllocator9(iface); + struct default_presenter *presenter = impl_from_IVMRSurfaceAllocator9(iface);
- TRACE("(%p/%p)->(...)\n", iface, This); + TRACE("presenter %p, notify %p.\n", presenter, notify);
/* No AddRef taken here or the base VMR9 filter would never be destroyed */ - This->SurfaceAllocatorNotify = allocnotify; + presenter->SurfaceAllocatorNotify = notify; return S_OK; }
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=72330
Your paranoid android.
=== w1064v1809_ar (32 bit report) ===
quartz: vmr9.c:1432: Test failed: Thread should block in Receive().
Zebediah Figura z.figura12@gmail.com writes:
@@ -3876,6 +3876,38 @@ out: DestroyWindow(window); }
+static void test_mixing_prefs(void) +{
You are not calling this anywhere.