Commit 1d1eebf3 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

mfmediaengine: Implement GetResourceCharacteristics().

parent 9a7d166e
......@@ -2453,9 +2453,19 @@ static HRESULT WINAPI media_engine_FrameStep(IMFMediaEngineEx *iface, BOOL forwa
static HRESULT WINAPI media_engine_GetResourceCharacteristics(IMFMediaEngineEx *iface, DWORD *flags)
{
FIXME("%p, %p stub.\n", iface, flags);
struct media_engine *engine = impl_from_IMFMediaEngineEx(iface);
HRESULT hr = E_FAIL;
return E_NOTIMPL;
TRACE("%p, %p.\n", iface, flags);
EnterCriticalSection(&engine->cs);
if (engine->flags & FLAGS_ENGINE_SHUT_DOWN)
hr = MF_E_SHUTDOWN;
else if (engine->presentation.source)
hr = IMFMediaSource_GetCharacteristics(engine->presentation.source, flags);
LeaveCriticalSection(&engine->cs);
return hr;
}
static HRESULT WINAPI media_engine_GetPresentationAttribute(IMFMediaEngineEx *iface, REFGUID attribute,
......
......@@ -295,9 +295,9 @@ static void test_Shutdown(void)
IMFMediaEngineEx *media_engine_ex;
IMFMediaTimeRange *time_range;
IMFMediaEngine *media_engine;
DWORD flags, cx, cy;
unsigned int state;
UINT32 value;
DWORD cx, cy;
double val;
HRESULT hr;
BSTR str;
......@@ -451,6 +451,12 @@ static void test_Shutdown(void)
hr = IMFMediaEngineEx_SetAudioEndpointRole(media_engine_ex, eConsole);
ok(hr == MF_E_SHUTDOWN, "Unexpected hr %#lx.\n", hr);
hr = IMFMediaEngineEx_GetResourceCharacteristics(media_engine_ex, NULL);
ok(hr == MF_E_SHUTDOWN, "Unexpected hr %#lx.\n", hr);
hr = IMFMediaEngineEx_GetResourceCharacteristics(media_engine_ex, &flags);
ok(hr == MF_E_SHUTDOWN, "Unexpected hr %#lx.\n", hr);
IMFMediaEngineEx_Release(media_engine_ex);
}
......@@ -863,6 +869,7 @@ static void test_SetSourceFromByteStream(void)
{
struct media_engine_notify *notify;
IMFMediaEngineEx *media_engine;
DWORD flags;
HRESULT hr;
notify = create_callback();
......@@ -878,6 +885,12 @@ static void test_SetSourceFromByteStream(void)
hr = IMFMediaEngineEx_SetSourceFromByteStream(media_engine, NULL, NULL);
ok(hr == E_POINTER, "Unexpected hr %#lx.\n", hr);
hr = IMFMediaEngineEx_GetResourceCharacteristics(media_engine, NULL);
ok(hr == E_FAIL, "Unexpected hr %#lx.\n", hr);
hr = IMFMediaEngineEx_GetResourceCharacteristics(media_engine, &flags);
ok(hr == E_FAIL, "Unexpected hr %#lx.\n", hr);
IMFMediaEngineEx_Release(media_engine);
IMFMediaEngineNotify_Release(&notify->IMFMediaEngineNotify_iface);
}
......
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