Window handle is passed as an attribute.
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/mf/evr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dlls/mf/evr.c b/dlls/mf/evr.c index d20fb1a395d..b35af55353d 100644 --- a/dlls/mf/evr.c +++ b/dlls/mf/evr.c @@ -619,7 +619,7 @@ HRESULT WINAPI MFCreateVideoRendererActivate(HWND hwnd, IMFActivate **activate) if (!activate) return E_POINTER;
- hr = create_activation_object(hwnd, &evr_activate_funcs, activate); + hr = create_activation_object(NULL, &evr_activate_funcs, activate); if (SUCCEEDED(hr)) IMFActivate_SetUINT64(*activate, &MF_ACTIVATE_VIDEO_WINDOW, (ULONG_PTR)hwnd);
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/mf/evr.c | 60 +++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 56 insertions(+), 4 deletions(-)
diff --git a/dlls/mf/evr.c b/dlls/mf/evr.c index b35af55353d..ebd4b232fc7 100644 --- a/dlls/mf/evr.c +++ b/dlls/mf/evr.c @@ -40,6 +40,8 @@ struct video_renderer LONG refcount;
IMFMediaEventQueue *event_queue; + IMFPresentationClock *clock; + IMFTransform *mixer; IMFVideoPresenter *presenter; unsigned int flags; @@ -142,6 +144,8 @@ static ULONG WINAPI video_renderer_sink_Release(IMFMediaSink *iface) IMFTransform_Release(renderer->mixer); if (renderer->presenter) IMFVideoPresenter_Release(renderer->presenter); + if (renderer->clock) + IMFPresentationClock_Release(renderer->clock); DeleteCriticalSection(&renderer->cs); heap_free(renderer); } @@ -201,18 +205,65 @@ static HRESULT WINAPI video_renderer_sink_GetStreamSinkById(IMFMediaSink *iface, return E_NOTIMPL; }
+static void video_renderer_set_presentation_clock(struct video_renderer *renderer, IMFPresentationClock *clock) +{ + if (renderer->clock) + { + IMFPresentationClock_RemoveClockStateSink(renderer->clock, &renderer->IMFClockStateSink_iface); + IMFPresentationClock_Release(renderer->clock); + } + renderer->clock = clock; + if (renderer->clock) + { + IMFPresentationClock_AddRef(renderer->clock); + IMFPresentationClock_AddClockStateSink(renderer->clock, &renderer->IMFClockStateSink_iface); + } +} + static HRESULT WINAPI video_renderer_sink_SetPresentationClock(IMFMediaSink *iface, IMFPresentationClock *clock) { - FIXME("%p, %p.\n", iface, clock); + struct video_renderer *renderer = impl_from_IMFMediaSink(iface); + HRESULT hr = S_OK;
- return E_NOTIMPL; + TRACE("%p, %p.\n", iface, clock); + + EnterCriticalSection(&renderer->cs); + + if (renderer->flags & EVR_SHUT_DOWN) + hr = MF_E_SHUTDOWN; + else + video_renderer_set_presentation_clock(renderer, clock); + + LeaveCriticalSection(&renderer->cs); + + return hr; }
static HRESULT WINAPI video_renderer_sink_GetPresentationClock(IMFMediaSink *iface, IMFPresentationClock **clock) { - FIXME("%p, %p.\n", iface, clock); + struct video_renderer *renderer = impl_from_IMFMediaSink(iface); + HRESULT hr = S_OK;
- return E_NOTIMPL; + TRACE("%p, %p.\n", iface, clock); + + if (!clock) + return E_POINTER; + + EnterCriticalSection(&renderer->cs); + + if (renderer->flags & EVR_SHUT_DOWN) + hr = MF_E_SHUTDOWN; + else if (renderer->clock) + { + *clock = renderer->clock; + IMFPresentationClock_AddRef(*clock); + } + else + hr = MF_E_NO_CLOCK; + + LeaveCriticalSection(&renderer->cs); + + return hr; }
static HRESULT WINAPI video_renderer_sink_Shutdown(IMFMediaSink *iface) @@ -227,6 +278,7 @@ static HRESULT WINAPI video_renderer_sink_Shutdown(IMFMediaSink *iface) EnterCriticalSection(&renderer->cs); renderer->flags |= EVR_SHUT_DOWN; IMFMediaEventQueue_Shutdown(renderer->event_queue); + video_renderer_set_presentation_clock(renderer, NULL); LeaveCriticalSection(&renderer->cs);
return S_OK;
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/mf/evr.c | 54 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+)
diff --git a/dlls/mf/evr.c b/dlls/mf/evr.c index ebd4b232fc7..4a70f798723 100644 --- a/dlls/mf/evr.c +++ b/dlls/mf/evr.c @@ -37,6 +37,7 @@ struct video_renderer IMFClockStateSink IMFClockStateSink_iface; IMFMediaEventGenerator IMFMediaEventGenerator_iface; IMFGetService IMFGetService_iface; + IMFTopologyServiceLookup IMFTopologyServiceLookup_iface; LONG refcount;
IMFMediaEventQueue *event_queue; @@ -78,6 +79,11 @@ static struct video_renderer *impl_from_IMFGetService(IMFGetService *iface) return CONTAINING_RECORD(iface, struct video_renderer, IMFGetService_iface); }
+static struct video_renderer *impl_from_IMFTopologyServiceLookup(IMFTopologyServiceLookup *iface) +{ + return CONTAINING_RECORD(iface, struct video_renderer, IMFTopologyServiceLookup_iface); +} + static HRESULT WINAPI video_renderer_sink_QueryInterface(IMFMediaSink *iface, REFIID riid, void **obj) { struct video_renderer *renderer = impl_from_IMFMediaSink(iface); @@ -556,6 +562,53 @@ static const IMFGetServiceVtbl video_renderer_get_service_vtbl = video_renderer_get_service_GetService, };
+static HRESULT WINAPI video_renderer_service_lookup_QueryInterface(IMFTopologyServiceLookup *iface, REFIID riid, void **obj) +{ + TRACE("%p, %s, %p.\n", iface, debugstr_guid(riid), obj); + + if (IsEqualIID(riid, &IID_IMFTopologyServiceLookup) || + IsEqualIID(riid, &IID_IUnknown)) + { + *obj = iface; + IMFTopologyServiceLookup_AddRef(iface); + return S_OK; + } + + WARN("Unsupported interface %s.\n", debugstr_guid(riid)); + *obj = NULL; + return E_NOINTERFACE; +} + +static ULONG WINAPI video_renderer_service_lookup_AddRef(IMFTopologyServiceLookup *iface) +{ + struct video_renderer *renderer = impl_from_IMFTopologyServiceLookup(iface); + return IMFMediaSink_AddRef(&renderer->IMFMediaSink_iface); +} + +static ULONG WINAPI video_renderer_service_lookup_Release(IMFTopologyServiceLookup *iface) +{ + struct video_renderer *renderer = impl_from_IMFTopologyServiceLookup(iface); + return IMFMediaSink_Release(&renderer->IMFMediaSink_iface); +} + +static HRESULT WINAPI video_renderer_service_lookup_LookupService(IMFTopologyServiceLookup *iface, + MF_SERVICE_LOOKUP_TYPE lookup_type, DWORD index, REFGUID service, REFIID riid, + void **objects, DWORD *num_objects) +{ + TRACE("%p, %u, %u, %s, %s, %p, %p.\n", iface, lookup_type, index, debugstr_guid(service), debugstr_guid(riid), + objects, num_objects); + + return E_NOTIMPL; +} + +static const IMFTopologyServiceLookupVtbl video_renderer_service_lookup_vtbl = +{ + video_renderer_service_lookup_QueryInterface, + video_renderer_service_lookup_AddRef, + video_renderer_service_lookup_Release, + video_renderer_service_lookup_LookupService, +}; + static HRESULT video_renderer_create_mixer(IMFAttributes *attributes, IMFTransform **out) { unsigned int flags = 0; @@ -618,6 +671,7 @@ static HRESULT evr_create_object(IMFAttributes *attributes, void *user_context, object->IMFMediaEventGenerator_iface.lpVtbl = &video_renderer_events_vtbl; object->IMFClockStateSink_iface.lpVtbl = &video_renderer_clock_sink_vtbl; object->IMFGetService_iface.lpVtbl = &video_renderer_get_service_vtbl; + object->IMFTopologyServiceLookup_iface.lpVtbl = &video_renderer_service_lookup_vtbl; object->refcount = 1; InitializeCriticalSection(&object->cs);
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/mf/evr.c | 127 ++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 123 insertions(+), 4 deletions(-)
diff --git a/dlls/mf/evr.c b/dlls/mf/evr.c index 4a70f798723..b702ed2e22a 100644 --- a/dlls/mf/evr.c +++ b/dlls/mf/evr.c @@ -27,6 +27,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(mfplat); enum video_renderer_flags { EVR_SHUT_DOWN = 0x1, + EVR_INIT_SERVICES = 0x2, /* Currently in InitServices() call. */ + EVR_PRESENTER_INITED_SERVICES = 0x4, };
struct video_renderer @@ -38,6 +40,7 @@ struct video_renderer IMFMediaEventGenerator IMFMediaEventGenerator_iface; IMFGetService IMFGetService_iface; IMFTopologyServiceLookup IMFTopologyServiceLookup_iface; + IMediaEventSink IMediaEventSink_iface; LONG refcount;
IMFMediaEventQueue *event_queue; @@ -84,6 +87,24 @@ static struct video_renderer *impl_from_IMFTopologyServiceLookup(IMFTopologyServ return CONTAINING_RECORD(iface, struct video_renderer, IMFTopologyServiceLookup_iface); }
+static struct video_renderer *impl_from_IMediaEventSink(IMediaEventSink *iface) +{ + return CONTAINING_RECORD(iface, struct video_renderer, IMediaEventSink_iface); +} + +static void video_renderer_release_services(struct video_renderer *renderer) +{ + IMFTopologyServiceLookupClient *lookup_client; + + if (renderer->flags & EVR_PRESENTER_INITED_SERVICES && SUCCEEDED(IMFVideoPresenter_QueryInterface(renderer->presenter, + &IID_IMFTopologyServiceLookupClient, (void **)&lookup_client))) + { + IMFTopologyServiceLookupClient_ReleaseServicePointers(lookup_client); + IMFTopologyServiceLookupClient_Release(lookup_client); + renderer->flags &= ~EVR_PRESENTER_INITED_SERVICES; + } +} + static HRESULT WINAPI video_renderer_sink_QueryInterface(IMFMediaSink *iface, REFIID riid, void **obj) { struct video_renderer *renderer = impl_from_IMFMediaSink(iface); @@ -285,6 +306,7 @@ static HRESULT WINAPI video_renderer_sink_Shutdown(IMFMediaSink *iface) renderer->flags |= EVR_SHUT_DOWN; IMFMediaEventQueue_Shutdown(renderer->event_queue); video_renderer_set_presentation_clock(renderer, NULL); + video_renderer_release_services(renderer); LeaveCriticalSection(&renderer->cs);
return S_OK; @@ -595,10 +617,43 @@ static HRESULT WINAPI video_renderer_service_lookup_LookupService(IMFTopologySer MF_SERVICE_LOOKUP_TYPE lookup_type, DWORD index, REFGUID service, REFIID riid, void **objects, DWORD *num_objects) { + struct video_renderer *renderer = impl_from_IMFTopologyServiceLookup(iface); + HRESULT hr = S_OK; + TRACE("%p, %u, %u, %s, %s, %p, %p.\n", iface, lookup_type, index, debugstr_guid(service), debugstr_guid(riid), objects, num_objects);
- return E_NOTIMPL; + EnterCriticalSection(&renderer->cs); + + if (!(renderer->flags & EVR_INIT_SERVICES)) + hr = MF_E_NOTACCEPTING; + else if (IsEqualGUID(service, &MR_VIDEO_RENDER_SERVICE)) + { + if (IsEqualIID(riid, &IID_IMediaEventSink)) + { + *objects = &renderer->IMediaEventSink_iface; + IUnknown_AddRef((IUnknown *)*objects); + } + else + { + FIXME("Unsupported interface %s for render service.\n", debugstr_guid(riid)); + hr = E_NOINTERFACE; + } + } + else if (IsEqualGUID(service, &MR_VIDEO_MIXER_SERVICE)) + { + FIXME("Unimplemented lookup for mixer service.\n"); + hr = MF_E_UNSUPPORTED_SERVICE; + } + else + { + WARN("Unsupported service %s.\n", debugstr_guid(service)); + hr = MF_E_UNSUPPORTED_SERVICE; + } + + LeaveCriticalSection(&renderer->cs); + + return hr; }
static const IMFTopologyServiceLookupVtbl video_renderer_service_lookup_vtbl = @@ -609,6 +664,50 @@ static const IMFTopologyServiceLookupVtbl video_renderer_service_lookup_vtbl = video_renderer_service_lookup_LookupService, };
+static HRESULT WINAPI video_renderer_event_sink_QueryInterface(IMediaEventSink *iface, REFIID riid, void **obj) +{ + TRACE("%p, %s, %p.\n", iface, debugstr_guid(riid), obj); + + if (IsEqualIID(riid, &IID_IMediaEventSink) || + IsEqualIID(riid, &IID_IUnknown)) + { + *obj = iface; + IMediaEventSink_AddRef(iface); + return S_OK; + } + + WARN("Unsupported interface %s.\n", debugstr_guid(riid)); + *obj = NULL; + return E_NOINTERFACE; +} + +static ULONG WINAPI video_renderer_event_sink_AddRef(IMediaEventSink *iface) +{ + struct video_renderer *renderer = impl_from_IMediaEventSink(iface); + return IMFMediaSink_AddRef(&renderer->IMFMediaSink_iface); +} + +static ULONG WINAPI video_renderer_event_sink_Release(IMediaEventSink *iface) +{ + struct video_renderer *renderer = impl_from_IMediaEventSink(iface); + return IMFMediaSink_Release(&renderer->IMFMediaSink_iface); +} + +static HRESULT WINAPI video_renderer_event_sink_Notify(IMediaEventSink *iface, LONG event, LONG_PTR param1, LONG_PTR param2) +{ + FIXME("%p, %d, %ld, %ld.\n", iface, event, param1, param2); + + return E_NOTIMPL; +} + +static const IMediaEventSinkVtbl media_event_sink_vtbl = +{ + video_renderer_event_sink_QueryInterface, + video_renderer_event_sink_AddRef, + video_renderer_event_sink_Release, + video_renderer_event_sink_Notify, +}; + static HRESULT video_renderer_create_mixer(IMFAttributes *attributes, IMFTransform **out) { unsigned int flags = 0; @@ -632,8 +731,10 @@ static HRESULT video_renderer_create_mixer(IMFAttributes *attributes, IMFTransfo return CoCreateInstance(&clsid, NULL, CLSCTX_INPROC_SERVER, &IID_IMFTransform, (void **)out); }
-static HRESULT video_renderer_create_presenter(IMFAttributes *attributes, IMFVideoPresenter **out) +static HRESULT video_renderer_create_presenter(struct video_renderer *renderer, IMFAttributes *attributes, + IMFVideoPresenter **out) { + IMFTopologyServiceLookupClient *lookup_client; unsigned int flags = 0; IMFActivate *activate; CLSID clsid; @@ -652,7 +753,23 @@ static HRESULT video_renderer_create_presenter(IMFAttributes *attributes, IMFVid if (FAILED(IMFAttributes_GetGUID(attributes, &MF_ACTIVATE_CUSTOM_VIDEO_PRESENTER_CLSID, &clsid))) memcpy(&clsid, &CLSID_MFVideoPresenter9, sizeof(clsid));
- return CoCreateInstance(&clsid, NULL, CLSCTX_INPROC_SERVER, &IID_IMFVideoPresenter, (void **)out); + if (SUCCEEDED(hr = CoCreateInstance(&clsid, NULL, CLSCTX_INPROC_SERVER, &IID_IMFVideoPresenter, (void **)out))) + { + if (SUCCEEDED(hr = IMFVideoPresenter_QueryInterface(*out, &IID_IMFTopologyServiceLookupClient, + (void **)&lookup_client))) + { + renderer->flags |= EVR_INIT_SERVICES; + if (SUCCEEDED(hr = IMFTopologyServiceLookupClient_InitServicePointers(lookup_client, + &renderer->IMFTopologyServiceLookup_iface))) + { + renderer->flags |= EVR_PRESENTER_INITED_SERVICES; + } + renderer->flags &= ~EVR_INIT_SERVICES; + IMFTopologyServiceLookupClient_Release(lookup_client); + } + } + + return hr; }
static HRESULT evr_create_object(IMFAttributes *attributes, void *user_context, IUnknown **obj) @@ -672,6 +789,7 @@ static HRESULT evr_create_object(IMFAttributes *attributes, void *user_context, object->IMFClockStateSink_iface.lpVtbl = &video_renderer_clock_sink_vtbl; object->IMFGetService_iface.lpVtbl = &video_renderer_get_service_vtbl; object->IMFTopologyServiceLookup_iface.lpVtbl = &video_renderer_service_lookup_vtbl; + object->IMediaEventSink_iface.lpVtbl = &media_event_sink_vtbl; object->refcount = 1; InitializeCriticalSection(&object->cs);
@@ -682,7 +800,7 @@ static HRESULT evr_create_object(IMFAttributes *attributes, void *user_context, if (FAILED(hr = video_renderer_create_mixer(attributes, &object->mixer))) goto failed;
- if (FAILED(hr = video_renderer_create_presenter(attributes, &object->presenter))) + if (FAILED(hr = video_renderer_create_presenter(object, attributes, &object->presenter))) goto failed;
*obj = (IUnknown *)&object->IMFMediaSink_iface; @@ -691,6 +809,7 @@ static HRESULT evr_create_object(IMFAttributes *attributes, void *user_context,
failed:
+ video_renderer_release_services(object); IMFMediaSink_Release(&object->IMFMediaSink_iface);
return hr;
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/mf/evr.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/dlls/mf/evr.c b/dlls/mf/evr.c index b702ed2e22a..42a6c98cf6a 100644 --- a/dlls/mf/evr.c +++ b/dlls/mf/evr.c @@ -642,8 +642,16 @@ static HRESULT WINAPI video_renderer_service_lookup_LookupService(IMFTopologySer } else if (IsEqualGUID(service, &MR_VIDEO_MIXER_SERVICE)) { - FIXME("Unimplemented lookup for mixer service.\n"); - hr = MF_E_UNSUPPORTED_SERVICE; + if (IsEqualIID(riid, &IID_IMFTransform)) + { + *objects = renderer->mixer; + IUnknown_AddRef((IUnknown *)*objects); + } + else + { + FIXME("Unsupported interface %s for mixer service.\n", debugstr_guid(riid)); + hr = E_NOINTERFACE; + } } else {
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/evr/mixer.c | 38 ++++++++++++++++++++++++++++++++++---- 1 file changed, 34 insertions(+), 4 deletions(-)
diff --git a/dlls/evr/mixer.c b/dlls/evr/mixer.c index f274a2a447f..7b9949b01d2 100644 --- a/dlls/evr/mixer.c +++ b/dlls/evr/mixer.c @@ -73,6 +73,8 @@ struct video_mixer
IDirect3DDeviceManager9 *device_manager;
+ IMediaEventSink *event_sink; + CRITICAL_SECTION cs; };
@@ -899,16 +901,44 @@ static ULONG WINAPI video_mixer_service_client_Release(IMFTopologyServiceLookupC static HRESULT WINAPI video_mixer_service_client_InitServicePointers(IMFTopologyServiceLookupClient *iface, IMFTopologyServiceLookup *service_lookup) { - FIXME("%p, %p.\n", iface, service_lookup); + struct video_mixer *mixer = impl_from_IMFTopologyServiceLookupClient(iface); + unsigned int count; + HRESULT hr;
- return E_NOTIMPL; + TRACE("%p, %p.\n", iface, service_lookup); + + if (!service_lookup) + return E_POINTER; + + EnterCriticalSection(&mixer->cs); + + count = 1; + if (FAILED(hr = IMFTopologyServiceLookup_LookupService(service_lookup, MF_SERVICE_LOOKUP_GLOBAL, 0, + &MR_VIDEO_RENDER_SERVICE, &IID_IMediaEventSink, (void **)&mixer->event_sink, &count))) + { + WARN("Failed to get renderer event sink, hr %#x.\n", hr); + } + + LeaveCriticalSection(&mixer->cs); + + return hr; }
static HRESULT WINAPI video_mixer_service_client_ReleaseServicePointers(IMFTopologyServiceLookupClient *iface) { - FIXME("%p.\n", iface); + struct video_mixer *mixer = impl_from_IMFTopologyServiceLookupClient(iface);
- return E_NOTIMPL; + TRACE("%p.\n", iface); + + EnterCriticalSection(&mixer->cs); + + if (mixer->event_sink) + IMediaEventSink_Release(mixer->event_sink); + mixer->event_sink = NULL; + + LeaveCriticalSection(&mixer->cs); + + return S_OK; }
static const IMFTopologyServiceLookupClientVtbl video_mixer_service_client_vtbl =
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/mf/evr.c | 35 +++++++++++++++++++++++++++++++---- 1 file changed, 31 insertions(+), 4 deletions(-)
diff --git a/dlls/mf/evr.c b/dlls/mf/evr.c index 42a6c98cf6a..8a4aa3c350d 100644 --- a/dlls/mf/evr.c +++ b/dlls/mf/evr.c @@ -28,7 +28,8 @@ enum video_renderer_flags { EVR_SHUT_DOWN = 0x1, EVR_INIT_SERVICES = 0x2, /* Currently in InitServices() call. */ - EVR_PRESENTER_INITED_SERVICES = 0x4, + EVR_MIXER_INITED_SERVICES = 0x4, + EVR_PRESENTER_INITED_SERVICES = 0x8, };
struct video_renderer @@ -96,6 +97,14 @@ static void video_renderer_release_services(struct video_renderer *renderer) { IMFTopologyServiceLookupClient *lookup_client;
+ if (renderer->flags & EVR_MIXER_INITED_SERVICES && SUCCEEDED(IMFTransform_QueryInterface(renderer->mixer, + &IID_IMFTopologyServiceLookupClient, (void **)&lookup_client))) + { + IMFTopologyServiceLookupClient_ReleaseServicePointers(lookup_client); + IMFTopologyServiceLookupClient_Release(lookup_client); + renderer->flags &= ~EVR_MIXER_INITED_SERVICES; + } + if (renderer->flags & EVR_PRESENTER_INITED_SERVICES && SUCCEEDED(IMFVideoPresenter_QueryInterface(renderer->presenter, &IID_IMFTopologyServiceLookupClient, (void **)&lookup_client))) { @@ -716,8 +725,10 @@ static const IMediaEventSinkVtbl media_event_sink_vtbl = video_renderer_event_sink_Notify, };
-static HRESULT video_renderer_create_mixer(IMFAttributes *attributes, IMFTransform **out) +static HRESULT video_renderer_create_mixer(struct video_renderer *renderer, IMFAttributes *attributes, + IMFTransform **out) { + IMFTopologyServiceLookupClient *lookup_client; unsigned int flags = 0; IMFActivate *activate; CLSID clsid; @@ -736,7 +747,23 @@ static HRESULT video_renderer_create_mixer(IMFAttributes *attributes, IMFTransfo if (FAILED(IMFAttributes_GetGUID(attributes, &MF_ACTIVATE_CUSTOM_VIDEO_MIXER_CLSID, &clsid))) memcpy(&clsid, &CLSID_MFVideoMixer9, sizeof(clsid));
- return CoCreateInstance(&clsid, NULL, CLSCTX_INPROC_SERVER, &IID_IMFTransform, (void **)out); + if (SUCCEEDED(hr = CoCreateInstance(&clsid, NULL, CLSCTX_INPROC_SERVER, &IID_IMFTransform, (void **)out))) + { + if (SUCCEEDED(hr = IMFTransform_QueryInterface(*out, &IID_IMFTopologyServiceLookupClient, + (void **)&lookup_client))) + { + renderer->flags |= EVR_INIT_SERVICES; + if (SUCCEEDED(hr = IMFTopologyServiceLookupClient_InitServicePointers(lookup_client, + &renderer->IMFTopologyServiceLookup_iface))) + { + renderer->flags |= EVR_MIXER_INITED_SERVICES; + } + renderer->flags &= ~EVR_INIT_SERVICES; + IMFTopologyServiceLookupClient_Release(lookup_client); + } + } + + return hr; }
static HRESULT video_renderer_create_presenter(struct video_renderer *renderer, IMFAttributes *attributes, @@ -805,7 +832,7 @@ static HRESULT evr_create_object(IMFAttributes *attributes, void *user_context, goto failed;
/* Create mixer and presenter. */ - if (FAILED(hr = video_renderer_create_mixer(attributes, &object->mixer))) + if (FAILED(hr = video_renderer_create_mixer(object, attributes, &object->mixer))) goto failed;
if (FAILED(hr = video_renderer_create_presenter(object, attributes, &object->presenter)))