Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/quartz/tests/videorenderer.c | 69 +++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+)
diff --git a/dlls/quartz/tests/videorenderer.c b/dlls/quartz/tests/videorenderer.c index 55af28be27..02e642aed6 100644 --- a/dlls/quartz/tests/videorenderer.c +++ b/dlls/quartz/tests/videorenderer.c @@ -269,6 +269,74 @@ todo_wine ok(!ref, "Got outstanding refcount %d.\n", ref); }
+static void test_media_types(void) +{ + IBaseFilter *filter = create_video_renderer(); + AM_MEDIA_TYPE *mt, req_mt = {0}; + VIDEOINFOHEADER vih = + { + {0}, {0}, 0, 0, 0, + {sizeof(BITMAPINFOHEADER), 32, 24, 1, 0, BI_RGB} + }; + IEnumMediaTypes *enummt; + unsigned int i; + HRESULT hr; + ULONG ref; + IPin *pin; + + static const GUID *subtype_tests[] = + { + &MEDIASUBTYPE_RGB8, + &MEDIASUBTYPE_RGB565, + &MEDIASUBTYPE_RGB24, + &MEDIASUBTYPE_RGB32, + }; + + IBaseFilter_FindPin(filter, sink_id, &pin); + + hr = IPin_EnumMediaTypes(pin, &enummt); + ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IEnumMediaTypes_Next(enummt, 1, &mt, NULL); + ok(hr == S_FALSE, "Got hr %#x.\n", hr); + + IEnumMediaTypes_Release(enummt); + + req_mt.majortype = MEDIATYPE_Video; + req_mt.formattype = FORMAT_VideoInfo; + req_mt.cbFormat = sizeof(VIDEOINFOHEADER); + req_mt.pbFormat = (BYTE *)&vih; + + for (i = 0; i < ARRAY_SIZE(subtype_tests); ++i) + { + req_mt.subtype = *subtype_tests[i]; + hr = IPin_QueryAccept(pin, &req_mt); + ok(hr == S_OK, "Got hr %#x for subtype %s.\n", hr, wine_dbgstr_guid(subtype_tests[i])); + } + + req_mt.subtype = MEDIASUBTYPE_NULL; + hr = IPin_QueryAccept(pin, &req_mt); + ok(hr == S_FALSE, "Got hr %#x.\n", hr); + req_mt.subtype = MEDIASUBTYPE_RGB24; + + req_mt.majortype = MEDIATYPE_NULL; + hr = IPin_QueryAccept(pin, &req_mt); + ok(hr == S_FALSE, "Got hr %#x.\n", hr); + req_mt.majortype = MEDIATYPE_Video; + + req_mt.formattype = FORMAT_None; + hr = IPin_QueryAccept(pin, &req_mt); + ok(hr == S_FALSE, "Got hr %#x.\n", hr); + + req_mt.formattype = GUID_NULL; + hr = IPin_QueryAccept(pin, &req_mt); + ok(hr == S_FALSE, "Got hr %#x.\n", hr); + + IPin_Release(pin); + ref = IBaseFilter_Release(filter); + ok(!ref, "Got outstanding refcount %d.\n", ref); +} + static void test_pin(IPin *pin) { IMemInputPin *mpin = NULL; @@ -333,6 +401,7 @@ START_TEST(videorenderer) test_enum_pins(); test_find_pin(); test_pin_info(); + test_media_types(); test_basefilter();
CoUninitialize();
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/quartz/tests/Makefile.in | 2 +- dlls/quartz/tests/filtermapper.c | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-)
diff --git a/dlls/quartz/tests/Makefile.in b/dlls/quartz/tests/Makefile.in index f4c56c14eb..902e57e845 100644 --- a/dlls/quartz/tests/Makefile.in +++ b/dlls/quartz/tests/Makefile.in @@ -1,5 +1,5 @@ TESTDLL = quartz.dll -IMPORTS = oleaut32 ole32 advapi32 user32 msvfw32 +IMPORTS = advapi32 msvfw32 ole32 oleaut32 strmiids user32 uuid
C_SRCS = \ acmwrapper.c \ diff --git a/dlls/quartz/tests/filtermapper.c b/dlls/quartz/tests/filtermapper.c index 2f82ce0ccf..fc4fa95fa4 100644 --- a/dlls/quartz/tests/filtermapper.c +++ b/dlls/quartz/tests/filtermapper.c @@ -22,14 +22,11 @@
#include "wine/test.h" #include "winbase.h" -#include "initguid.h" #include "dshow.h" #include "winternl.h" - +#include "initguid.h" #include "wine/fil_data.h"
-DEFINE_GUID(GUID_NULL,0,0,0,0,0,0,0,0,0,0,0); - /* Helper function, checks if filter with given name was enumerated. */ static BOOL enum_find_filter(const WCHAR *wszFilterName, IEnumMoniker *pEnum) {
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/quartz/tests/Makefile.in | 1 + dlls/quartz/tests/vmr7.c | 140 ++++++++++++++++++++++++++++++++++ 2 files changed, 141 insertions(+) create mode 100644 dlls/quartz/tests/vmr7.c
diff --git a/dlls/quartz/tests/Makefile.in b/dlls/quartz/tests/Makefile.in index 902e57e845..ce59b73fca 100644 --- a/dlls/quartz/tests/Makefile.in +++ b/dlls/quartz/tests/Makefile.in @@ -14,6 +14,7 @@ C_SRCS = \ mpegsplit.c \ systemclock.c \ videorenderer.c \ + vmr7.c \ waveparser.c
diff --git a/dlls/quartz/tests/vmr7.c b/dlls/quartz/tests/vmr7.c new file mode 100644 index 0000000000..b420991b47 --- /dev/null +++ b/dlls/quartz/tests/vmr7.c @@ -0,0 +1,140 @@ +/* + * Video Mixing Renderer 7 unit tests + * + * Copyright 2018 Zebediah Figura + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#define COBJMACROS +#include "dshow.h" +#include "d3d9.h" +#include "vmr9.h" +#include "wine/test.h" + +static void test_filter_config(void) +{ + IVMRFilterConfig *config; + DWORD count, mode; + HRESULT hr; + ULONG ref; + + hr = CoCreateInstance(&CLSID_VideoMixingRenderer, NULL, CLSCTX_INPROC_SERVER, + &IID_IVMRFilterConfig, (void **)&config); + ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IVMRFilterConfig_GetRenderingMode(config, &mode); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(mode == VMRMode_Windowed, "Got mode %#x.\n", mode); + + hr = IVMRFilterConfig_SetRenderingMode(config, VMRMode_Windowed); + todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IVMRFilterConfig_GetRenderingMode(config, &mode); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(mode == VMRMode_Windowed, "Got mode %#x.\n", mode); + + hr = IVMRFilterConfig_SetRenderingMode(config, VMRMode_Windowed); + todo_wine ok(hr == VFW_E_WRONG_STATE, "Got hr %#x.\n", hr); + + ref = IVMRFilterConfig_Release(config); + ok(!ref, "Got outstanding refcount %d.\n", ref); + + hr = CoCreateInstance(&CLSID_VideoMixingRenderer, NULL, CLSCTX_INPROC_SERVER, + &IID_IVMRFilterConfig, (void **)&config); + ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IVMRFilterConfig_SetRenderingMode(config, VMRMode_Windowless); + todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IVMRFilterConfig_GetRenderingMode(config, &mode); + ok(hr == S_OK, "Got hr %#x.\n", hr); + todo_wine ok(mode == VMRMode_Windowless, "Got mode %#x.\n", mode); + + hr = IVMRFilterConfig_SetRenderingMode(config, VMRMode_Windowed); + todo_wine ok(hr == VFW_E_WRONG_STATE, "Got hr %#x.\n", hr); + + ref = IVMRFilterConfig_Release(config); + ok(!ref, "Got outstanding refcount %d.\n", ref); + + hr = CoCreateInstance(&CLSID_VideoMixingRenderer, NULL, CLSCTX_INPROC_SERVER, + &IID_IVMRFilterConfig, (void **)&config); + ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IVMRFilterConfig_SetRenderingMode(config, VMRMode_Renderless); + todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IVMRFilterConfig_GetRenderingMode(config, &mode); + ok(hr == S_OK, "Got hr %#x.\n", hr); + todo_wine ok(mode == VMRMode_Renderless, "Got mode %#x.\n", mode); + + hr = IVMRFilterConfig_SetRenderingMode(config, VMRMode_Windowless); + todo_wine ok(hr == VFW_E_WRONG_STATE, "Got hr %#x.\n", hr); + + ref = IVMRFilterConfig_Release(config); + ok(!ref, "Got outstanding refcount %d.\n", ref); + + hr = CoCreateInstance(&CLSID_VideoMixingRenderer, NULL, CLSCTX_INPROC_SERVER, + &IID_IVMRFilterConfig, (void **)&config); + ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IVMRFilterConfig_GetNumberOfStreams(config, &count); + todo_wine ok(hr == VFW_E_VMR_NOT_IN_MIXER_MODE, "Got hr %#x.\n", hr); + + hr = IVMRFilterConfig_SetNumberOfStreams(config, 3); + if (hr != VFW_E_DDRAW_CAPS_NOT_SUITABLE) + { + todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IVMRFilterConfig_GetNumberOfStreams(config, &count); + todo_wine { + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(count == 3, "Got count %u.\n", count); + } + + hr = IVMRFilterConfig_GetRenderingMode(config, &mode); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(mode == VMRMode_Windowed, "Got mode %#x.\n", mode); + + /* Despite MSDN, you can still change the rendering mode after setting the + * stream count. */ + hr = IVMRFilterConfig_SetRenderingMode(config, VMRMode_Windowless); + todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IVMRFilterConfig_GetRenderingMode(config, &mode); + ok(hr == S_OK, "Got hr %#x.\n", hr); + todo_wine ok(mode == VMRMode_Windowless, "Got mode %#x.\n", mode); + + hr = IVMRFilterConfig_GetNumberOfStreams(config, &count); + todo_wine { + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(count == 3, "Got count %u.\n", count); + } + } + else + skip("Mixing mode is not supported.\n"); + + ref = IVMRFilterConfig_Release(config); + ok(!ref, "Got outstanding refcount %d.\n", ref); +} + +START_TEST(vmr7) +{ + CoInitialize(NULL); + + test_filter_config(); + + CoUninitialize(); +}
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/quartz/vmr9.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dlls/quartz/vmr9.c b/dlls/quartz/vmr9.c index d2dc47bcb6..0fd917584d 100644 --- a/dlls/quartz/vmr9.c +++ b/dlls/quartz/vmr9.c @@ -834,7 +834,6 @@ static ULONG WINAPI VMR9Inner_Release(IUnknown * iface) { TRACE("Destroying\n"); BaseControlWindow_Destroy(&This->baseControlWindow); - FreeLibrary(This->hD3d9);
if (This->allocator) IVMRSurfaceAllocatorEx9_Release(This->allocator); @@ -848,6 +847,7 @@ static ULONG WINAPI VMR9Inner_Release(IUnknown * iface) This->allocator_d3d9_dev = NULL; }
+ FreeLibrary(This->hD3d9); CoTaskMemFree(This); } return refCount;
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=42372 Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/quartz/tests/vmr7.c | 20 ++++++++++---------- dlls/quartz/vmr9.c | 7 ++++--- 2 files changed, 14 insertions(+), 13 deletions(-)
diff --git a/dlls/quartz/tests/vmr7.c b/dlls/quartz/tests/vmr7.c index b420991b47..105e6b23c7 100644 --- a/dlls/quartz/tests/vmr7.c +++ b/dlls/quartz/tests/vmr7.c @@ -40,14 +40,14 @@ static void test_filter_config(void) ok(mode == VMRMode_Windowed, "Got mode %#x.\n", mode);
hr = IVMRFilterConfig_SetRenderingMode(config, VMRMode_Windowed); - todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(hr == S_OK, "Got hr %#x.\n", hr);
hr = IVMRFilterConfig_GetRenderingMode(config, &mode); ok(hr == S_OK, "Got hr %#x.\n", hr); ok(mode == VMRMode_Windowed, "Got mode %#x.\n", mode);
hr = IVMRFilterConfig_SetRenderingMode(config, VMRMode_Windowed); - todo_wine ok(hr == VFW_E_WRONG_STATE, "Got hr %#x.\n", hr); + ok(hr == VFW_E_WRONG_STATE, "Got hr %#x.\n", hr);
ref = IVMRFilterConfig_Release(config); ok(!ref, "Got outstanding refcount %d.\n", ref); @@ -57,14 +57,14 @@ static void test_filter_config(void) ok(hr == S_OK, "Got hr %#x.\n", hr);
hr = IVMRFilterConfig_SetRenderingMode(config, VMRMode_Windowless); - todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(hr == S_OK, "Got hr %#x.\n", hr);
hr = IVMRFilterConfig_GetRenderingMode(config, &mode); ok(hr == S_OK, "Got hr %#x.\n", hr); - todo_wine ok(mode == VMRMode_Windowless, "Got mode %#x.\n", mode); + ok(mode == VMRMode_Windowless, "Got mode %#x.\n", mode);
hr = IVMRFilterConfig_SetRenderingMode(config, VMRMode_Windowed); - todo_wine ok(hr == VFW_E_WRONG_STATE, "Got hr %#x.\n", hr); + ok(hr == VFW_E_WRONG_STATE, "Got hr %#x.\n", hr);
ref = IVMRFilterConfig_Release(config); ok(!ref, "Got outstanding refcount %d.\n", ref); @@ -74,14 +74,14 @@ static void test_filter_config(void) ok(hr == S_OK, "Got hr %#x.\n", hr);
hr = IVMRFilterConfig_SetRenderingMode(config, VMRMode_Renderless); - todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(hr == S_OK, "Got hr %#x.\n", hr);
hr = IVMRFilterConfig_GetRenderingMode(config, &mode); ok(hr == S_OK, "Got hr %#x.\n", hr); - todo_wine ok(mode == VMRMode_Renderless, "Got mode %#x.\n", mode); + ok(mode == VMRMode_Renderless, "Got mode %#x.\n", mode);
hr = IVMRFilterConfig_SetRenderingMode(config, VMRMode_Windowless); - todo_wine ok(hr == VFW_E_WRONG_STATE, "Got hr %#x.\n", hr); + ok(hr == VFW_E_WRONG_STATE, "Got hr %#x.\n", hr);
ref = IVMRFilterConfig_Release(config); ok(!ref, "Got outstanding refcount %d.\n", ref); @@ -111,11 +111,11 @@ static void test_filter_config(void) /* Despite MSDN, you can still change the rendering mode after setting the * stream count. */ hr = IVMRFilterConfig_SetRenderingMode(config, VMRMode_Windowless); - todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(hr == S_OK, "Got hr %#x.\n", hr);
hr = IVMRFilterConfig_GetRenderingMode(config, &mode); ok(hr == S_OK, "Got hr %#x.\n", hr); - todo_wine ok(mode == VMRMode_Windowless, "Got mode %#x.\n", mode); + ok(mode == VMRMode_Windowless, "Got mode %#x.\n", mode);
hr = IVMRFilterConfig_GetNumberOfStreams(config, &count); todo_wine { diff --git a/dlls/quartz/vmr9.c b/dlls/quartz/vmr9.c index 0fd917584d..3afcb09d5d 100644 --- a/dlls/quartz/vmr9.c +++ b/dlls/quartz/vmr9.c @@ -1246,10 +1246,11 @@ static HRESULT WINAPI VMR7FilterConfig_GetRenderingPrefs(IVMRFilterConfig *iface
static HRESULT WINAPI VMR7FilterConfig_SetRenderingMode(IVMRFilterConfig *iface, DWORD mode) { - struct quartz_vmr *This = impl_from_IVMRFilterConfig(iface); + struct quartz_vmr *filter = impl_from_IVMRFilterConfig(iface);
- FIXME("(%p/%p)->(%u) stub\n", iface, This, mode); - return E_NOTIMPL; + TRACE("iface %p, mode %#x.\n", iface, mode); + + return IVMRFilterConfig9_SetRenderingMode(&filter->IVMRFilterConfig9_iface, mode); }
static HRESULT WINAPI VMR7FilterConfig_GetRenderingMode(IVMRFilterConfig *iface, DWORD *mode)
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=50327
Your paranoid android.
=== debian9 (64 bit WoW report) ===
quartz: Unhandled exception: page fault on read access to 0x00000000 in 64-bit code (0x00007fc7f70a015c).
Report errors: quartz:avisplit crashed (c0000005)