Commit b21d2b7c authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

evr/presenter: Add IMFGetService stub.

parent c303b08b
...@@ -46,6 +46,7 @@ struct video_presenter ...@@ -46,6 +46,7 @@ struct video_presenter
IMFTopologyServiceLookupClient IMFTopologyServiceLookupClient_iface; IMFTopologyServiceLookupClient IMFTopologyServiceLookupClient_iface;
IMFVideoDisplayControl IMFVideoDisplayControl_iface; IMFVideoDisplayControl IMFVideoDisplayControl_iface;
IMFRateSupport IMFRateSupport_iface; IMFRateSupport IMFRateSupport_iface;
IMFGetService IMFGetService_iface;
IUnknown IUnknown_inner; IUnknown IUnknown_inner;
IUnknown *outer_unk; IUnknown *outer_unk;
LONG refcount; LONG refcount;
...@@ -88,6 +89,11 @@ static struct video_presenter *impl_from_IMFRateSupport(IMFRateSupport *iface) ...@@ -88,6 +89,11 @@ static struct video_presenter *impl_from_IMFRateSupport(IMFRateSupport *iface)
return CONTAINING_RECORD(iface, struct video_presenter, IMFRateSupport_iface); return CONTAINING_RECORD(iface, struct video_presenter, IMFRateSupport_iface);
} }
static struct video_presenter *impl_from_IMFGetService(IMFGetService *iface)
{
return CONTAINING_RECORD(iface, struct video_presenter, IMFGetService_iface);
}
static HRESULT WINAPI video_presenter_inner_QueryInterface(IUnknown *iface, REFIID riid, void **obj) static HRESULT WINAPI video_presenter_inner_QueryInterface(IUnknown *iface, REFIID riid, void **obj)
{ {
struct video_presenter *presenter = impl_from_IUnknown(iface); struct video_presenter *presenter = impl_from_IUnknown(iface);
...@@ -119,6 +125,10 @@ static HRESULT WINAPI video_presenter_inner_QueryInterface(IUnknown *iface, REFI ...@@ -119,6 +125,10 @@ static HRESULT WINAPI video_presenter_inner_QueryInterface(IUnknown *iface, REFI
{ {
*obj = &presenter->IMFRateSupport_iface; *obj = &presenter->IMFRateSupport_iface;
} }
else if (IsEqualIID(riid, &IID_IMFGetService))
{
*obj = &presenter->IMFGetService_iface;
}
else else
{ {
WARN("Unimplemented interface %s.\n", debugstr_guid(riid)); WARN("Unimplemented interface %s.\n", debugstr_guid(riid));
...@@ -576,6 +586,39 @@ static const IMFRateSupportVtbl video_presenter_rate_support_vtbl = ...@@ -576,6 +586,39 @@ static const IMFRateSupportVtbl video_presenter_rate_support_vtbl =
video_presenter_rate_support_IsRateSupported, video_presenter_rate_support_IsRateSupported,
}; };
static HRESULT WINAPI video_presenter_getservice_QueryInterface(IMFGetService *iface, REFIID riid, void **obj)
{
struct video_presenter *presenter = impl_from_IMFGetService(iface);
return IMFVideoPresenter_QueryInterface(&presenter->IMFVideoPresenter_iface, riid, obj);
}
static ULONG WINAPI video_presenter_getservice_AddRef(IMFGetService *iface)
{
struct video_presenter *presenter = impl_from_IMFGetService(iface);
return IMFVideoPresenter_AddRef(&presenter->IMFVideoPresenter_iface);
}
static ULONG WINAPI video_presenter_getservice_Release(IMFGetService *iface)
{
struct video_presenter *presenter = impl_from_IMFGetService(iface);
return IMFVideoPresenter_Release(&presenter->IMFVideoPresenter_iface);
}
static HRESULT WINAPI video_presenter_getservice_GetService(IMFGetService *iface, REFGUID service, REFIID riid, void **obj)
{
FIXME("%p, %s, %s, %p.\n", iface, debugstr_guid(service), debugstr_guid(riid), obj);
return E_NOTIMPL;
}
static const IMFGetServiceVtbl video_presenter_getservice_vtbl =
{
video_presenter_getservice_QueryInterface,
video_presenter_getservice_AddRef,
video_presenter_getservice_Release,
video_presenter_getservice_GetService,
};
HRESULT WINAPI MFCreateVideoPresenter(IUnknown *owner, REFIID riid_device, REFIID riid, void **obj) HRESULT WINAPI MFCreateVideoPresenter(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);
...@@ -600,6 +643,7 @@ HRESULT evr_presenter_create(IUnknown *outer, void **out) ...@@ -600,6 +643,7 @@ HRESULT evr_presenter_create(IUnknown *outer, void **out)
object->IMFTopologyServiceLookupClient_iface.lpVtbl = &video_presenter_service_client_vtbl; object->IMFTopologyServiceLookupClient_iface.lpVtbl = &video_presenter_service_client_vtbl;
object->IMFVideoDisplayControl_iface.lpVtbl = &video_presenter_control_vtbl; object->IMFVideoDisplayControl_iface.lpVtbl = &video_presenter_control_vtbl;
object->IMFRateSupport_iface.lpVtbl = &video_presenter_rate_support_vtbl; object->IMFRateSupport_iface.lpVtbl = &video_presenter_rate_support_vtbl;
object->IMFGetService_iface.lpVtbl = &video_presenter_getservice_vtbl;
object->IUnknown_inner.lpVtbl = &video_presenter_inner_vtbl; object->IUnknown_inner.lpVtbl = &video_presenter_inner_vtbl;
object->outer_unk = outer ? outer : &object->IUnknown_inner; object->outer_unk = outer ? outer : &object->IUnknown_inner;
object->refcount = 1; object->refcount = 1;
......
...@@ -1002,6 +1002,10 @@ static void test_default_presenter(void) ...@@ -1002,6 +1002,10 @@ static void test_default_presenter(void)
ok(hr == S_OK, "Unexpected hr %#x.\n", hr); ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
IUnknown_Release(unk); IUnknown_Release(unk);
hr = IMFVideoPresenter_QueryInterface(presenter, &IID_IMFGetService, (void **)&unk);
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
IUnknown_Release(unk);
/* Rate support. */ /* Rate support. */
hr = IMFVideoPresenter_QueryInterface(presenter, &IID_IMFRateSupport, (void **)&rate_support); hr = IMFVideoPresenter_QueryInterface(presenter, &IID_IMFRateSupport, (void **)&rate_support);
ok(hr == S_OK, "Unexpected hr %#x.\n", hr); ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
......
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