Commit 51a0cdf5 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

mf/evr: Add slowest/fastest rate support methods.

parent 71f8e0d3
......@@ -2677,17 +2677,26 @@ static ULONG WINAPI video_renderer_rate_support_Release(IMFRateSupport *iface)
static HRESULT WINAPI video_renderer_rate_support_GetSlowestRate(IMFRateSupport *iface, MFRATE_DIRECTION direction,
BOOL thin, float *rate)
{
FIXME("%p, %d, %d, %p.\n", iface, direction, thin, rate);
struct video_renderer *renderer = impl_from_IMFRateSupport(iface);
return E_NOTIMPL;
TRACE("%p, %d, %d, %p.\n", iface, direction, thin, rate);
if (renderer->flags & EVR_SHUT_DOWN)
return MF_E_SHUTDOWN;
*rate = 0.0f;
return S_OK;
}
static HRESULT WINAPI video_renderer_rate_support_GetFastestRate(IMFRateSupport *iface, MFRATE_DIRECTION direction,
BOOL thin, float *rate)
{
FIXME("%p, %d, %d, %p.\n", iface, direction, thin, rate);
struct video_renderer *renderer = impl_from_IMFRateSupport(iface);
return E_NOTIMPL;
TRACE("%p, %d, %d, %p.\n", iface, direction, thin, rate);
return renderer->flags & EVR_SHUT_DOWN ? MF_E_SHUTDOWN : MF_E_INVALIDREQUEST;
}
static HRESULT WINAPI video_renderer_rate_support_IsRateSupported(IMFRateSupport *iface, BOOL thin, float rate,
......
......@@ -4224,10 +4224,12 @@ static void test_evr(void)
DWORD flags, count, value;
IMFActivate *activate;
HWND window, window2;
IMFRateSupport *rs;
LONG sample_count;
IMFSample *sample;
IUnknown *unk;
UINT64 window3;
float rate;
HRESULT hr;
GUID guid;
......@@ -4510,6 +4512,50 @@ todo_wine
hr = IMFMediaSink_SetPresentationClock(sink, clock);
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
hr = IMFMediaSink_QueryInterface(sink, &IID_IMFRateSupport, (void **)&rs);
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
rate = 1.0f;
hr = IMFRateSupport_GetSlowestRate(rs, MFRATE_FORWARD, FALSE, &rate);
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
ok(rate == 0.0f, "Unexpected rate %f.\n", rate);
rate = 1.0f;
hr = IMFRateSupport_GetSlowestRate(rs, MFRATE_REVERSE, FALSE, &rate);
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
ok(rate == 0.0f, "Unexpected rate %f.\n", rate);
rate = 1.0f;
hr = IMFRateSupport_GetSlowestRate(rs, MFRATE_FORWARD, TRUE, &rate);
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
ok(rate == 0.0f, "Unexpected rate %f.\n", rate);
rate = 1.0f;
hr = IMFRateSupport_GetSlowestRate(rs, MFRATE_REVERSE, TRUE, &rate);
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
ok(rate == 0.0f, "Unexpected rate %f.\n", rate);
hr = IMFRateSupport_GetFastestRate(rs, MFRATE_FORWARD, FALSE, &rate);
ok(hr == MF_E_INVALIDREQUEST, "Unexpected hr %#x.\n", hr);
hr = IMFRateSupport_GetFastestRate(rs, MFRATE_REVERSE, FALSE, &rate);
ok(hr == MF_E_INVALIDREQUEST, "Unexpected hr %#x.\n", hr);
hr = IMFRateSupport_GetFastestRate(rs, MFRATE_FORWARD, TRUE, &rate);
ok(hr == MF_E_INVALIDREQUEST, "Unexpected hr %#x.\n", hr);
hr = IMFRateSupport_GetFastestRate(rs, MFRATE_REVERSE, TRUE, &rate);
ok(hr == MF_E_INVALIDREQUEST, "Unexpected hr %#x.\n", hr);
hr = IMFMediaSink_Shutdown(sink);
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
hr = IMFRateSupport_GetSlowestRate(rs, MFRATE_FORWARD, FALSE, &rate);
ok(hr == MF_E_SHUTDOWN, "Unexpected hr %#x.\n", hr);
hr = IMFRateSupport_GetFastestRate(rs, MFRATE_FORWARD, FALSE, &rate);
ok(hr == MF_E_SHUTDOWN, "Unexpected hr %#x.\n", hr);
IMFPresentationClock_Release(clock);
IMFActivate_Release(activate);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment