diff --git a/dlls/winegstreamer/Makefile.in b/dlls/winegstreamer/Makefile.in index 671e3bcb7ba..17311cd663c 100644 --- a/dlls/winegstreamer/Makefile.in +++ b/dlls/winegstreamer/Makefile.in @@ -13,6 +13,7 @@ C_SRCS = \ mfplat.c \ quartz_parser.c \ wg_parser.c \ + wm_asyncreader.c \ wm_syncreader.c IDL_SRCS = \ diff --git a/dlls/winegstreamer/winegstreamer.spec b/dlls/winegstreamer/winegstreamer.spec index bd9f53a7445..bc6a390f8b1 100644 --- a/dlls/winegstreamer/winegstreamer.spec +++ b/dlls/winegstreamer/winegstreamer.spec @@ -2,4 +2,5 @@ @ stdcall -private DllGetClassObject(ptr ptr ptr) @ stdcall -private DllRegisterServer() @ stdcall -private DllUnregisterServer() +@ stdcall winegstreamer_create_wm_async_reader(ptr) @ stdcall winegstreamer_create_wm_sync_reader(ptr) diff --git a/dlls/wmvcore/reader.c b/dlls/winegstreamer/wm_asyncreader.c similarity index 98% rename from dlls/wmvcore/reader.c rename to dlls/winegstreamer/wm_asyncreader.c index 12ba8099ab1..d3fd1624f24 100644 --- a/dlls/wmvcore/reader.c +++ b/dlls/winegstreamer/wm_asyncreader.c @@ -16,11 +16,8 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include "wmvcore.h" - +#include "gst_private.h" #include "wmsdk.h" -#include "wine/debug.h" -#include "wine/heap.h" WINE_DEFAULT_DEBUG_CHANNEL(wmvcore); @@ -153,7 +150,7 @@ static ULONG WINAPI WMReader_Release(IWMReader *iface) TRACE("(%p) ref=%d\n", This, ref); if(!ref) - heap_free(This); + free(This); return ref; } @@ -2039,36 +2036,31 @@ static const IWMPacketSize2Vtbl WMPacketSize2Vtbl = packetsize_SetMinPacketSize }; -HRESULT WINAPI WMCreateReader(IUnknown *reserved, DWORD rights, IWMReader **ret_reader) +HRESULT WINAPI winegstreamer_create_wm_async_reader(IWMReader **reader) { - WMReader *reader; + WMReader *object; - TRACE("(%p, %x, %p)\n", reserved, rights, ret_reader); + TRACE("reader %p.\n", reader); - reader = heap_alloc(sizeof(*reader)); - if(!reader) + if (!(object = calloc(1, sizeof(*object)))) return E_OUTOFMEMORY; - reader->IWMReader_iface.lpVtbl = &WMReaderVtbl; - reader->IWMReaderAdvanced6_iface.lpVtbl = &WMReaderAdvanced6Vtbl; - reader->IWMReaderAccelerator_iface.lpVtbl = &WMReaderAcceleratorVtbl; - reader->IWMReaderNetworkConfig2_iface.lpVtbl = &WMReaderNetworkConfig2Vtbl; - reader->IWMReaderStreamClock_iface.lpVtbl = &WMReaderStreamClockVtbl; - reader->IWMReaderTypeNegotiation_iface.lpVtbl = &WMReaderTypeNegotiationVtbl; - reader->IWMReaderTimecode_iface.lpVtbl = &WMReaderTimecodeVtbl; - reader->IWMReaderPlaylistBurn_iface.lpVtbl = &WMReaderPlaylistBurnVtbl; - reader->IWMHeaderInfo3_iface.lpVtbl = &WMHeaderInfo3Vtbl; - reader->IWMLanguageList_iface.lpVtbl = &WMLanguageListVtbl; - reader->IReferenceClock_iface.lpVtbl = &ReferenceClockVtbl; - reader->IWMProfile3_iface.lpVtbl = &WMProfile3Vtbl; - reader->IWMPacketSize2_iface.lpVtbl = &WMPacketSize2Vtbl; - reader->ref = 1; + object->IReferenceClock_iface.lpVtbl = &ReferenceClockVtbl; + object->IWMHeaderInfo3_iface.lpVtbl = &WMHeaderInfo3Vtbl; + object->IWMLanguageList_iface.lpVtbl = &WMLanguageListVtbl; + object->IWMPacketSize2_iface.lpVtbl = &WMPacketSize2Vtbl; + object->IWMProfile3_iface.lpVtbl = &WMProfile3Vtbl; + object->IWMReader_iface.lpVtbl = &WMReaderVtbl; + object->IWMReaderAdvanced6_iface.lpVtbl = &WMReaderAdvanced6Vtbl; + object->IWMReaderAccelerator_iface.lpVtbl = &WMReaderAcceleratorVtbl; + object->IWMReaderNetworkConfig2_iface.lpVtbl = &WMReaderNetworkConfig2Vtbl; + object->IWMReaderPlaylistBurn_iface.lpVtbl = &WMReaderPlaylistBurnVtbl; + object->IWMReaderStreamClock_iface.lpVtbl = &WMReaderStreamClockVtbl; + object->IWMReaderTimecode_iface.lpVtbl = &WMReaderTimecodeVtbl; + object->IWMReaderTypeNegotiation_iface.lpVtbl = &WMReaderTypeNegotiationVtbl; + object->ref = 1; - *ret_reader = &reader->IWMReader_iface; + TRACE("Created async reader %p.\n", object); + *reader = (IWMReader *)&object->IWMReader_iface; return S_OK; } - -HRESULT WINAPI WMCreateReaderPriv(IWMReader **ret_reader) -{ - return WMCreateReader(NULL, 0, ret_reader); -} diff --git a/dlls/wmvcore/Makefile.in b/dlls/wmvcore/Makefile.in index d0b230dd7c0..6aed828abae 100644 --- a/dlls/wmvcore/Makefile.in +++ b/dlls/wmvcore/Makefile.in @@ -6,7 +6,6 @@ DELAYIMPORTS = winegstreamer EXTRADLLFLAGS = -Wb,--prefer-native C_SRCS = \ - reader.c \ wmvcore_main.c \ writer.c diff --git a/dlls/wmvcore/wmvcore_main.c b/dlls/wmvcore/wmvcore_main.c index 8d4d4251369..ff837921286 100644 --- a/dlls/wmvcore/wmvcore_main.c +++ b/dlls/wmvcore/wmvcore_main.c @@ -25,8 +25,23 @@ WINE_DEFAULT_DEBUG_CHANNEL(wmvcore); +HRESULT WINAPI winegstreamer_create_wm_async_reader(IWMReader **reader); HRESULT WINAPI winegstreamer_create_wm_sync_reader(IWMSyncReader **reader); +HRESULT WINAPI WMCreateReader(IUnknown *reserved, DWORD rights, IWMReader **reader) +{ + TRACE("reserved %p, rights %#x, reader %p.\n", reserved, rights, reader); + + return winegstreamer_create_wm_async_reader(reader); +} + +HRESULT WINAPI WMCreateReaderPriv(IWMReader **reader) +{ + TRACE("reader %p.\n", reader); + + return winegstreamer_create_wm_async_reader(reader); +} + HRESULT WINAPI WMCreateSyncReader(IUnknown *reserved, DWORD rights, IWMSyncReader **reader) { TRACE("reserved %p, rights %#x, reader %p.\n", reserved, rights, reader);