mfmediaengine: Handle realtime mode flag.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
1d1eebf38a
commit
40c9923982
|
@ -1169,6 +1169,9 @@ static HRESULT media_engine_create_topology(struct media_engine *engine, IMFMedi
|
|||
IMFTopologyNode *sar_node = NULL, *audio_src = NULL;
|
||||
IMFTopologyNode *grabber_node = NULL, *video_src = NULL;
|
||||
|
||||
if (engine->flags & MF_MEDIA_ENGINE_REAL_TIME_MODE)
|
||||
IMFTopology_SetUINT32(topology, &MF_LOW_LATENCY, TRUE);
|
||||
|
||||
if (sd_audio)
|
||||
{
|
||||
if (FAILED(hr = media_engine_create_source_node(source, pd, sd_audio, &audio_src)))
|
||||
|
@ -2695,16 +2698,36 @@ static HRESULT WINAPI media_engine_SetAudioEndpointRole(IMFMediaEngineEx *iface,
|
|||
|
||||
static HRESULT WINAPI media_engine_GetRealTimeMode(IMFMediaEngineEx *iface, BOOL *enabled)
|
||||
{
|
||||
FIXME("%p, %p stub.\n", iface, enabled);
|
||||
struct media_engine *engine = impl_from_IMFMediaEngineEx(iface);
|
||||
HRESULT hr = S_OK;
|
||||
|
||||
return E_NOTIMPL;
|
||||
TRACE("%p, %p.\n", iface, enabled);
|
||||
|
||||
EnterCriticalSection(&engine->cs);
|
||||
if (engine->flags & FLAGS_ENGINE_SHUT_DOWN)
|
||||
hr = MF_E_SHUTDOWN;
|
||||
else
|
||||
*enabled = !!(engine->flags & MF_MEDIA_ENGINE_REAL_TIME_MODE);
|
||||
LeaveCriticalSection(&engine->cs);
|
||||
|
||||
return hr;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI media_engine_SetRealTimeMode(IMFMediaEngineEx *iface, BOOL enable)
|
||||
{
|
||||
FIXME("%p, %d stub.\n", iface, enable);
|
||||
struct media_engine *engine = impl_from_IMFMediaEngineEx(iface);
|
||||
HRESULT hr = S_OK;
|
||||
|
||||
return E_NOTIMPL;
|
||||
TRACE("%p, %d.\n", iface, enable);
|
||||
|
||||
EnterCriticalSection(&engine->cs);
|
||||
if (engine->flags & FLAGS_ENGINE_SHUT_DOWN)
|
||||
hr = MF_E_SHUTDOWN;
|
||||
else
|
||||
media_engine_set_flag(engine, MF_MEDIA_ENGINE_REAL_TIME_MODE, enable);
|
||||
LeaveCriticalSection(&engine->cs);
|
||||
|
||||
return hr;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI media_engine_SetCurrentTimeEx(IMFMediaEngineEx *iface, double seektime, MF_MEDIA_ENGINE_SEEK_MODE mode)
|
||||
|
|
|
@ -240,12 +240,14 @@ static void test_factory(void)
|
|||
static void test_CreateInstance(void)
|
||||
{
|
||||
struct media_engine_notify *notify;
|
||||
IMFMediaEngineEx *media_engine_ex;
|
||||
IMFDXGIDeviceManager *manager;
|
||||
IMFMediaEngine *media_engine;
|
||||
IMFAttributes *attributes;
|
||||
IUnknown *unk;
|
||||
UINT token;
|
||||
HRESULT hr;
|
||||
BOOL ret;
|
||||
|
||||
notify = create_callback();
|
||||
|
||||
|
@ -273,7 +275,8 @@ static void test_CreateInstance(void)
|
|||
hr = IMFAttributes_SetUINT32(attributes, &MF_MEDIA_ENGINE_VIDEO_OUTPUT_FORMAT, DXGI_FORMAT_UNKNOWN);
|
||||
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
|
||||
|
||||
hr = IMFMediaEngineClassFactory_CreateInstance(factory, MF_MEDIA_ENGINE_WAITFORSTABLE_STATE, attributes, &media_engine);
|
||||
hr = IMFMediaEngineClassFactory_CreateInstance(factory, MF_MEDIA_ENGINE_REAL_TIME_MODE
|
||||
| MF_MEDIA_ENGINE_WAITFORSTABLE_STATE, attributes, &media_engine);
|
||||
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
|
||||
|
||||
check_interface(media_engine, &IID_IMFMediaEngine, TRUE);
|
||||
|
@ -283,6 +286,29 @@ static void test_CreateInstance(void)
|
|||
if (SUCCEEDED(hr))
|
||||
IUnknown_Release(unk);
|
||||
|
||||
if (SUCCEEDED(IMFMediaEngine_QueryInterface(media_engine, &IID_IMFMediaEngineEx, (void **)&media_engine_ex)))
|
||||
{
|
||||
hr = IMFMediaEngineEx_GetRealTimeMode(media_engine_ex, &ret);
|
||||
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
|
||||
ok(ret, "Unexpected value.\n");
|
||||
|
||||
hr = IMFMediaEngineEx_SetRealTimeMode(media_engine_ex, FALSE);
|
||||
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
|
||||
|
||||
hr = IMFMediaEngineEx_GetRealTimeMode(media_engine_ex, &ret);
|
||||
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
|
||||
ok(!ret, "Unexpected value.\n");
|
||||
|
||||
hr = IMFMediaEngineEx_SetRealTimeMode(media_engine_ex, TRUE);
|
||||
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
|
||||
|
||||
hr = IMFMediaEngineEx_GetRealTimeMode(media_engine_ex, &ret);
|
||||
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
|
||||
ok(ret, "Unexpected value.\n");
|
||||
|
||||
IMFMediaEngineEx_Release(media_engine_ex);
|
||||
}
|
||||
|
||||
IMFMediaEngine_Release(media_engine);
|
||||
IMFAttributes_Release(attributes);
|
||||
IMFDXGIDeviceManager_Release(manager);
|
||||
|
@ -301,6 +327,7 @@ static void test_Shutdown(void)
|
|||
double val;
|
||||
HRESULT hr;
|
||||
BSTR str;
|
||||
BOOL ret;
|
||||
|
||||
notify = create_callback();
|
||||
|
||||
|
@ -457,6 +484,15 @@ static void test_Shutdown(void)
|
|||
hr = IMFMediaEngineEx_GetResourceCharacteristics(media_engine_ex, &flags);
|
||||
ok(hr == MF_E_SHUTDOWN, "Unexpected hr %#lx.\n", hr);
|
||||
|
||||
hr = IMFMediaEngineEx_GetRealTimeMode(media_engine_ex, NULL);
|
||||
ok(hr == MF_E_SHUTDOWN, "Unexpected hr %#lx.\n", hr);
|
||||
|
||||
hr = IMFMediaEngineEx_GetRealTimeMode(media_engine_ex, &ret);
|
||||
ok(hr == MF_E_SHUTDOWN, "Unexpected hr %#lx.\n", hr);
|
||||
|
||||
hr = IMFMediaEngineEx_SetRealTimeMode(media_engine_ex, TRUE);
|
||||
ok(hr == MF_E_SHUTDOWN, "Unexpected hr %#lx.\n", hr);
|
||||
|
||||
IMFMediaEngineEx_Release(media_engine_ex);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue