msauddecmft: Register the AAC Decoder MFT class.

This commit is contained in:
Rémi Bernon 2024-08-22 21:28:23 +02:00 committed by Alexandre Julliard
parent a01e9eed6b
commit 77e3acd5c4
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
6 changed files with 148 additions and 35 deletions

View file

@ -1,4 +1,6 @@
MODULE = msauddecmft.dll
IMPORTS = combase mfplat mfuuid dmoguids strmiids wmcodecdspuuid uuid
SOURCES = \
main.c
msauddecmft.c \
msauddecmft.idl

View file

@ -0,0 +1,133 @@
/*
* 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 "mfapi.h"
#include "mfidl.h"
#include "rpcproxy.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(dmo);
#include "initguid.h"
DEFINE_MEDIATYPE_GUID(MFAudioFormat_RAW_AAC,WAVE_FORMAT_RAW_AAC1);
static HRESULT WINAPI aac_decoder_factory_CreateInstance(IClassFactory *iface, IUnknown *outer,
REFIID riid, void **out)
{
static const GUID CLSID_wg_aac_decoder = {0xe7889a8a,0x2083,0x4844,{0x83,0x70,0x5e,0xe3,0x49,0xb1,0x45,0x03}};
return CoCreateInstance(&CLSID_wg_aac_decoder, 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 aac_decoder_factory_vtbl =
{
class_factory_QueryInterface,
class_factory_AddRef,
class_factory_Release,
aac_decoder_factory_CreateInstance,
class_factory_LockServer,
};
static IClassFactory aac_decoder_factory = {&aac_decoder_factory_vtbl};
/***********************************************************************
* DllGetClassObject (msauddecmft.@)
*/
HRESULT WINAPI DllGetClassObject(REFCLSID clsid, REFIID riid, void **out)
{
if (IsEqualGUID(clsid, &CLSID_MSAACDecMFT))
return IClassFactory_QueryInterface(&aac_decoder_factory, riid, out);
*out = NULL;
FIXME("Unknown clsid %s.\n", debugstr_guid(clsid));
return CLASS_E_CLASSNOTAVAILABLE;
}
/***********************************************************************
* DllRegisterServer (msauddecmft.@)
*/
HRESULT WINAPI DllRegisterServer(void)
{
MFT_REGISTER_TYPE_INFO aac_decoder_mft_inputs[] =
{
{MFMediaType_Audio, MFAudioFormat_AAC},
{MFMediaType_Audio, MFAudioFormat_RAW_AAC},
{MFMediaType_Audio, MFAudioFormat_ADTS},
};
MFT_REGISTER_TYPE_INFO aac_decoder_mft_outputs[] =
{
{MFMediaType_Audio, MFAudioFormat_Float},
{MFMediaType_Audio, MFAudioFormat_PCM},
};
HRESULT hr;
TRACE("\n");
if (FAILED(hr = __wine_register_resources()))
return hr;
if (FAILED(hr = MFTRegister(CLSID_MSAACDecMFT, MFT_CATEGORY_AUDIO_DECODER,
(WCHAR *)L"Microsoft AAC Audio Decoder MFT", MFT_ENUM_FLAG_SYNCMFT,
ARRAY_SIZE(aac_decoder_mft_inputs), aac_decoder_mft_inputs,
ARRAY_SIZE(aac_decoder_mft_outputs), aac_decoder_mft_outputs, NULL)))
return hr;
return S_OK;
}
/***********************************************************************
* DllUnregisterServer (msauddecmft.@)
*/
HRESULT WINAPI DllUnregisterServer(void)
{
HRESULT hr;
TRACE("\n");
if (FAILED(hr = __wine_unregister_resources()))
return hr;
if (FAILED(hr = MFTUnregister(CLSID_MSAACDecMFT)))
return hr;
return S_OK;
}

View file

@ -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(msauddecmft);
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(32d186a7-218f-4c75-8876-dd77273a8999)
]
coclass CMSAACDecMFT {}

View file

@ -122,6 +122,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 struct class_object
{
@ -132,7 +133,7 @@ class_objects[] =
{
{ &CLSID_wg_video_processor, &video_processor_create },
{ &CLSID_GStreamerByteStreamHandler, &gstreamer_byte_stream_handler_create },
{ &CLSID_MSAACDecMFT, &aac_decoder_create },
{ &CLSID_wg_aac_decoder, &aac_decoder_create },
{ &CLSID_MSH264DecoderMFT, &h264_decoder_create },
{ &CLSID_MSH264EncoderMFT, &h264_encoder_create },
};
@ -165,18 +166,6 @@ HRESULT mfplat_get_class_object(REFCLSID rclsid, REFIID riid, void **obj)
HRESULT mfplat_DllRegisterServer(void)
{
MFT_REGISTER_TYPE_INFO aac_decoder_input_types[] =
{
{MFMediaType_Audio, MFAudioFormat_AAC},
{MFMediaType_Audio, MFAudioFormat_RAW_AAC},
{MFMediaType_Audio, MFAudioFormat_ADTS},
};
MFT_REGISTER_TYPE_INFO aac_decoder_output_types[] =
{
{MFMediaType_Audio, MFAudioFormat_Float},
{MFMediaType_Audio, MFAudioFormat_PCM},
};
MFT_REGISTER_TYPE_INFO h264_decoder_input_types[] =
{
{MFMediaType_Video, MFVideoFormat_H264},
@ -243,16 +232,6 @@ HRESULT mfplat_DllRegisterServer(void)
}
mfts[] =
{
{
CLSID_MSAACDecMFT,
MFT_CATEGORY_AUDIO_DECODER,
L"Microsoft AAC Audio Decoder MFT",
MFT_ENUM_FLAG_SYNCMFT,
ARRAY_SIZE(aac_decoder_input_types),
aac_decoder_input_types,
ARRAY_SIZE(aac_decoder_output_types),
aac_decoder_output_types,
},
{
CLSID_MSH264DecoderMFT,
MFT_CATEGORY_VIDEO_DECODER,

View file

@ -91,9 +91,9 @@ coclass wg_wma_decoder {};
[
threading(both),
uuid(32d186a7-218f-4c75-8876-dd77273a8999)
uuid(e7889a8a-2083-4844-8370-5ee349b14503)
]
coclass CMSAACDecMFT {}
coclass wg_aac_decoder {}
[
threading(both),

View file

@ -2110,6 +2110,7 @@ HKLM,%CurrentVersion%\Telephony\Country List\998,"SameAreaRule",,"G"
11,,mfasfsrcsnk.dll,1
11,,mfmp4srcsnk.dll,1
11,,mp3dmod.dll,1
11,,msauddecmft.dll,1
11,,mscoree.dll,1
11,,mshtml.dll,1
11,,msisip.dll,1