Vista does not support the IID_IMFQualityAdvise and IID_IMFQualityAdviseLimits interfaces. This fixes crashes on Vista.
Signed-off-by: Francois Gouget fgouget@codeweavers.com --- dlls/evr/tests/evr.c | 351 +++++++++++++++++++++++-------------------- 1 file changed, 189 insertions(+), 162 deletions(-)
diff --git a/dlls/evr/tests/evr.c b/dlls/evr/tests/evr.c index 31434bde43a..908d0844c7f 100644 --- a/dlls/evr/tests/evr.c +++ b/dlls/evr/tests/evr.c @@ -216,32 +216,49 @@ static void test_aggregation(void) IUnknown_Release(unk); }
+#define I_MISSING 1 +#define I_MAYBE 2 +#define I_SUPPORTED 3 + #define check_interface(a, b, c) check_interface_(__LINE__, a, b, c) -static void check_interface_(unsigned int line, void *iface_ptr, REFIID iid, BOOL supported) +static void check_interface_(unsigned int line, void *iface_ptr, REFIID iid, int present) { IUnknown *iface = iface_ptr; - HRESULT hr, expected_hr; + HRESULT hr; IUnknown *unk;
- expected_hr = supported ? S_OK : E_NOINTERFACE; - hr = IUnknown_QueryInterface(iface, iid, (void **)&unk); - ok_(__FILE__, line)(hr == expected_hr, "Got hr %#x, expected %#x.\n", hr, expected_hr); + if (present == I_MAYBE) + ok_(__FILE__, line)(hr == S_OK || + broken(hr == E_NOINTERFACE), /* Vista */ + "Got unexpected hr %#x\n", hr); + else + { + HRESULT expected_hr = (present == I_SUPPORTED) ? S_OK : E_NOINTERFACE; + ok_(__FILE__, line)(hr == expected_hr, + "Got hr %#x, expected %#x.\n", hr, expected_hr); + } if (SUCCEEDED(hr)) IUnknown_Release(unk); }
#define check_service_interface(a, b, c, d) check_service_interface_(__LINE__, a, b, c, d) -static void check_service_interface_(unsigned int line, void *iface_ptr, REFGUID service, REFIID iid, BOOL supported) +static void check_service_interface_(unsigned int line, void *iface_ptr, REFGUID service, REFIID iid, int present) { IUnknown *iface = iface_ptr; - HRESULT hr, expected_hr; + HRESULT hr; IUnknown *unk;
- expected_hr = supported ? S_OK : E_NOINTERFACE; - hr = MFGetService(iface, service, iid, (void **)&unk); - ok_(__FILE__, line)(hr == expected_hr, "Got hr %#x, expected %#x.\n", hr, expected_hr); + if (present == I_MAYBE) + ok_(__FILE__, line)(hr == S_OK || broken(hr == E_NOINTERFACE), + "Got unexpected hr %#x\n", hr); + else + { + HRESULT expected_hr = (present == I_SUPPORTED) ? S_OK : E_NOINTERFACE; + ok_(__FILE__, line)(hr == expected_hr, + "Got hr %#x, expected %#x.\n", hr, expected_hr); + } if (SUCCEEDED(hr)) IUnknown_Release(unk); } @@ -251,22 +268,22 @@ static void test_interfaces(void) IBaseFilter *filter = create_evr(); ULONG ref;
- todo_wine check_interface(filter, &IID_IAMFilterMiscFlags, TRUE); - check_interface(filter, &IID_IBaseFilter, TRUE); - check_interface(filter, &IID_IMediaFilter, TRUE); - check_interface(filter, &IID_IMediaPosition, TRUE); - check_interface(filter, &IID_IMediaSeeking, TRUE); - check_interface(filter, &IID_IPersist, TRUE); - check_interface(filter, &IID_IUnknown, TRUE); - - check_interface(filter, &IID_IBasicAudio, FALSE); - check_interface(filter, &IID_IBasicVideo, FALSE); - check_interface(filter, &IID_IDirectXVideoMemoryConfiguration, FALSE); - check_interface(filter, &IID_IMemInputPin, FALSE); - check_interface(filter, &IID_IPersistPropertyBag, FALSE); - check_interface(filter, &IID_IPin, FALSE); - check_interface(filter, &IID_IReferenceClock, FALSE); - check_interface(filter, &IID_IVideoWindow, FALSE); + todo_wine check_interface(filter, &IID_IAMFilterMiscFlags, I_SUPPORTED); + check_interface(filter, &IID_IBaseFilter, I_SUPPORTED); + check_interface(filter, &IID_IMediaFilter, I_SUPPORTED); + check_interface(filter, &IID_IMediaPosition, I_SUPPORTED); + check_interface(filter, &IID_IMediaSeeking, I_SUPPORTED); + check_interface(filter, &IID_IPersist, I_SUPPORTED); + check_interface(filter, &IID_IUnknown, I_SUPPORTED); + + check_interface(filter, &IID_IBasicAudio, I_MISSING); + check_interface(filter, &IID_IBasicVideo, I_MISSING); + check_interface(filter, &IID_IDirectXVideoMemoryConfiguration, I_MISSING); + check_interface(filter, &IID_IMemInputPin, I_MISSING); + check_interface(filter, &IID_IPersistPropertyBag, I_MISSING); + check_interface(filter, &IID_IPin, I_MISSING); + check_interface(filter, &IID_IReferenceClock, I_MISSING); + check_interface(filter, &IID_IVideoWindow, I_MISSING);
ref = IBaseFilter_Release(filter); ok(!ref, "Got unexpected refcount %d.\n", ref); @@ -475,21 +492,21 @@ static void test_default_mixer(void) hr = MFCreateVideoMixer(NULL, &IID_IDirect3DDevice9, &IID_IMFTransform, (void **)&transform); ok(hr == S_OK, "Failed to create default mixer, hr %#x.\n", hr);
- check_interface(transform, &IID_IMFQualityAdvise, TRUE); - check_interface(transform, &IID_IMFClockStateSink, TRUE); - check_interface(transform, &IID_IMFTopologyServiceLookupClient, TRUE); - check_interface(transform, &IID_IMFGetService, TRUE); - check_interface(transform, &IID_IMFAttributes, TRUE); - check_interface(transform, &IID_IMFVideoMixerBitmap, TRUE); - check_interface(transform, &IID_IMFVideoPositionMapper, TRUE); - check_interface(transform, &IID_IMFVideoProcessor, TRUE); - check_interface(transform, &IID_IMFVideoMixerControl, TRUE); - check_interface(transform, &IID_IMFVideoDeviceID, TRUE); - check_service_interface(transform, &MR_VIDEO_MIXER_SERVICE, &IID_IMFVideoMixerBitmap, TRUE); - check_service_interface(transform, &MR_VIDEO_MIXER_SERVICE, &IID_IMFVideoProcessor, TRUE); - check_service_interface(transform, &MR_VIDEO_MIXER_SERVICE, &IID_IMFVideoMixerControl, TRUE); - check_service_interface(transform, &MR_VIDEO_MIXER_SERVICE, &IID_IMFVideoPositionMapper, TRUE); - check_service_interface(transform, &MR_VIDEO_MIXER_SERVICE, &IID_IMFTransform, FALSE); + check_interface(transform, &IID_IMFQualityAdvise, I_SUPPORTED); + check_interface(transform, &IID_IMFClockStateSink, I_SUPPORTED); + check_interface(transform, &IID_IMFTopologyServiceLookupClient, I_SUPPORTED); + check_interface(transform, &IID_IMFGetService, I_SUPPORTED); + check_interface(transform, &IID_IMFAttributes, I_SUPPORTED); + check_interface(transform, &IID_IMFVideoMixerBitmap, I_SUPPORTED); + check_interface(transform, &IID_IMFVideoPositionMapper, I_SUPPORTED); + check_interface(transform, &IID_IMFVideoProcessor, I_SUPPORTED); + check_interface(transform, &IID_IMFVideoMixerControl, I_SUPPORTED); + check_interface(transform, &IID_IMFVideoDeviceID, I_SUPPORTED); + check_service_interface(transform, &MR_VIDEO_MIXER_SERVICE, &IID_IMFVideoMixerBitmap, I_SUPPORTED); + check_service_interface(transform, &MR_VIDEO_MIXER_SERVICE, &IID_IMFVideoProcessor, I_SUPPORTED); + check_service_interface(transform, &MR_VIDEO_MIXER_SERVICE, &IID_IMFVideoMixerControl, I_SUPPORTED); + check_service_interface(transform, &MR_VIDEO_MIXER_SERVICE, &IID_IMFVideoPositionMapper, I_SUPPORTED); + check_service_interface(transform, &MR_VIDEO_MIXER_SERVICE, &IID_IMFTransform, I_MISSING);
hr = MFGetService((IUnknown *)transform, &MR_VIDEO_RENDER_SERVICE, &IID_IUnknown, (void **)&unk); ok(hr == MF_E_UNSUPPORTED_SERVICE, "Unexpected hr %#x.\n", hr); @@ -1143,32 +1160,32 @@ static void test_default_presenter(void) if (FAILED(hr)) return;
- check_interface(presenter, &IID_IQualProp, TRUE); - check_interface(presenter, &IID_IMFVideoPositionMapper, TRUE); - check_interface(presenter, &IID_IMFTopologyServiceLookupClient, TRUE); - check_interface(presenter, &IID_IMFVideoDisplayControl, TRUE); - check_interface(presenter, &IID_IMFRateSupport, TRUE); - check_interface(presenter, &IID_IMFGetService, TRUE); - check_interface(presenter, &IID_IMFClockStateSink, TRUE); - check_interface(presenter, &IID_IMFVideoPresenter, TRUE); - check_interface(presenter, &IID_IMFVideoDeviceID, TRUE); - check_interface(presenter, &IID_IMFQualityAdvise, TRUE); - check_interface(presenter, &IID_IDirect3DDeviceManager9, TRUE); - todo_wine check_interface(presenter, &IID_IMFQualityAdviseLimits, TRUE); - check_service_interface(presenter, &MR_VIDEO_RENDER_SERVICE, &IID_IMFVideoPositionMapper, TRUE); - check_service_interface(presenter, &MR_VIDEO_RENDER_SERVICE, &IID_IMFVideoDisplayControl, TRUE); - check_service_interface(presenter, &MR_VIDEO_RENDER_SERVICE, &IID_IMFVideoPresenter, TRUE); - check_service_interface(presenter, &MR_VIDEO_RENDER_SERVICE, &IID_IMFClockStateSink, TRUE); - check_service_interface(presenter, &MR_VIDEO_RENDER_SERVICE, &IID_IMFTopologyServiceLookupClient, TRUE); - check_service_interface(presenter, &MR_VIDEO_RENDER_SERVICE, &IID_IQualProp, TRUE); - check_service_interface(presenter, &MR_VIDEO_RENDER_SERVICE, &IID_IMFRateSupport, TRUE); - check_service_interface(presenter, &MR_VIDEO_RENDER_SERVICE, &IID_IMFGetService, TRUE); - check_service_interface(presenter, &MR_VIDEO_RENDER_SERVICE, &IID_IMFVideoDeviceID, TRUE); - check_service_interface(presenter, &MR_VIDEO_RENDER_SERVICE, &IID_IMFQualityAdvise, TRUE); - todo_wine check_service_interface(presenter, &MR_VIDEO_RENDER_SERVICE, &IID_IMFQualityAdviseLimits, TRUE); - check_service_interface(presenter, &MR_VIDEO_RENDER_SERVICE, &IID_IMFTransform, FALSE); - check_service_interface(presenter, &MR_VIDEO_RENDER_SERVICE, &IID_IDirect3DDeviceManager9, TRUE); - check_service_interface(presenter, &MR_VIDEO_ACCELERATION_SERVICE, &IID_IDirect3DDeviceManager9, TRUE); + check_interface(presenter, &IID_IQualProp, I_SUPPORTED); + check_interface(presenter, &IID_IMFVideoPositionMapper, I_SUPPORTED); + check_interface(presenter, &IID_IMFTopologyServiceLookupClient, I_SUPPORTED); + check_interface(presenter, &IID_IMFVideoDisplayControl, I_SUPPORTED); + check_interface(presenter, &IID_IMFRateSupport, I_SUPPORTED); + check_interface(presenter, &IID_IMFGetService, I_SUPPORTED); + check_interface(presenter, &IID_IMFClockStateSink, I_SUPPORTED); + check_interface(presenter, &IID_IMFVideoPresenter, I_SUPPORTED); + check_interface(presenter, &IID_IMFVideoDeviceID, I_SUPPORTED); + check_interface(presenter, &IID_IMFQualityAdvise, I_MAYBE); /* Vista */ + check_interface(presenter, &IID_IDirect3DDeviceManager9, I_SUPPORTED); + todo_wine check_interface(presenter, &IID_IMFQualityAdviseLimits, I_MAYBE); /* Vista */ + check_service_interface(presenter, &MR_VIDEO_RENDER_SERVICE, &IID_IMFVideoPositionMapper, I_SUPPORTED); + check_service_interface(presenter, &MR_VIDEO_RENDER_SERVICE, &IID_IMFVideoDisplayControl, I_SUPPORTED); + check_service_interface(presenter, &MR_VIDEO_RENDER_SERVICE, &IID_IMFVideoPresenter, I_SUPPORTED); + check_service_interface(presenter, &MR_VIDEO_RENDER_SERVICE, &IID_IMFClockStateSink, I_SUPPORTED); + check_service_interface(presenter, &MR_VIDEO_RENDER_SERVICE, &IID_IMFTopologyServiceLookupClient, I_SUPPORTED); + check_service_interface(presenter, &MR_VIDEO_RENDER_SERVICE, &IID_IQualProp, I_SUPPORTED); + check_service_interface(presenter, &MR_VIDEO_RENDER_SERVICE, &IID_IMFRateSupport, I_SUPPORTED); + check_service_interface(presenter, &MR_VIDEO_RENDER_SERVICE, &IID_IMFGetService, I_SUPPORTED); + check_service_interface(presenter, &MR_VIDEO_RENDER_SERVICE, &IID_IMFVideoDeviceID, I_SUPPORTED); + check_service_interface(presenter, &MR_VIDEO_RENDER_SERVICE, &IID_IMFQualityAdvise, I_MAYBE); /* Vista */ + todo_wine check_service_interface(presenter, &MR_VIDEO_RENDER_SERVICE, &IID_IMFQualityAdviseLimits, I_MAYBE); /* Vista */ + check_service_interface(presenter, &MR_VIDEO_RENDER_SERVICE, &IID_IMFTransform, I_MISSING); + check_service_interface(presenter, &MR_VIDEO_RENDER_SERVICE, &IID_IDirect3DDeviceManager9, I_SUPPORTED); + check_service_interface(presenter, &MR_VIDEO_ACCELERATION_SERVICE, &IID_IDirect3DDeviceManager9, I_SUPPORTED);
/* Query arbitrary supported interface back from device manager wrapper. */ hr = IMFVideoPresenter_QueryInterface(presenter, &IID_IDirect3DDeviceManager9, (void **)&dm); @@ -1346,6 +1363,8 @@ static void test_MFCreateVideoSampleAllocator(void) HRESULT hr; BYTE *data;
+ video_type = create_video_type(&MFVideoFormat_RGB32); + hr = MFCreateVideoSampleAllocator(&IID_IUnknown, (void **)&unk); ok(hr == S_OK, "Unexpected hr %#x.\n", hr); IUnknown_Release(unk); @@ -1354,111 +1373,116 @@ static void test_MFCreateVideoSampleAllocator(void) ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
hr = IMFVideoSampleAllocator_QueryInterface(allocator, &IID_IMFVideoSampleAllocatorCallback, (void **)&allocator_cb); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); - - hr = IMFVideoSampleAllocatorCallback_SetCallback(allocator_cb, NULL); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); - - hr = IMFVideoSampleAllocatorCallback_SetCallback(allocator_cb, &test_notify); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); - - hr = IMFVideoSampleAllocatorCallback_SetCallback(allocator_cb, NULL); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + if (hr == E_NOINTERFACE) /* Vista */ + win_skip("IID_IMFVideoSampleAllocatorCallback is not supported\n"); + else + { + ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
- hr = IMFVideoSampleAllocatorCallback_GetFreeSampleCount(allocator_cb, NULL); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + hr = IMFVideoSampleAllocatorCallback_SetCallback(allocator_cb, NULL); + ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
- count = 10; - hr = IMFVideoSampleAllocatorCallback_GetFreeSampleCount(allocator_cb, &count); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); - ok(!count, "Unexpected count %d.\n", count); + hr = IMFVideoSampleAllocatorCallback_SetCallback(allocator_cb, &test_notify); + ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
- hr = IMFVideoSampleAllocator_UninitializeSampleAllocator(allocator); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + hr = IMFVideoSampleAllocatorCallback_SetCallback(allocator_cb, NULL); + ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
- hr = IMFVideoSampleAllocator_AllocateSample(allocator, &sample); - ok(hr == MF_E_NOT_INITIALIZED, "Unexpected hr %#x.\n", hr); + hr = IMFVideoSampleAllocatorCallback_GetFreeSampleCount(allocator_cb, NULL); + ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
- hr = IMFVideoSampleAllocator_SetDirectXManager(allocator, NULL); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + count = 10; + hr = IMFVideoSampleAllocatorCallback_GetFreeSampleCount(allocator_cb, &count); + ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(!count, "Unexpected count %d.\n", count);
- hr = MFCreateMediaType(&media_type); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + hr = IMFVideoSampleAllocator_UninitializeSampleAllocator(allocator); + ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
- /* It expects IMFVideoMediaType aka video major type. Exact return code is E_NOINTERFACE, - likely coming from querying for IMFVideoMediaType. Does not seem valuable to match it. */ - hr = IMFVideoSampleAllocator_InitializeSampleAllocator(allocator, 2, media_type); - ok(FAILED(hr), "Unexpected hr %#x.\n", hr); + hr = IMFVideoSampleAllocator_AllocateSample(allocator, &sample); + ok(hr == MF_E_NOT_INITIALIZED, "Unexpected hr %#x.\n", hr);
- video_type = create_video_type(&MFVideoFormat_RGB32); + hr = IMFVideoSampleAllocator_SetDirectXManager(allocator, NULL); + ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
- hr = IMFVideoSampleAllocator_InitializeSampleAllocator(allocator, 2, video_type); - ok(hr == MF_E_INVALIDMEDIATYPE, "Unexpected hr %#x.\n", hr); + hr = MFCreateMediaType(&media_type); + ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
- /* Frame size is required. */ - hr = IMFMediaType_SetUINT64(video_type, &MF_MT_FRAME_SIZE, (UINT64) 320 << 32 | 240); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); - hr = IMFVideoSampleAllocator_InitializeSampleAllocator(allocator, 0, video_type); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + /* It expects IMFVideoMediaType aka video major type. Exact return + * code is E_NOINTERFACE, likely coming from querying for + * IMFVideoMediaType. Does not seem valuable to match it. + */ + hr = IMFVideoSampleAllocator_InitializeSampleAllocator(allocator, 2, media_type); + ok(FAILED(hr), "Unexpected hr %#x.\n", hr);
- hr = IMFVideoSampleAllocatorCallback_GetFreeSampleCount(allocator_cb, &count); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); - ok(count == 1, "Unexpected count %d.\n", count); + hr = IMFVideoSampleAllocator_InitializeSampleAllocator(allocator, 2, video_type); + ok(hr == MF_E_INVALIDMEDIATYPE, "Unexpected hr %#x.\n", hr);
- sample = NULL; - hr = IMFVideoSampleAllocator_AllocateSample(allocator, &sample); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); - refcount = get_refcount(sample); + /* Frame size is required. */ + hr = IMFMediaType_SetUINT64(video_type, &MF_MT_FRAME_SIZE, (UINT64) 320 << 32 | 240); + ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + hr = IMFVideoSampleAllocator_InitializeSampleAllocator(allocator, 0, video_type); + ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
- hr = IMFVideoSampleAllocator_AllocateSample(allocator, &sample2); - ok(hr == MF_E_SAMPLEALLOCATOR_EMPTY, "Unexpected hr %#x.\n", hr); + hr = IMFVideoSampleAllocatorCallback_GetFreeSampleCount(allocator_cb, &count); + ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(count == 1, "Unexpected count %d.\n", count);
- /* Reinitialize with active sample. */ - hr = IMFVideoSampleAllocator_InitializeSampleAllocator(allocator, 4, video_type); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); - ok(refcount == get_refcount(sample), "Unexpected refcount %u.\n", get_refcount(sample)); + sample = NULL; + hr = IMFVideoSampleAllocator_AllocateSample(allocator, &sample); + ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + refcount = get_refcount(sample);
- hr = IMFVideoSampleAllocatorCallback_GetFreeSampleCount(allocator_cb, &count); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); - ok(count == 4, "Unexpected count %d.\n", count); + hr = IMFVideoSampleAllocator_AllocateSample(allocator, &sample2); + ok(hr == MF_E_SAMPLEALLOCATOR_EMPTY, "Unexpected hr %#x.\n", hr);
- hr = IMFSample_QueryInterface(sample, &IID_IMFDesiredSample, (void **)&unk); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); - IUnknown_Release(unk); + /* Reinitialize with active sample. */ + hr = IMFVideoSampleAllocator_InitializeSampleAllocator(allocator, 4, video_type); + ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(refcount == get_refcount(sample), "Unexpected refcount %u.\n", get_refcount(sample));
- hr = IMFSample_QueryInterface(sample, &IID_IMFTrackedSample, (void **)&unk); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); - IUnknown_Release(unk); + hr = IMFVideoSampleAllocatorCallback_GetFreeSampleCount(allocator_cb, &count); + ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(count == 4, "Unexpected count %d.\n", count);
- hr = IMFSample_GetBufferByIndex(sample, 0, &buffer); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + hr = IMFSample_QueryInterface(sample, &IID_IMFDesiredSample, (void **)&unk); + ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + IUnknown_Release(unk);
- hr = IMFMediaBuffer_QueryInterface(buffer, &IID_IMFGetService, (void **)&gs); - ok(hr == S_OK || broken(hr == E_NOINTERFACE) /* Win7 */, "Unexpected hr %#x.\n", hr); + hr = IMFSample_QueryInterface(sample, &IID_IMFTrackedSample, (void **)&unk); + ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + IUnknown_Release(unk);
- /* Device manager wasn't set, sample gets regular memory buffers. */ - if (SUCCEEDED(hr)) - { - hr = IMFGetService_GetService(gs, &MR_BUFFER_SERVICE, &IID_IDirect3DSurface9, (void **)&surface); - ok(hr == E_NOTIMPL, "Unexpected hr %#x.\n", hr); - IMFGetService_Release(gs); - } + hr = IMFSample_GetBufferByIndex(sample, 0, &buffer); + ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
- hr = IMFMediaBuffer_QueryInterface(buffer, &IID_IMF2DBuffer, (void **)&unk); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); - IUnknown_Release(unk); + hr = IMFMediaBuffer_QueryInterface(buffer, &IID_IMFGetService, (void **)&gs); + ok(hr == S_OK || broken(hr == E_NOINTERFACE) /* Win7 */, "Unexpected hr %#x.\n", hr);
- IMFMediaBuffer_Release(buffer); + /* Device manager wasn't set, sample gets regular memory buffers. */ + if (SUCCEEDED(hr)) + { + hr = IMFGetService_GetService(gs, &MR_BUFFER_SERVICE, &IID_IDirect3DSurface9, (void **)&surface); + ok(hr == E_NOTIMPL, "Unexpected hr %#x.\n", hr); + IMFGetService_Release(gs); + }
- IMFSample_Release(sample); + hr = IMFMediaBuffer_QueryInterface(buffer, &IID_IMF2DBuffer, (void **)&unk); + ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + IUnknown_Release(unk);
- IMFVideoSampleAllocatorCallback_Release(allocator_cb); + IMFMediaBuffer_Release(buffer); + IMFSample_Release(sample); + IMFVideoSampleAllocatorCallback_Release(allocator_cb); + }
IMFVideoSampleAllocator_Release(allocator);
hr = MFCreateVideoSampleAllocator(&IID_IMFVideoSampleAllocatorCallback, (void **)&unk); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); - IUnknown_Release(unk); + ok(hr == S_OK || broken(hr == E_NOINTERFACE) /* Vista */, + "Unexpected hr %#x.\n", hr); + if (SUCCEEDED(hr)) + IUnknown_Release(unk);
/* Using device manager */ window = create_window(); @@ -1492,7 +1516,7 @@ static void test_MFCreateVideoSampleAllocator(void) hr = IMFSample_GetBufferByIndex(sample, 0, &buffer); ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
- check_service_interface(buffer, &MR_BUFFER_SERVICE, &IID_IDirect3DSurface9, TRUE); + check_service_interface(buffer, &MR_BUFFER_SERVICE, &IID_IDirect3DSurface9, I_SUPPORTED);
hr = IMFMediaBuffer_QueryInterface(buffer, &IID_IMF2DBuffer, (void **)&unk); ok(hr == S_OK, "Unexpected hr %#x.\n", hr); @@ -2025,10 +2049,12 @@ static void test_presenter_quality_control(void)
hr = IMFVideoPresenter_QueryInterface(presenter, &IID_IMFQualityAdviseLimits, (void **)&qa_limits); todo_wine - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(hr == S_OK || broken(hr == E_NOINTERFACE) /* Vista */, + "Unexpected hr %#x.\n", hr);
hr = IMFVideoPresenter_QueryInterface(presenter, &IID_IMFQualityAdvise, (void **)&advise); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(hr == S_OK || broken(hr == E_NOINTERFACE) /* Vista */, + "Unexpected hr %#x.\n", hr);
if (qa_limits) { @@ -2049,25 +2075,26 @@ if (qa_limits) IMFQualityAdviseLimits_Release(qa_limits); }
-todo_wine { - mode = 1; - hr = IMFQualityAdvise_GetDropMode(advise, &mode); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); - ok(mode == MF_DROP_MODE_NONE, "Unexpected mode %d.\n", mode); + if (advise) + todo_wine { + mode = 1; + hr = IMFQualityAdvise_GetDropMode(advise, &mode); + ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(mode == MF_DROP_MODE_NONE, "Unexpected mode %d.\n", mode);
- level = 1; - hr = IMFQualityAdvise_GetQualityLevel(advise, &level); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); - ok(level == MF_QUALITY_NORMAL, "Unexpected mode %d.\n", level); + level = 1; + hr = IMFQualityAdvise_GetQualityLevel(advise, &level); + ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(level == MF_QUALITY_NORMAL, "Unexpected mode %d.\n", level);
- hr = IMFQualityAdvise_SetDropMode(advise, MF_DROP_MODE_1); - ok(hr == MF_E_NO_MORE_DROP_MODES, "Unexpected hr %#x.\n", hr); + hr = IMFQualityAdvise_SetDropMode(advise, MF_DROP_MODE_1); + ok(hr == MF_E_NO_MORE_DROP_MODES, "Unexpected hr %#x.\n", hr);
- hr = IMFQualityAdvise_SetQualityLevel(advise, MF_QUALITY_NORMAL_MINUS_1); - ok(hr == MF_E_NO_MORE_QUALITY_LEVELS, "Unexpected hr %#x.\n", hr); -} + hr = IMFQualityAdvise_SetQualityLevel(advise, MF_QUALITY_NORMAL_MINUS_1); + ok(hr == MF_E_NO_MORE_QUALITY_LEVELS, "Unexpected hr %#x.\n", hr);
- IMFQualityAdvise_Release(advise); + IMFQualityAdvise_Release(advise); + }
IMFVideoPresenter_Release(presenter); }
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=82440
Your paranoid android.
=== wvistau64 (32 bit report) ===
evr: evr.c:1889: Test failed: Unexpected ratio 0 x 0. evr.c:1902: Test failed: Unexpected ratio 0 x 0. evr.c:1911: Test failed: Unexpected size 640 x 480. evr.c:1912: Test failed: Unexpected ratio 0 x 0.
=== wvistau64 (64 bit report) ===
evr: evr.c:1889: Test failed: Unexpected ratio 0 x 0. evr.c:1902: Test failed: Unexpected ratio 0 x 0. evr.c:1911: Test failed: Unexpected size 640 x 480. evr.c:1912: Test failed: Unexpected ratio 0 x 0.
Personally I don't see value in Vista results. But to fix current crashes until any decision is made, smaller change would be to expand crashing tests from check_interface() and use broken() as we usually do. Accommodating such workarounds with generic skipping logic is not worth it.
I can send a patch if you want.
Signed-off-by: Francois Gouget fgouget@codeweavers.com ---
I propose the following where I moved the interface tests out of the generic check_*_interface() methods.
I also split the parts dealing with the crashes in test_MFCreateVideoSampleAllocator() and then in test_presenter_quality_control() in parts 2 and 3.
Finally I added one more patch to deal with the remaining GetNativeVideoSize() failures.
dlls/evr/tests/evr.c | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-)
diff --git a/dlls/evr/tests/evr.c b/dlls/evr/tests/evr.c index 31434bde43a..cfab5e73070 100644 --- a/dlls/evr/tests/evr.c +++ b/dlls/evr/tests/evr.c @@ -1152,9 +1152,18 @@ static void test_default_presenter(void) check_interface(presenter, &IID_IMFClockStateSink, TRUE); check_interface(presenter, &IID_IMFVideoPresenter, TRUE); check_interface(presenter, &IID_IMFVideoDeviceID, TRUE); - check_interface(presenter, &IID_IMFQualityAdvise, TRUE); + + hr = IUnknown_QueryInterface(presenter, &IID_IMFQualityAdvise, (void **)&unk); + ok(hr == S_OK || broken(hr == E_NOINTERFACE) /* Vista */, "Got hr %#x\n", hr); + if (SUCCEEDED(hr)) + IUnknown_Release(unk); + check_interface(presenter, &IID_IDirect3DDeviceManager9, TRUE); - todo_wine check_interface(presenter, &IID_IMFQualityAdviseLimits, TRUE); + hr = IUnknown_QueryInterface(presenter, &IID_IMFQualityAdviseLimits, (void **)&unk); + todo_wine ok(hr == S_OK || broken(hr == E_NOINTERFACE) /* Vista */, "Got hr %#x\n", hr); + if (SUCCEEDED(hr)) + IUnknown_Release(unk); + check_service_interface(presenter, &MR_VIDEO_RENDER_SERVICE, &IID_IMFVideoPositionMapper, TRUE); check_service_interface(presenter, &MR_VIDEO_RENDER_SERVICE, &IID_IMFVideoDisplayControl, TRUE); check_service_interface(presenter, &MR_VIDEO_RENDER_SERVICE, &IID_IMFVideoPresenter, TRUE); @@ -1164,8 +1173,17 @@ static void test_default_presenter(void) check_service_interface(presenter, &MR_VIDEO_RENDER_SERVICE, &IID_IMFRateSupport, TRUE); check_service_interface(presenter, &MR_VIDEO_RENDER_SERVICE, &IID_IMFGetService, TRUE); check_service_interface(presenter, &MR_VIDEO_RENDER_SERVICE, &IID_IMFVideoDeviceID, TRUE); - check_service_interface(presenter, &MR_VIDEO_RENDER_SERVICE, &IID_IMFQualityAdvise, TRUE); - todo_wine check_service_interface(presenter, &MR_VIDEO_RENDER_SERVICE, &IID_IMFQualityAdviseLimits, TRUE); + + hr = MFGetService((IUnknown*)presenter, &MR_VIDEO_RENDER_SERVICE, &IID_IMFQualityAdvise, (void **)&unk); + ok(hr == S_OK || broken(hr == E_NOINTERFACE) /* Vista */, "Got hr %#x\n", hr); + if (SUCCEEDED(hr)) + IUnknown_Release(unk); + + hr = MFGetService((IUnknown*)presenter, &MR_VIDEO_RENDER_SERVICE, &IID_IMFQualityAdviseLimits, (void **)&unk); + todo_wine ok(hr == S_OK || broken(hr == E_NOINTERFACE) /* Vista */, "Got hr %#x\n", hr); + if (SUCCEEDED(hr)) + IUnknown_Release(unk); + check_service_interface(presenter, &MR_VIDEO_RENDER_SERVICE, &IID_IMFTransform, FALSE); check_service_interface(presenter, &MR_VIDEO_RENDER_SERVICE, &IID_IDirect3DDeviceManager9, TRUE); check_service_interface(presenter, &MR_VIDEO_ACCELERATION_SERVICE, &IID_IDirect3DDeviceManager9, TRUE);
Signed-off-by: Francois Gouget fgouget@codeweavers.com --- dlls/evr/tests/evr.c | 161 ++++++++++++++++++++++--------------------- 1 file changed, 84 insertions(+), 77 deletions(-)
diff --git a/dlls/evr/tests/evr.c b/dlls/evr/tests/evr.c index cfab5e73070..ce791db21b1 100644 --- a/dlls/evr/tests/evr.c +++ b/dlls/evr/tests/evr.c @@ -1364,6 +1364,8 @@ static void test_MFCreateVideoSampleAllocator(void) HRESULT hr; BYTE *data;
+ video_type = create_video_type(&MFVideoFormat_RGB32); + hr = MFCreateVideoSampleAllocator(&IID_IUnknown, (void **)&unk); ok(hr == S_OK, "Unexpected hr %#x.\n", hr); IUnknown_Release(unk); @@ -1372,111 +1374,116 @@ static void test_MFCreateVideoSampleAllocator(void) ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
hr = IMFVideoSampleAllocator_QueryInterface(allocator, &IID_IMFVideoSampleAllocatorCallback, (void **)&allocator_cb); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); - - hr = IMFVideoSampleAllocatorCallback_SetCallback(allocator_cb, NULL); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); - - hr = IMFVideoSampleAllocatorCallback_SetCallback(allocator_cb, &test_notify); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); - - hr = IMFVideoSampleAllocatorCallback_SetCallback(allocator_cb, NULL); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + if (hr == E_NOINTERFACE) /* Vista */ + win_skip("IID_IMFVideoSampleAllocatorCallback is not supported\n"); + else + { + ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
- hr = IMFVideoSampleAllocatorCallback_GetFreeSampleCount(allocator_cb, NULL); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + hr = IMFVideoSampleAllocatorCallback_SetCallback(allocator_cb, NULL); + ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
- count = 10; - hr = IMFVideoSampleAllocatorCallback_GetFreeSampleCount(allocator_cb, &count); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); - ok(!count, "Unexpected count %d.\n", count); + hr = IMFVideoSampleAllocatorCallback_SetCallback(allocator_cb, &test_notify); + ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
- hr = IMFVideoSampleAllocator_UninitializeSampleAllocator(allocator); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + hr = IMFVideoSampleAllocatorCallback_SetCallback(allocator_cb, NULL); + ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
- hr = IMFVideoSampleAllocator_AllocateSample(allocator, &sample); - ok(hr == MF_E_NOT_INITIALIZED, "Unexpected hr %#x.\n", hr); + hr = IMFVideoSampleAllocatorCallback_GetFreeSampleCount(allocator_cb, NULL); + ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
- hr = IMFVideoSampleAllocator_SetDirectXManager(allocator, NULL); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + count = 10; + hr = IMFVideoSampleAllocatorCallback_GetFreeSampleCount(allocator_cb, &count); + ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(!count, "Unexpected count %d.\n", count);
- hr = MFCreateMediaType(&media_type); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + hr = IMFVideoSampleAllocator_UninitializeSampleAllocator(allocator); + ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
- /* It expects IMFVideoMediaType aka video major type. Exact return code is E_NOINTERFACE, - likely coming from querying for IMFVideoMediaType. Does not seem valuable to match it. */ - hr = IMFVideoSampleAllocator_InitializeSampleAllocator(allocator, 2, media_type); - ok(FAILED(hr), "Unexpected hr %#x.\n", hr); + hr = IMFVideoSampleAllocator_AllocateSample(allocator, &sample); + ok(hr == MF_E_NOT_INITIALIZED, "Unexpected hr %#x.\n", hr);
- video_type = create_video_type(&MFVideoFormat_RGB32); + hr = IMFVideoSampleAllocator_SetDirectXManager(allocator, NULL); + ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
- hr = IMFVideoSampleAllocator_InitializeSampleAllocator(allocator, 2, video_type); - ok(hr == MF_E_INVALIDMEDIATYPE, "Unexpected hr %#x.\n", hr); + hr = MFCreateMediaType(&media_type); + ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
- /* Frame size is required. */ - hr = IMFMediaType_SetUINT64(video_type, &MF_MT_FRAME_SIZE, (UINT64) 320 << 32 | 240); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); - hr = IMFVideoSampleAllocator_InitializeSampleAllocator(allocator, 0, video_type); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + /* It expects IMFVideoMediaType aka video major type. Exact return + * code is E_NOINTERFACE, likely coming from querying for + * IMFVideoMediaType. Does not seem valuable to match it. + */ + hr = IMFVideoSampleAllocator_InitializeSampleAllocator(allocator, 2, media_type); + ok(FAILED(hr), "Unexpected hr %#x.\n", hr);
- hr = IMFVideoSampleAllocatorCallback_GetFreeSampleCount(allocator_cb, &count); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); - ok(count == 1, "Unexpected count %d.\n", count); + hr = IMFVideoSampleAllocator_InitializeSampleAllocator(allocator, 2, video_type); + ok(hr == MF_E_INVALIDMEDIATYPE, "Unexpected hr %#x.\n", hr);
- sample = NULL; - hr = IMFVideoSampleAllocator_AllocateSample(allocator, &sample); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); - refcount = get_refcount(sample); + /* Frame size is required. */ + hr = IMFMediaType_SetUINT64(video_type, &MF_MT_FRAME_SIZE, (UINT64) 320 << 32 | 240); + ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + hr = IMFVideoSampleAllocator_InitializeSampleAllocator(allocator, 0, video_type); + ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
- hr = IMFVideoSampleAllocator_AllocateSample(allocator, &sample2); - ok(hr == MF_E_SAMPLEALLOCATOR_EMPTY, "Unexpected hr %#x.\n", hr); + hr = IMFVideoSampleAllocatorCallback_GetFreeSampleCount(allocator_cb, &count); + ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(count == 1, "Unexpected count %d.\n", count);
- /* Reinitialize with active sample. */ - hr = IMFVideoSampleAllocator_InitializeSampleAllocator(allocator, 4, video_type); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); - ok(refcount == get_refcount(sample), "Unexpected refcount %u.\n", get_refcount(sample)); + sample = NULL; + hr = IMFVideoSampleAllocator_AllocateSample(allocator, &sample); + ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + refcount = get_refcount(sample);
- hr = IMFVideoSampleAllocatorCallback_GetFreeSampleCount(allocator_cb, &count); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); - ok(count == 4, "Unexpected count %d.\n", count); + hr = IMFVideoSampleAllocator_AllocateSample(allocator, &sample2); + ok(hr == MF_E_SAMPLEALLOCATOR_EMPTY, "Unexpected hr %#x.\n", hr);
- hr = IMFSample_QueryInterface(sample, &IID_IMFDesiredSample, (void **)&unk); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); - IUnknown_Release(unk); + /* Reinitialize with active sample. */ + hr = IMFVideoSampleAllocator_InitializeSampleAllocator(allocator, 4, video_type); + ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(refcount == get_refcount(sample), "Unexpected refcount %u.\n", get_refcount(sample));
- hr = IMFSample_QueryInterface(sample, &IID_IMFTrackedSample, (void **)&unk); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); - IUnknown_Release(unk); + hr = IMFVideoSampleAllocatorCallback_GetFreeSampleCount(allocator_cb, &count); + ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(count == 4, "Unexpected count %d.\n", count);
- hr = IMFSample_GetBufferByIndex(sample, 0, &buffer); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + hr = IMFSample_QueryInterface(sample, &IID_IMFDesiredSample, (void **)&unk); + ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + IUnknown_Release(unk);
- hr = IMFMediaBuffer_QueryInterface(buffer, &IID_IMFGetService, (void **)&gs); - ok(hr == S_OK || broken(hr == E_NOINTERFACE) /* Win7 */, "Unexpected hr %#x.\n", hr); + hr = IMFSample_QueryInterface(sample, &IID_IMFTrackedSample, (void **)&unk); + ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + IUnknown_Release(unk);
- /* Device manager wasn't set, sample gets regular memory buffers. */ - if (SUCCEEDED(hr)) - { - hr = IMFGetService_GetService(gs, &MR_BUFFER_SERVICE, &IID_IDirect3DSurface9, (void **)&surface); - ok(hr == E_NOTIMPL, "Unexpected hr %#x.\n", hr); - IMFGetService_Release(gs); - } + hr = IMFSample_GetBufferByIndex(sample, 0, &buffer); + ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
- hr = IMFMediaBuffer_QueryInterface(buffer, &IID_IMF2DBuffer, (void **)&unk); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); - IUnknown_Release(unk); + hr = IMFMediaBuffer_QueryInterface(buffer, &IID_IMFGetService, (void **)&gs); + ok(hr == S_OK || broken(hr == E_NOINTERFACE) /* Win7 */, "Unexpected hr %#x.\n", hr);
- IMFMediaBuffer_Release(buffer); + /* Device manager wasn't set, sample gets regular memory buffers. */ + if (SUCCEEDED(hr)) + { + hr = IMFGetService_GetService(gs, &MR_BUFFER_SERVICE, &IID_IDirect3DSurface9, (void **)&surface); + ok(hr == E_NOTIMPL, "Unexpected hr %#x.\n", hr); + IMFGetService_Release(gs); + }
- IMFSample_Release(sample); + hr = IMFMediaBuffer_QueryInterface(buffer, &IID_IMF2DBuffer, (void **)&unk); + ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + IUnknown_Release(unk);
- IMFVideoSampleAllocatorCallback_Release(allocator_cb); + IMFMediaBuffer_Release(buffer); + IMFSample_Release(sample); + IMFVideoSampleAllocatorCallback_Release(allocator_cb); + }
IMFVideoSampleAllocator_Release(allocator);
hr = MFCreateVideoSampleAllocator(&IID_IMFVideoSampleAllocatorCallback, (void **)&unk); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); - IUnknown_Release(unk); + ok(hr == S_OK || broken(hr == E_NOINTERFACE) /* Vista */, + "Unexpected hr %#x.\n", hr); + if (SUCCEEDED(hr)) + IUnknown_Release(unk);
/* Using device manager */ window = create_window();
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=82551
Your paranoid android.
=== wvistau64 (32 bit report) ===
evr: evr.c:1890: Test failed: Unexpected ratio 0 x 0. evr.c:1903: Test failed: Unexpected ratio 0 x 0. evr.c:1912: Test failed: Unexpected size 640 x 480. evr.c:1913: Test failed: Unexpected ratio 0 x 0. evr.c:2053: Test failed: Unexpected hr 0x80004002.
=== wvistau64 (64 bit report) ===
evr: evr.c:1890: Test failed: Unexpected ratio 0 x 0. evr.c:1903: Test failed: Unexpected ratio 0 x 0. evr.c:1912: Test failed: Unexpected size 640 x 480. evr.c:1913: Test failed: Unexpected ratio 0 x 0. evr.c:2053: Test failed: Unexpected hr 0x80004002.
On Thu, 26 Nov 2020, Marvin wrote: [...]
=== wvistau64 (32 bit report) === === wvistau64 (64 bit report) ===
evr: evr.c:1890: Test failed: Unexpected ratio 0 x 0. evr.c:1903: Test failed: Unexpected ratio 0 x 0. evr.c:1912: Test failed: Unexpected size 640 x 480. evr.c:1913: Test failed: Unexpected ratio 0 x 0. evr.c:2053: Test failed: Unexpected hr 0x80004002.
These are fixed after the crashes, in patch 4/4.
Signed-off-by: Francois Gouget fgouget@codeweavers.com --- dlls/evr/tests/evr.c | 37 ++++++++++++++++++++----------------- 1 file changed, 20 insertions(+), 17 deletions(-)
diff --git a/dlls/evr/tests/evr.c b/dlls/evr/tests/evr.c index ce791db21b1..06a8b770088 100644 --- a/dlls/evr/tests/evr.c +++ b/dlls/evr/tests/evr.c @@ -2050,10 +2050,12 @@ static void test_presenter_quality_control(void)
hr = IMFVideoPresenter_QueryInterface(presenter, &IID_IMFQualityAdviseLimits, (void **)&qa_limits); todo_wine - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(hr == S_OK || broken(hr == E_NOINTERFACE) /* Vista */, + "Unexpected hr %#x.\n", hr);
hr = IMFVideoPresenter_QueryInterface(presenter, &IID_IMFQualityAdvise, (void **)&advise); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(hr == S_OK || broken(hr == E_NOINTERFACE) /* Vista */, + "Unexpected hr %#x.\n", hr);
if (qa_limits) { @@ -2074,25 +2076,26 @@ if (qa_limits) IMFQualityAdviseLimits_Release(qa_limits); }
-todo_wine { - mode = 1; - hr = IMFQualityAdvise_GetDropMode(advise, &mode); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); - ok(mode == MF_DROP_MODE_NONE, "Unexpected mode %d.\n", mode); + if (advise) + todo_wine { + mode = 1; + hr = IMFQualityAdvise_GetDropMode(advise, &mode); + ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(mode == MF_DROP_MODE_NONE, "Unexpected mode %d.\n", mode);
- level = 1; - hr = IMFQualityAdvise_GetQualityLevel(advise, &level); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); - ok(level == MF_QUALITY_NORMAL, "Unexpected mode %d.\n", level); + level = 1; + hr = IMFQualityAdvise_GetQualityLevel(advise, &level); + ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(level == MF_QUALITY_NORMAL, "Unexpected mode %d.\n", level);
- hr = IMFQualityAdvise_SetDropMode(advise, MF_DROP_MODE_1); - ok(hr == MF_E_NO_MORE_DROP_MODES, "Unexpected hr %#x.\n", hr); + hr = IMFQualityAdvise_SetDropMode(advise, MF_DROP_MODE_1); + ok(hr == MF_E_NO_MORE_DROP_MODES, "Unexpected hr %#x.\n", hr);
- hr = IMFQualityAdvise_SetQualityLevel(advise, MF_QUALITY_NORMAL_MINUS_1); - ok(hr == MF_E_NO_MORE_QUALITY_LEVELS, "Unexpected hr %#x.\n", hr); -} + hr = IMFQualityAdvise_SetQualityLevel(advise, MF_QUALITY_NORMAL_MINUS_1); + ok(hr == MF_E_NO_MORE_QUALITY_LEVELS, "Unexpected hr %#x.\n", hr);
- IMFQualityAdvise_Release(advise); + IMFQualityAdvise_Release(advise); + }
IMFVideoPresenter_Release(presenter); }
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=82552
Your paranoid android.
=== wvistau64 (32 bit report) ===
evr: evr.c:1890: Test failed: Unexpected ratio 0 x 0. evr.c:1903: Test failed: Unexpected ratio 0 x 0. evr.c:1912: Test failed: Unexpected size 640 x 480. evr.c:1913: Test failed: Unexpected ratio 0 x 0.
=== wvistau64 (64 bit report) ===
evr: evr.c:1890: Test failed: Unexpected ratio 0 x 0. evr.c:1903: Test failed: Unexpected ratio 0 x 0. evr.c:1912: Test failed: Unexpected size 640 x 480. evr.c:1913: Test failed: Unexpected ratio 0 x 0.
Signed-off-by: Francois Gouget fgouget@codeweavers.com --- dlls/evr/tests/evr.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-)
diff --git a/dlls/evr/tests/evr.c b/dlls/evr/tests/evr.c index 06a8b770088..568ee959cbc 100644 --- a/dlls/evr/tests/evr.c +++ b/dlls/evr/tests/evr.c @@ -1887,7 +1887,9 @@ static void test_presenter_native_video_size(void) hr = IMFVideoDisplayControl_GetNativeVideoSize(display_control, &size, &ratio); ok(hr == S_OK, "Unexpected hr %#x.\n", hr); ok(size.cx == 640 && size.cy == 480, "Unexpected size %u x %u.\n", size.cx, size.cy); - ok((ratio.cx == 4 && ratio.cy == 3) || broken(!memcmp(&ratio, &size, sizeof(ratio))) /* < Win10 */, + ok((ratio.cx == 4 && ratio.cy == 3) || + broken(ratio.cx == 0 && ratio.cy == 0) /* Vista */ || + broken(!memcmp(&ratio, &size, sizeof(ratio))) /* < Win10 */, "Unexpected ratio %u x %u.\n", ratio.cx, ratio.cy);
/* Update input type. */ @@ -1900,7 +1902,9 @@ static void test_presenter_native_video_size(void) hr = IMFVideoDisplayControl_GetNativeVideoSize(display_control, &size, &ratio); ok(hr == S_OK, "Unexpected hr %#x.\n", hr); ok(size.cx == 640 && size.cy == 480, "Unexpected size %u x %u.\n", size.cx, size.cy); - ok((ratio.cx == 4 && ratio.cy == 3) || broken(!memcmp(&ratio, &size, sizeof(ratio))) /* < Win10 */, + ok((ratio.cx == 4 && ratio.cy == 3) || + broken(ratio.cx == 0 && ratio.cy == 0) /* Vista */ || + broken(!memcmp(&ratio, &size, sizeof(ratio))) /* < Win10 */, "Unexpected ratio %u x %u.\n", ratio.cx, ratio.cy);
/* Negotiating types updates native video size. */ @@ -1909,8 +1913,12 @@ static void test_presenter_native_video_size(void)
hr = IMFVideoDisplayControl_GetNativeVideoSize(display_control, &size, &ratio); ok(hr == S_OK, "Unexpected hr %#x.\n", hr); - ok(size.cx == 320 && size.cy == 240, "Unexpected size %u x %u.\n", size.cx, size.cy); - ok((ratio.cx == 4 && ratio.cy == 3) || broken(!memcmp(&ratio, &size, sizeof(ratio))) /* < Win10 */, + ok((size.cx == 320 && size.cy == 240) || + broken(size.cx == 640 && size.cy == 480) /* Vista */, + "Unexpected size %u x %u.\n", size.cx, size.cy); + ok((ratio.cx == 4 && ratio.cy == 3) || + broken(ratio.cx == 0 && ratio.cy == 0) /* Vista */ || + broken(!memcmp(&ratio, &size, sizeof(ratio))) /* < Win10 */, "Unexpected ratio %u x %u.\n", ratio.cx, ratio.cy);
IMFMediaType_Release(video_type);