Module: wine Branch: master Commit: 015eb45a7b3ddc617d59beb6ae53852b91343c4b URL: https://gitlab.winehq.org/wine/wine/-/commit/015eb45a7b3ddc617d59beb6ae53852...
Author: Fabian Maurer dark.shadow4@web.de Date: Mon Oct 16 22:47:38 2023 +0200
winegstreamer: Implement IWMResamplerProps.
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); +}