mf: Create quality manager on session creation.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
76a347a53e
commit
c64f919b09
|
@ -70,6 +70,7 @@ struct media_session
|
|||
IMFPresentationClock *clock;
|
||||
IMFRateControl *clock_rate_control;
|
||||
IMFTopoLoader *topo_loader;
|
||||
IMFQualityManager *quality_manager;
|
||||
struct list topologies;
|
||||
enum session_state state;
|
||||
CRITICAL_SECTION cs;
|
||||
|
@ -332,6 +333,8 @@ static ULONG WINAPI mfsession_Release(IMFMediaSession *iface)
|
|||
IMFRateControl_Release(session->clock_rate_control);
|
||||
if (session->topo_loader)
|
||||
IMFTopoLoader_Release(session->topo_loader);
|
||||
if (session->quality_manager)
|
||||
IMFQualityManager_Release(session->quality_manager);
|
||||
DeleteCriticalSection(&session->cs);
|
||||
heap_free(session);
|
||||
}
|
||||
|
@ -761,6 +764,7 @@ static const IMFRateControlVtbl session_rate_control_vtbl =
|
|||
*/
|
||||
HRESULT WINAPI MFCreateMediaSession(IMFAttributes *config, IMFMediaSession **session)
|
||||
{
|
||||
BOOL without_quality_manager = FALSE;
|
||||
struct media_session *object;
|
||||
HRESULT hr;
|
||||
|
||||
|
@ -806,11 +810,29 @@ HRESULT WINAPI MFCreateMediaSession(IMFAttributes *config, IMFMediaSession **ses
|
|||
WARN("Failed to create custom topology loader, hr %#x.\n", hr);
|
||||
}
|
||||
}
|
||||
|
||||
if (SUCCEEDED(IMFAttributes_GetGUID(config, &MF_SESSION_QUALITY_MANAGER, &clsid)))
|
||||
{
|
||||
if (!(without_quality_manager = IsEqualGUID(&clsid, &GUID_NULL)))
|
||||
{
|
||||
if (FAILED(hr = CoCreateInstance(&clsid, NULL, CLSCTX_INPROC_SERVER, &IID_IMFQualityManager,
|
||||
(void **)&object->quality_manager)))
|
||||
{
|
||||
WARN("Failed to create custom quality manager, hr %#x.\n", hr);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!object->topo_loader && FAILED(hr = MFCreateTopoLoader(&object->topo_loader)))
|
||||
goto failed;
|
||||
|
||||
if (!object->quality_manager && !without_quality_manager &&
|
||||
FAILED(hr = MFCreateStandardQualityManager(&object->quality_manager)))
|
||||
{
|
||||
goto failed;
|
||||
}
|
||||
|
||||
*session = &object->IMFMediaSession_iface;
|
||||
|
||||
return S_OK;
|
||||
|
|
|
@ -1055,6 +1055,14 @@ todo_wine
|
|||
ok(hr == S_OK, "Failed to create media session, hr %#x.\n", hr);
|
||||
IMFMediaSession_Release(session);
|
||||
|
||||
/* Disabled quality manager. */
|
||||
hr = IMFAttributes_SetGUID(attributes, &MF_SESSION_QUALITY_MANAGER, &GUID_NULL);
|
||||
ok(hr == S_OK, "Failed to set attribute, hr %#x.\n", hr);
|
||||
|
||||
hr = MFCreateMediaSession(attributes, &session);
|
||||
ok(hr == S_OK, "Failed to create media session, hr %#x.\n", hr);
|
||||
IMFMediaSession_Release(session);
|
||||
|
||||
IMFAttributes_Release(attributes);
|
||||
|
||||
hr = MFShutdown();
|
||||
|
|
Loading…
Reference in New Issue