From: Rémi Bernon rbernon@codeweavers.com
--- configure.ac | 1 + dlls/l3codecx.ax/Makefile.in | 10 ++ dlls/l3codecx.ax/l3codecx.ax.spec | 3 + dlls/l3codecx.ax/l3codecx.c | 114 +++++++++++++++++++ dlls/l3codecx.ax/l3codecx.idl | 26 +++++ dlls/quartz/decoder.c | 18 +++ dlls/quartz/quartz_private.h | 1 + dlls/winegstreamer/main.c | 40 +------ dlls/winegstreamer/winegstreamer_classes.idl | 5 +- loader/wine.inf.in | 1 + 10 files changed, 178 insertions(+), 41 deletions(-) create mode 100644 dlls/l3codecx.ax/Makefile.in create mode 100644 dlls/l3codecx.ax/l3codecx.ax.spec create mode 100644 dlls/l3codecx.ax/l3codecx.c create mode 100644 dlls/l3codecx.ax/l3codecx.idl
diff --git a/configure.ac b/configure.ac index 4dcb780013a..be0b9d3a930 100644 --- a/configure.ac +++ b/configure.ac @@ -2785,6 +2785,7 @@ WINE_CONFIG_MAKEFILE(dlls/ksproxy.ax) WINE_CONFIG_MAKEFILE(dlls/ksuser) WINE_CONFIG_MAKEFILE(dlls/ktmw32) WINE_CONFIG_MAKEFILE(dlls/l3codeca.acm) +WINE_CONFIG_MAKEFILE(dlls/l3codecx.ax) WINE_CONFIG_MAKEFILE(dlls/light.msstyles) WINE_CONFIG_MAKEFILE(dlls/loadperf) WINE_CONFIG_MAKEFILE(dlls/localspl) diff --git a/dlls/l3codecx.ax/Makefile.in b/dlls/l3codecx.ax/Makefile.in new file mode 100644 index 00000000000..dd5e9d53693 --- /dev/null +++ b/dlls/l3codecx.ax/Makefile.in @@ -0,0 +1,10 @@ +MODULE = l3codecx.ax +IMPORTS = combase msdmo dmoguids strmiids wmcodecdspuuid uuid +PARENTSRC = ../quartz + +EXTRADLLFLAGS = -Wb,--prefer-native + +SOURCES = \ + decoder.c \ + l3codecx.c \ + l3codecx.idl diff --git a/dlls/l3codecx.ax/l3codecx.ax.spec b/dlls/l3codecx.ax/l3codecx.ax.spec new file mode 100644 index 00000000000..b717c9c9371 --- /dev/null +++ b/dlls/l3codecx.ax/l3codecx.ax.spec @@ -0,0 +1,3 @@ +@ stdcall -private DllGetClassObject(ptr ptr ptr) +@ stdcall -private DllRegisterServer() +@ stdcall -private DllUnregisterServer() diff --git a/dlls/l3codecx.ax/l3codecx.c b/dlls/l3codecx.ax/l3codecx.c new file mode 100644 index 00000000000..8c45347adec --- /dev/null +++ b/dlls/l3codecx.ax/l3codecx.c @@ -0,0 +1,114 @@ +/* + * 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 "quartz_private.h" +#include "mpegtype.h" +#include "rpcproxy.h" + +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(quartz); + +#include "initguid.h" + +DEFINE_GUID(CLSID_MPEGLayer3Decoder,0x38be3000,0xdbf4,0x11d0,0x86,0x0e,0x00,0xa0,0x24,0xcf,0xef,0x6d); +DEFINE_GUID(MEDIASUBTYPE_MP3,WAVE_FORMAT_MPEGLAYER3,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71); + +/*********************************************************************** + * DllGetClassObject (l3codecx.@) + */ +HRESULT WINAPI DllGetClassObject(REFCLSID clsid, REFIID iid, void **out) +{ + if (IsEqualGUID(clsid, &CLSID_MPEGLayer3Decoder)) + return IClassFactory_QueryInterface(&mp3_decoder_factory, iid, out); + + *out = NULL; + FIXME("Unknown clsid %s.\n", debugstr_guid(clsid)); + return CLASS_E_CLASSNOTAVAILABLE; +} + +/*********************************************************************** + * DllRegisterServer (l3codecx.@) + */ +HRESULT WINAPI DllRegisterServer(void) +{ + static const REGPINTYPES mpeg_layer3_decoder_inputs[] = + { + {&MEDIATYPE_Audio, &MEDIASUBTYPE_MP3}, + }; + static const REGPINTYPES mpeg_layer3_decoder_outputs[] = + { + {&MEDIATYPE_Audio, &MEDIASUBTYPE_PCM}, + }; + static const REGFILTERPINS2 mpeg_layer3_decoder_pins[] = + { + { + .nMediaTypes = ARRAY_SIZE(mpeg_layer3_decoder_inputs), + .lpMediaType = mpeg_layer3_decoder_inputs, + }, + { + .dwFlags = REG_PINFLAG_B_OUTPUT, + .nMediaTypes = ARRAY_SIZE(mpeg_layer3_decoder_outputs), + .lpMediaType = mpeg_layer3_decoder_outputs, + }, + }; + static const REGFILTER2 mpeg_layer3_decoder_desc = + { + .dwVersion = 2, + .dwMerit = 0x00810000, + .cPins2 = ARRAY_SIZE(mpeg_layer3_decoder_pins), + .rgPins2 = mpeg_layer3_decoder_pins, + }; + + IFilterMapper2 *mapper; + HRESULT hr; + + TRACE(".\n"); + + if (FAILED(hr = __wine_register_resources())) + return hr; + + if (FAILED(hr = CoCreateInstance(&CLSID_FilterMapper2, NULL, CLSCTX_INPROC_SERVER, + &IID_IFilterMapper2, (void **)&mapper))) + return hr; + hr = IFilterMapper2_RegisterFilter(mapper, &CLSID_MPEGLayer3Decoder, L"MPEG Layer-3 Decoder", NULL, + NULL, NULL, &mpeg_layer3_decoder_desc); + IFilterMapper2_Release(mapper); + return hr; +} + +/*********************************************************************** + * DllUnregisterServer (l3codecx.@) + */ +HRESULT WINAPI DllUnregisterServer(void) +{ + IFilterMapper2 *mapper; + HRESULT hr; + + TRACE(".\n"); + + if (FAILED(hr = __wine_unregister_resources())) + return hr; + + if (FAILED(hr = CoCreateInstance(&CLSID_FilterMapper2, NULL, CLSCTX_INPROC_SERVER, + &IID_IFilterMapper2, (void **)&mapper))) + return hr; + hr = IFilterMapper2_UnregisterFilter(mapper, NULL, NULL, &CLSID_MPEGLayer3Decoder); + IFilterMapper2_Release(mapper); + return S_OK; +} diff --git a/dlls/l3codecx.ax/l3codecx.idl b/dlls/l3codecx.ax/l3codecx.idl new file mode 100644 index 00000000000..22f5a5f285d --- /dev/null +++ b/dlls/l3codecx.ax/l3codecx.idl @@ -0,0 +1,26 @@ +/* + * 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 + +[ + helpstring("MPEG Layer-3 Decoder"), + threading(both), + uuid(38be3000-dbf4-11d0-860e-00a024cfef6d) +] +coclass MPEGLayer3Decoder {} diff --git a/dlls/quartz/decoder.c b/dlls/quartz/decoder.c index 82bea2d1f39..83efec158d5 100644 --- a/dlls/quartz/decoder.c +++ b/dlls/quartz/decoder.c @@ -18,6 +18,24 @@
#include "quartz_private.h"
+static HRESULT WINAPI mp3_decoder_factory_CreateInstance(IClassFactory *iface, IUnknown *outer, + REFIID riid, void **out) +{ + static const GUID CLSID_wg_mp3_decoder = {0x84cd8e3e,0xb221,0x434a,{0x88,0x82,0x9d,0x6c,0x8d,0xf4,0x90,0xe1}}; + return CoCreateInstance(&CLSID_wg_mp3_decoder, outer, CLSCTX_INPROC_SERVER, riid, out); +} + +static const IClassFactoryVtbl mp3_decoder_factory_vtbl = +{ + class_factory_QueryInterface, + class_factory_AddRef, + class_factory_Release, + mp3_decoder_factory_CreateInstance, + class_factory_LockServer, +}; + +IClassFactory mp3_decoder_factory = {&mp3_decoder_factory_vtbl}; + static HRESULT WINAPI mpeg_audio_codec_factory_CreateInstance(IClassFactory *iface, IUnknown *outer, REFIID riid, void **out) { diff --git a/dlls/quartz/quartz_private.h b/dlls/quartz/quartz_private.h index 3a01582e151..d58c5953b13 100644 --- a/dlls/quartz/quartz_private.h +++ b/dlls/quartz/quartz_private.h @@ -51,6 +51,7 @@ extern IClassFactory avi_splitter_factory; extern IClassFactory mpeg1_splitter_factory; extern IClassFactory wave_parser_factory; +extern IClassFactory mp3_decoder_factory; extern IClassFactory mpeg_audio_codec_factory; extern IClassFactory mpeg_video_codec_factory;
diff --git a/dlls/winegstreamer/main.c b/dlls/winegstreamer/main.c index 5822723722d..d18db8b21e8 100644 --- a/dlls/winegstreamer/main.c +++ b/dlls/winegstreamer/main.c @@ -41,8 +41,6 @@ WINE_DECLARE_DEBUG_CHANNEL(wmvcore); DEFINE_GUID(GUID_NULL, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); DEFINE_GUID(MEDIASUBTYPE_VC1S,MAKEFOURCC('V','C','1','S'),0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71);
-static const GUID MEDIASUBTYPE_MP3 = {0x00000055, 0x0000, 0x0010, {0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}}; - bool array_reserve(void **elements, size_t *capacity, size_t count, size_t size) { unsigned int new_capacity, max_capacity; @@ -1000,6 +998,7 @@ HRESULT WINAPI DllGetClassObject(REFCLSID clsid, REFIID iid, void **out) 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}}; static const GUID CLSID_wg_wmv_decoder = {0x62ee5ddb,0x4f52,0x48e2,{0x89,0x28,0x78,0x7b,0x02,0x53,0xa0,0xbc}}; + static const GUID CLSID_wg_mp3_decoder = {0x84cd8e3e,0xb221,0x434a,{0x88,0x82,0x9d,0x6c,0x8d,0xf4,0x90,0xe1}}; static const GUID CLSID_wg_mpeg1_splitter = {0xa8edbf98,0x2442,0x42c5,{0x85,0xa1,0xab,0x05,0xa5,0x80,0xdf,0x53}}; static const GUID CLSID_wg_wave_parser = {0x3f839ec7,0x5ea6,0x49e1,{0x80,0xc2,0x1e,0xa3,0x00,0xf8,0xb0,0xe0}}; struct class_factory *factory; @@ -1021,7 +1020,7 @@ HRESULT WINAPI DllGetClassObject(REFCLSID clsid, REFIID iid, void **out) factory = &mpeg_audio_codec_cf; else if (IsEqualGUID(clsid, &CLSID_wg_mpeg_video_decoder)) factory = &mpeg_video_codec_cf; - else if (IsEqualGUID(clsid, &CLSID_mpeg_layer3_decoder)) + else if (IsEqualGUID(clsid, &CLSID_wg_mp3_decoder)) factory = &mpeg_layer3_decoder_cf; else if (IsEqualGUID(clsid, &CLSID_wg_mpeg1_splitter)) factory = &mpeg_splitter_cf; @@ -1084,38 +1083,6 @@ static const REGPINTYPES reg_audio_mt = {&MEDIATYPE_Audio, &GUID_NULL}; static const REGPINTYPES reg_stream_mt = {&MEDIATYPE_Stream, &GUID_NULL}; static const REGPINTYPES reg_video_mt = {&MEDIATYPE_Video, &GUID_NULL};
-static const REGPINTYPES reg_mpeg_layer3_decoder_sink_mts[1] = -{ - {&MEDIATYPE_Audio, &MEDIASUBTYPE_MP3}, -}; - -static const REGPINTYPES reg_mpeg_layer3_decoder_source_mts[1] = -{ - {&MEDIATYPE_Audio, &MEDIASUBTYPE_PCM}, -}; - -static const REGFILTERPINS2 reg_mpeg_layer3_decoder_pins[2] = -{ - { - .nMediaTypes = 1, - .lpMediaType = reg_mpeg_layer3_decoder_sink_mts, - }, - { - .dwFlags = REG_PINFLAG_B_OUTPUT, - .nMediaTypes = 1, - .lpMediaType = reg_mpeg_layer3_decoder_source_mts, - }, -}; - -static const REGFILTER2 reg_mpeg_layer3_decoder = -{ - .dwVersion = 2, - .dwMerit = 0x00810000, - .u.s2.cPins2 = 2, - .u.s2.rgPins2 = reg_mpeg_layer3_decoder_pins, -}; - - static const REGFILTERPINS2 reg_decodebin_parser_pins[3] = { { @@ -1158,8 +1125,6 @@ HRESULT WINAPI DllRegisterServer(void)
IFilterMapper2_RegisterFilter(mapper, &CLSID_decodebin_parser, L"GStreamer splitter filter", NULL, NULL, NULL, ®_decodebin_parser); - IFilterMapper2_RegisterFilter(mapper, &CLSID_mpeg_layer3_decoder, - L"MPEG Layer-3 Decoder", NULL, NULL, NULL, ®_mpeg_layer3_decoder);
IFilterMapper2_Release(mapper);
@@ -1181,7 +1146,6 @@ HRESULT WINAPI DllUnregisterServer(void) return hr;
IFilterMapper2_UnregisterFilter(mapper, NULL, NULL, &CLSID_decodebin_parser); - IFilterMapper2_UnregisterFilter(mapper, NULL, NULL, &CLSID_mpeg_layer3_decoder);
IFilterMapper2_Release(mapper);
diff --git a/dlls/winegstreamer/winegstreamer_classes.idl b/dlls/winegstreamer/winegstreamer_classes.idl index 1438f9d663c..bb9f81c2341 100644 --- a/dlls/winegstreamer/winegstreamer_classes.idl +++ b/dlls/winegstreamer/winegstreamer_classes.idl @@ -40,11 +40,10 @@ coclass wg_mpeg_audio_decoder {} coclass wg_mpeg_video_decoder {}
[ - helpstring("MPEG Layer-3 Decoder"), threading(both), - uuid(38be3000-dbf4-11d0-860e-00a024cfef6d) + uuid(84cd8e3e-b221-434a-8882-9d6c8df490e1) ] -coclass mpeg_layer3_decoder {} +coclass wg_mp3_decoder {}
[ threading(both), diff --git a/loader/wine.inf.in b/loader/wine.inf.in index 7adba6e080a..ac1a20ef46a 100644 --- a/loader/wine.inf.in +++ b/loader/wine.inf.in @@ -2107,6 +2107,7 @@ HKLM,%CurrentVersion%\Telephony\Country List\998,"SameAreaRule",,"G" 11,,cryptdlg.dll,1 11,,cryptnet.dll,1 11,,devenum.dll,1 +11,,l3codecx.ax,1 11,,mfasfsrcsnk.dll,1 11,,mfh264enc.dll,1 11,,mfmp4srcsnk.dll,1