From: Rémi Bernon rbernon@codeweavers.com
This introduces a new module, sharing source with mfsrcsnk, to register the classes in the same module as native, and prefer native by default. --- configure.ac | 1 + dlls/mfmp4srcsnk/Makefile.in | 11 ++++ dlls/mfmp4srcsnk/mfmp4srcsnk.c | 37 ++++++++++++ dlls/mfmp4srcsnk/mfmp4srcsnk.idl | 27 +++++++++ dlls/mfmp4srcsnk/mfmp4srcsnk.rc | 24 ++++++++ dlls/mfmp4srcsnk/mfmp4srcsnk.rgs | 95 +++++++++++++++++++++++++++++++ dlls/mfmp4srcsnk/mfmp4srcsnk.spec | 3 + dlls/mfsrcsnk/media_source.c | 18 ++++++ dlls/mfsrcsnk/media_source.h | 1 + include/wine/mfinternal.idl | 1 + loader/wine.inf.in | 1 + 11 files changed, 219 insertions(+) create mode 100644 dlls/mfmp4srcsnk/Makefile.in create mode 100644 dlls/mfmp4srcsnk/mfmp4srcsnk.c create mode 100644 dlls/mfmp4srcsnk/mfmp4srcsnk.idl create mode 100644 dlls/mfmp4srcsnk/mfmp4srcsnk.rc create mode 100644 dlls/mfmp4srcsnk/mfmp4srcsnk.rgs create mode 100644 dlls/mfmp4srcsnk/mfmp4srcsnk.spec
diff --git a/configure.ac b/configure.ac index 2d841d0d496..d47e8fd8050 100644 --- a/configure.ac +++ b/configure.ac @@ -2808,6 +2808,7 @@ WINE_CONFIG_MAKEFILE(dlls/mf3216) WINE_CONFIG_MAKEFILE(dlls/mferror) WINE_CONFIG_MAKEFILE(dlls/mfmediaengine) WINE_CONFIG_MAKEFILE(dlls/mfmediaengine/tests) +WINE_CONFIG_MAKEFILE(dlls/mfmp4srcsnk) WINE_CONFIG_MAKEFILE(dlls/mfplat) WINE_CONFIG_MAKEFILE(dlls/mfplat/tests) WINE_CONFIG_MAKEFILE(dlls/mfplay) diff --git a/dlls/mfmp4srcsnk/Makefile.in b/dlls/mfmp4srcsnk/Makefile.in new file mode 100644 index 00000000000..d32a1744bc0 --- /dev/null +++ b/dlls/mfmp4srcsnk/Makefile.in @@ -0,0 +1,11 @@ +MODULE = mfmp4srcsnk.dll +IMPORTS = ole32 mfplat mfuuid uuid +PARENTSRC = ../mfsrcsnk + +EXTRADLLFLAGS = -Wb,--prefer-native + +SOURCES = \ + media_source.c \ + mfmp4srcsnk.c \ + mfmp4srcsnk.idl \ + mfmp4srcsnk.rc diff --git a/dlls/mfmp4srcsnk/mfmp4srcsnk.c b/dlls/mfmp4srcsnk/mfmp4srcsnk.c new file mode 100644 index 00000000000..c6a99334ca7 --- /dev/null +++ b/dlls/mfmp4srcsnk/mfmp4srcsnk.c @@ -0,0 +1,37 @@ +/* + * 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 "media_source.h" + +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(mfplat); + +/*********************************************************************** + * DllGetClassObject (mfsrcsnk.@) + */ +HRESULT WINAPI DllGetClassObject(REFCLSID clsid, REFIID riid, void **out) +{ + *out = NULL; + + if (IsEqualGUID(clsid, &CLSID_MPEG4ByteStreamHandlerPlugin)) + return IClassFactory_QueryInterface(&mpeg4_byte_stream_plugin_factory, riid, out); + + FIXME("Unknown clsid %s.\n", debugstr_guid(clsid)); + return CLASS_E_CLASSNOTAVAILABLE; +} diff --git a/dlls/mfmp4srcsnk/mfmp4srcsnk.idl b/dlls/mfmp4srcsnk/mfmp4srcsnk.idl new file mode 100644 index 00000000000..67c6ca58724 --- /dev/null +++ b/dlls/mfmp4srcsnk/mfmp4srcsnk.idl @@ -0,0 +1,27 @@ +/* + * 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("MPEG4 Byte Stream Handler"), + threading(both), + uuid(271c3902-6095-4c45-a22f-20091816ee9e) +] +coclass MPEG4ByteStreamHandlerPlugin {} + diff --git a/dlls/mfmp4srcsnk/mfmp4srcsnk.rc b/dlls/mfmp4srcsnk/mfmp4srcsnk.rc new file mode 100644 index 00000000000..ec9c8c7ddab --- /dev/null +++ b/dlls/mfmp4srcsnk/mfmp4srcsnk.rc @@ -0,0 +1,24 @@ +/* + * 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 "windef.h" + +LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL + +/* @makedep: mfmp4srcsnk.rgs */ +1 WINE_REGISTRY mfmp4srcsnk.rgs diff --git a/dlls/mfmp4srcsnk/mfmp4srcsnk.rgs b/dlls/mfmp4srcsnk/mfmp4srcsnk.rgs new file mode 100644 index 00000000000..e3669dc705c --- /dev/null +++ b/dlls/mfmp4srcsnk/mfmp4srcsnk.rgs @@ -0,0 +1,95 @@ +HKLM +{ + NoRemove 'Software' + { + NoRemove 'Microsoft' + { + NoRemove 'Windows Media Foundation' + { + NoRemove 'ByteStreamHandlers' + { + '.3g2' + { + val '{271c3902-6095-4c45-a22f-20091816ee9e}' = s 'MPEG4 Byte Stream Handler' + } + '.3gp' + { + val '{271c3902-6095-4c45-a22f-20091816ee9e}' = s 'MPEG4 Byte Stream Handler' + } + '.3gp2' + { + val '{271c3902-6095-4c45-a22f-20091816ee9e}' = s 'MPEG4 Byte Stream Handler' + } + '.3gpp' + { + val '{271c3902-6095-4c45-a22f-20091816ee9e}' = s 'MPEG4 Byte Stream Handler' + } + '.m4a' + { + val '{271c3902-6095-4c45-a22f-20091816ee9e}' = s 'MPEG4 Byte Stream Handler' + } + '.m4v' + { + val '{271c3902-6095-4c45-a22f-20091816ee9e}' = s 'MPEG4 Byte Stream Handler' + } + '.mov' + { + val '{271c3902-6095-4c45-a22f-20091816ee9e}' = s 'MPEG4 Byte Stream Handler' + } + '.mp4' + { + val '{271c3902-6095-4c45-a22f-20091816ee9e}' = s 'MPEG4 Byte Stream Handler' + } + '.mp4v' + { + val '{271c3902-6095-4c45-a22f-20091816ee9e}' = s 'MPEG4 Byte Stream Handler' + } + '.uvu' + { + val '{271c3902-6095-4c45-a22f-20091816ee9e}' = s 'MPEG4 Byte Stream Handler' + } + 'audio/3gpp' + { + val '{271c3902-6095-4c45-a22f-20091816ee9e}' = s 'MPEG4 Byte Stream Handler' + } + 'audio/3gpp2' + { + val '{271c3902-6095-4c45-a22f-20091816ee9e}' = s 'MPEG4 Byte Stream Handler' + } + 'audio/mp4' + { + val '{271c3902-6095-4c45-a22f-20091816ee9e}' = s 'MPEG4 Byte Stream Handler' + } + 'audio/MP4A-LATM' + { + val '{271c3902-6095-4c45-a22f-20091816ee9e}' = s 'MPEG4 Byte Stream Handler' + } + 'audio/x-m4a' + { + val '{271c3902-6095-4c45-a22f-20091816ee9e}' = s 'MPEG4 Byte Stream Handler' + } + 'video/3gpp' + { + val '{271c3902-6095-4c45-a22f-20091816ee9e}' = s 'MPEG4 Byte Stream Handler' + } + 'video/3gpp2' + { + val '{271c3902-6095-4c45-a22f-20091816ee9e}' = s 'MPEG4 Byte Stream Handler' + } + 'video/mp4' + { + val '{271c3902-6095-4c45-a22f-20091816ee9e}' = s 'MPEG4 Byte Stream Handler' + } + 'video/vnd.dece.mp4' + { + val '{271c3902-6095-4c45-a22f-20091816ee9e}' = s 'MPEG4 Byte Stream Handler' + } + 'video/x-m4v' + { + val '{271c3902-6095-4c45-a22f-20091816ee9e}' = s 'MPEG4 Byte Stream Handler' + } + } + } + } + } +} diff --git a/dlls/mfmp4srcsnk/mfmp4srcsnk.spec b/dlls/mfmp4srcsnk/mfmp4srcsnk.spec new file mode 100644 index 00000000000..b717c9c9371 --- /dev/null +++ b/dlls/mfmp4srcsnk/mfmp4srcsnk.spec @@ -0,0 +1,3 @@ +@ stdcall -private DllGetClassObject(ptr ptr ptr) +@ stdcall -private DllRegisterServer() +@ stdcall -private DllUnregisterServer() diff --git a/dlls/mfsrcsnk/media_source.c b/dlls/mfsrcsnk/media_source.c index 5c3605b8cdf..cdd00ece965 100644 --- a/dlls/mfsrcsnk/media_source.c +++ b/dlls/mfsrcsnk/media_source.c @@ -38,6 +38,24 @@ static const IClassFactoryVtbl avi_byte_stream_plugin_factory_vtbl =
IClassFactory avi_byte_stream_plugin_factory = {&avi_byte_stream_plugin_factory_vtbl};
+static HRESULT WINAPI mpeg4_byte_stream_plugin_factory_CreateInstance(IClassFactory *iface, + IUnknown *outer, REFIID riid, void **out) +{ + static const GUID CLSID_GStreamerByteStreamHandler = {0x317df618,0x5e5a,0x468a,{0x9f,0x15,0xd8,0x27,0xa9,0xa0,0x81,0x62}}; + return CoCreateInstance(&CLSID_GStreamerByteStreamHandler, outer, CLSCTX_INPROC_SERVER, riid, out); +} + +static const IClassFactoryVtbl mpeg4_byte_stream_plugin_factory_vtbl = +{ + class_factory_QueryInterface, + class_factory_AddRef, + class_factory_Release, + mpeg4_byte_stream_plugin_factory_CreateInstance, + class_factory_LockServer, +}; + +IClassFactory mpeg4_byte_stream_plugin_factory = {&mpeg4_byte_stream_plugin_factory_vtbl}; + static HRESULT WINAPI wav_byte_stream_plugin_factory_CreateInstance(IClassFactory *iface, IUnknown *outer, REFIID riid, void **out) { diff --git a/dlls/mfsrcsnk/media_source.h b/dlls/mfsrcsnk/media_source.h index 5c555c31a95..6ac052c1594 100644 --- a/dlls/mfsrcsnk/media_source.h +++ b/dlls/mfsrcsnk/media_source.h @@ -21,4 +21,5 @@ #include "wine/debug.h"
extern IClassFactory avi_byte_stream_plugin_factory; +extern IClassFactory mpeg4_byte_stream_plugin_factory; extern IClassFactory wav_byte_stream_plugin_factory; diff --git a/include/wine/mfinternal.idl b/include/wine/mfinternal.idl index a014faf4c3c..e2a33c9cf2f 100644 --- a/include/wine/mfinternal.idl +++ b/include/wine/mfinternal.idl @@ -54,4 +54,5 @@ cpp_quote("DEFINE_GUID(CLSID_MFMPEG4SinkClassFactory, 0xa22c4fc7, 0x6e91, 0x4e1d cpp_quote("DEFINE_GUID(CLSID_MFWAVESinkClassFactory, 0x36f99745, 0x23c9, 0x4c9c, 0x8d, 0xd5, 0xcc, 0x31, 0xce, 0x96, 0x43, 0x90);")
cpp_quote("DEFINE_GUID(CLSID_AVIByteStreamPlugin, 0x7afa253e, 0xf823, 0x42f6, 0xa5, 0xd9, 0x71, 0x4b, 0xde, 0x46, 0x74, 0x12);") +cpp_quote("DEFINE_GUID(CLSID_MPEG4ByteStreamHandlerPlugin, 0x271c3902, 0x6095, 0x4c45, 0xa2, 0x2f, 0x20, 0x09, 0x18, 0x16, 0xee, 0x9e);") cpp_quote("DEFINE_GUID(CLSID_WAVByteStreamPlugin, 0x42c9b9f5, 0x16fc, 0x47ef, 0xaf, 0x22, 0xda, 0x05, 0xf7, 0xc8, 0x42, 0xe3);") diff --git a/loader/wine.inf.in b/loader/wine.inf.in index 2903badd840..b7a11f86b53 100644 --- a/loader/wine.inf.in +++ b/loader/wine.inf.in @@ -2106,6 +2106,7 @@ HKLM,%CurrentVersion%\Telephony\Country List\998,"SameAreaRule",,"G" 11,,cryptdlg.dll,1 11,,cryptnet.dll,1 11,,devenum.dll,1 +11,,mfmp4srcsnk.dll,1 11,,mp3dmod.dll,1 11,,mscoree.dll,1 11,,mshtml.dll,1