wmvcore: Move the sync reader implementation to winegstreamer.

Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Zebediah Figura 2021-10-07 10:47:07 -05:00 committed by Alexandre Julliard
parent 009c1d66fa
commit e4767ea612
5 changed files with 33 additions and 23 deletions

View file

@ -1,5 +1,6 @@
MODULE = winegstreamer.dll
UNIXLIB = winegstreamer.so
IMPORTLIB = winegstreamer
IMPORTS = strmbase strmiids uuid ole32 mfuuid
DELAYIMPORTS = mfplat
EXTRAINCL = $(GSTREAMER_CFLAGS)
@ -11,7 +12,8 @@ C_SRCS = \
media_source.c \
mfplat.c \
quartz_parser.c \
wg_parser.c
wg_parser.c \
wm_syncreader.c
IDL_SRCS = \
winegstreamer_classes.idl

View file

@ -2,3 +2,4 @@
@ stdcall -private DllGetClassObject(ptr ptr ptr)
@ stdcall -private DllRegisterServer()
@ stdcall -private DllUnregisterServer()
@ stdcall winegstreamer_create_wm_sync_reader(ptr)

View file

@ -16,11 +16,9 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "wmvcore.h"
#include "gst_private.h"
#include "initguid.h"
#include "wmsdk.h"
#include "wine/debug.h"
#include "wine/heap.h"
WINE_DEFAULT_DEBUG_CHANNEL(wmvcore);
@ -85,7 +83,7 @@ static ULONG WINAPI WMSyncReader_Release(IWMSyncReader2 *iface)
TRACE("(%p) ref=%d\n", This, ref);
if(!ref)
heap_free(This);
free(This);
return ref;
}
@ -605,27 +603,20 @@ static const IWMProfile3Vtbl WMProfile3Vtbl =
WMProfile3_GetExpectedPacketCount
};
HRESULT WINAPI WMCreateSyncReader(IUnknown *pcert, DWORD rights, IWMSyncReader **syncreader)
HRESULT WINAPI winegstreamer_create_wm_sync_reader(IWMSyncReader **reader)
{
WMSyncReader *sync;
WMSyncReader *object;
TRACE("(%p, %x, %p)\n", pcert, rights, syncreader);
TRACE("reader %p.\n", reader);
sync = heap_alloc(sizeof(*sync));
if (!sync)
if (!(object = calloc(1, sizeof(*object))))
return E_OUTOFMEMORY;
sync->IWMProfile3_iface.lpVtbl = &WMProfile3Vtbl;
sync->IWMSyncReader2_iface.lpVtbl = &WMSyncReader2Vtbl;
sync->ref = 1;
*syncreader = (IWMSyncReader *)&sync->IWMSyncReader2_iface;
object->IWMProfile3_iface.lpVtbl = &WMProfile3Vtbl;
object->IWMSyncReader2_iface.lpVtbl = &WMSyncReader2Vtbl;
object->ref = 1;
TRACE("Created sync reader %p.\n", object);
*reader = (IWMSyncReader *)&object->IWMSyncReader2_iface;
return S_OK;
}
HRESULT WINAPI WMCreateSyncReaderPriv(IWMSyncReader **syncreader)
{
return WMCreateSyncReader(NULL, 0, syncreader);
}

View file

@ -1,12 +1,12 @@
MODULE = wmvcore.dll
IMPORTLIB = wmvcore
IMPORTS = kernel32
DELAYIMPORTS = winegstreamer
EXTRADLLFLAGS = -Wb,--prefer-native
C_SRCS = \
reader.c \
syncreader.c \
wmvcore_main.c \
writer.c

View file

@ -25,6 +25,22 @@
WINE_DEFAULT_DEBUG_CHANNEL(wmvcore);
HRESULT WINAPI winegstreamer_create_wm_sync_reader(IWMSyncReader **reader);
HRESULT WINAPI WMCreateSyncReader(IUnknown *reserved, DWORD rights, IWMSyncReader **reader)
{
TRACE("reserved %p, rights %#x, reader %p.\n", reserved, rights, reader);
return winegstreamer_create_wm_sync_reader(reader);
}
HRESULT WINAPI WMCreateSyncReaderPriv(IWMSyncReader **reader)
{
TRACE("reader %p.\n", reader);
return winegstreamer_create_wm_sync_reader(reader);
}
HRESULT WINAPI WMCheckURLExtension(const WCHAR *url)
{
FIXME("(%s): stub\n", wine_dbgstr_w(url));