Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/quartz/tests/vmr9.c | 2 +- dlls/quartz/vmr9.c | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/dlls/quartz/tests/vmr9.c b/dlls/quartz/tests/vmr9.c index e78d20a4118..4bba6f74319 100644 --- a/dlls/quartz/tests/vmr9.c +++ b/dlls/quartz/tests/vmr9.c @@ -298,7 +298,7 @@ static void test_interfaces(void) check_interface(filter, &IID_IVMRMixerControl, FALSE); todo_wine check_interface(filter, &IID_IVMRMonitorConfig, FALSE); todo_wine check_interface(filter, &IID_IVMRMonitorConfig9, FALSE); - todo_wine check_interface(filter, &IID_IVMRSurfaceAllocatorNotify, FALSE); + check_interface(filter, &IID_IVMRSurfaceAllocatorNotify, FALSE); check_interface(filter, &IID_IVMRWindowlessControl, FALSE); check_interface(filter, &IID_IVMRWindowlessControl9, FALSE);
diff --git a/dlls/quartz/vmr9.c b/dlls/quartz/vmr9.c index 389166db3ed..c847b9c448d 100644 --- a/dlls/quartz/vmr9.c +++ b/dlls/quartz/vmr9.c @@ -91,6 +91,11 @@ struct quartz_vmr HANDLE run_event; };
+static inline BOOL is_vmr9(const struct quartz_vmr *filter) +{ + return IsEqualGUID(&filter->renderer.filter.clsid, &CLSID_VideoMixingRenderer9); +} + static inline struct quartz_vmr *impl_from_video_window(struct video_window *iface) { return CONTAINING_RECORD(iface, struct quartz_vmr, baseControlWindow); @@ -435,7 +440,7 @@ static HRESULT VMR9_maybe_init(struct quartz_vmr *filter, BOOL force, const AM_M return E_FAIL; }
- if (IsEqualGUID(&filter->renderer.filter.clsid, &CLSID_VideoMixingRenderer)) + if (!is_vmr9(filter)) { switch (filter->bmiheader.biBitCount) { @@ -621,7 +626,8 @@ static HRESULT vmr_query_interface(struct strmbase_renderer *iface, REFIID iid, *out = &filter->IVMRMonitorConfig_iface; else if (IsEqualGUID(iid, &IID_IVMRMonitorConfig9)) *out = &filter->IVMRMonitorConfig9_iface; - else if (IsEqualGUID(iid, &IID_IVMRSurfaceAllocatorNotify) && filter->mode == (VMR9Mode)VMRMode_Renderless) + else if (IsEqualGUID(iid, &IID_IVMRSurfaceAllocatorNotify) + && filter->mode == (VMR9Mode)VMRMode_Renderless && !is_vmr9(filter)) *out = &filter->IVMRSurfaceAllocatorNotify_iface; else if (IsEqualGUID(iid, &IID_IVMRSurfaceAllocatorNotify9) && filter->mode == VMR9Mode_Renderless) *out = &filter->IVMRSurfaceAllocatorNotify9_iface;
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/quartz/tests/vmr7.c | 2 +- dlls/quartz/vmr9.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/dlls/quartz/tests/vmr7.c b/dlls/quartz/tests/vmr7.c index f4b26db554b..c242854659d 100644 --- a/dlls/quartz/tests/vmr7.c +++ b/dlls/quartz/tests/vmr7.c @@ -300,7 +300,7 @@ static void test_interfaces(void) check_interface(filter, &IID_IVMRMixerControl, FALSE); todo_wine check_interface(filter, &IID_IVMRMonitorConfig, FALSE); todo_wine check_interface(filter, &IID_IVMRMonitorConfig9, FALSE); - todo_wine check_interface(filter, &IID_IVMRSurfaceAllocatorNotify9, FALSE); + check_interface(filter, &IID_IVMRSurfaceAllocatorNotify9, FALSE); check_interface(filter, &IID_IVMRWindowlessControl, FALSE); check_interface(filter, &IID_IVMRWindowlessControl9, FALSE);
diff --git a/dlls/quartz/vmr9.c b/dlls/quartz/vmr9.c index c847b9c448d..aa125ddb896 100644 --- a/dlls/quartz/vmr9.c +++ b/dlls/quartz/vmr9.c @@ -629,7 +629,8 @@ static HRESULT vmr_query_interface(struct strmbase_renderer *iface, REFIID iid, else if (IsEqualGUID(iid, &IID_IVMRSurfaceAllocatorNotify) && filter->mode == (VMR9Mode)VMRMode_Renderless && !is_vmr9(filter)) *out = &filter->IVMRSurfaceAllocatorNotify_iface; - else if (IsEqualGUID(iid, &IID_IVMRSurfaceAllocatorNotify9) && filter->mode == VMR9Mode_Renderless) + else if (IsEqualGUID(iid, &IID_IVMRSurfaceAllocatorNotify9) + && filter->mode == VMR9Mode_Renderless && is_vmr9(filter)) *out = &filter->IVMRSurfaceAllocatorNotify9_iface; else if (IsEqualGUID(iid, &IID_IVMRWindowlessControl) && filter->mode == (VMR9Mode)VMRMode_Windowless) *out = &filter->IVMRWindowlessControl_iface;
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/quartz/tests/vmr9.c | 2 +- dlls/quartz/vmr9.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/dlls/quartz/tests/vmr9.c b/dlls/quartz/tests/vmr9.c index 4bba6f74319..442145ac6a8 100644 --- a/dlls/quartz/tests/vmr9.c +++ b/dlls/quartz/tests/vmr9.c @@ -271,7 +271,7 @@ static void test_interfaces(void) check_interface(filter, &IID_IVMRMixerControl, FALSE); check_interface(filter, &IID_IVMRMixerControl9, FALSE); todo_wine check_interface(filter, &IID_IVMRMonitorConfig, FALSE); - todo_wine check_interface(filter, &IID_IVMRWindowlessControl, FALSE); + check_interface(filter, &IID_IVMRWindowlessControl, FALSE);
IBaseFilter_FindPin(filter, L"VMR Input0", &pin);
diff --git a/dlls/quartz/vmr9.c b/dlls/quartz/vmr9.c index aa125ddb896..ea19977de4d 100644 --- a/dlls/quartz/vmr9.c +++ b/dlls/quartz/vmr9.c @@ -632,7 +632,8 @@ static HRESULT vmr_query_interface(struct strmbase_renderer *iface, REFIID iid, else if (IsEqualGUID(iid, &IID_IVMRSurfaceAllocatorNotify9) && filter->mode == VMR9Mode_Renderless && is_vmr9(filter)) *out = &filter->IVMRSurfaceAllocatorNotify9_iface; - else if (IsEqualGUID(iid, &IID_IVMRWindowlessControl) && filter->mode == (VMR9Mode)VMRMode_Windowless) + else if (IsEqualGUID(iid, &IID_IVMRWindowlessControl) + && filter->mode == (VMR9Mode)VMRMode_Windowless && !is_vmr9(filter)) *out = &filter->IVMRWindowlessControl_iface; else if (IsEqualGUID(iid, &IID_IVMRWindowlessControl9) && filter->mode == VMR9Mode_Windowless) *out = &filter->IVMRWindowlessControl9_iface;
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/quartz/tests/vmr7.c | 2 +- dlls/quartz/vmr9.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/dlls/quartz/tests/vmr7.c b/dlls/quartz/tests/vmr7.c index c242854659d..26324a36b16 100644 --- a/dlls/quartz/tests/vmr7.c +++ b/dlls/quartz/tests/vmr7.c @@ -273,7 +273,7 @@ static void test_interfaces(void) check_interface(filter, &IID_IVMRMixerControl, FALSE); check_interface(filter, &IID_IVMRMixerControl9, FALSE); todo_wine check_interface(filter, &IID_IVMRMonitorConfig9, FALSE); - todo_wine check_interface(filter, &IID_IVMRWindowlessControl9, FALSE); + check_interface(filter, &IID_IVMRWindowlessControl9, FALSE);
IBaseFilter_FindPin(filter, L"VMR Input0", &pin);
diff --git a/dlls/quartz/vmr9.c b/dlls/quartz/vmr9.c index ea19977de4d..771e90050da 100644 --- a/dlls/quartz/vmr9.c +++ b/dlls/quartz/vmr9.c @@ -635,7 +635,8 @@ static HRESULT vmr_query_interface(struct strmbase_renderer *iface, REFIID iid, else if (IsEqualGUID(iid, &IID_IVMRWindowlessControl) && filter->mode == (VMR9Mode)VMRMode_Windowless && !is_vmr9(filter)) *out = &filter->IVMRWindowlessControl_iface; - else if (IsEqualGUID(iid, &IID_IVMRWindowlessControl9) && filter->mode == VMR9Mode_Windowless) + else if (IsEqualGUID(iid, &IID_IVMRWindowlessControl9) + && filter->mode == VMR9Mode_Windowless && is_vmr9(filter)) *out = &filter->IVMRWindowlessControl9_iface; else return E_NOINTERFACE;
Test all interfaces in all modes, and test mixing mode.
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/quartz/tests/vmr9.c | 132 +++++++++++++++++++-------------------- 1 file changed, 66 insertions(+), 66 deletions(-)
diff --git a/dlls/quartz/tests/vmr9.c b/dlls/quartz/tests/vmr9.c index 442145ac6a8..783165a03a2 100644 --- a/dlls/quartz/tests/vmr9.c +++ b/dlls/quartz/tests/vmr9.c @@ -49,6 +49,21 @@ static IBaseFilter *create_vmr9(DWORD mode) return filter; }
+static HRESULT set_mixing_mode(IBaseFilter *filter, DWORD count) +{ + IVMRFilterConfig9 *config; + HRESULT hr; + + hr = IBaseFilter_QueryInterface(filter, &IID_IVMRFilterConfig9, (void **)&config); + 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); + + IVMRFilterConfig9_Release(config); + return hr; +} + static inline BOOL compare_media_types(const AM_MEDIA_TYPE *a, const AM_MEDIA_TYPE *b) { return !memcmp(a, b, offsetof(AM_MEDIA_TYPE, pbFormat)) @@ -198,17 +213,13 @@ static HRESULT check_interface_(unsigned int line, void *iface, REFIID riid, BOO return hr; }
-static void test_interfaces(void) +static void test_common_interfaces(IBaseFilter *filter) { - IBaseFilter *filter = create_vmr9(0); - ULONG ref; IPin *pin;
check_interface(filter, &IID_IAMCertifiedOutputProtection, TRUE); check_interface(filter, &IID_IAMFilterMiscFlags, TRUE); check_interface(filter, &IID_IBaseFilter, TRUE); - check_interface(filter, &IID_IBasicVideo, TRUE); - todo_wine check_interface(filter, &IID_IBasicVideo2, TRUE); todo_wine check_interface(filter, &IID_IKsPropertySet, TRUE); check_interface(filter, &IID_IMediaFilter, TRUE); check_interface(filter, &IID_IMediaPosition, TRUE); @@ -217,14 +228,10 @@ static void test_interfaces(void) check_interface(filter, &IID_IQualityControl, TRUE); todo_wine check_interface(filter, &IID_IQualProp, TRUE); check_interface(filter, &IID_IUnknown, TRUE); - check_interface(filter, &IID_IVideoWindow, TRUE); todo_wine check_interface(filter, &IID_IVMRAspectRatioControl9, TRUE); todo_wine check_interface(filter, &IID_IVMRDeinterlaceControl9, TRUE); check_interface(filter, &IID_IVMRFilterConfig9, TRUE); todo_wine check_interface(filter, &IID_IVMRMixerBitmap9, TRUE); - /* IVMRMonitorConfig9 may not be available if the d3d9 device has - * insufficient support. */ - check_interface_broken(filter, &IID_IVMRMonitorConfig9, TRUE);
check_interface(filter, &IID_IBasicAudio, FALSE); check_interface(filter, &IID_IDirectDrawVideo, FALSE); @@ -236,12 +243,9 @@ static void test_interfaces(void) todo_wine check_interface(filter, &IID_IVMRFilterConfig, FALSE); check_interface(filter, &IID_IVMRMixerBitmap, FALSE); check_interface(filter, &IID_IVMRMixerControl, FALSE); - check_interface(filter, &IID_IVMRMixerControl9, FALSE); todo_wine check_interface(filter, &IID_IVMRMonitorConfig, FALSE); check_interface(filter, &IID_IVMRSurfaceAllocatorNotify, FALSE); - check_interface(filter, &IID_IVMRSurfaceAllocatorNotify9, FALSE); check_interface(filter, &IID_IVMRWindowlessControl, FALSE); - check_interface(filter, &IID_IVMRWindowlessControl9, FALSE);
IBaseFilter_FindPin(filter, L"VMR Input0", &pin);
@@ -256,68 +260,79 @@ static void test_interfaces(void) check_interface(pin, &IID_IMediaSeeking, FALSE);
IPin_Release(pin); +} + +static void test_interfaces(void) +{ + IBaseFilter *filter = create_vmr9(0); + ULONG ref; + + test_common_interfaces(filter); + + check_interface(filter, &IID_IBasicVideo, TRUE); + todo_wine check_interface(filter, &IID_IBasicVideo2, TRUE); + check_interface(filter, &IID_IVideoWindow, TRUE); + /* IVMRMonitorConfig9 may not be available if the d3d9 device has + * insufficient support. */ + check_interface_broken(filter, &IID_IVMRMonitorConfig9, TRUE); + + check_interface(filter, &IID_IVMRMixerControl9, 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);
- IBaseFilter_Release(filter); filter = create_vmr9(VMR9Mode_Windowless); + test_common_interfaces(filter);
+ /* IVMRMonitorConfig9 may not be available if the d3d9 device has + * insufficient support. */ check_interface_broken(filter, &IID_IVMRMonitorConfig9, TRUE); check_interface(filter, &IID_IVMRWindowlessControl9, TRUE);
todo_wine check_interface(filter, &IID_IBasicVideo, FALSE); check_interface(filter, &IID_IBasicVideo2, FALSE); todo_wine check_interface(filter, &IID_IVideoWindow, FALSE); - check_interface(filter, &IID_IVMRSurfaceAllocatorNotify, FALSE); - check_interface(filter, &IID_IVMRSurfaceAllocatorNotify9, FALSE); - check_interface(filter, &IID_IVMRMixerControl, FALSE); check_interface(filter, &IID_IVMRMixerControl9, FALSE); - todo_wine check_interface(filter, &IID_IVMRMonitorConfig, FALSE); - check_interface(filter, &IID_IVMRWindowlessControl, FALSE); - - IBaseFilter_FindPin(filter, L"VMR Input0", &pin); - - check_interface(pin, &IID_IMemInputPin, TRUE); - check_interface(pin, &IID_IOverlay, TRUE); - check_interface(pin, &IID_IPin, TRUE); - todo_wine check_interface(pin, &IID_IQualityControl, TRUE); - check_interface(pin, &IID_IUnknown, TRUE); - - check_interface(pin, &IID_IKsPropertySet, FALSE); - check_interface(pin, &IID_IMediaPosition, FALSE); - check_interface(pin, &IID_IMediaSeeking, FALSE); + check_interface(filter, &IID_IVMRSurfaceAllocatorNotify9, FALSE);
- IPin_Release(pin); + ref = IBaseFilter_Release(filter); + ok(!ref, "Got outstanding refcount %d.\n", ref);
- IBaseFilter_Release(filter); filter = create_vmr9(VMR9Mode_Renderless); + test_common_interfaces(filter);
check_interface(filter, &IID_IVMRSurfaceAllocatorNotify9, TRUE);
todo_wine check_interface(filter, &IID_IBasicVideo, FALSE); check_interface(filter, &IID_IBasicVideo2, FALSE); todo_wine check_interface(filter, &IID_IVideoWindow, FALSE); - check_interface(filter, &IID_IVMRMixerControl, FALSE); - todo_wine check_interface(filter, &IID_IVMRMonitorConfig, FALSE); todo_wine check_interface(filter, &IID_IVMRMonitorConfig9, FALSE); - check_interface(filter, &IID_IVMRSurfaceAllocatorNotify, FALSE); - check_interface(filter, &IID_IVMRWindowlessControl, FALSE); check_interface(filter, &IID_IVMRWindowlessControl9, FALSE);
- IBaseFilter_FindPin(filter, L"VMR Input0", &pin); + ref = IBaseFilter_Release(filter); + ok(!ref, "Got outstanding refcount %d.\n", ref);
- check_interface(pin, &IID_IMemInputPin, TRUE); - check_interface(pin, &IID_IOverlay, TRUE); - check_interface(pin, &IID_IPin, TRUE); - todo_wine check_interface(pin, &IID_IQualityControl, TRUE); - check_interface(pin, &IID_IUnknown, TRUE); + filter = create_vmr9(VMR9Mode_Windowed); + if (SUCCEEDED(set_mixing_mode(filter, 1))) + { + test_common_interfaces(filter);
- check_interface(pin, &IID_IKsPropertySet, FALSE); - check_interface(pin, &IID_IMediaPosition, FALSE); - check_interface(pin, &IID_IMediaSeeking, FALSE); + 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);
- IPin_Release(pin); + 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}; @@ -414,21 +429,6 @@ static void test_aggregation(void) ok(outer_ref == 1, "Got unexpected refcount %d.\n", outer_ref); }
-static HRESULT set_mixing_mode(IBaseFilter *filter) -{ - IVMRFilterConfig9 *config; - HRESULT hr; - - hr = IBaseFilter_QueryInterface(filter, &IID_IVMRFilterConfig9, (void **)&config); - ok(hr == S_OK, "Got hr %#x.\n", hr); - - hr = IVMRFilterConfig9_SetNumberOfStreams(config, 2); - todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr); - - IVMRFilterConfig9_Release(config); - return hr; -} - static void test_enum_pins(void) { IBaseFilter *filter = create_vmr9(0); @@ -515,7 +515,7 @@ static void test_enum_pins(void)
IEnumPins_Release(enum2);
- if (SUCCEEDED(set_mixing_mode(filter))) + if (SUCCEEDED(set_mixing_mode(filter, 2))) { hr = IEnumPins_Next(enum1, 1, pins, NULL); ok(hr == S_FALSE, "Got hr %#x.\n", hr); @@ -585,7 +585,7 @@ 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))) + if (SUCCEEDED(set_mixing_mode(filter, 2))) { IEnumPins_Reset(enum_pins);
@@ -645,7 +645,7 @@ static void test_pin_info(void)
IPin_Release(pin);
- if (SUCCEEDED(set_mixing_mode(filter))) + if (SUCCEEDED(set_mixing_mode(filter, 2))) { IBaseFilter_FindPin(filter, L"VMR Input1", &pin); hr = IPin_QueryPinInfo(pin, &info);