mirror of
https://gitlab.winehq.org/wine/wine.git
synced 2024-11-19 17:06:04 -07:00
msmpeg2vdec: Register the H264 Decoder MFT class.
This commit is contained in:
parent
2d92d14de5
commit
23d303e8ee
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
8 changed files with 124 additions and 37 deletions
|
@ -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
|
||||
|
|
88
dlls/msmpeg2vdec/msmpeg2vdec.c
Normal file
88
dlls/msmpeg2vdec/msmpeg2vdec.c
Normal file
|
@ -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;
|
||||
}
|
|
@ -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 {}
|
|
@ -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,
|
||||
|
|
|
@ -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),
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue