evr: Add IMFTopologyServiceLookupClient stub for default mixer.

Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Nikolay Sivov 2020-06-17 14:59:35 +03:00 committed by Alexandre Julliard
parent 8d79156213
commit 186ed57ba5
2 changed files with 55 additions and 3 deletions

View File

@ -30,6 +30,7 @@ struct video_mixer
{ {
IMFTransform IMFTransform_iface; IMFTransform IMFTransform_iface;
IMFVideoDeviceID IMFVideoDeviceID_iface; IMFVideoDeviceID IMFVideoDeviceID_iface;
IMFTopologyServiceLookupClient IMFTopologyServiceLookupClient_iface;
LONG refcount; LONG refcount;
}; };
@ -43,6 +44,11 @@ static struct video_mixer *impl_from_IMFVideoDeviceID(IMFVideoDeviceID *iface)
return CONTAINING_RECORD(iface, struct video_mixer, IMFVideoDeviceID_iface); return CONTAINING_RECORD(iface, struct video_mixer, IMFVideoDeviceID_iface);
} }
static struct video_mixer *impl_from_IMFTopologyServiceLookupClient(IMFTopologyServiceLookupClient *iface)
{
return CONTAINING_RECORD(iface, struct video_mixer, IMFTopologyServiceLookupClient_iface);
}
static HRESULT WINAPI video_mixer_transform_QueryInterface(IMFTransform *iface, REFIID riid, void **obj) static HRESULT WINAPI video_mixer_transform_QueryInterface(IMFTransform *iface, REFIID riid, void **obj)
{ {
struct video_mixer *mixer = impl_from_IMFTransform(iface); struct video_mixer *mixer = impl_from_IMFTransform(iface);
@ -58,6 +64,10 @@ static HRESULT WINAPI video_mixer_transform_QueryInterface(IMFTransform *iface,
{ {
*obj = &mixer->IMFVideoDeviceID_iface; *obj = &mixer->IMFVideoDeviceID_iface;
} }
else if (IsEqualIID(riid, &IID_IMFTopologyServiceLookupClient))
{
*obj = &mixer->IMFTopologyServiceLookupClient_iface;
}
else else
{ {
WARN("Unsupported interface %s.\n", debugstr_guid(riid)); WARN("Unsupported interface %s.\n", debugstr_guid(riid));
@ -328,6 +338,49 @@ static const IMFVideoDeviceIDVtbl video_mixer_device_id_vtbl =
video_mixer_device_id_GetDeviceID, video_mixer_device_id_GetDeviceID,
}; };
static HRESULT WINAPI video_mixer_service_client_QueryInterface(IMFTopologyServiceLookupClient *iface,
REFIID riid, void **obj)
{
struct video_mixer *mixer = impl_from_IMFTopologyServiceLookupClient(iface);
return IMFTransform_QueryInterface(&mixer->IMFTransform_iface, riid, obj);
}
static ULONG WINAPI video_mixer_service_client_AddRef(IMFTopologyServiceLookupClient *iface)
{
struct video_mixer *mixer = impl_from_IMFTopologyServiceLookupClient(iface);
return IMFTransform_AddRef(&mixer->IMFTransform_iface);
}
static ULONG WINAPI video_mixer_service_client_Release(IMFTopologyServiceLookupClient *iface)
{
struct video_mixer *mixer = impl_from_IMFTopologyServiceLookupClient(iface);
return IMFTransform_Release(&mixer->IMFTransform_iface);
}
static HRESULT WINAPI video_mixer_service_client_InitServicePointers(IMFTopologyServiceLookupClient *iface,
IMFTopologyServiceLookup *service_lookup)
{
FIXME("%p, %p.\n", iface, service_lookup);
return E_NOTIMPL;
}
static HRESULT WINAPI video_mixer_service_client_ReleaseServicePointers(IMFTopologyServiceLookupClient *iface)
{
FIXME("%p.\n", iface);
return E_NOTIMPL;
}
static const IMFTopologyServiceLookupClientVtbl video_mixer_service_client_vtbl =
{
video_mixer_service_client_QueryInterface,
video_mixer_service_client_AddRef,
video_mixer_service_client_Release,
video_mixer_service_client_InitServicePointers,
video_mixer_service_client_ReleaseServicePointers,
};
HRESULT WINAPI MFCreateVideoMixer(IUnknown *owner, REFIID riid_device, REFIID riid, void **obj) HRESULT WINAPI MFCreateVideoMixer(IUnknown *owner, REFIID riid_device, REFIID riid, void **obj)
{ {
TRACE("%p, %s, %s, %p.\n", owner, debugstr_guid(riid_device), debugstr_guid(riid), obj); TRACE("%p, %s, %s, %p.\n", owner, debugstr_guid(riid_device), debugstr_guid(riid), obj);
@ -352,6 +405,7 @@ HRESULT evr_mixer_create(IUnknown *outer, void **out)
object->IMFTransform_iface.lpVtbl = &video_mixer_transform_vtbl; object->IMFTransform_iface.lpVtbl = &video_mixer_transform_vtbl;
object->IMFVideoDeviceID_iface.lpVtbl = &video_mixer_device_id_vtbl; object->IMFVideoDeviceID_iface.lpVtbl = &video_mixer_device_id_vtbl;
object->IMFTopologyServiceLookupClient_iface.lpVtbl = &video_mixer_service_client_vtbl;
object->refcount = 1; object->refcount = 1;
*out = &object->IMFTransform_iface; *out = &object->IMFTransform_iface;

View File

@ -350,10 +350,8 @@ static void test_default_mixer(void)
ok(hr == S_OK, "Failed to create default mixer, hr %#x.\n", hr); ok(hr == S_OK, "Failed to create default mixer, hr %#x.\n", hr);
hr = IMFTransform_QueryInterface(transform, &IID_IMFTopologyServiceLookupClient, (void **)&unk); hr = IMFTransform_QueryInterface(transform, &IID_IMFTopologyServiceLookupClient, (void **)&unk);
todo_wine
ok(hr == S_OK, "Unexpected hr %#x.\n", hr); ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
if (SUCCEEDED(hr)) IUnknown_Release(unk);
IUnknown_Release(unk);
hr = IMFTransform_QueryInterface(transform, &IID_IMFVideoDeviceID, (void **)&deviceid); hr = IMFTransform_QueryInterface(transform, &IID_IMFVideoDeviceID, (void **)&deviceid);
ok(hr == S_OK, "Unexpected hr %#x.\n", hr); ok(hr == S_OK, "Unexpected hr %#x.\n", hr);