From: Zebediah Figura zfigura@codeweavers.com
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=34622 Signed-off-by: Zebediah Figura zfigura@codeweavers.com --- dlls/qasf/dmowrapper.c | 56 ++++++++++++++++++++++++++++++++++++ dlls/qasf/tests/dmowrapper.c | 2 +- 2 files changed, 57 insertions(+), 1 deletion(-)
diff --git a/dlls/qasf/dmowrapper.c b/dlls/qasf/dmowrapper.c index c7c5d3df9ea..d4547d4ba30 100644 --- a/dlls/qasf/dmowrapper.c +++ b/dlls/qasf/dmowrapper.c @@ -25,6 +25,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(qasf); struct dmo_wrapper { struct strmbase_filter filter; + IDMOWrapperFilter IDMOWrapperFilter_iface; };
static inline struct dmo_wrapper *impl_from_strmbase_filter(struct strmbase_filter *iface) @@ -32,6 +33,44 @@ static inline struct dmo_wrapper *impl_from_strmbase_filter(struct strmbase_filt return CONTAINING_RECORD(iface, struct dmo_wrapper, filter); }
+static inline struct dmo_wrapper *impl_from_IDMOWrapperFilter(IDMOWrapperFilter *iface) +{ + return CONTAINING_RECORD(iface, struct dmo_wrapper, IDMOWrapperFilter_iface); +} + +static HRESULT WINAPI dmo_wrapper_filter_QueryInterface(IDMOWrapperFilter *iface, REFIID iid, void **out) +{ + struct dmo_wrapper *filter = impl_from_IDMOWrapperFilter(iface); + return IUnknown_QueryInterface(filter->filter.outer_unk, iid, out); +} + +static ULONG WINAPI dmo_wrapper_filter_AddRef(IDMOWrapperFilter *iface) +{ + struct dmo_wrapper *filter = impl_from_IDMOWrapperFilter(iface); + return IUnknown_AddRef(filter->filter.outer_unk); +} + +static ULONG WINAPI dmo_wrapper_filter_Release(IDMOWrapperFilter *iface) +{ + struct dmo_wrapper *filter = impl_from_IDMOWrapperFilter(iface); + return IUnknown_Release(filter->filter.outer_unk); +} + +static HRESULT WINAPI dmo_wrapper_filter_Init(IDMOWrapperFilter *iface, REFCLSID clsid, REFCLSID category) +{ + FIXME("iface %p, clsid %s, category %s, stub!\n", + iface, wine_dbgstr_guid(clsid), wine_dbgstr_guid(category)); + return E_NOTIMPL; +} + +static const IDMOWrapperFilterVtbl dmo_wrapper_filter_vtbl = +{ + dmo_wrapper_filter_QueryInterface, + dmo_wrapper_filter_AddRef, + dmo_wrapper_filter_Release, + dmo_wrapper_filter_Init, +}; + static struct strmbase_pin *dmo_wrapper_get_pin(struct strmbase_filter *iface, unsigned int index) { return NULL; @@ -45,10 +84,25 @@ static void dmo_wrapper_destroy(struct strmbase_filter *iface) free(filter); }
+static HRESULT dmo_wrapper_query_interface(struct strmbase_filter *iface, REFIID iid, void **out) +{ + struct dmo_wrapper *filter = impl_from_strmbase_filter(iface); + + if (IsEqualGUID(iid, &IID_IDMOWrapperFilter)) + { + *out = &filter->IDMOWrapperFilter_iface; + IUnknown_AddRef((IUnknown *)*out); + return S_OK; + } + + return E_NOINTERFACE; +} + static struct strmbase_filter_ops filter_ops = { .filter_get_pin = dmo_wrapper_get_pin, .filter_destroy = dmo_wrapper_destroy, + .filter_query_interface = dmo_wrapper_query_interface, };
HRESULT dmo_wrapper_create(IUnknown *outer, IUnknown **out) @@ -61,6 +115,8 @@ HRESULT dmo_wrapper_create(IUnknown *outer, IUnknown **out) /* Always pass NULL as the outer object; see test_aggregation(). */ strmbase_filter_init(&object->filter, NULL, &CLSID_DMOWrapperFilter, &filter_ops);
+ object->IDMOWrapperFilter_iface.lpVtbl = &dmo_wrapper_filter_vtbl; + TRACE("Created DMO wrapper %p.\n", object); *out = &object->filter.IUnknown_inner;
diff --git a/dlls/qasf/tests/dmowrapper.c b/dlls/qasf/tests/dmowrapper.c index 397980b3760..e061ca24177 100644 --- a/dlls/qasf/tests/dmowrapper.c +++ b/dlls/qasf/tests/dmowrapper.c @@ -62,7 +62,7 @@ static void test_interfaces(void) IBaseFilter *filter = create_dmo_wrapper();
check_interface(filter, &IID_IBaseFilter, TRUE); - todo_wine check_interface(filter, &IID_IDMOWrapperFilter, TRUE); + check_interface(filter, &IID_IDMOWrapperFilter, TRUE); check_interface(filter, &IID_IMediaFilter, TRUE); check_interface(filter, &IID_IPersist, TRUE); todo_wine check_interface(filter, &IID_IPersistStream, TRUE);