Commit 7608e775 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

mfmediaengine: Implement GetStreamAttribute().

parent 2086698e
......@@ -2504,9 +2504,28 @@ static HRESULT WINAPI media_engine_GetNumberOfStreams(IMFMediaEngineEx *iface, D
static HRESULT WINAPI media_engine_GetStreamAttribute(IMFMediaEngineEx *iface, DWORD stream_index, REFGUID attribute,
PROPVARIANT *value)
{
FIXME("%p, %ld, %s, %p stub.\n", iface, stream_index, debugstr_guid(attribute), value);
struct media_engine *engine = impl_from_IMFMediaEngineEx(iface);
IMFStreamDescriptor *sd;
HRESULT hr = E_FAIL;
BOOL selected;
return E_NOTIMPL;
TRACE("%p, %ld, %s, %p.\n", iface, stream_index, debugstr_guid(attribute), value);
EnterCriticalSection(&engine->cs);
if (engine->flags & FLAGS_ENGINE_SHUT_DOWN)
hr = MF_E_SHUTDOWN;
else if (engine->presentation.pd)
{
if (SUCCEEDED(hr = IMFPresentationDescriptor_GetStreamDescriptorByIndex(engine->presentation.pd,
stream_index, &selected, &sd)))
{
hr = IMFStreamDescriptor_GetItem(sd, attribute, value);
IMFStreamDescriptor_Release(sd);
}
}
LeaveCriticalSection(&engine->cs);
return hr;
}
static HRESULT WINAPI media_engine_GetStreamSelection(IMFMediaEngineEx *iface, DWORD stream_index, BOOL *enabled)
......
......@@ -497,6 +497,9 @@ static void test_Shutdown(void)
hr = IMFMediaEngineEx_GetPresentationAttribute(media_engine_ex, &MF_PD_DURATION, &propvar);
ok(hr == MF_E_SHUTDOWN, "Unexpected hr %#lx.\n", hr);
hr = IMFMediaEngineEx_GetStreamAttribute(media_engine_ex, 0, &MF_SD_PROTECTED, &propvar);
ok(hr == MF_E_SHUTDOWN, "Unexpected hr %#lx.\n", hr);
IMFMediaEngineEx_Release(media_engine_ex);
}
......@@ -935,6 +938,9 @@ static void test_SetSourceFromByteStream(void)
hr = IMFMediaEngineEx_GetPresentationAttribute(media_engine, &MF_PD_DURATION, &propvar);
ok(hr == E_FAIL, "Unexpected hr %#lx.\n", hr);
hr = IMFMediaEngineEx_GetStreamAttribute(media_engine, 0, &MF_SD_PROTECTED, &propvar);
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