mfmediaengine: Implement GetResourceCharacteristics().

Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Nikolay Sivov 2022-02-18 10:47:40 +03:00 committed by Alexandre Julliard
parent 9a7d166e6b
commit 1d1eebf38a
2 changed files with 26 additions and 3 deletions

View File

@ -2453,9 +2453,19 @@ static HRESULT WINAPI media_engine_FrameStep(IMFMediaEngineEx *iface, BOOL forwa
static HRESULT WINAPI media_engine_GetResourceCharacteristics(IMFMediaEngineEx *iface, DWORD *flags) 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, static HRESULT WINAPI media_engine_GetPresentationAttribute(IMFMediaEngineEx *iface, REFGUID attribute,

View File

@ -295,9 +295,9 @@ static void test_Shutdown(void)
IMFMediaEngineEx *media_engine_ex; IMFMediaEngineEx *media_engine_ex;
IMFMediaTimeRange *time_range; IMFMediaTimeRange *time_range;
IMFMediaEngine *media_engine; IMFMediaEngine *media_engine;
DWORD flags, cx, cy;
unsigned int state; unsigned int state;
UINT32 value; UINT32 value;
DWORD cx, cy;
double val; double val;
HRESULT hr; HRESULT hr;
BSTR str; BSTR str;
@ -451,6 +451,12 @@ static void test_Shutdown(void)
hr = IMFMediaEngineEx_SetAudioEndpointRole(media_engine_ex, eConsole); hr = IMFMediaEngineEx_SetAudioEndpointRole(media_engine_ex, eConsole);
ok(hr == MF_E_SHUTDOWN, "Unexpected hr %#lx.\n", hr); 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); IMFMediaEngineEx_Release(media_engine_ex);
} }
@ -863,6 +869,7 @@ static void test_SetSourceFromByteStream(void)
{ {
struct media_engine_notify *notify; struct media_engine_notify *notify;
IMFMediaEngineEx *media_engine; IMFMediaEngineEx *media_engine;
DWORD flags;
HRESULT hr; HRESULT hr;
notify = create_callback(); notify = create_callback();
@ -878,6 +885,12 @@ static void test_SetSourceFromByteStream(void)
hr = IMFMediaEngineEx_SetSourceFromByteStream(media_engine, NULL, NULL); hr = IMFMediaEngineEx_SetSourceFromByteStream(media_engine, NULL, NULL);
ok(hr == E_POINTER, "Unexpected hr %#lx.\n", hr); 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); IMFMediaEngineEx_Release(media_engine);
IMFMediaEngineNotify_Release(&notify->IMFMediaEngineNotify_iface); IMFMediaEngineNotify_Release(&notify->IMFMediaEngineNotify_iface);
} }