Vista does not support the IID_IMFQualityAdvise and
IID_IMFQualityAdviseLimits interfaces.
This fixes crashes on Vista.
Signed-off-by: Francois Gouget <fgouget(a)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);
}
--
2.20.1