From: Rémi Bernon rbernon@codeweavers.com
--- dlls/msmpeg2vdec/Makefile.in | 6 +- dlls/msmpeg2vdec/msmpeg2vdec.c | 88 ++++++++++++++++++++ dlls/msmpeg2vdec/{main.c => msmpeg2vdec.idl} | 16 ++-- dlls/winegstreamer/mfplat.c | 27 +----- dlls/winegstreamer/winegstreamer_classes.idl | 4 +- dlls/wmvdecod/video_decoder.c | 18 ++++ dlls/wmvdecod/video_decoder.h | 1 + loader/wine.inf.in | 1 + 8 files changed, 124 insertions(+), 37 deletions(-) create mode 100644 dlls/msmpeg2vdec/msmpeg2vdec.c rename dlls/msmpeg2vdec/{main.c => msmpeg2vdec.idl} (70%)
diff --git a/dlls/msmpeg2vdec/Makefile.in b/dlls/msmpeg2vdec/Makefile.in index 74a2cdffceb..efbcb6aa238 100644 --- a/dlls/msmpeg2vdec/Makefile.in +++ b/dlls/msmpeg2vdec/Makefile.in @@ -1,4 +1,8 @@ MODULE = msmpeg2vdec.dll +IMPORTS = combase mfplat mfuuid dmoguids strmiids wmcodecdspuuid uuid +PARENTSRC = ../wmvdecod
SOURCES = \ - main.c + msmpeg2vdec.c \ + msmpeg2vdec.idl \ + video_decoder.c diff --git a/dlls/msmpeg2vdec/msmpeg2vdec.c b/dlls/msmpeg2vdec/msmpeg2vdec.c new file mode 100644 index 00000000000..2bb07296dbf --- /dev/null +++ b/dlls/msmpeg2vdec/msmpeg2vdec.c @@ -0,0 +1,88 @@ +/* + * 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 "video_decoder.h" + +#include "rpcproxy.h" + +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(dmo); + +/*********************************************************************** + * DllGetClassObject (msmpeg2vdec.@) + */ +HRESULT WINAPI DllGetClassObject(REFCLSID clsid, REFIID riid, void **out) +{ + if (IsEqualGUID(clsid, &CLSID_MSH264DecoderMFT)) + return IClassFactory_QueryInterface(&h264_decoder_factory, riid, out); + + *out = NULL; + FIXME("Unknown clsid %s.\n", debugstr_guid(clsid)); + return CLASS_E_CLASSNOTAVAILABLE; +} + +/*********************************************************************** + * DllRegisterServer (msmpeg2vdec.@) + */ +HRESULT WINAPI DllRegisterServer(void) +{ + MFT_REGISTER_TYPE_INFO h264_decoder_mft_inputs[] = + { + {MFMediaType_Video, MFVideoFormat_H264}, + {MFMediaType_Video, MFVideoFormat_H264_ES}, + }; + MFT_REGISTER_TYPE_INFO h264_decoder_mft_outputs[] = + { + {MFMediaType_Video, MFVideoFormat_NV12}, + {MFMediaType_Video, MFVideoFormat_YV12}, + {MFMediaType_Video, MFVideoFormat_IYUV}, + {MFMediaType_Video, MFVideoFormat_I420}, + {MFMediaType_Video, MFVideoFormat_YUY2}, + }; + HRESULT hr; + + TRACE("\n"); + + if (FAILED(hr = __wine_register_resources())) + return hr; + if (FAILED(hr = MFTRegister(CLSID_MSH264DecoderMFT, MFT_CATEGORY_VIDEO_DECODER, + (WCHAR *)L"Microsoft H264 Video Decoder MFT", MFT_ENUM_FLAG_SYNCMFT, + ARRAY_SIZE(h264_decoder_mft_inputs), h264_decoder_mft_inputs, + ARRAY_SIZE(h264_decoder_mft_outputs), h264_decoder_mft_outputs, NULL))) + return hr; + + return S_OK; +} + +/*********************************************************************** + * DllUnregisterServer (msmpeg2vdec.@) + */ +HRESULT WINAPI DllUnregisterServer(void) +{ + HRESULT hr; + + TRACE("\n"); + + if (FAILED(hr = __wine_unregister_resources())) + return hr; + if (FAILED(hr = MFTUnregister(CLSID_MSH264DecoderMFT))) + return hr; + + return S_OK; +} diff --git a/dlls/msmpeg2vdec/main.c b/dlls/msmpeg2vdec/msmpeg2vdec.idl similarity index 70% rename from dlls/msmpeg2vdec/main.c rename to dlls/msmpeg2vdec/msmpeg2vdec.idl index 0ff52f5d1cb..f2ddcdef819 100644 --- a/dlls/msmpeg2vdec/main.c +++ b/dlls/msmpeg2vdec/msmpeg2vdec.idl @@ -1,5 +1,5 @@ /* - * Copyright (C) 2023 Mohamad Al-Jaf + * 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 @@ -16,12 +16,10 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */
-#include "wine/debug.h" +#pragma makedep register
-WINE_DEFAULT_DEBUG_CHANNEL(msmpeg2vdec); - -HRESULT WINAPI DllGetClassObject( REFCLSID clsid, REFIID riid, void **out ) -{ - FIXME( "clsid %s, riid %s, out %p stub!\n", debugstr_guid(clsid), debugstr_guid(riid), out ); - return CLASS_E_CLASSNOTAVAILABLE; -} +[ + threading(both), + uuid(62ce7e72-4c71-4d20-b15d-452831a87d9d) +] +coclass CMSH264DecoderMFT {} diff --git a/dlls/winegstreamer/mfplat.c b/dlls/winegstreamer/mfplat.c index 0e3aed20efa..2b627ffc706 100644 --- a/dlls/winegstreamer/mfplat.c +++ b/dlls/winegstreamer/mfplat.c @@ -123,6 +123,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 GUID CLSID_wg_aac_decoder = {0xe7889a8a,0x2083,0x4844,{0x83,0x70,0x5e,0xe3,0x49,0xb1,0x45,0x03}}; +static const GUID CLSID_wg_h264_decoder = {0x1f1e273d,0x12c0,0x4b3a,{0x8e,0x9b,0x19,0x33,0xc2,0x49,0x8a,0xea}};
static const struct class_object { @@ -134,7 +135,7 @@ class_objects[] = { &CLSID_wg_video_processor, &video_processor_create }, { &CLSID_GStreamerByteStreamHandler, &gstreamer_byte_stream_handler_create }, { &CLSID_wg_aac_decoder, &aac_decoder_create }, - { &CLSID_MSH264DecoderMFT, &h264_decoder_create }, + { &CLSID_wg_h264_decoder, &h264_decoder_create }, { &CLSID_MSH264EncoderMFT, &h264_encoder_create }, };
@@ -166,20 +167,6 @@ HRESULT mfplat_get_class_object(REFCLSID rclsid, REFIID riid, void **obj)
HRESULT mfplat_DllRegisterServer(void) { - MFT_REGISTER_TYPE_INFO h264_decoder_input_types[] = - { - {MFMediaType_Video, MFVideoFormat_H264}, - {MFMediaType_Video, MFVideoFormat_H264_ES}, - }; - MFT_REGISTER_TYPE_INFO h264_decoder_output_types[] = - { - {MFMediaType_Video, MFVideoFormat_NV12}, - {MFMediaType_Video, MFVideoFormat_YV12}, - {MFMediaType_Video, MFVideoFormat_IYUV}, - {MFMediaType_Video, MFVideoFormat_I420}, - {MFMediaType_Video, MFVideoFormat_YUY2}, - }; - MFT_REGISTER_TYPE_INFO h264_encoder_input_types[] = { {MFMediaType_Video, MFVideoFormat_IYUV}, @@ -205,16 +192,6 @@ HRESULT mfplat_DllRegisterServer(void) } mfts[] = { - { - CLSID_MSH264DecoderMFT, - MFT_CATEGORY_VIDEO_DECODER, - L"Microsoft H264 Video Decoder MFT", - MFT_ENUM_FLAG_SYNCMFT, - ARRAY_SIZE(h264_decoder_input_types), - h264_decoder_input_types, - ARRAY_SIZE(h264_decoder_output_types), - h264_decoder_output_types, - }, { CLSID_MSH264EncoderMFT, MFT_CATEGORY_VIDEO_ENCODER, diff --git a/dlls/winegstreamer/winegstreamer_classes.idl b/dlls/winegstreamer/winegstreamer_classes.idl index ba848b5a837..f030a11875a 100644 --- a/dlls/winegstreamer/winegstreamer_classes.idl +++ b/dlls/winegstreamer/winegstreamer_classes.idl @@ -103,9 +103,9 @@ coclass wg_wmv_decoder {}
[ threading(both), - uuid(62ce7e72-4c71-4d20-b15d-452831a87d9d) + uuid(1f1e273d-12c0-4b3a-8e9b-1933c2498aea) ] -coclass CMSH264DecoderMFT {} +coclass wg_h264_decoder {}
[ threading(both), diff --git a/dlls/wmvdecod/video_decoder.c b/dlls/wmvdecod/video_decoder.c index 1b0ba9d972a..7c4c0ddd683 100644 --- a/dlls/wmvdecod/video_decoder.c +++ b/dlls/wmvdecod/video_decoder.c @@ -23,6 +23,24 @@ DEFINE_MEDIATYPE_GUID(MEDIASUBTYPE_VC1S,MAKEFOURCC('V','C','1','S')); DEFINE_GUID(MEDIASUBTYPE_WMV_Unknown, 0x7ce12ca9,0xbfbf,0x43d9,0x9d,0x00,0x82,0xb8,0xed,0x54,0x31,0x6b);
+static HRESULT WINAPI h264_decoder_factory_CreateInstance(IClassFactory *iface, IUnknown *outer, + REFIID riid, void **out) +{ + static const GUID CLSID_wg_h264_decoder = {0x1f1e273d,0x12c0,0x4b3a,{0x8e,0x9b,0x19,0x33,0xc2,0x49,0x8a,0xea}}; + return CoCreateInstance(&CLSID_wg_h264_decoder, outer, CLSCTX_INPROC_SERVER, riid, out); +} + +static const IClassFactoryVtbl h264_decoder_factory_vtbl = +{ + class_factory_QueryInterface, + class_factory_AddRef, + class_factory_Release, + h264_decoder_factory_CreateInstance, + class_factory_LockServer, +}; + +IClassFactory h264_decoder_factory = {&h264_decoder_factory_vtbl}; + static HRESULT WINAPI wmv_decoder_factory_CreateInstance(IClassFactory *iface, IUnknown *outer, REFIID riid, void **out) { diff --git a/dlls/wmvdecod/video_decoder.h b/dlls/wmvdecod/video_decoder.h index bd426de3600..3784eda4684 100644 --- a/dlls/wmvdecod/video_decoder.h +++ b/dlls/wmvdecod/video_decoder.h @@ -29,6 +29,7 @@ #include "mfidl.h" #include "wmcodecdsp.h"
+extern IClassFactory h264_decoder_factory; extern IClassFactory wmv_decoder_factory;
static inline HRESULT WINAPI class_factory_QueryInterface(IClassFactory *iface, REFIID riid, void **out) diff --git a/loader/wine.inf.in b/loader/wine.inf.in index 1777c17ac77..096257904a9 100644 --- a/loader/wine.inf.in +++ b/loader/wine.inf.in @@ -2114,6 +2114,7 @@ HKLM,%CurrentVersion%\Telephony\Country List\998,"SameAreaRule",,"G" 11,,mscoree.dll,1 11,,mshtml.dll,1 11,,msisip.dll,1 +11,,msmpeg2vdec.dll,1 11,,msvproc.dll,1 11,,qcap.dll,1 11,,qedit.dll,1