From: Rémi Bernon rbernon@codeweavers.com
--- configure.ac | 1 + dlls/winegstreamer/main.c | 20 +-- dlls/winegstreamer/mfplat.c | 23 --- dlls/winegstreamer/winegstreamer_classes.idl | 4 +- dlls/wmadmod/Makefile.in | 6 + dlls/wmadmod/wmadmod.c | 151 +++++++++++++++++++ dlls/wmadmod/wmadmod.idl | 25 +++ dlls/wmadmod/wmadmod.spec | 4 + loader/wine.inf.in | 1 + 9 files changed, 192 insertions(+), 43 deletions(-) create mode 100644 dlls/wmadmod/Makefile.in create mode 100644 dlls/wmadmod/wmadmod.c create mode 100644 dlls/wmadmod/wmadmod.idl create mode 100644 dlls/wmadmod/wmadmod.spec
diff --git a/configure.ac b/configure.ac index 56f24f721df..fc05179a940 100644 --- a/configure.ac +++ b/configure.ac @@ -3335,6 +3335,7 @@ WINE_CONFIG_MAKEFILE(dlls/wldap32) WINE_CONFIG_MAKEFILE(dlls/wldap32/tests) WINE_CONFIG_MAKEFILE(dlls/wldp) WINE_CONFIG_MAKEFILE(dlls/wldp/tests) +WINE_CONFIG_MAKEFILE(dlls/wmadmod) WINE_CONFIG_MAKEFILE(dlls/wmasf) WINE_CONFIG_MAKEFILE(dlls/wmi) WINE_CONFIG_MAKEFILE(dlls/wmiutils) diff --git a/dlls/winegstreamer/main.c b/dlls/winegstreamer/main.c index ccb3e9f52e5..fbe5274f14a 100644 --- a/dlls/winegstreamer/main.c +++ b/dlls/winegstreamer/main.c @@ -995,6 +995,7 @@ HRESULT WINAPI DllGetClassObject(REFCLSID clsid, REFIID iid, void **out) static const GUID CLSID_wg_mp3_sink_factory = {0x1f302877,0xaaab,0x40a3,{0xb9,0xe0,0x9f,0x48,0xda,0xf3,0x5b,0xc8}}; static const GUID CLSID_wg_mpeg4_sink_factory = {0x5d5407d9,0xc6ca,0x4770,{0xa7,0xcc,0x27,0xc0,0xcb,0x8a,0x76,0x27}}; static const GUID CLSID_wg_resampler = {0x92f35e78,0x15a5,0x486b,{0x88,0x8e,0x57,0x5f,0x99,0x65,0x1c,0xe2}}; + static const GUID CLSID_wg_wma_decoder = {0x5b4d4e54,0x0620,0x4cf9,{0x94,0xae,0x78,0x23,0x96,0x5c,0x28,0xb6}}; struct class_factory *factory; HRESULT hr;
@@ -1020,7 +1021,7 @@ HRESULT WINAPI DllGetClassObject(REFCLSID clsid, REFIID iid, void **out) factory = &mpeg_splitter_cf; else if (IsEqualGUID(clsid, &CLSID_WAVEParser)) factory = &wave_parser_cf; - else if (IsEqualGUID(clsid, &CLSID_WMADecMediaObject)) + else if (IsEqualGUID(clsid, &CLSID_wg_wma_decoder)) factory = &wma_decoder_cf; else if (IsEqualGUID(clsid, &CLSID_WMVDecoderMFT)) factory = &wmv_decoder_cf; @@ -1298,18 +1299,6 @@ static const REGFILTER2 reg_decodebin_parser =
HRESULT WINAPI DllRegisterServer(void) { - DMO_PARTIAL_MEDIATYPE wma_decoder_output[2] = - { - {.type = MEDIATYPE_Audio, .subtype = MEDIASUBTYPE_PCM}, - {.type = MEDIATYPE_Audio, .subtype = MEDIASUBTYPE_IEEE_FLOAT}, - }; - DMO_PARTIAL_MEDIATYPE wma_decoder_input[4] = - { - {.type = MEDIATYPE_Audio, .subtype = MEDIASUBTYPE_MSAUDIO1}, - {.type = MEDIATYPE_Audio, .subtype = MEDIASUBTYPE_WMAUDIO2}, - {.type = MEDIATYPE_Audio, .subtype = MEDIASUBTYPE_WMAUDIO3}, - {.type = MEDIATYPE_Audio, .subtype = MEDIASUBTYPE_WMAUDIO_LOSSLESS}, - }; DMO_PARTIAL_MEDIATYPE wmv_decoder_output[11] = { {.type = MEDIATYPE_Video, .subtype = MEDIASUBTYPE_YV12}, @@ -1363,9 +1352,6 @@ HRESULT WINAPI DllRegisterServer(void)
IFilterMapper2_Release(mapper);
- if (FAILED(hr = DMORegister(L"WMAudio Decoder DMO", &CLSID_WMADecMediaObject, &DMOCATEGORY_AUDIO_DECODER, - 0, ARRAY_SIZE(wma_decoder_input), wma_decoder_input, ARRAY_SIZE(wma_decoder_output), wma_decoder_output))) - return hr; if (FAILED(hr = DMORegister(L"WMVideo Decoder DMO", &CLSID_WMVDecoderMFT, &DMOCATEGORY_VIDEO_DECODER, 0, ARRAY_SIZE(wmv_decoder_input), wmv_decoder_input, ARRAY_SIZE(wmv_decoder_output), wmv_decoder_output))) return hr; @@ -1397,8 +1383,6 @@ HRESULT WINAPI DllUnregisterServer(void)
IFilterMapper2_Release(mapper);
- if (FAILED(hr = DMOUnregister(&CLSID_WMADecMediaObject, &DMOCATEGORY_AUDIO_DECODER))) - return hr; if (FAILED(hr = DMOUnregister(&CLSID_WMVDecoderMFT, &DMOCATEGORY_VIDEO_DECODER))) return hr;
diff --git a/dlls/winegstreamer/mfplat.c b/dlls/winegstreamer/mfplat.c index afa04f152dc..e84d10d013e 100644 --- a/dlls/winegstreamer/mfplat.c +++ b/dlls/winegstreamer/mfplat.c @@ -177,19 +177,6 @@ HRESULT mfplat_DllRegisterServer(void) {MFMediaType_Audio, MFAudioFormat_PCM}, };
- MFT_REGISTER_TYPE_INFO wma_decoder_input_types[] = - { - {MFMediaType_Audio, MEDIASUBTYPE_MSAUDIO1}, - {MFMediaType_Audio, MFAudioFormat_WMAudioV8}, - {MFMediaType_Audio, MFAudioFormat_WMAudioV9}, - {MFMediaType_Audio, MFAudioFormat_WMAudio_Lossless}, - }; - MFT_REGISTER_TYPE_INFO wma_decoder_output_types[] = - { - {MFMediaType_Audio, MFAudioFormat_PCM}, - {MFMediaType_Audio, MFAudioFormat_Float}, - }; - MFT_REGISTER_TYPE_INFO h264_decoder_input_types[] = { {MFMediaType_Video, MFVideoFormat_H264}, @@ -266,16 +253,6 @@ HRESULT mfplat_DllRegisterServer(void) ARRAY_SIZE(aac_decoder_output_types), aac_decoder_output_types, }, - { - CLSID_WMADecMediaObject, - MFT_CATEGORY_AUDIO_DECODER, - L"WMAudio Decoder MFT", - MFT_ENUM_FLAG_SYNCMFT, - ARRAY_SIZE(wma_decoder_input_types), - wma_decoder_input_types, - ARRAY_SIZE(wma_decoder_output_types), - wma_decoder_output_types, - }, { CLSID_MSH264DecoderMFT, MFT_CATEGORY_VIDEO_DECODER, diff --git a/dlls/winegstreamer/winegstreamer_classes.idl b/dlls/winegstreamer/winegstreamer_classes.idl index 7b38084badc..3636e9863a9 100644 --- a/dlls/winegstreamer/winegstreamer_classes.idl +++ b/dlls/winegstreamer/winegstreamer_classes.idl @@ -85,9 +85,9 @@ coclass GStreamerByteStreamHandler {}
[ threading(both), - uuid(2eeb4adf-4578-4d10-bca7-bb955f56320a) + uuid(5b4d4e54-0620-4cf9-94ae-7823965c28b6) ] -coclass CWMADecMediaObject {}; +coclass wg_wma_decoder {};
[ threading(both), diff --git a/dlls/wmadmod/Makefile.in b/dlls/wmadmod/Makefile.in new file mode 100644 index 00000000000..bd22cb82b61 --- /dev/null +++ b/dlls/wmadmod/Makefile.in @@ -0,0 +1,6 @@ +MODULE = wmadmod.dll +IMPORTS = combase mfplat msdmo mfuuid dmoguids strmiids wmcodecdspuuid uuid + +SOURCES = \ + wmadmod.c \ + wmadmod.idl diff --git a/dlls/wmadmod/wmadmod.c b/dlls/wmadmod/wmadmod.c new file mode 100644 index 00000000000..3d619d93a35 --- /dev/null +++ b/dlls/wmadmod/wmadmod.c @@ -0,0 +1,151 @@ +/* + * Copyright 2024 Rémi Bernon for CodeWeavers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include <stddef.h> +#include <stdarg.h> + +#define COBJMACROS +#include "windef.h" +#include "winbase.h" + +#include "dmoreg.h" +#include "dshow.h" +#include "mfapi.h" +#include "mfidl.h" +#include "rpcproxy.h" +#include "wmcodecdsp.h" + +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(dmo); + +static HRESULT WINAPI wma_decoder_factory_CreateInstance(IClassFactory *iface, IUnknown *outer, + REFIID riid, void **out) +{ + static const GUID CLSID_wg_wma_decoder = {0x5b4d4e54,0x0620,0x4cf9,{0x94,0xae,0x78,0x23,0x96,0x5c,0x28,0xb6}}; + return CoCreateInstance(&CLSID_wg_wma_decoder, outer, CLSCTX_INPROC_SERVER, riid, out); +} + +static HRESULT WINAPI class_factory_QueryInterface(IClassFactory *iface, REFIID riid, void **out) +{ + *out = IsEqualGUID(riid, &IID_IClassFactory) || IsEqualGUID(riid, &IID_IUnknown) ? iface : NULL; + return *out ? S_OK : E_NOINTERFACE; +} +static ULONG WINAPI class_factory_AddRef(IClassFactory *iface) +{ + return 2; +} +static ULONG WINAPI class_factory_Release(IClassFactory *iface) +{ + return 1; +} +static HRESULT WINAPI class_factory_LockServer(IClassFactory *iface, BOOL dolock) +{ + return S_OK; +} + +static const IClassFactoryVtbl wma_decoder_factory_vtbl = +{ + class_factory_QueryInterface, + class_factory_AddRef, + class_factory_Release, + wma_decoder_factory_CreateInstance, + class_factory_LockServer, +}; + +static IClassFactory wma_decoder_factory = {&wma_decoder_factory_vtbl}; + +/*********************************************************************** + * DllGetClassObject (wmadmod.@) + */ +HRESULT WINAPI DllGetClassObject(REFCLSID clsid, REFIID riid, void **out) +{ + if (IsEqualGUID(clsid, &CLSID_WMADecMediaObject)) + return IClassFactory_QueryInterface(&wma_decoder_factory, riid, out); + + *out = NULL; + FIXME("Unknown clsid %s.\n", debugstr_guid(clsid)); + return CLASS_E_CLASSNOTAVAILABLE; +} + +/*********************************************************************** + * DllRegisterServer (wmadmod.@) + */ +HRESULT WINAPI DllRegisterServer(void) +{ + MFT_REGISTER_TYPE_INFO wma_decoder_mft_inputs[] = + { + {MFMediaType_Audio, MEDIASUBTYPE_MSAUDIO1}, + {MFMediaType_Audio, MFAudioFormat_WMAudioV8}, + {MFMediaType_Audio, MFAudioFormat_WMAudioV9}, + {MFMediaType_Audio, MFAudioFormat_WMAudio_Lossless}, + }; + MFT_REGISTER_TYPE_INFO wma_decoder_mft_outputs[] = + { + {MFMediaType_Audio, MFAudioFormat_PCM}, + {MFMediaType_Audio, MFAudioFormat_Float}, + }; + DMO_PARTIAL_MEDIATYPE wma_decoder_dmo_outputs[] = + { + {.type = MEDIATYPE_Audio, .subtype = MEDIASUBTYPE_PCM}, + {.type = MEDIATYPE_Audio, .subtype = MEDIASUBTYPE_IEEE_FLOAT}, + }; + DMO_PARTIAL_MEDIATYPE wma_decoder_dmo_inputs[] = + { + {.type = MEDIATYPE_Audio, .subtype = MEDIASUBTYPE_MSAUDIO1}, + {.type = MEDIATYPE_Audio, .subtype = MEDIASUBTYPE_WMAUDIO2}, + {.type = MEDIATYPE_Audio, .subtype = MEDIASUBTYPE_WMAUDIO3}, + {.type = MEDIATYPE_Audio, .subtype = MEDIASUBTYPE_WMAUDIO_LOSSLESS}, + }; + HRESULT hr; + + TRACE("\n"); + + if (FAILED(hr = __wine_register_resources())) + return hr; + if (FAILED(hr = MFTRegister(CLSID_WMADecMediaObject, MFT_CATEGORY_AUDIO_DECODER, + (WCHAR *)L"WMAudio Decoder MFT", MFT_ENUM_FLAG_SYNCMFT, + ARRAY_SIZE(wma_decoder_mft_inputs), wma_decoder_mft_inputs, + ARRAY_SIZE(wma_decoder_mft_outputs), wma_decoder_mft_outputs, NULL))) + return hr; + if (FAILED(hr = DMORegister(L"WMAudio Decoder DMO", &CLSID_WMADecMediaObject, &DMOCATEGORY_AUDIO_DECODER, 0, + ARRAY_SIZE(wma_decoder_dmo_inputs), wma_decoder_dmo_inputs, + ARRAY_SIZE(wma_decoder_dmo_outputs), wma_decoder_dmo_outputs))) + return hr; + + return S_OK; +} + +/*********************************************************************** + * DllUnregisterServer (wmadmod.@) + */ +HRESULT WINAPI DllUnregisterServer(void) +{ + HRESULT hr; + + TRACE("\n"); + + if (FAILED(hr = __wine_unregister_resources())) + return hr; + if (FAILED(hr = MFTUnregister(CLSID_WMADecMediaObject))) + return hr; + if (FAILED(hr = DMOUnregister(&CLSID_WMADecMediaObject, &DMOCATEGORY_AUDIO_DECODER))) + return hr; + + return S_OK; +} diff --git a/dlls/wmadmod/wmadmod.idl b/dlls/wmadmod/wmadmod.idl new file mode 100644 index 00000000000..4ca0507d651 --- /dev/null +++ b/dlls/wmadmod/wmadmod.idl @@ -0,0 +1,25 @@ +/* + * Copyright 2024 Rémi Bernon for CodeWeavers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#pragma makedep register + +[ + threading(both), + uuid(2eeb4adf-4578-4d10-bca7-bb955f56320a) +] +coclass CWMADecMediaObject {} diff --git a/dlls/wmadmod/wmadmod.spec b/dlls/wmadmod/wmadmod.spec new file mode 100644 index 00000000000..b16365d0c9f --- /dev/null +++ b/dlls/wmadmod/wmadmod.spec @@ -0,0 +1,4 @@ +@ stdcall -private DllCanUnloadNow() +@ stdcall -private DllGetClassObject(ptr ptr ptr) +@ stdcall -private DllRegisterServer() +@ stdcall -private DllUnregisterServer() diff --git a/loader/wine.inf.in b/loader/wine.inf.in index cd862135cef..278f7fedffc 100644 --- a/loader/wine.inf.in +++ b/loader/wine.inf.in @@ -2124,6 +2124,7 @@ HKLM,%CurrentVersion%\Telephony\Country List\998,"SameAreaRule",,"G" 11,,winevulkan.dll,1 55,,winprint.dll,1 11,,wintrust.dll,1 +11,,wmadmod.dll,1 11,,iexplore.exe,1
; 32bit-only fake dlls