[PATCH 0/3] MR9565: vidreszr, msvdsp: Add stub DLLs.
These need to be registered and take place in the list of registered MFTs as some games lookup some MFT by hardcoding its index in the expected MFTEnum returned class GUID array. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/9565
From: Rémi Bernon <rbernon(a)codeweavers.com> --- include/wmcodecdsp.idl | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/include/wmcodecdsp.idl b/include/wmcodecdsp.idl index 9982b6e6b8a..74cd567bc89 100644 --- a/include/wmcodecdsp.idl +++ b/include/wmcodecdsp.idl @@ -98,6 +98,21 @@ coclass CWMVDecMediaObject {} ] coclass CWMVXEncMediaObject {} +[ + uuid(01f36ce2-0907-4d8b-979d-f151be91c883) +] +coclass CFrameRateConvertDmo {} + +[ + uuid(798059f0-89ca-4160-b325-aeb48efe4f9a) +] +coclass CColorControlDmo {} + +[ + uuid(1ea1ea14-48f4-4054-ad1a-e8aee10ac805) +] +coclass CResizerDMO {} + typedef float ChMtxType; [ -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/9565
From: Rémi Bernon <rbernon(a)codeweavers.com> --- configure.ac | 1 + dlls/msvdsp/Makefile.in | 6 ++ dlls/msvdsp/msvdsp.c | 194 ++++++++++++++++++++++++++++++++++++++++ dlls/msvdsp/msvdsp.idl | 31 +++++++ dlls/msvdsp/msvdsp.spec | 4 + loader/wine.inf.in | 1 + 6 files changed, 237 insertions(+) create mode 100644 dlls/msvdsp/Makefile.in create mode 100644 dlls/msvdsp/msvdsp.c create mode 100644 dlls/msvdsp/msvdsp.idl create mode 100644 dlls/msvdsp/msvdsp.spec diff --git a/configure.ac b/configure.ac index a9db2abcce4..f3354395fb5 100644 --- a/configure.ac +++ b/configure.ac @@ -2995,6 +2995,7 @@ WINE_CONFIG_MAKEFILE(dlls/msvfw32) WINE_CONFIG_MAKEFILE(dlls/msvfw32/tests) WINE_CONFIG_MAKEFILE(dlls/msvidc32) WINE_CONFIG_MAKEFILE(dlls/msvideo.dll16) +WINE_CONFIG_MAKEFILE(dlls/msvdsp) WINE_CONFIG_MAKEFILE(dlls/msvproc) WINE_CONFIG_MAKEFILE(dlls/mswsock) WINE_CONFIG_MAKEFILE(dlls/msxml) diff --git a/dlls/msvdsp/Makefile.in b/dlls/msvdsp/Makefile.in new file mode 100644 index 00000000000..088d5f55915 --- /dev/null +++ b/dlls/msvdsp/Makefile.in @@ -0,0 +1,6 @@ +MODULE = msvdsp.dll +IMPORTS = combase mfplat msdmo mfuuid dmoguids strmiids wmcodecdspuuid uuid + +SOURCES = \ + msvdsp.c \ + msvdsp.idl diff --git a/dlls/msvdsp/msvdsp.c b/dlls/msvdsp/msvdsp.c new file mode 100644 index 00000000000..42bcaac491a --- /dev/null +++ b/dlls/msvdsp/msvdsp.c @@ -0,0 +1,194 @@ +/* + * 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 "dmoreg.h" +#include "dshow.h" +#include "mfapi.h" +#include "rpcproxy.h" +#include "wmcodecdsp.h" + +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(dmo); + +#include "initguid.h" + +DEFINE_MEDIATYPE_GUID(MFVideoFormat_ABGR32, D3DFMT_A8B8G8R8); +DEFINE_GUID(DMOVideoFormat_RGB32,D3DFMT_X8R8G8B8,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70); +DEFINE_GUID(DMOVideoFormat_RGB24,D3DFMT_R8G8B8,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70); +DEFINE_GUID(DMOVideoFormat_RGB565,D3DFMT_R5G6B5,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70); +DEFINE_GUID(DMOVideoFormat_RGB555,D3DFMT_X1R5G5B5,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70); +DEFINE_GUID(DMOVideoFormat_RGB8,D3DFMT_P8,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70); + +/*********************************************************************** + * DllGetClassObject (msvproc.@) + */ +HRESULT WINAPI DllGetClassObject(REFCLSID clsid, REFIID riid, void **out) +{ + *out = NULL; + FIXME("Unknown clsid %s.\n", debugstr_guid(clsid)); + return CLASS_E_CLASSNOTAVAILABLE; +} + +/*********************************************************************** + * DllRegisterServer (colorcnv.@) + */ +HRESULT WINAPI DllRegisterServer(void) +{ + MFT_REGISTER_TYPE_INFO color_converter_mft_inputs[] = + { + {MFMediaType_Video, MFVideoFormat_YV12}, + {MFMediaType_Video, MFVideoFormat_YUY2}, + {MFMediaType_Video, MFVideoFormat_UYVY}, + {MFMediaType_Video, MFVideoFormat_AYUV}, + {MFMediaType_Video, MFVideoFormat_NV12}, + {MFMediaType_Video, DMOVideoFormat_RGB32}, + {MFMediaType_Video, DMOVideoFormat_RGB565}, + {MFMediaType_Video, MFVideoFormat_I420}, + {MFMediaType_Video, MFVideoFormat_IYUV}, + {MFMediaType_Video, MFVideoFormat_YVYU}, + {MFMediaType_Video, DMOVideoFormat_RGB24}, + {MFMediaType_Video, DMOVideoFormat_RGB555}, + {MFMediaType_Video, DMOVideoFormat_RGB8}, + {MFMediaType_Video, MEDIASUBTYPE_V216}, + {MFMediaType_Video, MEDIASUBTYPE_V410}, + {MFMediaType_Video, MFVideoFormat_NV11}, + {MFMediaType_Video, MFVideoFormat_Y41P}, + {MFMediaType_Video, MFVideoFormat_Y41T}, + {MFMediaType_Video, MFVideoFormat_Y42T}, + {MFMediaType_Video, MFVideoFormat_YVU9}, + }; + MFT_REGISTER_TYPE_INFO color_converter_mft_outputs[] = + { + {MFMediaType_Video, MFVideoFormat_YV12}, + {MFMediaType_Video, MFVideoFormat_YUY2}, + {MFMediaType_Video, MFVideoFormat_UYVY}, + {MFMediaType_Video, MFVideoFormat_AYUV}, + {MFMediaType_Video, MFVideoFormat_NV12}, + {MFMediaType_Video, DMOVideoFormat_RGB32}, + {MFMediaType_Video, DMOVideoFormat_RGB565}, + {MFMediaType_Video, MFVideoFormat_I420}, + {MFMediaType_Video, MFVideoFormat_IYUV}, + {MFMediaType_Video, MFVideoFormat_YVYU}, + {MFMediaType_Video, DMOVideoFormat_RGB24}, + {MFMediaType_Video, DMOVideoFormat_RGB555}, + {MFMediaType_Video, DMOVideoFormat_RGB8}, + {MFMediaType_Video, MEDIASUBTYPE_V216}, + {MFMediaType_Video, MEDIASUBTYPE_V410}, + {MFMediaType_Video, MFVideoFormat_NV11}, + }; + DMO_PARTIAL_MEDIATYPE color_converter_dmo_inputs[] = + { + {.type = MEDIATYPE_Video, .subtype = MEDIASUBTYPE_YV12}, + {.type = MEDIATYPE_Video, .subtype = MEDIASUBTYPE_YUY2}, + {.type = MEDIATYPE_Video, .subtype = MEDIASUBTYPE_UYVY}, + {.type = MEDIATYPE_Video, .subtype = MEDIASUBTYPE_AYUV}, + {.type = MEDIATYPE_Video, .subtype = MEDIASUBTYPE_NV12}, + {.type = MEDIATYPE_Video, .subtype = MEDIASUBTYPE_RGB32}, + {.type = MEDIATYPE_Video, .subtype = MEDIASUBTYPE_RGB565}, + {.type = MEDIATYPE_Video, .subtype = MEDIASUBTYPE_I420}, + {.type = MEDIATYPE_Video, .subtype = MEDIASUBTYPE_IYUV}, + {.type = MEDIATYPE_Video, .subtype = MEDIASUBTYPE_YVYU}, + {.type = MEDIATYPE_Video, .subtype = MEDIASUBTYPE_RGB24}, + {.type = MEDIATYPE_Video, .subtype = MEDIASUBTYPE_RGB555}, + {.type = MEDIATYPE_Video, .subtype = MEDIASUBTYPE_RGB8}, + {.type = MEDIATYPE_Video, .subtype = MEDIASUBTYPE_V216}, + {.type = MEDIATYPE_Video, .subtype = MEDIASUBTYPE_V410}, + {.type = MEDIATYPE_Video, .subtype = MEDIASUBTYPE_NV11}, + {.type = MEDIATYPE_Video, .subtype = MEDIASUBTYPE_Y41P}, + {.type = MEDIATYPE_Video, .subtype = MEDIASUBTYPE_Y41T}, + {.type = MEDIATYPE_Video, .subtype = MEDIASUBTYPE_Y42T}, + {.type = MEDIATYPE_Video, .subtype = MEDIASUBTYPE_YVU9}, + }; + DMO_PARTIAL_MEDIATYPE color_converter_dmo_outputs[] = + { + {.type = MEDIATYPE_Video, .subtype = MEDIASUBTYPE_YV12}, + {.type = MEDIATYPE_Video, .subtype = MEDIASUBTYPE_YUY2}, + {.type = MEDIATYPE_Video, .subtype = MEDIASUBTYPE_UYVY}, + {.type = MEDIATYPE_Video, .subtype = MEDIASUBTYPE_AYUV}, + {.type = MEDIATYPE_Video, .subtype = MEDIASUBTYPE_NV12}, + {.type = MEDIATYPE_Video, .subtype = MEDIASUBTYPE_RGB32}, + {.type = MEDIATYPE_Video, .subtype = MEDIASUBTYPE_RGB565}, + {.type = MEDIATYPE_Video, .subtype = MEDIASUBTYPE_I420}, + {.type = MEDIATYPE_Video, .subtype = MEDIASUBTYPE_IYUV}, + {.type = MEDIATYPE_Video, .subtype = MEDIASUBTYPE_YVYU}, + {.type = MEDIATYPE_Video, .subtype = MEDIASUBTYPE_RGB24}, + {.type = MEDIATYPE_Video, .subtype = MEDIASUBTYPE_RGB555}, + {.type = MEDIATYPE_Video, .subtype = MEDIASUBTYPE_RGB8}, + {.type = MEDIATYPE_Video, .subtype = MEDIASUBTYPE_V216}, + {.type = MEDIATYPE_Video, .subtype = MEDIASUBTYPE_V410}, + {.type = MEDIATYPE_Video, .subtype = MEDIASUBTYPE_NV11}, + }; + HRESULT hr; + + TRACE("\n"); + + if (FAILED(hr = __wine_register_resources())) + return hr; + if (FAILED(hr = MFTRegister(CLSID_CFrameRateConvertDmo, MFT_CATEGORY_VIDEO_EFFECT, + (WCHAR *)L"Frame Rate Converter", MFT_ENUM_FLAG_SYNCMFT, + ARRAY_SIZE(color_converter_mft_inputs), color_converter_mft_inputs, + ARRAY_SIZE(color_converter_mft_outputs), color_converter_mft_outputs, NULL))) + return hr; + if (FAILED(hr = DMORegister(L"Frame Rate Converter", &CLSID_CFrameRateConvertDmo, &DMOCATEGORY_VIDEO_EFFECT, 0, + ARRAY_SIZE(color_converter_dmo_inputs), color_converter_dmo_inputs, + ARRAY_SIZE(color_converter_dmo_outputs), color_converter_dmo_outputs))) + return hr; + if (FAILED(hr = MFTRegister(CLSID_CColorControlDmo, MFT_CATEGORY_VIDEO_EFFECT, + (WCHAR *)L"Color Control", MFT_ENUM_FLAG_SYNCMFT, + ARRAY_SIZE(color_converter_mft_inputs), color_converter_mft_inputs, + ARRAY_SIZE(color_converter_mft_outputs), color_converter_mft_outputs, NULL))) + return hr; + if (FAILED(hr = DMORegister(L"Color Control", &CLSID_CColorControlDmo, &DMOCATEGORY_VIDEO_EFFECT, 0, + ARRAY_SIZE(color_converter_dmo_inputs), color_converter_dmo_inputs, + ARRAY_SIZE(color_converter_dmo_outputs), color_converter_dmo_outputs))) + return hr; + + return S_OK; +} + +/*********************************************************************** + * DllUnregisterServer (colorcnv.@) + */ +HRESULT WINAPI DllUnregisterServer(void) +{ + HRESULT hr; + + TRACE("\n"); + + if (FAILED(hr = __wine_unregister_resources())) + return hr; + if (FAILED(hr = MFTUnregister(CLSID_CFrameRateConvertDmo))) + return hr; + if (FAILED(hr = DMOUnregister(&CLSID_CFrameRateConvertDmo, &DMOCATEGORY_VIDEO_EFFECT))) + return hr; + if (FAILED(hr = MFTUnregister(CLSID_CColorControlDmo))) + return hr; + if (FAILED(hr = DMOUnregister(&CLSID_CColorControlDmo, &DMOCATEGORY_VIDEO_EFFECT))) + return hr; + + return S_OK; +} diff --git a/dlls/msvdsp/msvdsp.idl b/dlls/msvdsp/msvdsp.idl new file mode 100644 index 00000000000..acd9ba36bac --- /dev/null +++ b/dlls/msvdsp/msvdsp.idl @@ -0,0 +1,31 @@ +/* + * 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(01f36ce2-0907-4d8b-979d-f151be91c883) +] +coclass CFrameRateConvertDmo {} + +[ + threading(both), + uuid(798059f0-89ca-4160-b325-aeb48efe4f9a) +] +coclass CColorControlDmo {} diff --git a/dlls/msvdsp/msvdsp.spec b/dlls/msvdsp/msvdsp.spec new file mode 100644 index 00000000000..b16365d0c9f --- /dev/null +++ b/dlls/msvdsp/msvdsp.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 8a77c538006..ca31af717cf 100644 --- a/loader/wine.inf.in +++ b/loader/wine.inf.in @@ -696,6 +696,7 @@ HKLM,SOFTWARE\Microsoft\VisualStudio\14.0\VC\Runtimes\x86,"Version",2,"14.42.344 11,,mshtml.dll,1 11,,msisip.dll,1 11,,msmpeg2vdec.dll,1 +11,,msvdsp.dll,1 11,,msvproc.dll,1 11,,qcap.dll,1 11,,qedit.dll,1 -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/9565
From: Rémi Bernon <rbernon(a)codeweavers.com> --- configure.ac | 1 + dlls/vidreszr/Makefile.in | 6 ++ dlls/vidreszr/vidreszr.c | 181 ++++++++++++++++++++++++++++++++++++ dlls/vidreszr/vidreszr.idl | 25 +++++ dlls/vidreszr/vidreszr.spec | 4 + loader/wine.inf.in | 1 + 6 files changed, 218 insertions(+) create mode 100644 dlls/vidreszr/Makefile.in create mode 100644 dlls/vidreszr/vidreszr.c create mode 100644 dlls/vidreszr/vidreszr.idl create mode 100644 dlls/vidreszr/vidreszr.spec diff --git a/configure.ac b/configure.ac index f3354395fb5..f3c5089e22c 100644 --- a/configure.ac +++ b/configure.ac @@ -3256,6 +3256,7 @@ WINE_CONFIG_MAKEFILE(dlls/ver.dll16) WINE_CONFIG_MAKEFILE(dlls/version) WINE_CONFIG_MAKEFILE(dlls/version/tests) WINE_CONFIG_MAKEFILE(dlls/vga) +WINE_CONFIG_MAKEFILE(dlls/vidreszr) WINE_CONFIG_MAKEFILE(dlls/virtdisk) WINE_CONFIG_MAKEFILE(dlls/virtdisk/tests) WINE_CONFIG_MAKEFILE(dlls/vmm.vxd) diff --git a/dlls/vidreszr/Makefile.in b/dlls/vidreszr/Makefile.in new file mode 100644 index 00000000000..2427d28ab08 --- /dev/null +++ b/dlls/vidreszr/Makefile.in @@ -0,0 +1,6 @@ +MODULE = vidreszr.dll +IMPORTS = combase mfplat msdmo mfuuid dmoguids strmiids wmcodecdspuuid uuid + +SOURCES = \ + vidreszr.c \ + vidreszr.idl diff --git a/dlls/vidreszr/vidreszr.c b/dlls/vidreszr/vidreszr.c new file mode 100644 index 00000000000..92e4d2c3771 --- /dev/null +++ b/dlls/vidreszr/vidreszr.c @@ -0,0 +1,181 @@ +/* + * 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 "dmoreg.h" +#include "dshow.h" +#include "mfapi.h" +#include "rpcproxy.h" +#include "wmcodecdsp.h" + +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(dmo); + +#include "initguid.h" + +DEFINE_MEDIATYPE_GUID(MFVideoFormat_ABGR32, D3DFMT_A8B8G8R8); +DEFINE_GUID(DMOVideoFormat_RGB32,D3DFMT_X8R8G8B8,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70); +DEFINE_GUID(DMOVideoFormat_RGB24,D3DFMT_R8G8B8,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70); +DEFINE_GUID(DMOVideoFormat_RGB565,D3DFMT_R5G6B5,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70); +DEFINE_GUID(DMOVideoFormat_RGB555,D3DFMT_X1R5G5B5,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70); +DEFINE_GUID(DMOVideoFormat_RGB8,D3DFMT_P8,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70); + +/*********************************************************************** + * DllGetClassObject (msvproc.@) + */ +HRESULT WINAPI DllGetClassObject(REFCLSID clsid, REFIID riid, void **out) +{ + *out = NULL; + FIXME("Unknown clsid %s.\n", debugstr_guid(clsid)); + return CLASS_E_CLASSNOTAVAILABLE; +} + +/*********************************************************************** + * DllRegisterServer (colorcnv.@) + */ +HRESULT WINAPI DllRegisterServer(void) +{ + MFT_REGISTER_TYPE_INFO color_converter_mft_inputs[] = + { + {MFMediaType_Video, MFVideoFormat_YV12}, + {MFMediaType_Video, MFVideoFormat_YUY2}, + {MFMediaType_Video, MFVideoFormat_UYVY}, + {MFMediaType_Video, MFVideoFormat_AYUV}, + {MFMediaType_Video, MFVideoFormat_NV12}, + {MFMediaType_Video, DMOVideoFormat_RGB32}, + {MFMediaType_Video, DMOVideoFormat_RGB565}, + {MFMediaType_Video, MFVideoFormat_I420}, + {MFMediaType_Video, MFVideoFormat_IYUV}, + {MFMediaType_Video, MFVideoFormat_YVYU}, + {MFMediaType_Video, DMOVideoFormat_RGB24}, + {MFMediaType_Video, DMOVideoFormat_RGB555}, + {MFMediaType_Video, DMOVideoFormat_RGB8}, + {MFMediaType_Video, MEDIASUBTYPE_V216}, + {MFMediaType_Video, MEDIASUBTYPE_V410}, + {MFMediaType_Video, MFVideoFormat_NV11}, + {MFMediaType_Video, MFVideoFormat_Y41P}, + {MFMediaType_Video, MFVideoFormat_Y41T}, + {MFMediaType_Video, MFVideoFormat_Y42T}, + {MFMediaType_Video, MFVideoFormat_YVU9}, + }; + MFT_REGISTER_TYPE_INFO color_converter_mft_outputs[] = + { + {MFMediaType_Video, MFVideoFormat_YV12}, + {MFMediaType_Video, MFVideoFormat_YUY2}, + {MFMediaType_Video, MFVideoFormat_UYVY}, + {MFMediaType_Video, MFVideoFormat_AYUV}, + {MFMediaType_Video, MFVideoFormat_NV12}, + {MFMediaType_Video, DMOVideoFormat_RGB32}, + {MFMediaType_Video, DMOVideoFormat_RGB565}, + {MFMediaType_Video, MFVideoFormat_I420}, + {MFMediaType_Video, MFVideoFormat_IYUV}, + {MFMediaType_Video, MFVideoFormat_YVYU}, + {MFMediaType_Video, DMOVideoFormat_RGB24}, + {MFMediaType_Video, DMOVideoFormat_RGB555}, + {MFMediaType_Video, DMOVideoFormat_RGB8}, + {MFMediaType_Video, MEDIASUBTYPE_V216}, + {MFMediaType_Video, MEDIASUBTYPE_V410}, + {MFMediaType_Video, MFVideoFormat_NV11}, + }; + DMO_PARTIAL_MEDIATYPE color_converter_dmo_inputs[] = + { + {.type = MEDIATYPE_Video, .subtype = MEDIASUBTYPE_YV12}, + {.type = MEDIATYPE_Video, .subtype = MEDIASUBTYPE_YUY2}, + {.type = MEDIATYPE_Video, .subtype = MEDIASUBTYPE_UYVY}, + {.type = MEDIATYPE_Video, .subtype = MEDIASUBTYPE_AYUV}, + {.type = MEDIATYPE_Video, .subtype = MEDIASUBTYPE_NV12}, + {.type = MEDIATYPE_Video, .subtype = MEDIASUBTYPE_RGB32}, + {.type = MEDIATYPE_Video, .subtype = MEDIASUBTYPE_RGB565}, + {.type = MEDIATYPE_Video, .subtype = MEDIASUBTYPE_I420}, + {.type = MEDIATYPE_Video, .subtype = MEDIASUBTYPE_IYUV}, + {.type = MEDIATYPE_Video, .subtype = MEDIASUBTYPE_YVYU}, + {.type = MEDIATYPE_Video, .subtype = MEDIASUBTYPE_RGB24}, + {.type = MEDIATYPE_Video, .subtype = MEDIASUBTYPE_RGB555}, + {.type = MEDIATYPE_Video, .subtype = MEDIASUBTYPE_RGB8}, + {.type = MEDIATYPE_Video, .subtype = MEDIASUBTYPE_V216}, + {.type = MEDIATYPE_Video, .subtype = MEDIASUBTYPE_V410}, + {.type = MEDIATYPE_Video, .subtype = MEDIASUBTYPE_NV11}, + {.type = MEDIATYPE_Video, .subtype = MEDIASUBTYPE_Y41P}, + {.type = MEDIATYPE_Video, .subtype = MEDIASUBTYPE_Y41T}, + {.type = MEDIATYPE_Video, .subtype = MEDIASUBTYPE_Y42T}, + {.type = MEDIATYPE_Video, .subtype = MEDIASUBTYPE_YVU9}, + }; + DMO_PARTIAL_MEDIATYPE color_converter_dmo_outputs[] = + { + {.type = MEDIATYPE_Video, .subtype = MEDIASUBTYPE_YV12}, + {.type = MEDIATYPE_Video, .subtype = MEDIASUBTYPE_YUY2}, + {.type = MEDIATYPE_Video, .subtype = MEDIASUBTYPE_UYVY}, + {.type = MEDIATYPE_Video, .subtype = MEDIASUBTYPE_AYUV}, + {.type = MEDIATYPE_Video, .subtype = MEDIASUBTYPE_NV12}, + {.type = MEDIATYPE_Video, .subtype = MEDIASUBTYPE_RGB32}, + {.type = MEDIATYPE_Video, .subtype = MEDIASUBTYPE_RGB565}, + {.type = MEDIATYPE_Video, .subtype = MEDIASUBTYPE_I420}, + {.type = MEDIATYPE_Video, .subtype = MEDIASUBTYPE_IYUV}, + {.type = MEDIATYPE_Video, .subtype = MEDIASUBTYPE_YVYU}, + {.type = MEDIATYPE_Video, .subtype = MEDIASUBTYPE_RGB24}, + {.type = MEDIATYPE_Video, .subtype = MEDIASUBTYPE_RGB555}, + {.type = MEDIATYPE_Video, .subtype = MEDIASUBTYPE_RGB8}, + {.type = MEDIATYPE_Video, .subtype = MEDIASUBTYPE_V216}, + {.type = MEDIATYPE_Video, .subtype = MEDIASUBTYPE_V410}, + {.type = MEDIATYPE_Video, .subtype = MEDIASUBTYPE_NV11}, + }; + HRESULT hr; + + TRACE("\n"); + + if (FAILED(hr = __wine_register_resources())) + return hr; + if (FAILED(hr = MFTRegister(CLSID_CResizerDMO, MFT_CATEGORY_VIDEO_EFFECT, + (WCHAR *)L"Resizer MFT", MFT_ENUM_FLAG_SYNCMFT, + ARRAY_SIZE(color_converter_mft_inputs), color_converter_mft_inputs, + ARRAY_SIZE(color_converter_mft_outputs), color_converter_mft_outputs, NULL))) + return hr; + if (FAILED(hr = DMORegister(L"Resizer DMO", &CLSID_CResizerDMO, &DMOCATEGORY_VIDEO_EFFECT, 0, + ARRAY_SIZE(color_converter_dmo_inputs), color_converter_dmo_inputs, + ARRAY_SIZE(color_converter_dmo_outputs), color_converter_dmo_outputs))) + return hr; + + return S_OK; +} + +/*********************************************************************** + * DllUnregisterServer (colorcnv.@) + */ +HRESULT WINAPI DllUnregisterServer(void) +{ + HRESULT hr; + + TRACE("\n"); + + if (FAILED(hr = __wine_unregister_resources())) + return hr; + if (FAILED(hr = MFTUnregister(CLSID_CResizerDMO))) + return hr; + if (FAILED(hr = DMOUnregister(&CLSID_CResizerDMO, &DMOCATEGORY_VIDEO_EFFECT))) + return hr; + + return S_OK; +} diff --git a/dlls/vidreszr/vidreszr.idl b/dlls/vidreszr/vidreszr.idl new file mode 100644 index 00000000000..8838f188587 --- /dev/null +++ b/dlls/vidreszr/vidreszr.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(1ea1ea14-48f4-4054-ad1a-e8aee10ac805) +] +coclass CResizerDMO {} diff --git a/dlls/vidreszr/vidreszr.spec b/dlls/vidreszr/vidreszr.spec new file mode 100644 index 00000000000..b16365d0c9f --- /dev/null +++ b/dlls/vidreszr/vidreszr.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 ca31af717cf..80a4a062351 100644 --- a/loader/wine.inf.in +++ b/loader/wine.inf.in @@ -702,6 +702,7 @@ HKLM,SOFTWARE\Microsoft\VisualStudio\14.0\VC\Runtimes\x86,"Version",2,"14.42.344 11,,qedit.dll,1 11,,resampledmo.dll,1 11,,urlmon.dll,1 +11,,vidreszr.dll,1 11,,windowscodecs.dll,1 11,,winegstreamer.dll,1 55,,wineps.drv,1 -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/9565
Similar to !6430 but without `DllGetClassObject` returning classes stubs. LGTM -- https://gitlab.winehq.org/wine/wine/-/merge_requests/9565#note_123432
participants (2)
-
Loïc Rebmeister -
Rémi Bernon