Commit a7508d54 authored by Rémi Bernon's avatar Rémi Bernon Committed by Alexandre Julliard

winegstreamer: Stub implement WMA decoder DMO / MF transform.

Final Fantasy XIV intro videos require media_object_GetStreamCount and property_bag_Write to return S_OK in order to not get stuck. This could be done in a separate commit but would cause a temporary regression. Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51931 Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=52391Signed-off-by: 's avatarRémi Bernon <rbernon@codeweavers.com> Signed-off-by: 's avatarZebediah Figura <zfigura@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent adda27cd
......@@ -5743,7 +5743,6 @@ static void test_wma_decoder(void)
&transform, &class_id))
goto failed;
todo_wine
check_interface(transform, &IID_IMediaObject, TRUE);
/* check default media types */
......
......@@ -2,7 +2,7 @@ EXTRADEFS = -DWINE_NO_LONG_TYPES
MODULE = winegstreamer.dll
UNIXLIB = winegstreamer.so
IMPORTLIB = winegstreamer
IMPORTS = strmbase ole32
IMPORTS = strmbase ole32 msdmo
DELAYIMPORTS = mfplat
EXTRAINCL = $(GSTREAMER_CFLAGS)
EXTRALIBS = $(GSTREAMER_LIBS) $(PTHREAD_LIBS)
......@@ -16,7 +16,8 @@ C_SRCS = \
wg_parser.c \
wm_asyncreader.c \
wm_reader.c \
wm_syncreader.c
wm_syncreader.c \
wma_decoder.c
IDL_SRCS = \
winegstreamer_classes.idl
......
......@@ -102,6 +102,7 @@ HRESULT avi_splitter_create(IUnknown *outer, IUnknown **out) DECLSPEC_HIDDEN;
HRESULT decodebin_parser_create(IUnknown *outer, IUnknown **out) DECLSPEC_HIDDEN;
HRESULT mpeg_splitter_create(IUnknown *outer, IUnknown **out) DECLSPEC_HIDDEN;
HRESULT wave_parser_create(IUnknown *outer, IUnknown **out) DECLSPEC_HIDDEN;
HRESULT wma_decoder_create(IUnknown *outer, IUnknown **out) DECLSPEC_HIDDEN;
bool amt_from_wg_format(AM_MEDIA_TYPE *mt, const struct wg_format *format, bool wm);
bool amt_to_wg_format(const AM_MEDIA_TYPE *mt, struct wg_format *format);
......
......@@ -25,7 +25,9 @@
#include "gst_private.h"
#include "winternl.h"
#include "rpcproxy.h"
#include "dmoreg.h"
#include "gst_guids.h"
#include "wmcodecdsp.h"
static unixlib_handle_t unix_handle;
......@@ -339,6 +341,7 @@ static struct class_factory avi_splitter_cf = {{&class_factory_vtbl}, avi_splitt
static struct class_factory decodebin_parser_cf = {{&class_factory_vtbl}, decodebin_parser_create};
static struct class_factory mpeg_splitter_cf = {{&class_factory_vtbl}, mpeg_splitter_create};
static struct class_factory wave_parser_cf = {{&class_factory_vtbl}, wave_parser_create};
static struct class_factory wma_decoder_cf = {{&class_factory_vtbl}, wma_decoder_create};
HRESULT WINAPI DllGetClassObject(REFCLSID clsid, REFIID iid, void **out)
{
......@@ -361,6 +364,8 @@ HRESULT WINAPI DllGetClassObject(REFCLSID clsid, REFIID iid, void **out)
factory = &mpeg_splitter_cf;
else if (IsEqualGUID(clsid, &CLSID_WAVEParser))
factory = &wave_parser_cf;
else if (IsEqualGUID(clsid, &CLSID_WMADecMediaObject))
factory = &wma_decoder_cf;
else
{
FIXME("%s not implemented, returning CLASS_E_CLASSNOTAVAILABLE.\n", debugstr_guid(clsid));
......@@ -522,6 +527,19 @@ static const REGFILTER2 reg_decodebin_parser =
HRESULT WINAPI DllRegisterServer(void)
{
DMO_PARTIAL_MEDIATYPE wma_decoder_output[2] =
{
{.type = MEDIATYPE_Audio, .subtype = MEDIASUBTYPE_PCM},
{.type = MEDIATYPE_Audio, .subtype = MEDIASUBTYPE_IEEE_FLOAT},
};
DMO_PARTIAL_MEDIATYPE wma_decoder_input[4] =
{
{.type = MEDIATYPE_Audio, .subtype = MEDIASUBTYPE_MSAUDIO1},
{.type = MEDIATYPE_Audio, .subtype = MEDIASUBTYPE_WMAUDIO2},
{.type = MEDIATYPE_Audio, .subtype = MEDIASUBTYPE_WMAUDIO3},
{.type = MEDIATYPE_Audio, .subtype = MEDIASUBTYPE_WMAUDIO_LOSSLESS},
};
IFilterMapper2 *mapper;
HRESULT hr;
......@@ -543,6 +561,10 @@ HRESULT WINAPI DllRegisterServer(void)
IFilterMapper2_Release(mapper);
if (FAILED(hr = DMORegister(L"WMA Decoder DMO", &CLSID_WMADecMediaObject, &DMOCATEGORY_AUDIO_DECODER,
0, ARRAY_SIZE(wma_decoder_input), wma_decoder_input, ARRAY_SIZE(wma_decoder_output), wma_decoder_output)))
return hr;
return mfplat_DllRegisterServer();
}
......@@ -566,5 +588,9 @@ HRESULT WINAPI DllUnregisterServer(void)
IFilterMapper2_UnregisterFilter(mapper, NULL, NULL, &CLSID_WAVEParser);
IFilterMapper2_Release(mapper);
if (FAILED(hr = DMOUnregister(&CLSID_WMADecMediaObject, &DMOCATEGORY_AUDIO_DECODER)))
return hr;
return S_OK;
}
......@@ -21,6 +21,7 @@
#include "ks.h"
#include "ksmedia.h"
#include "wmcodecdsp.h"
#include "initguid.h"
#include "mfapi.h"
......@@ -442,6 +443,20 @@ static const GUID *audio_converter_supported_types[] =
&MFAudioFormat_Float,
};
static WCHAR wma_decoderW[] = L"WMAudio Decoder MFT";
static const GUID *wma_decoder_input_types[] =
{
&MEDIASUBTYPE_MSAUDIO1,
&MFAudioFormat_WMAudioV8,
&MFAudioFormat_WMAudioV9,
&MFAudioFormat_WMAudio_Lossless,
};
static const GUID *wma_decoder_output_types[] =
{
&MFAudioFormat_PCM,
&MFAudioFormat_Float,
};
static const struct mft
{
const GUID *clsid;
......@@ -467,13 +482,24 @@ mfts[] =
ARRAY_SIZE(audio_converter_supported_types),
audio_converter_supported_types,
},
{
&CLSID_WMADecMediaObject,
&MFT_CATEGORY_AUDIO_DECODER,
wma_decoderW,
MFT_ENUM_FLAG_SYNCMFT,
&MFMediaType_Audio,
ARRAY_SIZE(wma_decoder_input_types),
wma_decoder_input_types,
ARRAY_SIZE(wma_decoder_output_types),
wma_decoder_output_types,
},
};
HRESULT mfplat_DllRegisterServer(void)
{
unsigned int i, j;
HRESULT hr;
MFT_REGISTER_TYPE_INFO input_types[2], output_types[2];
MFT_REGISTER_TYPE_INFO input_types[4], output_types[2];
for (i = 0; i < ARRAY_SIZE(mfts); i++)
{
......
......@@ -29,8 +29,8 @@
#include "dvdmedia.h"
#include "mmreg.h"
#include "ks.h"
#include "initguid.h"
#include "wmcodecdsp.h"
#include "initguid.h"
#include "ksmedia.h"
WINE_DEFAULT_DEBUG_CHANNEL(quartz);
......
......@@ -67,3 +67,9 @@ coclass GStreamerByteStreamHandler {}
uuid(6a170414-aad9-4693-b806-3a0c47c570d6)
]
coclass WINEAudioConverter { }
[
threading(both),
uuid(2eeb4adf-4578-4d10-bca7-bb955f56320a)
]
coclass CWMADecMediaObject {};
......@@ -52,11 +52,8 @@ static void test_DMOGetTypes(void)
hr = DMOGetTypes( &CLSID_CWMADecMediaObject, ARRAY_SIZE(input), &input_count, input,
ARRAY_SIZE(output), &output_count, output );
todo_wine
ok( hr == S_OK, "DMOGetTypes returned %#lx\n", hr );
todo_wine
ok( input_count == ARRAY_SIZE(expect_input), "got input_count %lu\n", input_count );
todo_wine
ok( output_count == ARRAY_SIZE(expect_output), "got output_count %lu\n", output_count );
for (i = 0; i < input_count; ++i)
......@@ -135,9 +132,7 @@ static void test_interfaces(void)
hr = CoCreateInstance( &CLSID_CWMADecMediaObject, &outer, CLSCTX_INPROC_SERVER, &IID_IUnknown,
(void **)&unknown );
todo_wine
ok( hr == S_OK, "CoCreateInstance returned %#lx\n", hr );
if (FAILED(hr)) return;
hr = IUnknown_QueryInterface( unknown, &IID_IMFTransform, (void **)&transform );
ok( hr == S_OK, "QueryInterface returned %#lx\n", hr );
hr = IUnknown_QueryInterface( unknown, &IID_IMediaObject, (void **)&media_object );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment