From: Rémi Bernon rbernon@codeweavers.com
--- configure.ac | 1 + dlls/msvproc/Makefile.in | 6 + dlls/msvproc/msvproc.c | 174 +++++++++++++++++++ dlls/msvproc/msvproc.idl | 25 +++ dlls/msvproc/msvproc.spec | 4 + dlls/winegstreamer/mfplat.c | 63 +------ dlls/winegstreamer/winegstreamer_classes.idl | 4 +- loader/wine.inf.in | 1 + 8 files changed, 215 insertions(+), 63 deletions(-) create mode 100644 dlls/msvproc/Makefile.in create mode 100644 dlls/msvproc/msvproc.c create mode 100644 dlls/msvproc/msvproc.idl create mode 100644 dlls/msvproc/msvproc.spec
diff --git a/configure.ac b/configure.ac index ecc765b082a..12c308bcc8b 100644 --- a/configure.ac +++ b/configure.ac @@ -2949,6 +2949,7 @@ WINE_CONFIG_MAKEFILE(dlls/msvfw32) WINE_CONFIG_MAKEFILE(dlls/msvfw32/tests) WINE_CONFIG_MAKEFILE(dlls/msvidc32) WINE_CONFIG_MAKEFILE(dlls/msvideo.dll16,enable_win16) +WINE_CONFIG_MAKEFILE(dlls/msvproc) WINE_CONFIG_MAKEFILE(dlls/mswsock) WINE_CONFIG_MAKEFILE(dlls/msxml) WINE_CONFIG_MAKEFILE(dlls/msxml2) diff --git a/dlls/msvproc/Makefile.in b/dlls/msvproc/Makefile.in new file mode 100644 index 00000000000..f98b4d6d44b --- /dev/null +++ b/dlls/msvproc/Makefile.in @@ -0,0 +1,6 @@ +MODULE = msvproc.dll +IMPORTS = combase mfplat mfuuid dmoguids dxguid strmiids wmcodecdspuuid uuid + +SOURCES = \ + msvproc.c \ + msvproc.idl diff --git a/dlls/msvproc/msvproc.c b/dlls/msvproc/msvproc.c new file mode 100644 index 00000000000..fdf6a1cddb1 --- /dev/null +++ b/dlls/msvproc/msvproc.c @@ -0,0 +1,174 @@ +/* + * 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 "d3d9.h" +#include "mfapi.h" +#include "mfidl.h" +#include "rpcproxy.h" + +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(dmo); + +#include "initguid.h" + +DEFINE_MEDIATYPE_GUID(MFVideoFormat_ABGR32, D3DFMT_A8B8G8R8); +DEFINE_MEDIATYPE_GUID(MFVideoFormat_P208,MAKEFOURCC('P','2','0','8')); + +static HRESULT WINAPI video_processor_factory_CreateInstance(IClassFactory *iface, IUnknown *outer, + REFIID riid, void **out) +{ + static const GUID CLSID_wg_video_processor = {0xd527607f,0x89cb,0x4e94,{0x95,0x71,0xbc,0xfe,0x62,0x17,0x56,0x13}}; + return CoCreateInstance(&CLSID_wg_video_processor, 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 video_processor_factory_vtbl = +{ + class_factory_QueryInterface, + class_factory_AddRef, + class_factory_Release, + video_processor_factory_CreateInstance, + class_factory_LockServer, +}; + +static IClassFactory video_processor_factory = {&video_processor_factory_vtbl}; + +/*********************************************************************** + * DllGetClassObject (msvproc.@) + */ +HRESULT WINAPI DllGetClassObject(REFCLSID clsid, REFIID riid, void **out) +{ + if (IsEqualGUID(clsid, &CLSID_VideoProcessorMFT)) + return IClassFactory_QueryInterface(&video_processor_factory, riid, out); + + *out = NULL; + FIXME("Unknown clsid %s.\n", debugstr_guid(clsid)); + return CLASS_E_CLASSNOTAVAILABLE; +} + +/*********************************************************************** + * DllRegisterServer (msvproc.@) + */ +HRESULT WINAPI DllRegisterServer(void) +{ + MFT_REGISTER_TYPE_INFO video_processor_mft_inputs[] = + { + {MFMediaType_Video, MFVideoFormat_IYUV}, + {MFMediaType_Video, MFVideoFormat_YV12}, + {MFMediaType_Video, MFVideoFormat_NV12}, + {MFMediaType_Video, MFVideoFormat_YUY2}, + {MFMediaType_Video, MFVideoFormat_ARGB32}, + {MFMediaType_Video, MFVideoFormat_RGB32}, + {MFMediaType_Video, MFVideoFormat_NV11}, + {MFMediaType_Video, MFVideoFormat_AYUV}, + {MFMediaType_Video, MFVideoFormat_UYVY}, + {MFMediaType_Video, MFVideoFormat_P208}, + {MFMediaType_Video, MFVideoFormat_RGB24}, + {MFMediaType_Video, MFVideoFormat_RGB555}, + {MFMediaType_Video, MFVideoFormat_RGB565}, + {MFMediaType_Video, MFVideoFormat_RGB8}, + {MFMediaType_Video, MFVideoFormat_I420}, + {MFMediaType_Video, MFVideoFormat_Y216}, + {MFMediaType_Video, MFVideoFormat_v410}, + {MFMediaType_Video, MFVideoFormat_Y41P}, + {MFMediaType_Video, MFVideoFormat_Y41T}, + {MFMediaType_Video, MFVideoFormat_Y42T}, + {MFMediaType_Video, MFVideoFormat_YVYU}, + {MFMediaType_Video, MFVideoFormat_420O}, + }; + MFT_REGISTER_TYPE_INFO video_processor_mft_outputs[] = + { + {MFMediaType_Video, MFVideoFormat_IYUV}, + {MFMediaType_Video, MFVideoFormat_YV12}, + {MFMediaType_Video, MFVideoFormat_NV12}, + {MFMediaType_Video, MFVideoFormat_YUY2}, + {MFMediaType_Video, MFVideoFormat_ARGB32}, + {MFMediaType_Video, MFVideoFormat_RGB32}, + {MFMediaType_Video, MFVideoFormat_NV11}, + {MFMediaType_Video, MFVideoFormat_AYUV}, + {MFMediaType_Video, MFVideoFormat_UYVY}, + {MFMediaType_Video, MFVideoFormat_P208}, + {MFMediaType_Video, MFVideoFormat_RGB24}, + {MFMediaType_Video, MFVideoFormat_RGB555}, + {MFMediaType_Video, MFVideoFormat_RGB565}, + {MFMediaType_Video, MFVideoFormat_RGB8}, + {MFMediaType_Video, MFVideoFormat_I420}, + {MFMediaType_Video, MFVideoFormat_Y216}, + {MFMediaType_Video, MFVideoFormat_v410}, + {MFMediaType_Video, MFVideoFormat_Y41P}, + {MFMediaType_Video, MFVideoFormat_Y41T}, + {MFMediaType_Video, MFVideoFormat_Y42T}, + {MFMediaType_Video, MFVideoFormat_YVYU}, + }; + + HRESULT hr; + + TRACE("\n"); + + if (FAILED(hr = __wine_register_resources())) + return hr; + if (FAILED(hr = MFTRegister(CLSID_VideoProcessorMFT, MFT_CATEGORY_VIDEO_PROCESSOR, + (WCHAR *)L"Microsoft Video Processor MFT", MFT_ENUM_FLAG_SYNCMFT, + ARRAY_SIZE(video_processor_mft_inputs), video_processor_mft_inputs, + ARRAY_SIZE(video_processor_mft_outputs), video_processor_mft_outputs, NULL))) + return hr; + + return S_OK; +} + +/*********************************************************************** + * DllUnregisterServer (msvproc.@) + */ +HRESULT WINAPI DllUnregisterServer(void) +{ + HRESULT hr; + + TRACE("\n"); + + if (FAILED(hr = __wine_unregister_resources())) + return hr; + if (FAILED(hr = MFTUnregister(CLSID_VideoProcessorMFT))) + return hr; + + return S_OK; +} diff --git a/dlls/msvproc/msvproc.idl b/dlls/msvproc/msvproc.idl new file mode 100644 index 00000000000..c64155fd265 --- /dev/null +++ b/dlls/msvproc/msvproc.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(88753b26-5b24-49bd-b2e7-0c445c78c982) +] +coclass VideoProcessorMFT {} diff --git a/dlls/msvproc/msvproc.spec b/dlls/msvproc/msvproc.spec new file mode 100644 index 00000000000..b16365d0c9f --- /dev/null +++ b/dlls/msvproc/msvproc.spec @@ -0,0 +1,4 @@ +@ stdcall -private DllCanUnloadNow() +@ stdcall -private DllGetClassObject(ptr ptr ptr) +@ stdcall -private DllRegisterServer() +@ stdcall -private DllUnregisterServer() diff --git a/dlls/winegstreamer/mfplat.c b/dlls/winegstreamer/mfplat.c index 5df15388066..ca2227656d9 100644 --- a/dlls/winegstreamer/mfplat.c +++ b/dlls/winegstreamer/mfplat.c @@ -121,6 +121,7 @@ static const IClassFactoryVtbl class_factory_vtbl = };
static const GUID CLSID_GStreamerByteStreamHandler = {0x317df618, 0x5e5a, 0x468a, {0x9f, 0x15, 0xd8, 0x27, 0xa9, 0xa0, 0x81, 0x62}}; +static const GUID CLSID_wg_video_processor = {0xd527607f,0x89cb,0x4e94,{0x95,0x71,0xbc,0xfe,0x62,0x17,0x56,0x13}};
static const struct class_object { @@ -129,7 +130,7 @@ static const struct class_object } class_objects[] = { - { &CLSID_VideoProcessorMFT, &video_processor_create }, + { &CLSID_wg_video_processor, &video_processor_create }, { &CLSID_GStreamerByteStreamHandler, &gstreamer_byte_stream_handler_create }, { &CLSID_MSAACDecMFT, &aac_decoder_create }, { &CLSID_MSH264DecoderMFT, &h264_decoder_create }, @@ -221,56 +222,6 @@ HRESULT mfplat_DllRegisterServer(void) {MFMediaType_Video, MFVideoFormat_H264}, };
- MFT_REGISTER_TYPE_INFO video_processor_input_types[] = - { - {MFMediaType_Video, MFVideoFormat_IYUV}, - {MFMediaType_Video, MFVideoFormat_YV12}, - {MFMediaType_Video, MFVideoFormat_NV12}, - {MFMediaType_Video, MFVideoFormat_YUY2}, - {MFMediaType_Video, MFVideoFormat_ARGB32}, - {MFMediaType_Video, MFVideoFormat_RGB32}, - {MFMediaType_Video, MFVideoFormat_NV11}, - {MFMediaType_Video, MFVideoFormat_AYUV}, - {MFMediaType_Video, MFVideoFormat_UYVY}, - {MFMediaType_Video, MEDIASUBTYPE_P208}, - {MFMediaType_Video, MFVideoFormat_RGB24}, - {MFMediaType_Video, MFVideoFormat_RGB555}, - {MFMediaType_Video, MFVideoFormat_RGB565}, - {MFMediaType_Video, MFVideoFormat_RGB8}, - {MFMediaType_Video, MFVideoFormat_I420}, - {MFMediaType_Video, MFVideoFormat_Y216}, - {MFMediaType_Video, MFVideoFormat_v410}, - {MFMediaType_Video, MFVideoFormat_Y41P}, - {MFMediaType_Video, MFVideoFormat_Y41T}, - {MFMediaType_Video, MFVideoFormat_Y42T}, - {MFMediaType_Video, MFVideoFormat_YVYU}, - {MFMediaType_Video, MFVideoFormat_420O}, - }; - MFT_REGISTER_TYPE_INFO video_processor_output_types[] = - { - {MFMediaType_Video, MFVideoFormat_IYUV}, - {MFMediaType_Video, MFVideoFormat_YV12}, - {MFMediaType_Video, MFVideoFormat_NV12}, - {MFMediaType_Video, MFVideoFormat_YUY2}, - {MFMediaType_Video, MFVideoFormat_ARGB32}, - {MFMediaType_Video, MFVideoFormat_RGB32}, - {MFMediaType_Video, MFVideoFormat_NV11}, - {MFMediaType_Video, MFVideoFormat_AYUV}, - {MFMediaType_Video, MFVideoFormat_UYVY}, - {MFMediaType_Video, MEDIASUBTYPE_P208}, - {MFMediaType_Video, MFVideoFormat_RGB24}, - {MFMediaType_Video, MFVideoFormat_RGB555}, - {MFMediaType_Video, MFVideoFormat_RGB565}, - {MFMediaType_Video, MFVideoFormat_RGB8}, - {MFMediaType_Video, MFVideoFormat_I420}, - {MFMediaType_Video, MFVideoFormat_Y216}, - {MFMediaType_Video, MFVideoFormat_v410}, - {MFMediaType_Video, MFVideoFormat_Y41P}, - {MFMediaType_Video, MFVideoFormat_Y41T}, - {MFMediaType_Video, MFVideoFormat_Y42T}, - {MFMediaType_Video, MFVideoFormat_YVYU}, - }; - MFT_REGISTER_TYPE_INFO wmv_decoder_input_types[] = { {MFMediaType_Video, MFVideoFormat_WMV1}, @@ -361,16 +312,6 @@ HRESULT mfplat_DllRegisterServer(void) ARRAY_SIZE(wmv_decoder_output_types), wmv_decoder_output_types, }, - { - CLSID_VideoProcessorMFT, - MFT_CATEGORY_VIDEO_PROCESSOR, - L"Microsoft Video Processor MFT", - MFT_ENUM_FLAG_SYNCMFT, - ARRAY_SIZE(video_processor_input_types), - video_processor_input_types, - ARRAY_SIZE(video_processor_output_types), - video_processor_output_types, - }, { CLSID_CResamplerMediaObject, MFT_CATEGORY_AUDIO_EFFECT, diff --git a/dlls/winegstreamer/winegstreamer_classes.idl b/dlls/winegstreamer/winegstreamer_classes.idl index 53a46a09d38..421424a9577 100644 --- a/dlls/winegstreamer/winegstreamer_classes.idl +++ b/dlls/winegstreamer/winegstreamer_classes.idl @@ -72,9 +72,9 @@ coclass decodebin_parser {}
[ threading(both), - uuid(88753b26-5b24-49bd-b2e7-0c445c78c982) + uuid(d527607f-89cb-4e94-9571-bcfe62175613) ] -coclass VideoProcessorMFT {} +coclass wg_video_processor {}
[ helpstring("Generic Decodebin Byte Stream Handler"), diff --git a/loader/wine.inf.in b/loader/wine.inf.in index 8df38973681..a529a9d9408 100644 --- a/loader/wine.inf.in +++ b/loader/wine.inf.in @@ -2113,6 +2113,7 @@ HKLM,%CurrentVersion%\Telephony\Country List\998,"SameAreaRule",,"G" 11,,mscoree.dll,1 11,,mshtml.dll,1 11,,msisip.dll,1 +11,,msvproc.dll,1 11,,qcap.dll,1 11,,qedit.dll,1 11,,urlmon.dll,1