Commit 113a4c4f authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

mfmediaengine: Keep "preload" property.

parent abb88520
......@@ -87,6 +87,7 @@ struct media_engine
MF_MEDIA_ENGINE_ERR error_code;
HRESULT extended_code;
MF_MEDIA_ENGINE_READY ready_state;
MF_MEDIA_ENGINE_PRELOAD preload;
IMFMediaSession *session;
IMFSourceResolver *resolver;
BSTR current_source;
......@@ -717,16 +718,29 @@ static USHORT WINAPI media_engine_GetNetworkState(IMFMediaEngine *iface)
static MF_MEDIA_ENGINE_PRELOAD WINAPI media_engine_GetPreload(IMFMediaEngine *iface)
{
FIXME("(%p): stub.\n", iface);
struct media_engine *engine = impl_from_IMFMediaEngine(iface);
MF_MEDIA_ENGINE_PRELOAD preload;
TRACE("%p.\n", iface);
EnterCriticalSection(&engine->cs);
preload = engine->preload;
LeaveCriticalSection(&engine->cs);
return MF_MEDIA_ENGINE_PRELOAD_NONE;
return preload;
}
static HRESULT WINAPI media_engine_SetPreload(IMFMediaEngine *iface, MF_MEDIA_ENGINE_PRELOAD preload)
{
FIXME("(%p, %d): stub.\n", iface, preload);
struct media_engine *engine = impl_from_IMFMediaEngine(iface);
return E_NOTIMPL;
TRACE("%p, %d.\n", iface, preload);
EnterCriticalSection(&engine->cs);
engine->preload = preload;
LeaveCriticalSection(&engine->cs);
return S_OK;
}
static HRESULT WINAPI media_engine_GetBuffered(IMFMediaEngine *iface, IMFMediaTimeRange **buffered)
......
......@@ -265,17 +265,20 @@ todo_wine
/* Preload mode is still accessible. */
state = IMFMediaEngine_GetPreload(media_engine);
todo_wine
ok(!state, "Unexpected state %d.\n", state);
hr = IMFMediaEngine_SetPreload(media_engine, MF_MEDIA_ENGINE_PRELOAD_AUTOMATIC);
todo_wine
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
state = IMFMediaEngine_GetPreload(media_engine);
todo_wine
ok(state == MF_MEDIA_ENGINE_PRELOAD_AUTOMATIC, "Unexpected state %d.\n", state);
hr = IMFMediaEngine_SetPreload(media_engine, 100);
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
state = IMFMediaEngine_GetPreload(media_engine);
ok(state == 100, "Unexpected state %d.\n", state);
hr = IMFMediaEngine_GetBuffered(media_engine, &time_range);
todo_wine
ok(hr == MF_E_SHUTDOWN, "Unexpected hr %#x.\n", hr);
......
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