Signed-off-by: Zebediah Figura z.figura12@gmail.com --- include/Makefile.in | 1 + include/wmcodecdsp.idl | 26 ++++++++++++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 include/wmcodecdsp.idl
diff --git a/include/Makefile.in b/include/Makefile.in index 22262ac..b598fd8 100644 --- a/include/Makefile.in +++ b/include/Makefile.in @@ -702,6 +702,7 @@ SOURCES = \ winuser.rh \ winver.h \ wlanapi.h \ + wmcodecdsp.idl \ wmdrmsdk.idl \ wmistr.h \ wmium.h \ diff --git a/include/wmcodecdsp.idl b/include/wmcodecdsp.idl new file mode 100644 index 0000000..dc6b9ee --- /dev/null +++ b/include/wmcodecdsp.idl @@ -0,0 +1,26 @@ +/* + * Copyright 2018 Zebediah Figura + * + * 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 + */ + +import "mediaobj.idl"; +import "strmif.idl"; + +[ + threading(both), + uuid(bbeea841-0a63-4f52-a7ab-a9b3a84ed38a) +] +coclass CMP3DecMediaObject {}
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- configure | 2 ++ configure.ac | 1 + dlls/wmcodecdspuuid/Makefile.in | 4 ++++ dlls/wmcodecdspuuid/wmcodecdspuuid.c | 27 +++++++++++++++++++++++++++ 4 files changed, 34 insertions(+) create mode 100644 dlls/wmcodecdspuuid/Makefile.in create mode 100644 dlls/wmcodecdspuuid/wmcodecdspuuid.c
diff --git a/configure b/configure index b9431d5..b1dc27e 100755 --- a/configure +++ b/configure @@ -1597,6 +1597,7 @@ enable_winusb enable_wlanapi enable_wldap32 enable_wmasf +enable_wmcodecdspuuid enable_wmi enable_wmiutils enable_wmp @@ -19154,6 +19155,7 @@ wine_fn_config_makefile dlls/wlanapi/tests enable_tests wine_fn_config_makefile dlls/wldap32 enable_wldap32 wine_fn_config_makefile dlls/wldap32/tests enable_tests wine_fn_config_makefile dlls/wmasf enable_wmasf +wine_fn_config_makefile dlls/wmcodecdspuuid enable_wmcodecdspuuid wine_fn_config_makefile dlls/wmi enable_wmi wine_fn_config_makefile dlls/wmiutils enable_wmiutils wine_fn_config_makefile dlls/wmiutils/tests enable_tests diff --git a/configure.ac b/configure.ac index 7b648af..1b26014 100644 --- a/configure.ac +++ b/configure.ac @@ -3770,6 +3770,7 @@ WINE_CONFIG_MAKEFILE(dlls/wlanapi/tests) WINE_CONFIG_MAKEFILE(dlls/wldap32) WINE_CONFIG_MAKEFILE(dlls/wldap32/tests) WINE_CONFIG_MAKEFILE(dlls/wmasf) +WINE_CONFIG_MAKEFILE(dlls/wmcodecdspuuid) WINE_CONFIG_MAKEFILE(dlls/wmi) WINE_CONFIG_MAKEFILE(dlls/wmiutils) WINE_CONFIG_MAKEFILE(dlls/wmiutils/tests) diff --git a/dlls/wmcodecdspuuid/Makefile.in b/dlls/wmcodecdspuuid/Makefile.in new file mode 100644 index 0000000..d8f5d02 --- /dev/null +++ b/dlls/wmcodecdspuuid/Makefile.in @@ -0,0 +1,4 @@ +MODULE = libwmcodecdspuuid.a + +C_SRCS = \ + wmcodecdspuuid.c diff --git a/dlls/wmcodecdspuuid/wmcodecdspuuid.c b/dlls/wmcodecdspuuid/wmcodecdspuuid.c new file mode 100644 index 0000000..c715641 --- /dev/null +++ b/dlls/wmcodecdspuuid/wmcodecdspuuid.c @@ -0,0 +1,27 @@ +/* + * GUID definitions + * + * Copyright 2018 Zebediah Figura + * + * 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 + */ + +/* Don't define those GUIDs here */ +#include "strmif.h" +#include "mediaobj.h" + +#include "initguid.h" + +#include "wmcodecdsp.h"
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- configure | 2 + configure.ac | 1 + dlls/mp3dmod/Makefile.in | 8 + dlls/mp3dmod/mp3dmod.c | 382 ++++++++++++++++++++++++++++++++++++++++++++++ dlls/mp3dmod/mp3dmod.idl | 27 ++++ dlls/mp3dmod/mp3dmod.spec | 5 + 6 files changed, 425 insertions(+) create mode 100644 dlls/mp3dmod/Makefile.in create mode 100644 dlls/mp3dmod/mp3dmod.c create mode 100644 dlls/mp3dmod/mp3dmod.idl create mode 100644 dlls/mp3dmod/mp3dmod.spec
diff --git a/configure b/configure index b1dc27e..cfe69f2 100755 --- a/configure +++ b/configure @@ -1355,6 +1355,7 @@ enable_mlang enable_mmcndmgr enable_mmdevapi enable_mountmgr_sys +enable_mp3dmod enable_mpr enable_mprapi enable_msacm32_drv @@ -18777,6 +18778,7 @@ wine_fn_config_makefile dlls/mmsystem.dll16 enable_win16 wine_fn_config_makefile dlls/monodebg.vxd enable_win16 wine_fn_config_makefile dlls/mountmgr.sys enable_mountmgr_sys wine_fn_config_makefile dlls/mouse.drv16 enable_win16 +wine_fn_config_makefile dlls/mp3dmod enable_mp3dmod wine_fn_config_makefile dlls/mpr enable_mpr wine_fn_config_makefile dlls/mpr/tests enable_tests wine_fn_config_makefile dlls/mprapi enable_mprapi diff --git a/configure.ac b/configure.ac index 1b26014..b1c02ed 100644 --- a/configure.ac +++ b/configure.ac @@ -3392,6 +3392,7 @@ WINE_CONFIG_MAKEFILE(dlls/mmsystem.dll16,enable_win16) WINE_CONFIG_MAKEFILE(dlls/monodebg.vxd,enable_win16) WINE_CONFIG_MAKEFILE(dlls/mountmgr.sys) WINE_CONFIG_MAKEFILE(dlls/mouse.drv16,enable_win16) +WINE_CONFIG_MAKEFILE(dlls/mp3dmod) WINE_CONFIG_MAKEFILE(dlls/mpr) WINE_CONFIG_MAKEFILE(dlls/mpr/tests) WINE_CONFIG_MAKEFILE(dlls/mprapi) diff --git a/dlls/mp3dmod/Makefile.in b/dlls/mp3dmod/Makefile.in new file mode 100644 index 0000000..d892751 --- /dev/null +++ b/dlls/mp3dmod/Makefile.in @@ -0,0 +1,8 @@ +MODULE = mp3dmod.dll +IMPORTS = dmoguids uuid wmcodecdspuuid + +C_SRCS = \ + mp3dmod.c + +IDL_SRCS = \ + mp3dmod.idl diff --git a/dlls/mp3dmod/mp3dmod.c b/dlls/mp3dmod/mp3dmod.c new file mode 100644 index 0000000..c6cb0ad --- /dev/null +++ b/dlls/mp3dmod/mp3dmod.c @@ -0,0 +1,382 @@ +/* + * MP3 decoder DMO + * + * Copyright 2018 Zebediah Figura + * + * 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 <stdarg.h> +#include "windef.h" +#include "winbase.h" +#define COBJMACROS +#include "objbase.h" +#include "rpcproxy.h" +#include "wmcodecdsp.h" +#include "wine/debug.h" +#include "wine/heap.h" + +WINE_DEFAULT_DEBUG_CHANNEL(mp3dmod); + +static HINSTANCE mp3dmod_instance; + +struct mp3_decoder { + IMediaObject IMediaObject_iface; + LONG ref; +}; + +static inline struct mp3_decoder *impl_from_IMediaObject(IMediaObject *iface) +{ + return CONTAINING_RECORD(iface, struct mp3_decoder, IMediaObject_iface); +} + +static HRESULT WINAPI MediaObject_QueryInterface(IMediaObject *iface, REFIID iid, void **ppv) +{ + struct mp3_decoder *This = impl_from_IMediaObject(iface); + + TRACE("(%p)->(%s, %p)\n", This, debugstr_guid(iid), ppv); + + if (IsEqualIID(iid, &IID_IUnknown) || IsEqualIID(iid, &IID_IMediaObject)) + *ppv = &This->IMediaObject_iface; + else + { + FIXME("no interface for %s\n", debugstr_guid(iid)); + *ppv = NULL; + return E_NOINTERFACE; + } + + IMediaObject_AddRef(iface); + return S_OK; +} + +static ULONG WINAPI MediaObject_AddRef(IMediaObject *iface) +{ + struct mp3_decoder *This = impl_from_IMediaObject(iface); + ULONG refcount = InterlockedIncrement(&This->ref); + + TRACE("(%p) AddRef from %d\n", This, refcount - 1); + + return refcount; +} + +static ULONG WINAPI MediaObject_Release(IMediaObject *iface) +{ + struct mp3_decoder *This = impl_from_IMediaObject(iface); + ULONG refcount = InterlockedDecrement(&This->ref); + + TRACE("(%p) Release from %d\n", This, refcount + 1); + + if (!refcount) + { + heap_free(This); + } + return refcount; +} + +static HRESULT WINAPI MediaObject_GetStreamCount(IMediaObject *iface, DWORD *input, DWORD *output) +{ + FIXME("(%p)->(%p, %p) stub!\n", iface, input, output); + + return E_NOTIMPL; +} + +static HRESULT WINAPI MediaObject_GetInputStreamInfo(IMediaObject *iface, DWORD index, DWORD *flags) +{ + FIXME("(%p)->(%d, %p) stub!\n", iface, index, flags); + + return E_NOTIMPL; +} + +static HRESULT WINAPI MediaObject_GetOutputStreamInfo(IMediaObject *iface, DWORD index, DWORD *flags) +{ + FIXME("(%p)->(%d, %p) stub!\n", iface, index, flags); + + return E_NOTIMPL; +} + +static HRESULT WINAPI MediaObject_GetInputType(IMediaObject *iface, DWORD index, DWORD type_index, DMO_MEDIA_TYPE *type) +{ + FIXME("(%p)->(%d, %d, %p) stub!\n", iface, index, type_index, type); + + return E_NOTIMPL; +} + +static HRESULT WINAPI MediaObject_GetOutputType(IMediaObject *iface, DWORD index, DWORD type_index, DMO_MEDIA_TYPE *type) +{ + FIXME("(%p)->(%d, %d, %p) stub!\n", iface, index, type_index, type); + + return E_NOTIMPL; +} + +static HRESULT WINAPI MediaObject_SetInputType(IMediaObject *iface, DWORD index, const DMO_MEDIA_TYPE *type, DWORD flags) +{ + FIXME("(%p)->(%d, %p, %#x) stub!\n", iface, index, type, flags); + + return E_NOTIMPL; +} + +static HRESULT WINAPI MediaObject_SetOutputType(IMediaObject *iface, DWORD index, const DMO_MEDIA_TYPE *type, DWORD flags) +{ + FIXME("(%p)->(%d, %p, %#x) stub!\n", iface, index, type, flags); + + return E_NOTIMPL; +} + +static HRESULT WINAPI MediaObject_GetInputCurrentType(IMediaObject *iface, DWORD index, DMO_MEDIA_TYPE *type) +{ + FIXME("(%p)->(%d, %p) stub!\n", iface, index, type); + + return E_NOTIMPL; +} + +static HRESULT WINAPI MediaObject_GetOutputCurrentType(IMediaObject *iface, DWORD index, DMO_MEDIA_TYPE *type) +{ + FIXME("(%p)->(%d, %p) stub!\n", iface, index, type); + + return E_NOTIMPL; +} + +static HRESULT WINAPI MediaObject_GetInputSizeInfo(IMediaObject *iface, DWORD index, DWORD *size, DWORD *max_lookahead, DWORD *alignment) +{ + FIXME("(%p)->(%d, %p, %p, %p) stub!\n", iface, index, size, max_lookahead, alignment); + + return E_NOTIMPL; +} + +static HRESULT WINAPI MediaObject_GetOutputSizeInfo(IMediaObject *iface, DWORD index, DWORD *size, DWORD *alignment) +{ + FIXME("(%p)->(%d, %p, %p) stub!\n", iface, index, size, alignment); + + return E_NOTIMPL; +} + +static HRESULT WINAPI MediaObject_GetInputMaxLatency(IMediaObject *iface, DWORD index, REFERENCE_TIME *latency) +{ + FIXME("(%p)->(%d, %p) stub!\n", iface, index, latency); + + return E_NOTIMPL; +} + +static HRESULT WINAPI MediaObject_SetInputMaxLatency(IMediaObject *iface, DWORD index, REFERENCE_TIME latency) +{ + FIXME("(%p)->(%d, %s) stub!\n", iface, index, wine_dbgstr_longlong(latency)); + + return E_NOTIMPL; +} + +static HRESULT WINAPI MediaObject_Flush(IMediaObject *iface) +{ + FIXME("(%p)->() stub!\n", iface); + + return E_NOTIMPL; +} + +static HRESULT WINAPI MediaObject_Discontinuity(IMediaObject *iface, DWORD index) +{ + FIXME("(%p)->(%d) stub!\n", iface, index); + + return E_NOTIMPL; +} + +static HRESULT WINAPI MediaObject_AllocateStreamingResources(IMediaObject *iface) +{ + FIXME("(%p)->() stub!\n", iface); + + return E_NOTIMPL; +} + +static HRESULT WINAPI MediaObject_FreeStreamingResources(IMediaObject *iface) +{ + FIXME("(%p)->() stub!\n", iface); + + return E_NOTIMPL; +} + +static HRESULT WINAPI MediaObject_GetInputStatus(IMediaObject *iface, DWORD index, DWORD *flags) +{ + FIXME("(%p)->(%d, %p) stub!\n", iface, index, flags); + + return E_NOTIMPL; +} + +static HRESULT WINAPI MediaObject_ProcessInput(IMediaObject *iface, DWORD index, + IMediaBuffer *buffer, DWORD flags, REFERENCE_TIME timestamp, REFERENCE_TIME timelength) +{ + FIXME("(%p)->(%d, %p, %#x, %s, %s) stub!\n", iface, index, buffer, flags, + wine_dbgstr_longlong(timestamp), wine_dbgstr_longlong(timelength)); + + return E_NOTIMPL; +} + +static HRESULT WINAPI MediaObject_ProcessOutput(IMediaObject *iface, DWORD flags, DWORD count, DMO_OUTPUT_DATA_BUFFER *buffers, DWORD *status) +{ + FIXME("(%p)->(%x, %d, %p, %p) stub!\n", iface, flags, count, buffers, status); + + return E_NOTIMPL; +} + +static HRESULT WINAPI MediaObject_Lock(IMediaObject *iface, LONG lock) +{ + FIXME("(%p)->(%d) stub!\n", iface, lock); + + return E_NOTIMPL; +} + +static const IMediaObjectVtbl IMediaObject_vtbl = { + MediaObject_QueryInterface, + MediaObject_AddRef, + MediaObject_Release, + MediaObject_GetStreamCount, + MediaObject_GetInputStreamInfo, + MediaObject_GetOutputStreamInfo, + MediaObject_GetInputType, + MediaObject_GetOutputType, + MediaObject_SetInputType, + MediaObject_SetOutputType, + MediaObject_GetInputCurrentType, + MediaObject_GetOutputCurrentType, + MediaObject_GetInputSizeInfo, + MediaObject_GetOutputSizeInfo, + MediaObject_GetInputMaxLatency, + MediaObject_SetInputMaxLatency, + MediaObject_Flush, + MediaObject_Discontinuity, + MediaObject_AllocateStreamingResources, + MediaObject_FreeStreamingResources, + MediaObject_GetInputStatus, + MediaObject_ProcessInput, + MediaObject_ProcessOutput, + MediaObject_Lock, +}; + +static HRESULT create_mp3_decoder(REFIID iid, void **obj) +{ + struct mp3_decoder *This; + + if (!(This = heap_alloc(sizeof(*This)))) + return E_OUTOFMEMORY; + + This->IMediaObject_iface.lpVtbl = &IMediaObject_vtbl; + This->ref = 0; + + return IMediaObject_QueryInterface(&This->IMediaObject_iface, iid, obj); +} + +static HRESULT WINAPI ClassFactory_QueryInterface(IClassFactory *iface, REFIID iid, void **obj) +{ + TRACE("(%p, %s, %p)\n", iface, debugstr_guid(iid), obj); + + if (IsEqualGUID(&IID_IUnknown, iid) || + IsEqualGUID(&IID_IClassFactory, iid)) + { + IClassFactory_AddRef(iface); + *obj = iface; + return S_OK; + } + + *obj = NULL; + WARN("no interface for %s\n", debugstr_guid(iid)); + return E_NOINTERFACE; +} + +static ULONG WINAPI ClassFactory_AddRef(IClassFactory *iface) +{ + return 2; +} + +static ULONG WINAPI ClassFactory_Release(IClassFactory *iface) +{ + return 1; +} + +static HRESULT WINAPI ClassFactory_CreateInstance(IClassFactory *iface, IUnknown *outer, REFIID iid, void **obj) +{ + TRACE("(%p, %s, %p)\n", outer, debugstr_guid(iid), obj); + + if (outer) + { + *obj = NULL; + return CLASS_E_NOAGGREGATION; + } + + return create_mp3_decoder(iid, obj); +} + +static HRESULT WINAPI ClassFactory_LockServer(IClassFactory *iface, BOOL lock) +{ + FIXME("(%d) stub\n", lock); + return S_OK; +} + +static const IClassFactoryVtbl classfactory_vtbl = { + ClassFactory_QueryInterface, + ClassFactory_AddRef, + ClassFactory_Release, + ClassFactory_CreateInstance, + ClassFactory_LockServer +}; + +static IClassFactory mp3_decoder_cf = { &classfactory_vtbl }; + +BOOL WINAPI DllMain(HINSTANCE instance, DWORD reason, LPVOID reserved) +{ + TRACE("%p, %d, %p\n", instance, reason, reserved); + switch (reason) + { + case DLL_PROCESS_ATTACH: + DisableThreadLibraryCalls(instance); + mp3dmod_instance = instance; + break; + } + return TRUE; +} + +/************************************************************************* + * DllGetClassObject (DSDMO.@) + */ +HRESULT WINAPI DllGetClassObject(REFCLSID clsid, REFIID iid, void **obj) +{ + TRACE("%s, %s, %p\n", debugstr_guid(clsid), debugstr_guid(iid), obj); + + if (IsEqualGUID(clsid, &CLSID_CMP3DecMediaObject)) + return IClassFactory_QueryInterface(&mp3_decoder_cf, iid, obj); + + FIXME("class %s not available\n", debugstr_guid(clsid)); + return CLASS_E_CLASSNOTAVAILABLE; +} + +/****************************************************************** + * DllCanUnloadNow (DSDMO.@) + */ +HRESULT WINAPI DllCanUnloadNow(void) +{ + return S_FALSE; +} + +/*********************************************************************** + * DllRegisterServer (DSDMO.@) + */ +HRESULT WINAPI DllRegisterServer(void) +{ + return __wine_register_resources( mp3dmod_instance ); +} + +/*********************************************************************** + * DllUnregisterServer (DSDMO.@) + */ +HRESULT WINAPI DllUnregisterServer(void) +{ + return __wine_unregister_resources( mp3dmod_instance ); +} diff --git a/dlls/mp3dmod/mp3dmod.idl b/dlls/mp3dmod/mp3dmod.idl new file mode 100644 index 0000000..c4afd3a --- /dev/null +++ b/dlls/mp3dmod/mp3dmod.idl @@ -0,0 +1,27 @@ +/* + * MP3 decoder DMO + * + * Copyright 2018 Zebediah Figura + * + * 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(bbeea841-0a63-4f52-a7ab-a9b3a84ed38a) +] +coclass CMP3DecMediaObject { interface IMediaObject; } diff --git a/dlls/mp3dmod/mp3dmod.spec b/dlls/mp3dmod/mp3dmod.spec new file mode 100644 index 0000000..2510405 --- /dev/null +++ b/dlls/mp3dmod/mp3dmod.spec @@ -0,0 +1,5 @@ +@ stub CreateInstance +@ stdcall -private DllCanUnloadNow() +@ stdcall -private DllGetClassObject(ptr ptr ptr) +@ stdcall -private DllRegisterServer() +@ stdcall -private DllUnregisterServer()
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- configure.ac | 9 ++++++--- dlls/mp3dmod/Makefile.in | 2 ++ dlls/mp3dmod/mp3dmod.c | 7 +++++++ 3 files changed, 15 insertions(+), 3 deletions(-)
diff --git a/configure.ac b/configure.ac index b1c02ed..a4f2348 100644 --- a/configure.ac +++ b/configure.ac @@ -1753,9 +1753,12 @@ then MPG123_LIBS="" fi]) fi -WINE_NOTICE_WITH(mpg123,[test "x$ac_cv_lib_mpg123_mpg123_feed" != xyes -a x"$ac_cv_header_CoreAudio_CoreAudio_h" != xyes], - [libmpg123 ${notice_platform}development files not found (or too old), mp3 codec won't be supported.], - [enable_l3codeca_acm]) +if test "x$ac_cv_lib_mpg123_mpg123_feed" != xyes -a x"$ac_cv_header_CoreAudio_CoreAudio_h" != xyes +then + WINE_NOTICE([libmpg123 ${notice_platform}development files not found (or too old), mp3 codec won't be supported.]) + enable_l3codeca_acm=${enable_l3codeca_acm:-no} + enable_mp3dmod=${enable_mp3dmod:-no} +fi
dnl **** Check for OpenAL 1.1 **** if test "$ac_cv_header_AL_al_h" = "yes" diff --git a/dlls/mp3dmod/Makefile.in b/dlls/mp3dmod/Makefile.in index d892751..5bcef48 100644 --- a/dlls/mp3dmod/Makefile.in +++ b/dlls/mp3dmod/Makefile.in @@ -1,5 +1,7 @@ MODULE = mp3dmod.dll IMPORTS = dmoguids uuid wmcodecdspuuid +EXTRAINCL = $(MPG123_CFLAGS) +EXTRALIBS = $(MPG123_LIBS)
C_SRCS = \ mp3dmod.c diff --git a/dlls/mp3dmod/mp3dmod.c b/dlls/mp3dmod/mp3dmod.c index c6cb0ad..0f1f069 100644 --- a/dlls/mp3dmod/mp3dmod.c +++ b/dlls/mp3dmod/mp3dmod.c @@ -19,6 +19,7 @@ */
#include <stdarg.h> +#include <mpg123.h> #include "windef.h" #include "winbase.h" #define COBJMACROS @@ -35,6 +36,7 @@ static HINSTANCE mp3dmod_instance; struct mp3_decoder { IMediaObject IMediaObject_iface; LONG ref; + mpg123_handle *mh; };
static inline struct mp3_decoder *impl_from_IMediaObject(IMediaObject *iface) @@ -80,6 +82,7 @@ static ULONG WINAPI MediaObject_Release(IMediaObject *iface)
if (!refcount) { + mpg123_delete(This->mh); heap_free(This); } return refcount; @@ -264,6 +267,7 @@ static const IMediaObjectVtbl IMediaObject_vtbl = { static HRESULT create_mp3_decoder(REFIID iid, void **obj) { struct mp3_decoder *This; + int err;
if (!(This = heap_alloc(sizeof(*This)))) return E_OUTOFMEMORY; @@ -271,6 +275,9 @@ static HRESULT create_mp3_decoder(REFIID iid, void **obj) This->IMediaObject_iface.lpVtbl = &IMediaObject_vtbl; This->ref = 0;
+ mpg123_init(); + This->mh = mpg123_new(NULL, &err); + return IMediaObject_QueryInterface(&This->IMediaObject_iface, iid, obj); }