Signed-off-by: Giovanni Mascellani gmascellani@codeweavers.com --- dlls/mfplat/tests/mfplat.c | 47 ++++++++++++++++++++++++++++++++++++-- 1 file changed, 45 insertions(+), 2 deletions(-)
diff --git a/dlls/mfplat/tests/mfplat.c b/dlls/mfplat/tests/mfplat.c index 65ab72bd57b..cfc22f35927 100644 --- a/dlls/mfplat/tests/mfplat.c +++ b/dlls/mfplat/tests/mfplat.c @@ -654,12 +654,15 @@ static void test_source_resolver(void) IMFStreamDescriptor *sd; IUnknown *cancel_cookie; IMFByteStream *stream; + IMFGetService *get_service; + IMFRateSupport *rate_support; WCHAR pathW[MAX_PATH]; int i, sample_count; WCHAR *filename; PROPVARIANT var; HRESULT hr; GUID guid; + float rate;
if (!pMFCreateSourceResolver) { @@ -763,8 +766,46 @@ static void test_source_resolver(void) ok(mediasource != NULL, "got %p\n", mediasource); ok(obj_type == MF_OBJECT_MEDIASOURCE, "got %d\n", obj_type);
- check_interface(mediasource, &IID_IMFGetService, TRUE); - check_service_interface(mediasource, &MF_RATE_CONTROL_SERVICE, &IID_IMFRateSupport, TRUE); + hr = IMFMediaSource_QueryInterface(mediasource, &IID_IMFGetService, (void**)&get_service); + ok(hr == S_OK, "Failed to get service interface, hr %#x.\n", hr); + + hr = IMFGetService_GetService(get_service, &MF_RATE_CONTROL_SERVICE, &IID_IMFRateSupport, (void**)&rate_support); + ok(hr == S_OK, "Failed to get rate support interface, hr %#x.\n", hr); + + hr = IMFRateSupport_GetFastestRate(rate_support, MFRATE_FORWARD, FALSE, &rate); + ok(hr == S_OK, "Failed to query fastest rate, hr %#x.\n", hr); +todo_wine + ok(rate == 1e6f, "Unexpected fastest rate %f.\n", rate); + hr = IMFRateSupport_GetFastestRate(rate_support, MFRATE_FORWARD, TRUE, &rate); + ok(hr == S_OK, "Failed to query fastest rate, hr %#x.\n", hr); +todo_wine + ok(rate == 1e6f, "Unexpected fastest rate %f.\n", rate); + hr = IMFRateSupport_GetFastestRate(rate_support, MFRATE_REVERSE, FALSE, &rate); + ok(hr == S_OK, "Failed to query fastest rate, hr %#x.\n", hr); +todo_wine + ok(rate == -1e6f, "Unexpected fastest rate %f.\n", rate); + hr = IMFRateSupport_GetFastestRate(rate_support, MFRATE_REVERSE, TRUE, &rate); + ok(hr == S_OK, "Failed to query fastest rate, hr %#x.\n", hr); +todo_wine + ok(rate == -1e6f, "Unexpected fastest rate %f.\n", rate); + + hr = IMFRateSupport_GetSlowestRate(rate_support, MFRATE_FORWARD, FALSE, &rate); + ok(hr == S_OK, "Failed to query slowest rate, hr %#x.\n", hr); +todo_wine + ok(rate == 0.0f, "Unexpected slowest rate %f.\n", rate); + hr = IMFRateSupport_GetSlowestRate(rate_support, MFRATE_FORWARD, TRUE, &rate); + ok(hr == S_OK, "Failed to query slowest rate, hr %#x.\n", hr); +todo_wine + ok(rate == 0.0f, "Unexpected slowest rate %f.\n", rate); + hr = IMFRateSupport_GetSlowestRate(rate_support, MFRATE_REVERSE, FALSE, &rate); + ok(hr == S_OK, "Failed to query slowest rate, hr %#x.\n", hr); +todo_wine + ok(rate == 0.0f, "Unexpected slowest rate %f.\n", rate); + hr = IMFRateSupport_GetSlowestRate(rate_support, MFRATE_REVERSE, TRUE, &rate); + ok(hr == S_OK, "Failed to query slowest rate, hr %#x.\n", hr); +todo_wine + ok(rate == 0.0f, "Unexpected slowest rate %f.\n", rate); + check_service_interface(mediasource, &MF_RATE_CONTROL_SERVICE, &IID_IMFRateControl, TRUE); hr = IMFMediaSource_CreatePresentationDescriptor(mediasource, &descriptor); ok(hr == S_OK, "Failed to get presentation descriptor, hr %#x.\n", hr); @@ -878,6 +919,8 @@ todo_wine hr = IMFMediaSource_CreatePresentationDescriptor(mediasource, NULL); ok(hr == MF_E_SHUTDOWN, "Unexpected hr %#x.\n", hr);
+ IMFRateSupport_Release(rate_support); + IMFGetService_Release(get_service); IMFMediaSource_Release(mediasource); IMFByteStream_Release(stream);