mfmediaengine: Handle shutdown state in a few stubs.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
a4890ac799
commit
4c61027967
|
@ -1538,16 +1538,36 @@ static HRESULT WINAPI media_engine_GetBuffered(IMFMediaEngineEx *iface, IMFMedia
|
||||||
|
|
||||||
static HRESULT WINAPI media_engine_Load(IMFMediaEngineEx *iface)
|
static HRESULT WINAPI media_engine_Load(IMFMediaEngineEx *iface)
|
||||||
{
|
{
|
||||||
|
struct media_engine *engine = impl_from_IMFMediaEngineEx(iface);
|
||||||
|
HRESULT hr = E_NOTIMPL;
|
||||||
|
|
||||||
FIXME("(%p): stub.\n", iface);
|
FIXME("(%p): stub.\n", iface);
|
||||||
|
|
||||||
return E_NOTIMPL;
|
EnterCriticalSection(&engine->cs);
|
||||||
|
|
||||||
|
if (engine->flags & FLAGS_ENGINE_SHUT_DOWN)
|
||||||
|
hr = MF_E_SHUTDOWN;
|
||||||
|
|
||||||
|
LeaveCriticalSection(&engine->cs);
|
||||||
|
|
||||||
|
return hr;
|
||||||
}
|
}
|
||||||
|
|
||||||
static HRESULT WINAPI media_engine_CanPlayType(IMFMediaEngineEx *iface, BSTR type, MF_MEDIA_ENGINE_CANPLAY *answer)
|
static HRESULT WINAPI media_engine_CanPlayType(IMFMediaEngineEx *iface, BSTR type, MF_MEDIA_ENGINE_CANPLAY *answer)
|
||||||
{
|
{
|
||||||
|
struct media_engine *engine = impl_from_IMFMediaEngineEx(iface);
|
||||||
|
HRESULT hr = E_NOTIMPL;
|
||||||
|
|
||||||
FIXME("(%p, %s, %p): stub.\n", iface, debugstr_w(type), answer);
|
FIXME("(%p, %s, %p): stub.\n", iface, debugstr_w(type), answer);
|
||||||
|
|
||||||
return E_NOTIMPL;
|
EnterCriticalSection(&engine->cs);
|
||||||
|
|
||||||
|
if (engine->flags & FLAGS_ENGINE_SHUT_DOWN)
|
||||||
|
hr = MF_E_SHUTDOWN;
|
||||||
|
|
||||||
|
LeaveCriticalSection(&engine->cs);
|
||||||
|
|
||||||
|
return hr;
|
||||||
}
|
}
|
||||||
|
|
||||||
static USHORT WINAPI media_engine_GetReadyState(IMFMediaEngineEx *iface)
|
static USHORT WINAPI media_engine_GetReadyState(IMFMediaEngineEx *iface)
|
||||||
|
@ -1595,9 +1615,19 @@ static double WINAPI media_engine_GetCurrentTime(IMFMediaEngineEx *iface)
|
||||||
|
|
||||||
static HRESULT WINAPI media_engine_SetCurrentTime(IMFMediaEngineEx *iface, double time)
|
static HRESULT WINAPI media_engine_SetCurrentTime(IMFMediaEngineEx *iface, double time)
|
||||||
{
|
{
|
||||||
|
struct media_engine *engine = impl_from_IMFMediaEngineEx(iface);
|
||||||
|
HRESULT hr = E_NOTIMPL;
|
||||||
|
|
||||||
FIXME("(%p, %f): stub.\n", iface, time);
|
FIXME("(%p, %f): stub.\n", iface, time);
|
||||||
|
|
||||||
return E_NOTIMPL;
|
EnterCriticalSection(&engine->cs);
|
||||||
|
|
||||||
|
if (engine->flags & FLAGS_ENGINE_SHUT_DOWN)
|
||||||
|
hr = MF_E_SHUTDOWN;
|
||||||
|
|
||||||
|
LeaveCriticalSection(&engine->cs);
|
||||||
|
|
||||||
|
return hr;
|
||||||
}
|
}
|
||||||
|
|
||||||
static double WINAPI media_engine_GetStartTime(IMFMediaEngineEx *iface)
|
static double WINAPI media_engine_GetStartTime(IMFMediaEngineEx *iface)
|
||||||
|
@ -1705,16 +1735,36 @@ static HRESULT WINAPI media_engine_SetPlaybackRate(IMFMediaEngineEx *iface, doub
|
||||||
|
|
||||||
static HRESULT WINAPI media_engine_GetPlayed(IMFMediaEngineEx *iface, IMFMediaTimeRange **played)
|
static HRESULT WINAPI media_engine_GetPlayed(IMFMediaEngineEx *iface, IMFMediaTimeRange **played)
|
||||||
{
|
{
|
||||||
|
struct media_engine *engine = impl_from_IMFMediaEngineEx(iface);
|
||||||
|
HRESULT hr = E_NOTIMPL;
|
||||||
|
|
||||||
FIXME("(%p, %p): stub.\n", iface, played);
|
FIXME("(%p, %p): stub.\n", iface, played);
|
||||||
|
|
||||||
return E_NOTIMPL;
|
EnterCriticalSection(&engine->cs);
|
||||||
|
|
||||||
|
if (engine->flags & FLAGS_ENGINE_SHUT_DOWN)
|
||||||
|
hr = MF_E_SHUTDOWN;
|
||||||
|
|
||||||
|
LeaveCriticalSection(&engine->cs);
|
||||||
|
|
||||||
|
return hr;
|
||||||
}
|
}
|
||||||
|
|
||||||
static HRESULT WINAPI media_engine_GetSeekable(IMFMediaEngineEx *iface, IMFMediaTimeRange **seekable)
|
static HRESULT WINAPI media_engine_GetSeekable(IMFMediaEngineEx *iface, IMFMediaTimeRange **seekable)
|
||||||
{
|
{
|
||||||
|
struct media_engine *engine = impl_from_IMFMediaEngineEx(iface);
|
||||||
|
HRESULT hr = E_NOTIMPL;
|
||||||
|
|
||||||
FIXME("(%p, %p): stub.\n", iface, seekable);
|
FIXME("(%p, %p): stub.\n", iface, seekable);
|
||||||
|
|
||||||
return E_NOTIMPL;
|
EnterCriticalSection(&engine->cs);
|
||||||
|
|
||||||
|
if (engine->flags & FLAGS_ENGINE_SHUT_DOWN)
|
||||||
|
hr = MF_E_SHUTDOWN;
|
||||||
|
|
||||||
|
LeaveCriticalSection(&engine->cs);
|
||||||
|
|
||||||
|
return hr;
|
||||||
}
|
}
|
||||||
|
|
||||||
static BOOL WINAPI media_engine_IsEnded(IMFMediaEngineEx *iface)
|
static BOOL WINAPI media_engine_IsEnded(IMFMediaEngineEx *iface)
|
||||||
|
|
|
@ -344,12 +344,10 @@ static void test_Shutdown(void)
|
||||||
ok(hr == MF_E_SHUTDOWN, "Unexpected hr %#x.\n", hr);
|
ok(hr == MF_E_SHUTDOWN, "Unexpected hr %#x.\n", hr);
|
||||||
|
|
||||||
hr = IMFMediaEngine_Load(media_engine);
|
hr = IMFMediaEngine_Load(media_engine);
|
||||||
todo_wine
|
|
||||||
ok(hr == MF_E_SHUTDOWN, "Unexpected hr %#x.\n", hr);
|
ok(hr == MF_E_SHUTDOWN, "Unexpected hr %#x.\n", hr);
|
||||||
|
|
||||||
str = SysAllocString(L"video/mp4");
|
str = SysAllocString(L"video/mp4");
|
||||||
hr = IMFMediaEngine_CanPlayType(media_engine, str, &state);
|
hr = IMFMediaEngine_CanPlayType(media_engine, str, &state);
|
||||||
todo_wine
|
|
||||||
ok(hr == MF_E_SHUTDOWN, "Unexpected hr %#x.\n", hr);
|
ok(hr == MF_E_SHUTDOWN, "Unexpected hr %#x.\n", hr);
|
||||||
SysFreeString(str);
|
SysFreeString(str);
|
||||||
|
|
||||||
|
@ -363,7 +361,6 @@ todo_wine
|
||||||
ok(val == 0.0, "Unexpected time %f.\n", val);
|
ok(val == 0.0, "Unexpected time %f.\n", val);
|
||||||
|
|
||||||
hr = IMFMediaEngine_SetCurrentTime(media_engine, 1.0);
|
hr = IMFMediaEngine_SetCurrentTime(media_engine, 1.0);
|
||||||
todo_wine
|
|
||||||
ok(hr == MF_E_SHUTDOWN, "Unexpected hr %#x.\n", hr);
|
ok(hr == MF_E_SHUTDOWN, "Unexpected hr %#x.\n", hr);
|
||||||
|
|
||||||
val = IMFMediaEngine_GetStartTime(media_engine);
|
val = IMFMediaEngine_GetStartTime(media_engine);
|
||||||
|
@ -382,11 +379,9 @@ todo_wine
|
||||||
ok(val == 1.0, "Unexpected rate %f.\n", val);
|
ok(val == 1.0, "Unexpected rate %f.\n", val);
|
||||||
|
|
||||||
hr = IMFMediaEngine_GetPlayed(media_engine, &time_range);
|
hr = IMFMediaEngine_GetPlayed(media_engine, &time_range);
|
||||||
todo_wine
|
|
||||||
ok(hr == MF_E_SHUTDOWN, "Unexpected hr %#x.\n", hr);
|
ok(hr == MF_E_SHUTDOWN, "Unexpected hr %#x.\n", hr);
|
||||||
|
|
||||||
hr = IMFMediaEngine_GetSeekable(media_engine, &time_range);
|
hr = IMFMediaEngine_GetSeekable(media_engine, &time_range);
|
||||||
todo_wine
|
|
||||||
ok(hr == MF_E_SHUTDOWN, "Unexpected hr %#x.\n", hr);
|
ok(hr == MF_E_SHUTDOWN, "Unexpected hr %#x.\n", hr);
|
||||||
|
|
||||||
state = IMFMediaEngine_IsEnded(media_engine);
|
state = IMFMediaEngine_IsEnded(media_engine);
|
||||||
|
|
Loading…
Reference in New Issue