Some programs just assume this interface exists, this fixes the resulting crash.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=55789
-- v2: winegstreamer: Implement IWMResamplerProps
From: Fabian Maurer dark.shadow4@web.de
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=55789 --- dlls/winegstreamer/resampler.c | 45 ++++++++++++++++++++++++++++++++++ include/wmcodecdsp.idl | 13 ++++++++++ 2 files changed, 58 insertions(+)
diff --git a/dlls/winegstreamer/resampler.c b/dlls/winegstreamer/resampler.c index df39d1a1e07..b5b62d58800 100644 --- a/dlls/winegstreamer/resampler.c +++ b/dlls/winegstreamer/resampler.c @@ -41,6 +41,7 @@ struct resampler IMediaObject IMediaObject_iface; IPropertyBag IPropertyBag_iface; IPropertyStore IPropertyStore_iface; + IWMResamplerProps IWMResamplerProps_iface; IUnknown *outer; LONG refcount;
@@ -97,6 +98,8 @@ static HRESULT WINAPI unknown_QueryInterface(IUnknown *iface, REFIID iid, void * *out = &impl->IPropertyBag_iface; else if (IsEqualIID(iid, &IID_IPropertyStore)) *out = &impl->IPropertyStore_iface; + else if (IsEqualIID(iid, &IID_IWMResamplerProps)) + *out = &impl->IWMResamplerProps_iface; else { *out = NULL; @@ -872,6 +875,47 @@ static const IPropertyStoreVtbl property_store_vtbl = property_store_Commit, };
+static inline struct resampler *impl_from_IWMResamplerProps(IWMResamplerProps *iface) +{ + return CONTAINING_RECORD(iface, struct resampler, IWMResamplerProps_iface); +} + +static HRESULT WINAPI resampler_props_QueryInterface(IWMResamplerProps *iface, REFIID iid, void **out) +{ + return IUnknown_QueryInterface(impl_from_IWMResamplerProps(iface)->outer, iid, out); +} + +static ULONG WINAPI resampler_props_AddRef(IWMResamplerProps *iface) +{ + return IUnknown_AddRef(impl_from_IWMResamplerProps(iface)->outer); +} + +static ULONG WINAPI resampler_props_Release(IWMResamplerProps *iface) +{ + return IUnknown_Release(impl_from_IWMResamplerProps(iface)->outer); +} + +static HRESULT WINAPI resampler_props_SetHalfFilterLength(IWMResamplerProps *iface, LONG length) +{ + FIXME("iface %p, count %lu stub!\n", iface, length); + return E_NOTIMPL; +} + +static HRESULT WINAPI resampler_props_SetUserChannelMtx(IWMResamplerProps *iface, ChMtxType *conversion_matrix) +{ + FIXME("iface %p, userChannelMtx %p stub!\n", iface, conversion_matrix); + return E_NOTIMPL; +} + +static const IWMResamplerPropsVtbl resampler_props_vtbl = +{ + resampler_props_QueryInterface, + resampler_props_AddRef, + resampler_props_Release, + resampler_props_SetHalfFilterLength, + resampler_props_SetUserChannelMtx, +}; + HRESULT resampler_create(IUnknown *outer, IUnknown **out) { static const struct wg_format input_format = @@ -924,6 +968,7 @@ HRESULT resampler_create(IUnknown *outer, IUnknown **out) impl->IMediaObject_iface.lpVtbl = &media_object_vtbl; impl->IPropertyBag_iface.lpVtbl = &property_bag_vtbl; impl->IPropertyStore_iface.lpVtbl = &property_store_vtbl; + impl->IWMResamplerProps_iface.lpVtbl = &resampler_props_vtbl; impl->refcount = 1; impl->outer = outer ? outer : &impl->IUnknown_inner;
diff --git a/include/wmcodecdsp.idl b/include/wmcodecdsp.idl index 5769b0e011e..a6f350ea2fc 100644 --- a/include/wmcodecdsp.idl +++ b/include/wmcodecdsp.idl @@ -91,3 +91,16 @@ coclass CWMVDecMediaObject {} uuid(7e320092-596a-41b2-bbeb-175d10504eb6) ] coclass CWMVXEncMediaObject {} + +typedef float ChMtxType; + +[ + local, + object, + uuid(e7e9984f-f09f-4da4-903f-6e2e0efe56b5), +] +interface IWMResamplerProps : IUnknown +{ + HRESULT SetHalfFilterLength(LONG length); + HRESULT SetUserChannelMtx(ChMtxType *conversion_matrix); +}
On Mon Oct 16 21:51:33 2023 +0000, Zebediah Figura wrote:
Can we please use better parameter names here, and fix the asterisk placement?
Sure, done
On Mon Oct 16 21:51:33 2023 +0000, Zebediah Figura wrote:
This should have [local] and [object].
Done. Not sure where you found this though, I did only find the method signatures.
On Mon Oct 16 21:57:40 2023 +0000, Fabian Maurer wrote:
Done. Not sure where you found this though, I did only find the method signatures.
I don't think there's a real IDL for it, but any actual COM interface should have [object], and anything that's not going to be marshalled should have [local]. It's possible that neither one ends up mattering if all we generate is the header, though...
On Mon Oct 16 22:02:22 2023 +0000, Zebediah Figura wrote:
I don't think there's a real IDL for it, but any actual COM interface should have [object], and anything that's not going to be marshalled should have [local]. It's possible that neither one ends up mattering if all we generate is the header, though...
Any news on this?
This merge request was approved by Zebediah Figura.
Any news on this?
Sorry, it slipped my mind.