From 8c59a0467776ac2387686b477d2fa8089bd529fe Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Wed, 21 Apr 2021 20:23:44 -0500 Subject: [PATCH] evr: Stub IEVRFilterConfig. Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=50415 Signed-off-by: Zebediah Figura Signed-off-by: Alexandre Julliard --- dlls/evr/evr.c | 66 ++++++++++++++++++++++++++++++++++++++++++++ dlls/evr/tests/evr.c | 1 + 2 files changed, 67 insertions(+) diff --git a/dlls/evr/evr.c b/dlls/evr/evr.c index 94239417794..1965fd247de 100644 --- a/dlls/evr/evr.c +++ b/dlls/evr/evr.c @@ -33,6 +33,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(evr); struct evr { struct strmbase_renderer renderer; + IEVRFilterConfig IEVRFilterConfig_iface; }; static struct evr *impl_from_strmbase_renderer(struct strmbase_renderer *iface) @@ -40,6 +41,19 @@ static struct evr *impl_from_strmbase_renderer(struct strmbase_renderer *iface) return CONTAINING_RECORD(iface, struct evr, renderer); } +static HRESULT evr_query_interface(struct strmbase_renderer *iface, REFIID iid, void **out) +{ + struct evr *filter = impl_from_strmbase_renderer(iface); + + if (IsEqualGUID(iid, &IID_IEVRFilterConfig)) + *out = &filter->IEVRFilterConfig_iface; + else + return E_NOINTERFACE; + + IUnknown_AddRef((IUnknown *)*out); + return S_OK; +} + static void evr_destroy(struct strmbase_renderer *iface) { struct evr *filter = impl_from_strmbase_renderer(iface); @@ -64,9 +78,60 @@ static const struct strmbase_renderer_ops renderer_ops = { .renderer_query_accept = evr_query_accept, .renderer_render = evr_render, + .renderer_query_interface = evr_query_interface, .renderer_destroy = evr_destroy, }; +static struct evr *impl_from_IEVRFilterConfig(IEVRFilterConfig *iface) +{ + return CONTAINING_RECORD(iface, struct evr, IEVRFilterConfig_iface); +} + +static HRESULT WINAPI filter_config_QueryInterface(IEVRFilterConfig *iface, REFIID iid, void **out) +{ + struct evr *filter = impl_from_IEVRFilterConfig(iface); + return IUnknown_QueryInterface(filter->renderer.filter.outer_unk, iid, out); +} + +static ULONG WINAPI filter_config_AddRef(IEVRFilterConfig *iface) +{ + struct evr *filter = impl_from_IEVRFilterConfig(iface); + return IUnknown_AddRef(filter->renderer.filter.outer_unk); +} + +static ULONG WINAPI filter_config_Release(IEVRFilterConfig *iface) +{ + struct evr *filter = impl_from_IEVRFilterConfig(iface); + return IUnknown_Release(filter->renderer.filter.outer_unk); +} + +static HRESULT WINAPI filter_config_SetNumberOfStreams(IEVRFilterConfig *iface, DWORD count) +{ + struct evr *filter = impl_from_IEVRFilterConfig(iface); + + FIXME("filter %p, count %u, stub!\n", filter, count); + + return E_NOTIMPL; +} + +static HRESULT WINAPI filter_config_GetNumberOfStreams(IEVRFilterConfig *iface, DWORD *count) +{ + struct evr *filter = impl_from_IEVRFilterConfig(iface); + + FIXME("filter %p, count %p, stub!\n", filter, count); + + return E_NOTIMPL; +} + +static const IEVRFilterConfigVtbl filter_config_vtbl = +{ + filter_config_QueryInterface, + filter_config_AddRef, + filter_config_Release, + filter_config_SetNumberOfStreams, + filter_config_GetNumberOfStreams, +}; + HRESULT evr_filter_create(IUnknown *outer, void **out) { struct evr *object; @@ -76,6 +141,7 @@ HRESULT evr_filter_create(IUnknown *outer, void **out) strmbase_renderer_init(&object->renderer, outer, &CLSID_EnhancedVideoRenderer, L"EVR Input0", &renderer_ops); + object->IEVRFilterConfig_iface.lpVtbl = &filter_config_vtbl; TRACE("Created EVR %p.\n", object); *out = &object->renderer.filter.IUnknown_inner; diff --git a/dlls/evr/tests/evr.c b/dlls/evr/tests/evr.c index fb4a2130f37..bcea437db4c 100644 --- a/dlls/evr/tests/evr.c +++ b/dlls/evr/tests/evr.c @@ -253,6 +253,7 @@ static void test_interfaces(void) todo_wine check_interface(filter, &IID_IAMFilterMiscFlags, TRUE); check_interface(filter, &IID_IBaseFilter, TRUE); + check_interface(filter, &IID_IEVRFilterConfig, TRUE); check_interface(filter, &IID_IMediaFilter, TRUE); check_interface(filter, &IID_IMediaPosition, TRUE); check_interface(filter, &IID_IMediaSeeking, TRUE);