Needed by Devil May Cry 3, which however only uses one stream.
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/quartz/tests/vmr9.c | 129 ++++++++++++++++++++------------------- dlls/quartz/vmr9.c | 27 +++++++- 2 files changed, 89 insertions(+), 67 deletions(-)
diff --git a/dlls/quartz/tests/vmr9.c b/dlls/quartz/tests/vmr9.c index 6fe2a9bab10..d67e3b6fdc7 100644 --- a/dlls/quartz/tests/vmr9.c +++ b/dlls/quartz/tests/vmr9.c @@ -59,7 +59,7 @@ static HRESULT set_mixing_mode(IBaseFilter *filter, DWORD count) ok(hr == S_OK, "Got hr %#x.\n", hr);
hr = IVMRFilterConfig9_SetNumberOfStreams(config, count); - todo_wine_if (count != 1) ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(hr == S_OK, "Got hr %#x.\n", hr);
IVMRFilterConfig9_Release(config); return hr; @@ -173,7 +173,7 @@ static void test_filter_config(void) todo_wine ok(hr == VFW_E_VMR_NOT_IN_MIXER_MODE, "Got hr %#x.\n", hr);
hr = IVMRFilterConfig9_SetNumberOfStreams(config, 3); - todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(hr == S_OK, "Got hr %#x.\n", hr);
hr = IVMRFilterConfig9_GetNumberOfStreams(config, &count); todo_wine { @@ -332,24 +332,21 @@ static void test_interfaces(void) ok(!ref, "Got outstanding refcount %d.\n", ref);
filter = create_vmr9(VMR9Mode_Windowed); - if (SUCCEEDED(set_mixing_mode(filter, 1))) - { - test_common_interfaces(filter); + test_common_interfaces(filter);
- check_interface(filter, &IID_IBasicVideo, TRUE); - todo_wine check_interface(filter, &IID_IBasicVideo2, TRUE); - check_interface(filter, &IID_IVideoWindow, TRUE); - todo_wine check_interface(filter, &IID_IVMRMixerControl9, TRUE); - /* IVMRMonitorConfig9 may not be available if the d3d9 device has - * insufficient support. */ - check_interface_broken(filter, &IID_IVMRMonitorConfig9, TRUE); + check_interface(filter, &IID_IBasicVideo, TRUE); + todo_wine check_interface(filter, &IID_IBasicVideo2, TRUE); + check_interface(filter, &IID_IVideoWindow, TRUE); + todo_wine check_interface(filter, &IID_IVMRMixerControl9, TRUE); + /* IVMRMonitorConfig9 may not be available if the d3d9 device has + * insufficient support. */ + check_interface_broken(filter, &IID_IVMRMonitorConfig9, TRUE);
- check_interface(filter, &IID_IVMRSurfaceAllocatorNotify9, FALSE); - check_interface(filter, &IID_IVMRWindowlessControl9, FALSE); + check_interface(filter, &IID_IVMRSurfaceAllocatorNotify9, FALSE); + check_interface(filter, &IID_IVMRWindowlessControl9, FALSE);
- ref = IBaseFilter_Release(filter); - ok(!ref, "Got outstanding refcount %d.\n", ref); - } + ref = IBaseFilter_Release(filter); + ok(!ref, "Got outstanding refcount %d.\n", ref); }
static const GUID test_iid = {0x33333333}; @@ -532,43 +529,42 @@ static void test_enum_pins(void)
IEnumPins_Release(enum2);
- if (SUCCEEDED(set_mixing_mode(filter, 2))) - { - hr = IEnumPins_Next(enum1, 1, pins, NULL); - ok(hr == S_FALSE, "Got hr %#x.\n", hr); + set_mixing_mode(filter, 2);
- hr = IEnumPins_Reset(enum1); - ok(hr == S_OK, "Got hr %#x.\n", hr); + hr = IEnumPins_Next(enum1, 1, pins, NULL); + ok(hr == S_FALSE, "Got hr %#x.\n", hr);
- hr = IEnumPins_Next(enum1, 1, pins, NULL); - ok(hr == S_OK, "Got hr %#x.\n", hr); - IPin_Release(pins[0]); + hr = IEnumPins_Reset(enum1); + ok(hr == S_OK, "Got hr %#x.\n", hr);
- hr = IEnumPins_Next(enum1, 1, pins, NULL); - ok(hr == S_OK, "Got hr %#x.\n", hr); - IPin_Release(pins[0]); + hr = IEnumPins_Next(enum1, 1, pins, NULL); + ok(hr == S_OK, "Got hr %#x.\n", hr); + IPin_Release(pins[0]);
- hr = IEnumPins_Next(enum1, 1, pins, NULL); - ok(hr == S_FALSE, "Got hr %#x.\n", hr); + hr = IEnumPins_Next(enum1, 1, pins, NULL); + todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr); + if (hr == S_OK) IPin_Release(pins[0]);
- hr = IEnumPins_Reset(enum1); - ok(hr == S_OK, "Got hr %#x.\n", hr); + hr = IEnumPins_Next(enum1, 1, pins, NULL); + ok(hr == S_FALSE, "Got hr %#x.\n", hr);
- hr = IEnumPins_Next(enum1, 2, pins, &count); - ok(hr == S_OK, "Got hr %#x.\n", hr); - ok(count == 2, "Got count %u.\n", count); - IPin_Release(pins[0]); - IPin_Release(pins[1]); + hr = IEnumPins_Reset(enum1); + ok(hr == S_OK, "Got hr %#x.\n", hr);
- hr = IEnumPins_Reset(enum1); - ok(hr == S_OK, "Got hr %#x.\n", hr); + hr = IEnumPins_Next(enum1, 2, pins, &count); + todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr); + todo_wine ok(count == 2, "Got count %u.\n", count); + IPin_Release(pins[0]); + if (count > 1) IPin_Release(pins[1]);
- hr = IEnumPins_Next(enum1, 3, pins, &count); - ok(hr == S_FALSE, "Got hr %#x.\n", hr); - ok(count == 2, "Got count %u.\n", count); - IPin_Release(pins[0]); - IPin_Release(pins[1]); - } + hr = IEnumPins_Reset(enum1); + ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IEnumPins_Next(enum1, 3, pins, &count); + ok(hr == S_FALSE, "Got hr %#x.\n", hr); + todo_wine ok(count == 2, "Got count %u.\n", count); + IPin_Release(pins[0]); + if (count > 1) IPin_Release(pins[1]);
IEnumPins_Release(enum1); ref = IBaseFilter_Release(filter); @@ -602,30 +598,32 @@ static void test_find_pin(void) hr = IBaseFilter_FindPin(filter, L"VMR Input1", &pin); ok(hr == VFW_E_NOT_FOUND, "Got hr %#x.\n", hr);
- if (SUCCEEDED(set_mixing_mode(filter, 2))) - { - IEnumPins_Reset(enum_pins); + set_mixing_mode(filter, 2);
- hr = IBaseFilter_FindPin(filter, L"VMR Input0", &pin); - ok(hr == S_OK, "Got hr %#x.\n", hr); - hr = IEnumPins_Next(enum_pins, 1, &pin2, NULL); - ok(hr == S_OK, "Got hr %#x.\n", hr); - ok(pin == pin2, "Pins did not match.\n"); - IPin_Release(pin); - IPin_Release(pin2); + IEnumPins_Reset(enum_pins);
- hr = IBaseFilter_FindPin(filter, L"VMR Input1", &pin); - ok(hr == S_OK, "Got hr %#x.\n", hr); + hr = IBaseFilter_FindPin(filter, L"VMR Input0", &pin); + ok(hr == S_OK, "Got hr %#x.\n", hr); + hr = IEnumPins_Next(enum_pins, 1, &pin2, NULL); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(pin == pin2, "Pins did not match.\n"); + IPin_Release(pin); + IPin_Release(pin2); + + hr = IBaseFilter_FindPin(filter, L"VMR Input1", &pin); + todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr); + if (hr == S_OK) + { hr = IEnumPins_Next(enum_pins, 1, &pin2, NULL); ok(hr == S_OK, "Got hr %#x.\n", hr); ok(pin == pin2, "Pins did not match.\n"); IPin_Release(pin); IPin_Release(pin2); - - hr = IBaseFilter_FindPin(filter, L"VMR Input2", &pin); - ok(hr == VFW_E_NOT_FOUND, "Got hr %#x.\n", hr); }
+ hr = IBaseFilter_FindPin(filter, L"VMR Input2", &pin); + ok(hr == VFW_E_NOT_FOUND, "Got hr %#x.\n", hr); + IEnumPins_Release(enum_pins); ref = IBaseFilter_Release(filter); ok(!ref, "Got outstanding refcount %d.\n", ref); @@ -662,9 +660,12 @@ static void test_pin_info(void)
IPin_Release(pin);
- if (SUCCEEDED(set_mixing_mode(filter, 2))) + set_mixing_mode(filter, 2); + + hr = IBaseFilter_FindPin(filter, L"VMR Input1", &pin); + todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr); + if (hr == S_OK) { - IBaseFilter_FindPin(filter, L"VMR Input1", &pin); hr = IPin_QueryPinInfo(pin, &info); ok(info.pFilter == filter, "Expected filter %p, got %p.\n", filter, info.pFilter); ok(info.dir == PINDIR_INPUT, "Got direction %d.\n", info.dir); @@ -3160,7 +3161,7 @@ static void test_mixing_mode(void) IVMRMixerControl9_Release(mixer_control);
hr = IVMRFilterConfig9_SetNumberOfStreams(config, 2); - todo_wine ok(hr == VFW_E_WRONG_STATE, "Got hr %#x.\n", hr); + ok(hr == VFW_E_WRONG_STATE, "Got hr %#x.\n", hr);
hr = IVMRFilterConfig9_GetNumberOfStreams(config, &stream_count); todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr); diff --git a/dlls/quartz/vmr9.c b/dlls/quartz/vmr9.c index 5ff63467338..ef306a546b3 100644 --- a/dlls/quartz/vmr9.c +++ b/dlls/quartz/vmr9.c @@ -82,6 +82,8 @@ struct quartz_vmr IVMRImagePresenter9 *presenter; BOOL allocator_is_ex;
+ DWORD stream_count; + /* * The Video Mixing Renderer supports 3 modes, renderless, windowless and windowed * What I do is implement windowless as a special case of renderless, and then @@ -1274,10 +1276,29 @@ static HRESULT WINAPI VMR9FilterConfig_SetImageCompositor(IVMRFilterConfig9 *ifa
static HRESULT WINAPI VMR9FilterConfig_SetNumberOfStreams(IVMRFilterConfig9 *iface, DWORD count) { + struct quartz_vmr *filter = impl_from_IVMRFilterConfig9(iface); + FIXME("iface %p, count %u, stub!\n", iface, count); - if (count == 1) - return S_OK; - return E_NOTIMPL; + + if (!count) + { + WARN("Application requested zero streams; returning E_INVALIDARG.\n"); + return E_INVALIDARG; + } + + EnterCriticalSection(&filter->renderer.filter.csFilter); + + if (filter->stream_count) + { + LeaveCriticalSection(&filter->renderer.filter.csFilter); + WARN("Stream count is already set; returning VFW_E_WRONG_STATE.\n"); + return VFW_E_WRONG_STATE; + } + + filter->stream_count = count; + + LeaveCriticalSection(&filter->renderer.filter.csFilter); + return S_OK; }
static HRESULT WINAPI VMR9FilterConfig_GetNumberOfStreams(IVMRFilterConfig9 *iface, DWORD *max)
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/quartz/tests/vmr9.c | 26 +++++++++++--------------- dlls/quartz/vmr9.c | 20 ++++++++++++++++---- 2 files changed, 27 insertions(+), 19 deletions(-)
diff --git a/dlls/quartz/tests/vmr9.c b/dlls/quartz/tests/vmr9.c index d67e3b6fdc7..0b6fde1d4b7 100644 --- a/dlls/quartz/tests/vmr9.c +++ b/dlls/quartz/tests/vmr9.c @@ -170,16 +170,14 @@ static void test_filter_config(void) ok(hr == S_OK, "Got hr %#x.\n", hr);
hr = IVMRFilterConfig9_GetNumberOfStreams(config, &count); - todo_wine ok(hr == VFW_E_VMR_NOT_IN_MIXER_MODE, "Got hr %#x.\n", hr); + ok(hr == VFW_E_VMR_NOT_IN_MIXER_MODE, "Got hr %#x.\n", hr);
hr = IVMRFilterConfig9_SetNumberOfStreams(config, 3); ok(hr == S_OK, "Got hr %#x.\n", hr);
hr = IVMRFilterConfig9_GetNumberOfStreams(config, &count); - todo_wine { - ok(hr == S_OK, "Got hr %#x.\n", hr); - ok(count == 3, "Got count %u.\n", count); - } + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(count == 3, "Got count %u.\n", count);
hr = IVMRFilterConfig9_GetRenderingMode(config, &mode); ok(hr == S_OK, "Got hr %#x.\n", hr); @@ -195,10 +193,8 @@ static void test_filter_config(void) ok(mode == VMR9Mode_Windowless, "Got mode %#x.\n", mode);
hr = IVMRFilterConfig9_GetNumberOfStreams(config, &count); - todo_wine { - ok(hr == S_OK, "Got hr %#x.\n", hr); - ok(count == 3, "Got count %u.\n", count); - } + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(count == 3, "Got count %u.\n", count);
ref = IVMRFilterConfig9_Release(config); ok(!ref, "Got outstanding refcount %d.\n", ref); @@ -3146,14 +3142,14 @@ static void test_mixing_mode(void) ok(hr == E_NOINTERFACE, "Got hr %#x.\n", hr);
hr = IVMRFilterConfig9_GetNumberOfStreams(config, &stream_count); - todo_wine ok(hr == VFW_E_VMR_NOT_IN_MIXER_MODE, "Got hr %#x.\n", hr); + ok(hr == VFW_E_VMR_NOT_IN_MIXER_MODE, "Got hr %#x.\n", hr);
hr = IVMRFilterConfig9_SetNumberOfStreams(config, 1); ok(hr == S_OK, "Got hr %#x.\n", hr);
hr = IVMRFilterConfig9_GetNumberOfStreams(config, &stream_count); - todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr); - todo_wine ok(stream_count == 1, "Got %u streams.\n", stream_count); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(stream_count == 1, "Got %u streams.\n", stream_count);
hr = IBaseFilter_QueryInterface(filter, &IID_IVMRMixerControl9, (void **)&mixer_control); todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr); @@ -3164,8 +3160,8 @@ static void test_mixing_mode(void) ok(hr == VFW_E_WRONG_STATE, "Got hr %#x.\n", hr);
hr = IVMRFilterConfig9_GetNumberOfStreams(config, &stream_count); - todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr); - todo_wine ok(stream_count == 1, "Got %u streams.\n", stream_count); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(stream_count == 1, "Got %u streams.\n", stream_count);
IVMRFilterConfig9_Release(config); ref = IBaseFilter_Release(filter); @@ -3194,7 +3190,7 @@ static void test_mixing_mode(void) todo_wine ok(hr == VFW_E_WRONG_STATE, "Got hr %#x.\n", hr);
hr = IVMRFilterConfig9_GetNumberOfStreams(config, &stream_count); - todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(hr == S_OK, "Got hr %#x.\n", hr); todo_wine ok(stream_count == 4, "Got %u streams.\n", stream_count);
IVMRWindowlessControl9_Release(windowless_control); diff --git a/dlls/quartz/vmr9.c b/dlls/quartz/vmr9.c index ef306a546b3..6dfc82804f1 100644 --- a/dlls/quartz/vmr9.c +++ b/dlls/quartz/vmr9.c @@ -1301,12 +1301,24 @@ static HRESULT WINAPI VMR9FilterConfig_SetNumberOfStreams(IVMRFilterConfig9 *ifa return S_OK; }
-static HRESULT WINAPI VMR9FilterConfig_GetNumberOfStreams(IVMRFilterConfig9 *iface, DWORD *max) +static HRESULT WINAPI VMR9FilterConfig_GetNumberOfStreams(IVMRFilterConfig9 *iface, DWORD *count) { - struct quartz_vmr *This = impl_from_IVMRFilterConfig9(iface); + struct quartz_vmr *filter = impl_from_IVMRFilterConfig9(iface);
- FIXME("(%p/%p)->(%p) stub\n", iface, This, max); - return E_NOTIMPL; + TRACE("filter %p, count %p.\n", filter, count); + + EnterCriticalSection(&filter->renderer.filter.csFilter); + + if (!filter->stream_count) + { + LeaveCriticalSection(&filter->renderer.filter.csFilter); + return VFW_E_VMR_NOT_IN_MIXER_MODE; + } + + *count = filter->stream_count; + + LeaveCriticalSection(&filter->renderer.filter.csFilter); + return S_OK; }
static HRESULT WINAPI VMR9FilterConfig_SetRenderingPrefs(IVMRFilterConfig9 *iface, DWORD renderflags)
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=71639
Your paranoid android.
=== w8 (32 bit report) ===
quartz: vmr9.c:336: Test failed: Got hr 0x80004002, expected 0.
=== w8adm (32 bit report) ===
quartz: vmr9.c:336: Test failed: Got hr 0x80004002, expected 0.
=== w1064v1507 (32 bit report) ===
quartz: vmr9.c:336: Test failed: Got hr 0x80004002, expected 0.
=== w1064v1809 (32 bit report) ===
quartz: vmr9.c:336: Test failed: Got hr 0x80004002, expected 0.
=== w1064v1809_2scr (32 bit report) ===
quartz: vmr9.c:336: Test failed: Got hr 0x80004002, expected 0.
=== w1064v1809_ar (32 bit report) ===
quartz: vmr9.c:336: Test failed: Got hr 0x80004002, expected 0.
=== w1064v1809_he (32 bit report) ===
quartz: vmr9.c:336: Test failed: Got hr 0x80004002, expected 0.
=== w1064v1809_ja (32 bit report) ===
quartz: vmr9.c:336: Test failed: Got hr 0x80004002, expected 0.
=== w1064v1809_zh_CN (32 bit report) ===
quartz: vmr9.c:336: Test failed: Got hr 0x80004002, expected 0.
=== w864 (64 bit report) ===
quartz: vmr9.c:336: Test failed: Got hr 0x80004002, expected 0.
=== w1064v1507 (64 bit report) ===
quartz: vmr9.c:336: Test failed: Got hr 0x80004002, expected 0.
=== w1064v1809 (64 bit report) ===
quartz: vmr9.c:336: Test failed: Got hr 0x80004002, expected 0.
Needed by Sniper Fury and Modern Combat 5.
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/quartz/tests/vmr9.c | 10 +-- dlls/quartz/vmr9.c | 171 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 175 insertions(+), 6 deletions(-)
diff --git a/dlls/quartz/tests/vmr9.c b/dlls/quartz/tests/vmr9.c index 0b6fde1d4b7..2b6643a060b 100644 --- a/dlls/quartz/tests/vmr9.c +++ b/dlls/quartz/tests/vmr9.c @@ -3152,9 +3152,8 @@ static void test_mixing_mode(void) ok(stream_count == 1, "Got %u streams.\n", stream_count);
hr = IBaseFilter_QueryInterface(filter, &IID_IVMRMixerControl9, (void **)&mixer_control); - todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr); - if (hr == S_OK) - IVMRMixerControl9_Release(mixer_control); + ok(hr == S_OK, "Got hr %#x.\n", hr); + IVMRMixerControl9_Release(mixer_control);
hr = IVMRFilterConfig9_SetNumberOfStreams(config, 2); ok(hr == VFW_E_WRONG_STATE, "Got hr %#x.\n", hr); @@ -3182,9 +3181,8 @@ static void test_mixing_mode(void) todo_wine ok(stream_count == 4, "Got %u streams.\n", stream_count);
hr = IBaseFilter_QueryInterface(filter, &IID_IVMRMixerControl9, (void **)&mixer_control); - todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr); - if (hr == S_OK) - IVMRMixerControl9_Release(mixer_control); + ok(hr == S_OK, "Got hr %#x.\n", hr); + IVMRMixerControl9_Release(mixer_control);
hr = IVMRFilterConfig9_SetNumberOfStreams(config, 2); todo_wine ok(hr == VFW_E_WRONG_STATE, "Got hr %#x.\n", hr); diff --git a/dlls/quartz/vmr9.c b/dlls/quartz/vmr9.c index 6dfc82804f1..edcfe447323 100644 --- a/dlls/quartz/vmr9.c +++ b/dlls/quartz/vmr9.c @@ -63,6 +63,7 @@ struct quartz_vmr IVMRFilterConfig IVMRFilterConfig_iface; IVMRFilterConfig9 IVMRFilterConfig9_iface; IVMRMixerBitmap9 IVMRMixerBitmap9_iface; + IVMRMixerControl9 IVMRMixerControl9_iface; IVMRMonitorConfig IVMRMonitorConfig_iface; IVMRMonitorConfig9 IVMRMonitorConfig9_iface; IVMRSurfaceAllocatorNotify IVMRSurfaceAllocatorNotify_iface; @@ -597,6 +598,8 @@ static HRESULT vmr_query_interface(struct strmbase_renderer *iface, REFIID iid, *out = &filter->IVMRFilterConfig9_iface; else if (IsEqualGUID(iid, &IID_IVMRMixerBitmap9) && is_vmr9(filter)) *out = &filter->IVMRMixerBitmap9_iface; + else if (IsEqualGUID(iid, &IID_IVMRMixerControl9) && is_vmr9(filter) && filter->stream_count) + *out = &filter->IVMRMixerControl9_iface; else if (IsEqualGUID(iid, &IID_IVMRMonitorConfig)) *out = &filter->IVMRMonitorConfig_iface; else if (IsEqualGUID(iid, &IID_IVMRMonitorConfig9)) @@ -2121,6 +2124,173 @@ static const IVMRSurfaceAllocatorNotify9Vtbl VMR9_SurfaceAllocatorNotify_Vtbl = VMR9SurfaceAllocatorNotify_NotifyEvent };
+static inline struct quartz_vmr *impl_from_IVMRMixerControl9(IVMRMixerControl9 *iface) +{ + return CONTAINING_RECORD(iface, struct quartz_vmr, IVMRMixerControl9_iface); +} + +static HRESULT WINAPI mixer_control9_QueryInterface(IVMRMixerControl9 *iface, REFIID iid, void **out) +{ + struct quartz_vmr *filter = impl_from_IVMRMixerControl9(iface); + return IUnknown_QueryInterface(filter->renderer.filter.outer_unk, iid, out); +} + +static ULONG WINAPI mixer_control9_AddRef(IVMRMixerControl9 *iface) +{ + struct quartz_vmr *filter = impl_from_IVMRMixerControl9(iface); + return IUnknown_AddRef(filter->renderer.filter.outer_unk); +} + +static ULONG WINAPI mixer_control9_Release(IVMRMixerControl9 *iface) +{ + struct quartz_vmr *filter = impl_from_IVMRMixerControl9(iface); + return IUnknown_Release(filter->renderer.filter.outer_unk); +} + +static HRESULT WINAPI mixer_control9_SetAlpha(IVMRMixerControl9 *iface, DWORD stream, float alpha) +{ + struct quartz_vmr *filter = impl_from_IVMRMixerControl9(iface); + + FIXME("filter %p, stream %u, alpha %.8e, stub!\n", filter, stream, alpha); + + return E_NOTIMPL; +} + +static HRESULT WINAPI mixer_control9_GetAlpha(IVMRMixerControl9 *iface, DWORD stream, float *alpha) +{ + struct quartz_vmr *filter = impl_from_IVMRMixerControl9(iface); + + FIXME("filter %p, stream %u, alpha %p, stub!\n", filter, stream, alpha); + + return E_NOTIMPL; +} + +static HRESULT WINAPI mixer_control9_SetZOrder(IVMRMixerControl9 *iface, DWORD stream, DWORD z) +{ + struct quartz_vmr *filter = impl_from_IVMRMixerControl9(iface); + + FIXME("filter %p, stream %u, z %u, stub!\n", filter, stream, z); + + return E_NOTIMPL; +} + +static HRESULT WINAPI mixer_control9_GetZOrder(IVMRMixerControl9 *iface, DWORD stream, DWORD *z) +{ + struct quartz_vmr *filter = impl_from_IVMRMixerControl9(iface); + + FIXME("filter %p, stream %u, z %p, stub!\n", filter, stream, z); + + return E_NOTIMPL; +} + +static HRESULT WINAPI mixer_control9_SetOutputRect(IVMRMixerControl9 *iface, + DWORD stream, const VMR9NormalizedRect *rect) +{ + struct quartz_vmr *filter = impl_from_IVMRMixerControl9(iface); + + FIXME("filter %p, stream %u, rect %s, stub!\n", filter, stream, debugstr_normalized_rect(rect)); + + return E_NOTIMPL; +} + +static HRESULT WINAPI mixer_control9_GetOutputRect(IVMRMixerControl9 *iface, + DWORD stream, VMR9NormalizedRect *rect) +{ + struct quartz_vmr *filter = impl_from_IVMRMixerControl9(iface); + + FIXME("filter %p, stream %u, rect %p, stub!\n", filter, stream, rect); + + return E_NOTIMPL; +} + +static HRESULT WINAPI mixer_control9_SetBackgroundClr(IVMRMixerControl9 *iface, COLORREF color) +{ + struct quartz_vmr *filter = impl_from_IVMRMixerControl9(iface); + + FIXME("filter %p, color #%06x, stub!\n", filter, color); + + return E_NOTIMPL; +} + +static HRESULT WINAPI mixer_control9_GetBackgroundClr(IVMRMixerControl9 *iface, COLORREF *color) +{ + struct quartz_vmr *filter = impl_from_IVMRMixerControl9(iface); + + FIXME("filter %p, color %p, stub!\n", filter, color); + + return E_NOTIMPL; +} + +static HRESULT WINAPI mixer_control9_SetMixingPrefs(IVMRMixerControl9 *iface, DWORD flags) +{ + struct quartz_vmr *filter = impl_from_IVMRMixerControl9(iface); + + FIXME("filter %p, flags %#x, stub!\n", filter, flags); + + return E_NOTIMPL; +} + +static HRESULT WINAPI mixer_control9_GetMixingPrefs(IVMRMixerControl9 *iface, DWORD *flags) +{ + struct quartz_vmr *filter = impl_from_IVMRMixerControl9(iface); + + FIXME("filter %p, flags %p, stub!\n", filter, flags); + + *flags = MixerPref9_NoDecimation | MixerPref9_ARAdjustXorY | MixerPref9_BiLinearFiltering | MixerPref9_RenderTargetRGB; + + return S_OK; +} + +static HRESULT WINAPI mixer_control9_SetProcAmpControl(IVMRMixerControl9 *iface, + DWORD stream, VMR9ProcAmpControl *settings) +{ + struct quartz_vmr *filter = impl_from_IVMRMixerControl9(iface); + + FIXME("filter %p, settings %p, stub!\n", filter, settings); + + return E_NOTIMPL; +} + +static HRESULT WINAPI mixer_control9_GetProcAmpControl(IVMRMixerControl9 *iface, + DWORD stream, VMR9ProcAmpControl *settings) +{ + struct quartz_vmr *filter = impl_from_IVMRMixerControl9(iface); + + FIXME("filter %p, settings %p, stub!\n", filter, settings); + + return E_NOTIMPL; +} + +static HRESULT WINAPI mixer_control9_GetProcAmpControlRange(IVMRMixerControl9 *iface, + DWORD stream, VMR9ProcAmpControlRange *settings) +{ + struct quartz_vmr *filter = impl_from_IVMRMixerControl9(iface); + + FIXME("filter %p, settings %p, stub!\n", filter, settings); + + return E_NOTIMPL; +} + +static const IVMRMixerControl9Vtbl mixer_control9_vtbl = +{ + mixer_control9_QueryInterface, + mixer_control9_AddRef, + mixer_control9_Release, + mixer_control9_SetAlpha, + mixer_control9_GetAlpha, + mixer_control9_SetZOrder, + mixer_control9_GetZOrder, + mixer_control9_SetOutputRect, + mixer_control9_GetOutputRect, + mixer_control9_SetBackgroundClr, + mixer_control9_GetBackgroundClr, + mixer_control9_SetMixingPrefs, + mixer_control9_GetMixingPrefs, + mixer_control9_SetProcAmpControl, + mixer_control9_GetProcAmpControl, + mixer_control9_GetProcAmpControlRange, +}; + static inline struct quartz_vmr *impl_from_IVMRMixerBitmap9(IVMRMixerBitmap9 *iface) { return CONTAINING_RECORD(iface, struct quartz_vmr, IVMRMixerBitmap9_iface); @@ -2307,6 +2477,7 @@ static HRESULT vmr_create(IUnknown *outer, IUnknown **out, const CLSID *clsid) object->IVMRFilterConfig_iface.lpVtbl = &VMR7_FilterConfig_Vtbl; object->IVMRFilterConfig9_iface.lpVtbl = &VMR9_FilterConfig_Vtbl; object->IVMRMixerBitmap9_iface.lpVtbl = &mixer_bitmap9_vtbl; + object->IVMRMixerControl9_iface.lpVtbl = &mixer_control9_vtbl; object->IVMRMonitorConfig_iface.lpVtbl = &VMR7_MonitorConfig_Vtbl; object->IVMRMonitorConfig9_iface.lpVtbl = &VMR9_MonitorConfig_Vtbl; object->IVMRSurfaceAllocatorNotify_iface.lpVtbl = &VMR7_SurfaceAllocatorNotify_Vtbl;
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=71640
Your paranoid android.
=== w8 (32 bit report) ===
quartz: vmr9.c:336: Test failed: Got hr 0x80004002, expected 0.
=== w8adm (32 bit report) ===
quartz: vmr9.c:336: Test failed: Got hr 0x80004002, expected 0.
=== w1064v1507 (32 bit report) ===
quartz: vmr9.c:336: Test failed: Got hr 0x80004002, expected 0.
=== w1064v1809 (32 bit report) ===
quartz: vmr9.c:336: Test failed: Got hr 0x80004002, expected 0.
=== w1064v1809_2scr (32 bit report) ===
quartz: vmr9.c:336: Test failed: Got hr 0x80004002, expected 0.
=== w1064v1809_ar (32 bit report) ===
quartz: vmr9.c:336: Test failed: Got hr 0x80004002, expected 0.
=== w1064v1809_he (32 bit report) ===
quartz: vmr9.c:336: Test failed: Got hr 0x80004002, expected 0.
=== w1064v1809_ja (32 bit report) ===
quartz: vmr9.c:336: Test failed: Got hr 0x80004002, expected 0.
=== w1064v1809_zh_CN (32 bit report) ===
quartz: vmr9.c:336: Test failed: Got hr 0x80004002, expected 0.
=== w864 (64 bit report) ===
quartz: vmr9.c:336: Test failed: Got hr 0x80004002, expected 0.
=== w1064v1507 (64 bit report) ===
quartz: vmr9.c:336: Test failed: Got hr 0x80004002, expected 0.
=== w1064v1809 (64 bit report) ===
quartz: vmr9.c:336: Test failed: Got hr 0x80004002, expected 0.
=== debiant (32 bit report) ===
quartz: vmr9.c:3184: Test failed: Got hr 0x80004002. Unhandled exception: page fault on read access to 0x00000000 in 32-bit code (0x00487420).
Report validation errors: quartz:vmr9 crashed (c0000005)
=== debiant (32 bit French report) ===
quartz: vmr9.c:3184: Test failed: Got hr 0x80004002. Unhandled exception: page fault on read access to 0x00000000 in 32-bit code (0x00487420).
Report validation errors: quartz:vmr9 crashed (c0000005)
=== debiant (32 bit Japanese:Japan report) ===
quartz: vmr9.c:3184: Test failed: Got hr 0x80004002. Unhandled exception: page fault on read access to 0x00000000 in 32-bit code (0x00487420).
Report validation errors: quartz:vmr9 crashed (c0000005)
=== debiant (32 bit Chinese:China report) ===
quartz: vmr9.c:3184: Test failed: Got hr 0x80004002. Unhandled exception: page fault on read access to 0x00000000 in 32-bit code (0x00487420).
Report validation errors: quartz:vmr9 crashed (c0000005)
=== debiant (32 bit WoW report) ===
quartz: vmr9.c:3184: Test failed: Got hr 0x80004002. Unhandled exception: page fault on read access to 0x00000000 in 32-bit code (0x00487420).
Report validation errors: quartz:vmr9 crashed (c0000005)
=== debiant (64 bit WoW report) ===
quartz: vmr9.c:3184: Test failed: Got hr 0x80004002. Unhandled exception: page fault on read access to 0x00000000 in 32-bit code (0x00487420).
Report validation errors: quartz:vmr9 crashed (c0000005)
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/quartz/tests/vmr9.c | 8 ++++---- dlls/quartz/vmr9.c | 5 ++++- 2 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/dlls/quartz/tests/vmr9.c b/dlls/quartz/tests/vmr9.c index 2b6643a060b..25f66bc0a0c 100644 --- a/dlls/quartz/tests/vmr9.c +++ b/dlls/quartz/tests/vmr9.c @@ -3177,19 +3177,19 @@ static void test_mixing_mode(void) ok(hr == S_OK, "Got hr %#x.\n", hr);
hr = IVMRFilterConfig9_GetNumberOfStreams(config, &stream_count); - todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr); - todo_wine ok(stream_count == 4, "Got %u streams.\n", stream_count); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(stream_count == 4, "Got %u streams.\n", stream_count);
hr = IBaseFilter_QueryInterface(filter, &IID_IVMRMixerControl9, (void **)&mixer_control); ok(hr == S_OK, "Got hr %#x.\n", hr); IVMRMixerControl9_Release(mixer_control);
hr = IVMRFilterConfig9_SetNumberOfStreams(config, 2); - todo_wine ok(hr == VFW_E_WRONG_STATE, "Got hr %#x.\n", hr); + ok(hr == VFW_E_WRONG_STATE, "Got hr %#x.\n", hr);
hr = IVMRFilterConfig9_GetNumberOfStreams(config, &stream_count); ok(hr == S_OK, "Got hr %#x.\n", hr); - todo_wine ok(stream_count == 4, "Got %u streams.\n", stream_count); + ok(stream_count == 4, "Got %u streams.\n", stream_count);
IVMRWindowlessControl9_Release(windowless_control); IVMRFilterConfig9_Release(config); diff --git a/dlls/quartz/vmr9.c b/dlls/quartz/vmr9.c index edcfe447323..73119431a67 100644 --- a/dlls/quartz/vmr9.c +++ b/dlls/quartz/vmr9.c @@ -1734,6 +1734,7 @@ static HRESULT WINAPI VMR9WindowlessControl_SetAspectRatioMode(IVMRWindowlessCon static HRESULT WINAPI VMR9WindowlessControl_SetVideoClippingWindow(IVMRWindowlessControl9 *iface, HWND window) { struct quartz_vmr *filter = impl_from_IVMRWindowlessControl9(iface); + HRESULT hr;
TRACE("filter %p, window %p.\n", filter, window);
@@ -1754,8 +1755,10 @@ static HRESULT WINAPI VMR9WindowlessControl_SetVideoClippingWindow(IVMRWindowles
filter->clipping_window = window;
+ hr = IVMRFilterConfig9_SetNumberOfStreams(&filter->IVMRFilterConfig9_iface, 4); + LeaveCriticalSection(&filter->renderer.filter.csFilter); - return S_OK; + return hr; }
static HRESULT WINAPI VMR9WindowlessControl_RepaintVideo(IVMRWindowlessControl9 *iface, HWND hwnd, HDC hdc)
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=71641
Your paranoid android.
=== w8 (32 bit report) ===
quartz: vmr9.c:336: Test failed: Got hr 0x80004002, expected 0.
=== w8adm (32 bit report) ===
quartz: vmr9.c:336: Test failed: Got hr 0x80004002, expected 0.
=== w1064v1507 (32 bit report) ===
quartz: vmr9.c:336: Test failed: Got hr 0x80004002, expected 0.
=== w1064v1809 (32 bit report) ===
quartz: vmr9.c:336: Test failed: Got hr 0x80004002, expected 0.
=== w1064v1809_2scr (32 bit report) ===
quartz: vmr9.c:336: Test failed: Got hr 0x80004002, expected 0.
=== w1064v1809_ar (32 bit report) ===
quartz: vmr9.c:336: Test failed: Got hr 0x80004002, expected 0.
=== w1064v1809_he (32 bit report) ===
quartz: vmr9.c:336: Test failed: Got hr 0x80004002, expected 0.
=== w1064v1809_ja (32 bit report) ===
quartz: vmr9.c:336: Test failed: Got hr 0x80004002, expected 0.
=== w1064v1809_zh_CN (32 bit report) ===
quartz: vmr9.c:336: Test failed: Got hr 0x80004002, expected 0.
=== w864 (64 bit report) ===
quartz: vmr9.c:336: Test failed: Got hr 0x80004002, expected 0.
=== w1064v1507 (64 bit report) ===
quartz: vmr9.c:336: Test failed: Got hr 0x80004002, expected 0.
=== w1064v1809 (64 bit report) ===
quartz: vmr9.c:336: Test failed: Got hr 0x80004002, expected 0.
Avoid allocating it twice if we try multiple formats.
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/quartz/vmr9.c | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-)
diff --git a/dlls/quartz/vmr9.c b/dlls/quartz/vmr9.c index 73119431a67..81e265f104a 100644 --- a/dlls/quartz/vmr9.c +++ b/dlls/quartz/vmr9.c @@ -339,25 +339,19 @@ static HRESULT WINAPI VMR9_CheckMediaType(struct strmbase_renderer *iface, const return S_OK; }
-static HRESULT initialize_device(struct quartz_vmr *filter, VMR9AllocationInfo *info) +static HRESULT initialize_device(struct quartz_vmr *filter, VMR9AllocationInfo *info, DWORD count) { - DWORD buffer_count = 1, i; HRESULT hr; + DWORD i;
if (FAILED(hr = IVMRSurfaceAllocatorEx9_InitializeDevice(filter->allocator, - filter->cookie, info, &buffer_count))) + filter->cookie, info, &count))) { WARN("Failed to initialize device (flags %#x), hr %#x.\n", info->dwFlags, hr); return hr; }
- if (!(filter->surfaces = calloc(buffer_count, sizeof(IDirect3DSurface9 *)))) - { - IVMRSurfaceAllocatorEx9_TerminateDevice(filter->allocator, filter->cookie); - return E_OUTOFMEMORY; - } - - for (i = 0; i < buffer_count; ++i) + for (i = 0; i < count; ++i) { if (FAILED(hr = IVMRSurfaceAllocatorEx9_GetSurface(filter->allocator, filter->cookie, i, 0, &filter->surfaces[i]))) @@ -370,7 +364,6 @@ static HRESULT initialize_device(struct quartz_vmr *filter, VMR9AllocationInfo * } }
- filter->num_surfaces = buffer_count; return hr; }
@@ -378,6 +371,7 @@ static HRESULT allocate_surfaces(struct quartz_vmr *filter, const AM_MEDIA_TYPE { VMR9AllocationInfo info = {}; HRESULT hr = E_FAIL; + DWORD count = 1; unsigned int i;
static const struct @@ -410,10 +404,13 @@ static HRESULT allocate_surfaces(struct quartz_vmr *filter, const AM_MEDIA_TYPE return S_OK;
info.Pool = D3DPOOL_DEFAULT; - info.MinBuffers = 1; + info.MinBuffers = count; info.dwWidth = info.szAspectRatio.cx = info.szNativeSize.cx = filter->bmiheader.biWidth; info.dwHeight = info.szAspectRatio.cy = info.szNativeSize.cy = filter->bmiheader.biHeight;
+ if (!(filter->surfaces = calloc(count, sizeof(IDirect3DSurface9 *)))) + return E_OUTOFMEMORY; + filter->num_surfaces = count; filter->cur_surface = 0;
if (!is_vmr9(filter)) @@ -431,7 +428,7 @@ static HRESULT allocate_surfaces(struct quartz_vmr *filter, const AM_MEDIA_TYPE }
info.dwFlags = VMR9AllocFlag_TextureSurface; - return initialize_device(filter, &info); + return initialize_device(filter, &info, count); }
for (i = 0; i < ARRAY_SIZE(formats); ++i) @@ -443,14 +440,14 @@ static HRESULT allocate_surfaces(struct quartz_vmr *filter, const AM_MEDIA_TYPE if (formats[i].flags & VMR9AllocFlag_TextureSurface) { info.dwFlags = VMR9AllocFlag_TextureSurface; - if (SUCCEEDED(hr = initialize_device(filter, &info))) + if (SUCCEEDED(hr = initialize_device(filter, &info, count))) return hr; }
if (formats[i].flags & VMR9AllocFlag_OffscreenSurface) { info.dwFlags = VMR9AllocFlag_OffscreenSurface; - if (SUCCEEDED(hr = initialize_device(filter, &info))) + if (SUCCEEDED(hr = initialize_device(filter, &info, count))) return 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=71638
Your paranoid android.
=== w8 (32 bit report) ===
quartz: vmr9.c:340: Test failed: Got hr 0x80004002, expected 0.
=== w8adm (32 bit report) ===
quartz: vmr9.c:340: Test failed: Got hr 0x80004002, expected 0.
=== w1064v1507 (32 bit report) ===
quartz: vmr9.c:340: Test failed: Got hr 0x80004002, expected 0.
=== w1064v1809 (32 bit report) ===
quartz: vmr9.c:340: Test failed: Got hr 0x80004002, expected 0.
=== w1064v1809_2scr (32 bit report) ===
quartz: vmr9.c:340: Test failed: Got hr 0x80004002, expected 0.
=== w1064v1809_ar (32 bit report) ===
quartz: vmr9.c:340: Test failed: Got hr 0x80004002, expected 0.
=== w1064v1809_he (32 bit report) ===
quartz: vmr9.c:340: Test failed: Got hr 0x80004002, expected 0.
=== w1064v1809_ja (32 bit report) ===
quartz: vmr9.c:340: Test failed: Got hr 0x80004002, expected 0.
=== w1064v1809_zh_CN (32 bit report) ===
quartz: vmr9.c:340: Test failed: Got hr 0x80004002, expected 0.
=== w864 (64 bit report) ===
quartz: vmr9.c:340: Test failed: Got hr 0x80004002, expected 0.
=== w1064v1507 (64 bit report) ===
quartz: vmr9.c:340: Test failed: Got hr 0x80004002, expected 0.
=== w1064v1809 (64 bit report) ===
quartz: vmr9.c:340: Test failed: Got hr 0x80004002, expected 0.