msvproc: Register the Video Processor MFT class.

This commit is contained in:
Rémi Bernon 2024-08-23 00:42:18 +02:00 committed by Alexandre Julliard
parent ef4cd564a9
commit d8cfc9c474
Notes: Alexandre Julliard 2024-09-03 23:30:11 +02:00
Approved-by: Alexandre Julliard (@julliard)
Merge-Request: https://gitlab.winehq.org/wine/wine/merge_requests/6430
9 changed files with 217 additions and 63 deletions

2
configure vendored
View file

@ -1319,6 +1319,7 @@ enable_msvcrt40
enable_msvcrtd
enable_msvfw32
enable_msvidc32
enable_msvproc
enable_mswsock
enable_msxml
enable_msxml2
@ -22470,6 +22471,7 @@ wine_fn_config_makefile dlls/msvfw32 enable_msvfw32
wine_fn_config_makefile dlls/msvfw32/tests enable_tests
wine_fn_config_makefile dlls/msvidc32 enable_msvidc32
wine_fn_config_makefile dlls/msvideo.dll16 enable_win16
wine_fn_config_makefile dlls/msvproc enable_msvproc
wine_fn_config_makefile dlls/mswsock enable_mswsock
wine_fn_config_makefile dlls/msxml enable_msxml
wine_fn_config_makefile dlls/msxml2 enable_msxml2

View file

@ -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)

6
dlls/msvproc/Makefile.in Normal file
View file

@ -0,0 +1,6 @@
MODULE = msvproc.dll
IMPORTS = combase mfplat mfuuid dmoguids dxguid strmiids wmcodecdspuuid uuid
SOURCES = \
msvproc.c \
msvproc.idl

174
dlls/msvproc/msvproc.c Normal file
View file

@ -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;
}

25
dlls/msvproc/msvproc.idl Normal file
View file

@ -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 {}

View file

@ -0,0 +1,4 @@
@ stdcall -private DllCanUnloadNow()
@ stdcall -private DllGetClassObject(ptr ptr ptr)
@ stdcall -private DllRegisterServer()
@ stdcall -private DllUnregisterServer()

View file

@ -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,

View file

@ -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"),

View file

@ -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