From: Brendan McGrath bmcgrath@codeweavers.com
--- dlls/mfsrcsnk/factory.c | 2 ++ dlls/mfsrcsnk/media_source.c | 26 ++++++++++++++++++++++++++ dlls/mfsrcsnk/media_source.h | 1 + dlls/mfsrcsnk/mfsrcsnk.idl | 7 +++++++ dlls/mfsrcsnk/mfsrcsnk.rgs | 13 +++++++++++++ dlls/mp3dmod/mp3dmod.c | 2 ++ include/wine/mfinternal.idl | 1 + 7 files changed, 52 insertions(+)
diff --git a/dlls/mfsrcsnk/factory.c b/dlls/mfsrcsnk/factory.c index c0a02d5fa9d..d8fe4268feb 100644 --- a/dlls/mfsrcsnk/factory.c +++ b/dlls/mfsrcsnk/factory.c @@ -33,6 +33,8 @@ HRESULT WINAPI DllGetClassObject(REFCLSID clsid, REFIID riid, void **out) return IClassFactory_QueryInterface(&avi_byte_stream_plugin_factory, riid, out); if (IsEqualGUID(clsid, &CLSID_WAVByteStreamPlugin)) return IClassFactory_QueryInterface(&wav_byte_stream_plugin_factory, riid, out); + if (IsEqualGUID(clsid, &CLSID_MP3ByteStreamPlugin)) + return IClassFactory_QueryInterface(&mp3_byte_stream_plugin_factory, riid, out);
if (IsEqualGUID(clsid, &CLSID_MFWAVESinkClassFactory)) return IClassFactory_QueryInterface(wave_sink_class_factory, riid, out); diff --git a/dlls/mfsrcsnk/media_source.c b/dlls/mfsrcsnk/media_source.c index 5fe5a4af6e7..1e7918562fd 100644 --- a/dlls/mfsrcsnk/media_source.c +++ b/dlls/mfsrcsnk/media_source.c @@ -2008,3 +2008,29 @@ static const IClassFactoryVtbl wav_byte_stream_plugin_factory_vtbl = };
IClassFactory wav_byte_stream_plugin_factory = {&wav_byte_stream_plugin_factory_vtbl}; + +static HRESULT WINAPI mp3_byte_stream_plugin_factory_CreateInstance(IClassFactory *iface, + IUnknown *outer, REFIID riid, void **out) +{ + NTSTATUS status; + + if ((status = winedmo_demuxer_check("audio/mp3")) || use_gst_byte_stream_handler()) + { + static const GUID CLSID_GStreamerByteStreamHandler = {0x317df618,0x5e5a,0x468a,{0x9f,0x15,0xd8,0x27,0xa9,0xa0,0x81,0x62}}; + if (status) WARN("Unsupported demuxer, status %#lx.\n", status); + return CoCreateInstance(&CLSID_GStreamerByteStreamHandler, outer, CLSCTX_INPROC_SERVER, riid, out); + } + + return byte_stream_plugin_create(outer, riid, out); +} + +static const IClassFactoryVtbl mp3_byte_stream_plugin_factory_vtbl = +{ + class_factory_QueryInterface, + class_factory_AddRef, + class_factory_Release, + mp3_byte_stream_plugin_factory_CreateInstance, + class_factory_LockServer, +}; + +IClassFactory mp3_byte_stream_plugin_factory = {&mp3_byte_stream_plugin_factory_vtbl}; diff --git a/dlls/mfsrcsnk/media_source.h b/dlls/mfsrcsnk/media_source.h index 1e6c90ea7d5..7703e7634ec 100644 --- a/dlls/mfsrcsnk/media_source.h +++ b/dlls/mfsrcsnk/media_source.h @@ -24,3 +24,4 @@ extern IClassFactory asf_byte_stream_plugin_factory; extern IClassFactory avi_byte_stream_plugin_factory; extern IClassFactory mpeg4_byte_stream_plugin_factory; extern IClassFactory wav_byte_stream_plugin_factory; +extern IClassFactory mp3_byte_stream_plugin_factory; diff --git a/dlls/mfsrcsnk/mfsrcsnk.idl b/dlls/mfsrcsnk/mfsrcsnk.idl index 10b41769060..e6473b355e9 100644 --- a/dlls/mfsrcsnk/mfsrcsnk.idl +++ b/dlls/mfsrcsnk/mfsrcsnk.idl @@ -38,3 +38,10 @@ coclass MFWAVESinkClassFactory { } uuid(42c9b9f5-16fc-47ef-af22-da05f7c842e3) ] coclass WAVByteStreamPlugin {} + +[ + helpstring("MP3 Byte Stream Handler"), + threading(both), + uuid(a82e50ba-8e92-41eb-9df2-433f50ec2993) +] +coclass MP3ByteStreamPlugin {} diff --git a/dlls/mfsrcsnk/mfsrcsnk.rgs b/dlls/mfsrcsnk/mfsrcsnk.rgs index c8272189273..dcdcb165db1 100644 --- a/dlls/mfsrcsnk/mfsrcsnk.rgs +++ b/dlls/mfsrcsnk/mfsrcsnk.rgs @@ -37,6 +37,19 @@ HKLM { val '{42c9b9f5-16fc-47ef-af22-da05f7c842e3}' = s 'WAV Byte Stream Handler' } + + '.mp3' + { + val '{a82e50ba-8e92-41eb-9df2-433f50ec2993}' = s 'MP3 Byte Stream Handler' + } + 'audio/mp3' + { + val '{a82e50ba-8e92-41eb-9df2-433f50ec2993}' = s 'MP3 Byte Stream Handler' + } + 'audio/x-mp3' + { + val '{a82e50ba-8e92-41eb-9df2-433f50ec2993}' = s 'MP3 Byte Stream Handler' + } } } } diff --git a/dlls/mp3dmod/mp3dmod.c b/dlls/mp3dmod/mp3dmod.c index 82da02bfaee..bf518f38f39 100644 --- a/dlls/mp3dmod/mp3dmod.c +++ b/dlls/mp3dmod/mp3dmod.c @@ -872,6 +872,7 @@ fail: IMFMediaType_Release(*type); return hr; } + static HRESULT WINAPI MFTransform_SetInputType(IMFTransform *iface, DWORD id, IMFMediaType *type, DWORD flags) { struct mp3_decoder *decoder = impl_from_IMFTransform(iface); @@ -991,6 +992,7 @@ static HRESULT WINAPI MFTransform_ProcessMessage(IMFTransform *iface, MFT_MESSAG if (FAILED(hr = IMediaObject_Flush(&decoder->IMediaObject_iface))) return convert_dmo_to_mf_error(hr); break; + case MFT_MESSAGE_COMMAND_DRAIN: decoder->draining = TRUE; break; diff --git a/include/wine/mfinternal.idl b/include/wine/mfinternal.idl index 3fc915c0437..0b77eaefab1 100644 --- a/include/wine/mfinternal.idl +++ b/include/wine/mfinternal.idl @@ -71,3 +71,4 @@ cpp_quote("DEFINE_GUID(CLSID_AsfByteStreamPlugin, 0x41457294, 0x644c, 0x4298, 0x cpp_quote("DEFINE_GUID(CLSID_AVIByteStreamPlugin, 0x7afa253e, 0xf823, 0x42f6, 0xa5, 0xd9, 0x71, 0x4b, 0xde, 0x46, 0x74, 0x12);") cpp_quote("DEFINE_GUID(CLSID_MPEG4ByteStreamHandlerPlugin, 0x271c3902, 0x6095, 0x4c45, 0xa2, 0x2f, 0x20, 0x09, 0x18, 0x16, 0xee, 0x9e);") cpp_quote("DEFINE_GUID(CLSID_WAVByteStreamPlugin, 0x42c9b9f5, 0x16fc, 0x47ef, 0xaf, 0x22, 0xda, 0x05, 0xf7, 0xc8, 0x42, 0xe3);") +cpp_quote("DEFINE_GUID(CLSID_MP3ByteStreamPlugin, 0xa82e50ba, 0x8e92, 0x41eb, 0x9d, 0xf2, 0x43, 0x3f, 0x50, 0xec, 0x29, 0x93);")