From: Brendan McGrath <bmcgrath@codeweavers.com> --- configure.ac | 1 + dlls/iyuv_32/Makefile.in | 6 ++ dlls/iyuv_32/iyuv.c | 184 ++++++++++++++++++++++++++++++++++++ dlls/iyuv_32/iyuv_32.rc | 29 ++++++ dlls/iyuv_32/iyuv_32.spec | 1 + dlls/iyuv_32/iyuv_private.h | 34 +++++++ loader/wine.inf.in | 2 + 7 files changed, 257 insertions(+) create mode 100644 dlls/iyuv_32/Makefile.in create mode 100644 dlls/iyuv_32/iyuv.c create mode 100644 dlls/iyuv_32/iyuv_32.rc create mode 100644 dlls/iyuv_32/iyuv_32.spec create mode 100644 dlls/iyuv_32/iyuv_private.h diff --git a/configure.ac b/configure.ac index 9a437851996..953edcce7b9 100644 --- a/configure.ac +++ b/configure.ac @@ -2880,6 +2880,7 @@ WINE_CONFIG_MAKEFILE(dlls/irprops.cpl) WINE_CONFIG_MAKEFILE(dlls/itircl) WINE_CONFIG_MAKEFILE(dlls/itss) WINE_CONFIG_MAKEFILE(dlls/itss/tests) +WINE_CONFIG_MAKEFILE(dlls/iyuv_32) WINE_CONFIG_MAKEFILE(dlls/joy.cpl) WINE_CONFIG_MAKEFILE(dlls/jscript) WINE_CONFIG_MAKEFILE(dlls/jscript/tests) diff --git a/dlls/iyuv_32/Makefile.in b/dlls/iyuv_32/Makefile.in new file mode 100644 index 00000000000..c386ec9b924 --- /dev/null +++ b/dlls/iyuv_32/Makefile.in @@ -0,0 +1,6 @@ +MODULE = iyuv_32.dll +IMPORTS = user32 mfplat ole32 + +SOURCES = \ + iyuv.c \ + iyuv_32.rc diff --git a/dlls/iyuv_32/iyuv.c b/dlls/iyuv_32/iyuv.c new file mode 100644 index 00000000000..d1ebd4d383a --- /dev/null +++ b/dlls/iyuv_32/iyuv.c @@ -0,0 +1,184 @@ +/* + * iyuv Video "Decoder" + * Copyright 2026 Brendan McGrath 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 <stdarg.h> +#include <stdlib.h> +#include "windef.h" +#include "winbase.h" +#include "wingdi.h" +#include "winuser.h" +#include "commdlg.h" +#include "vfw.h" +#include "initguid.h" +#include "wmcodecdsp.h" +#include "iyuv_private.h" + +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(iyuv_32); + +static HINSTANCE IYUV_32_hModule; + +static LRESULT IYUV_Open( const ICINFO *icinfo ) +{ + FIXME("DRV_OPEN %p\n", icinfo); + + return 0; +} + +static LRESULT IYUV_DecompressQuery( const BITMAPINFOHEADER *in, const BITMAPINFOHEADER *out ) +{ + FIXME("ICM_DECOMPRESS_QUERY %p %p\n", in, out); + + return ICERR_UNSUPPORTED; +} + +static LRESULT IYUV_DecompressGetFormat( BITMAPINFOHEADER *in, BITMAPINFOHEADER *out ) +{ + FIXME("ICM_DECOMPRESS_GETFORMAT %p %p\n", in, out); + + return ICERR_UNSUPPORTED; +} + +static LRESULT IYUV_DecompressBegin( IMFTransform *transform, const BITMAPINFOHEADER *in, const BITMAPINFOHEADER *out ) +{ + FIXME("ICM_DECOMPRESS_BEGIN %p %p %p\n", transform, in, out); + + return ICERR_UNSUPPORTED; +} + +static LRESULT IYUV_Decompress( IMFTransform *transform, const ICDECOMPRESS *params ) +{ + FIXME("ICM_DECOMPRESS %p %p\n", transform, params); + + return ICERR_UNSUPPORTED; +} + +static LRESULT IYUV_GetInfo( ICINFO *icinfo, DWORD dwSize ) +{ + FIXME("ICM_GETINFO %p %lu\n", icinfo, dwSize); + + return ICERR_UNSUPPORTED; +} + +/*********************************************************************** + * DriverProc (IYUV_32.@) + */ +LRESULT WINAPI IYUV_DriverProc( DWORD_PTR dwDriverId, HDRVR hdrvr, UINT msg, + LPARAM lParam1, LPARAM lParam2 ) +{ + IMFTransform *transform = (IMFTransform *) dwDriverId; + LRESULT r = ICERR_UNSUPPORTED; + + TRACE("%Id %p %04x %08Ix %08Ix\n", dwDriverId, hdrvr, msg, lParam1, lParam2); + + switch( msg ) + { + case DRV_LOAD: + TRACE("DRV_LOAD\n"); + r = TRUE; + break; + + case DRV_OPEN: + r = IYUV_Open((ICINFO *)lParam2); + break; + + case DRV_CLOSE: + TRACE("DRV_CLOSE\n"); + if ( transform ) + IMFTransform_Release( transform ); + r = TRUE; + break; + + case DRV_ENABLE: + case DRV_DISABLE: + case DRV_FREE: + break; + + case ICM_GETINFO: + r = IYUV_GetInfo( (ICINFO *) lParam1, (DWORD) lParam2 ); + break; + + case ICM_DECOMPRESS_QUERY: + r = IYUV_DecompressQuery( (BITMAPINFOHEADER *)lParam1, (BITMAPINFOHEADER *)lParam2 ); + break; + + case ICM_DECOMPRESS_GET_FORMAT: + r = IYUV_DecompressGetFormat( (BITMAPINFOHEADER*) lParam1, (BITMAPINFOHEADER*) lParam2 ); + break; + + case ICM_DECOMPRESS_GET_PALETTE: + FIXME("ICM_DECOMPRESS_GET_PALETTE\n"); + break; + + case ICM_DECOMPRESS: + r = IYUV_Decompress( transform, (ICDECOMPRESS *)lParam1 ); + break; + + case ICM_DECOMPRESS_BEGIN: + r = IYUV_DecompressBegin( transform, (BITMAPINFOHEADER *)lParam1, (BITMAPINFOHEADER *)lParam2 ); + break; + + case ICM_DECOMPRESS_END: + r = ICERR_OK; + break; + + case ICM_DECOMPRESSEX_QUERY: + case ICM_DECOMPRESSEX_BEGIN: + case ICM_DECOMPRESSEX: + case ICM_DECOMPRESSEX_END: + /* unsupported */ + break; + + case ICM_COMPRESS_QUERY: + r = ICERR_BADFORMAT; + /* fall through */ + case ICM_COMPRESS_GET_FORMAT: + case ICM_COMPRESS_END: + case ICM_COMPRESS: + FIXME("compression not implemented\n"); + break; + + case ICM_CONFIGURE: + break; + + default: + FIXME("Unknown message: %04x %Id %Id\n", msg, lParam1, lParam2); + } + + return r; +} + +/*********************************************************************** + * DllMain + */ +BOOL WINAPI DllMain(HINSTANCE hModule, DWORD dwReason, LPVOID lpReserved) +{ + TRACE("(%p,%lu,%p)\n", hModule, dwReason, lpReserved); + + switch (dwReason) + { + case DLL_PROCESS_ATTACH: + DisableThreadLibraryCalls(hModule); + IYUV_32_hModule = hModule; + break; + } + return TRUE; +} diff --git a/dlls/iyuv_32/iyuv_32.rc b/dlls/iyuv_32/iyuv_32.rc new file mode 100644 index 00000000000..a9705a2bd76 --- /dev/null +++ b/dlls/iyuv_32/iyuv_32.rc @@ -0,0 +1,29 @@ +/* + * Copyright 2026 Brendan McGrath 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 "iyuv_private.h" + +#pragma makedep po + +LANGUAGE LANG_ENGLISH, SUBLANG_DEFAULT + +STRINGTABLE +{ + IDS_NAME "IYUV codec" + IDS_DESCRIPTION "IYUV codec" +} diff --git a/dlls/iyuv_32/iyuv_32.spec b/dlls/iyuv_32/iyuv_32.spec new file mode 100644 index 00000000000..a0c64b96696 --- /dev/null +++ b/dlls/iyuv_32/iyuv_32.spec @@ -0,0 +1 @@ +@ stdcall -private DriverProc(long long long long long) IYUV_DriverProc diff --git a/dlls/iyuv_32/iyuv_private.h b/dlls/iyuv_32/iyuv_private.h new file mode 100644 index 00000000000..00b5a577c9f --- /dev/null +++ b/dlls/iyuv_32/iyuv_private.h @@ -0,0 +1,34 @@ +/* + * Copyright 2026 Brendan McGrath 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 + */ + +#ifndef __IYUV_PRIVATE_H +#define __IYUV_PRIVATE_H + +#include "windef.h" + +#define COBJMACROS +#include "mfapi.h" +#include "mferror.h" +#include "mfobjects.h" +#include "mfidl.h" +#include "mftransform.h" + +#define IDS_NAME 100 +#define IDS_DESCRIPTION 101 + +#endif /* __IYUV_PRIVATE_H */ diff --git a/loader/wine.inf.in b/loader/wine.inf.in index 8c58fb781e4..fc3f085e68b 100644 --- a/loader/wine.inf.in +++ b/loader/wine.inf.in @@ -887,6 +887,8 @@ system.ini, drivers32,,"vidc.mrle=msrle32.dll" system.ini, drivers32,,"vidc.msvc=msvidc32.dll" system.ini, drivers32,,"vidc.cvid=iccvid.dll" system.ini, drivers32,,"vidc.IV50=ir50_32.dll" +system.ini, drivers32,,"vidc.i420=iyuv_32.dll" +system.ini, drivers32,,"vidc.iyuv=iyuv_32.dll" system.ini, drivers32,,"; vidc.IV31=ir32_32.dll" system.ini, drivers32,,"; vidc.IV32=ir32_32.dll" -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/10467