Signed-off-by: Zebediah Figura zfigura@codeweavers.com --- dlls/winegstreamer/Makefile.in | 3 +- dlls/winegstreamer/gst_private.h | 17 + dlls/winegstreamer/main.c | 6 +- dlls/winegstreamer/mfplat.c | 3 +- dlls/winegstreamer/wm_asyncreader.c | 471 +++++----------------------- dlls/winegstreamer/wm_reader.c | 308 ++++++++++++++++++ dlls/winegstreamer/wm_syncreader.c | 2 - 7 files changed, 418 insertions(+), 392 deletions(-) create mode 100644 dlls/winegstreamer/wm_reader.c
diff --git a/dlls/winegstreamer/Makefile.in b/dlls/winegstreamer/Makefile.in index 17311cd663c..76e6aeed54d 100644 --- a/dlls/winegstreamer/Makefile.in +++ b/dlls/winegstreamer/Makefile.in @@ -1,7 +1,7 @@ MODULE = winegstreamer.dll UNIXLIB = winegstreamer.so IMPORTLIB = winegstreamer -IMPORTS = strmbase strmiids uuid ole32 mfuuid +IMPORTS = strmbase ole32 DELAYIMPORTS = mfplat EXTRAINCL = $(GSTREAMER_CFLAGS) EXTRALIBS = $(GSTREAMER_LIBS) $(PTHREAD_LIBS) @@ -14,6 +14,7 @@ C_SRCS = \ quartz_parser.c \ wg_parser.c \ wm_asyncreader.c \ + wm_reader.c \ wm_syncreader.c
IDL_SRCS = \ diff --git a/dlls/winegstreamer/gst_private.h b/dlls/winegstreamer/gst_private.h index 986c8ca695d..6c86031897e 100644 --- a/dlls/winegstreamer/gst_private.h +++ b/dlls/winegstreamer/gst_private.h @@ -33,6 +33,7 @@ #define NONAMELESSUNION #include "dshow.h" #include "mfidl.h" +#include "wmsdk.h" #include "wine/debug.h" #include "wine/strmbase.h"
@@ -112,4 +113,20 @@ HRESULT winegstreamer_stream_handler_create(REFIID riid, void **obj) DECLSPEC_HI
HRESULT audio_converter_create(REFIID riid, void **ret) DECLSPEC_HIDDEN;
+struct wm_reader +{ + IWMProfile3 IWMProfile3_iface; + LONG refcount; + + const struct wm_reader_ops *ops; +}; + +struct wm_reader_ops +{ + void *(*query_interface)(struct wm_reader *reader, REFIID iid); + void (*destroy)(struct wm_reader *reader); +}; + +void wm_reader_init(struct wm_reader *reader, const struct wm_reader_ops *ops); + #endif /* __GST_PRIVATE_INCLUDED__ */ diff --git a/dlls/winegstreamer/main.c b/dlls/winegstreamer/main.c index d6f19fb4ad1..ac9a3201792 100644 --- a/dlls/winegstreamer/main.c +++ b/dlls/winegstreamer/main.c @@ -20,17 +20,19 @@
#define WINE_NO_NAMELESS_EXTENSION
+#define EXTERN_GUID DEFINE_GUID +#include "initguid.h" #include "gst_private.h" #include "winternl.h" #include "rpcproxy.h" - -#include "initguid.h" #include "gst_guids.h"
static unixlib_handle_t unix_handle;
WINE_DEFAULT_DEBUG_CHANNEL(quartz);
+DEFINE_GUID(GUID_NULL, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + bool array_reserve(void **elements, size_t *capacity, size_t count, size_t size) { unsigned int new_capacity, max_capacity; diff --git a/dlls/winegstreamer/mfplat.c b/dlls/winegstreamer/mfplat.c index 93f4b8d5bd7..58200dc409a 100644 --- a/dlls/winegstreamer/mfplat.c +++ b/dlls/winegstreamer/mfplat.c @@ -19,9 +19,10 @@
#include "gst_private.h"
-#include "mfapi.h" #include "ks.h" #include "ksmedia.h" +#include "initguid.h" +#include "mfapi.h"
#include "wine/debug.h"
diff --git a/dlls/winegstreamer/wm_asyncreader.c b/dlls/winegstreamer/wm_asyncreader.c index b4ef4851c33..3e341ec41e9 100644 --- a/dlls/winegstreamer/wm_asyncreader.c +++ b/dlls/winegstreamer/wm_asyncreader.c @@ -17,12 +17,13 @@ */
#include "gst_private.h" -#include "wmsdk.h"
WINE_DEFAULT_DEBUG_CHANNEL(wmvcore);
struct async_reader { + struct wm_reader reader; + IWMReader IWMReader_iface; IWMReaderAdvanced6 IWMReaderAdvanced6_iface; IWMReaderAccelerator IWMReaderAccelerator_iface; @@ -34,9 +35,7 @@ struct async_reader IWMHeaderInfo3 IWMHeaderInfo3_iface; IWMLanguageList IWMLanguageList_iface; IReferenceClock IReferenceClock_iface; - IWMProfile3 IWMProfile3_iface; IWMPacketSize2 IWMPacketSize2_iface; - LONG ref; };
static struct async_reader *impl_from_IWMReader(IWMReader *iface) @@ -44,116 +43,25 @@ static struct async_reader *impl_from_IWMReader(IWMReader *iface) return CONTAINING_RECORD(iface, struct async_reader, IWMReader_iface); }
-static HRESULT WINAPI WMReader_QueryInterface(IWMReader *iface, REFIID riid, void **ppv) +static HRESULT WINAPI WMReader_QueryInterface(IWMReader *iface, REFIID iid, void **out) { - struct async_reader *This = impl_from_IWMReader(iface); + struct async_reader *reader = impl_from_IWMReader(iface);
- if(IsEqualGUID(riid, &IID_IUnknown)) { - TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv); - *ppv = &This->IWMReader_iface; - }else if(IsEqualGUID(riid, &IID_IWMReader)) { - TRACE("(%p)->(IID_IWMReader %p)\n", This, ppv); - *ppv = &This->IWMReader_iface; - }else if(IsEqualGUID(riid, &IID_IWMReaderAdvanced)) { - TRACE("(%p)->(IID_IWMReaderAdvanced %p)\n", This, ppv); - *ppv = &This->IWMReaderAdvanced6_iface; - }else if(IsEqualGUID(riid, &IID_IWMReaderAdvanced2)) { - TRACE("(%p)->(IID_IWMReaderAdvanced2 %p)\n", This, ppv); - *ppv = &This->IWMReaderAdvanced6_iface; - }else if(IsEqualGUID(riid, &IID_IWMReaderAdvanced3)) { - TRACE("(%p)->(IID_IWMReaderAdvanced3 %p)\n", This, ppv); - *ppv = &This->IWMReaderAdvanced6_iface; - }else if(IsEqualGUID(riid, &IID_IWMReaderAdvanced4)) { - TRACE("(%p)->(IID_IWMReaderAdvanced4 %p)\n", This, ppv); - *ppv = &This->IWMReaderAdvanced6_iface; - }else if(IsEqualGUID(riid, &IID_IWMReaderAdvanced5)) { - TRACE("(%p)->(IID_IWMReaderAdvanced5 %p)\n", This, ppv); - *ppv = &This->IWMReaderAdvanced6_iface; - }else if(IsEqualGUID(riid, &IID_IWMReaderAdvanced6)) { - TRACE("(%p)->(IID_IWMReaderAdvanced6 %p)\n", This, ppv); - *ppv = &This->IWMReaderAdvanced6_iface; - }else if(IsEqualGUID(riid, &IID_IWMReaderAccelerator)) { - TRACE("(%p)->(IID_IWMReaderAccelerator %p)\n", This, ppv); - *ppv = &This->IWMReaderAccelerator_iface; - }else if(IsEqualGUID(riid, &IID_IWMReaderNetworkConfig)) { - TRACE("(%p)->(IWMReaderNetworkConfig %p)\n", This, ppv); - *ppv = &This->IWMReaderNetworkConfig2_iface; - }else if(IsEqualGUID(riid, &IID_IWMReaderNetworkConfig2)) { - TRACE("(%p)->(IWMReaderNetworkConfig2 %p)\n", This, ppv); - *ppv = &This->IWMReaderNetworkConfig2_iface; - }else if(IsEqualGUID(riid, &IID_IWMReaderStreamClock)) { - TRACE("(%p)->(IWMReaderStreamClock %p)\n", This, ppv); - *ppv = &This->IWMReaderStreamClock_iface; - }else if(IsEqualGUID(riid, &IID_IWMReaderTypeNegotiation)) { - TRACE("(%p)->(IWMReaderTypeNegotiation %p)\n", This, ppv); - *ppv = &This->IWMReaderTypeNegotiation_iface; - }else if(IsEqualGUID(riid, &IID_IWMReaderTimecode)) { - TRACE("(%p)->(IWMReaderTimecode %p)\n", This, ppv); - *ppv = &This->IWMReaderTimecode_iface; - }else if(IsEqualGUID(riid, &IID_IWMReaderPlaylistBurn)) { - TRACE("(%p)->(IWMReaderPlaylistBurn %p)\n", This, ppv); - *ppv = &This->IWMReaderPlaylistBurn_iface; - }else if(IsEqualGUID(riid, &IID_IWMHeaderInfo)) { - TRACE("(%p)->(IWMHeaderInfo %p)\n", This, ppv); - *ppv = &This->IWMHeaderInfo3_iface; - }else if(IsEqualGUID(riid, &IID_IWMHeaderInfo2)) { - TRACE("(%p)->(IWMHeaderInfo2 %p)\n", This, ppv); - *ppv = &This->IWMHeaderInfo3_iface; - }else if(IsEqualGUID(riid, &IID_IWMHeaderInfo3)) { - TRACE("(%p)->(IWMHeaderInfo3 %p)\n", This, ppv); - *ppv = &This->IWMHeaderInfo3_iface; - }else if(IsEqualGUID(riid, &IID_IWMLanguageList)) { - TRACE("(%p)->(IWMLanguageList %p)\n", This, ppv); - *ppv = &This->IWMLanguageList_iface; - }else if(IsEqualGUID(riid, &IID_IReferenceClock)) { - TRACE("(%p)->(IWMLanguageList %p)\n", This, ppv); - *ppv = &This->IReferenceClock_iface; - }else if(IsEqualGUID(riid, &IID_IWMProfile)) { - TRACE("(%p)->(IWMProfile %p)\n", This, ppv); - *ppv = &This->IWMProfile3_iface; - }else if(IsEqualGUID(riid, &IID_IWMProfile2)) { - TRACE("(%p)->(IWMProfile2 %p)\n", This, ppv); - *ppv = &This->IWMProfile3_iface; - }else if(IsEqualGUID(riid, &IID_IWMProfile3)) { - TRACE("(%p)->(IWMProfile3 %p)\n", This, ppv); - *ppv = &This->IWMProfile3_iface; - }else if(IsEqualGUID(riid, &IID_IWMPacketSize)) { - TRACE("(%p)->(IWMPacketSize %p)\n", This, ppv); - *ppv = &This->IWMPacketSize2_iface; - }else if(IsEqualGUID(riid, &IID_IWMPacketSize2)) { - TRACE("(%p)->(IWMPacketSize2 %p)\n", This, ppv); - *ppv = &This->IWMPacketSize2_iface; - }else { - *ppv = NULL; - FIXME("(%p)->(%s %p)\n", This, debugstr_guid(riid), ppv); - return E_NOINTERFACE; - } - - IUnknown_AddRef((IUnknown*)*ppv); - return S_OK; + return IWMProfile3_QueryInterface(&reader->reader.IWMProfile3_iface, iid, out); }
static ULONG WINAPI WMReader_AddRef(IWMReader *iface) { - struct async_reader *This = impl_from_IWMReader(iface); - LONG ref = InterlockedIncrement(&This->ref); + struct async_reader *reader = impl_from_IWMReader(iface);
- TRACE("(%p) ref=%d\n", This, ref); - - return ref; + return IWMProfile3_AddRef(&reader->reader.IWMProfile3_iface); }
static ULONG WINAPI WMReader_Release(IWMReader *iface) { - struct async_reader *This = impl_from_IWMReader(iface); - LONG ref = InterlockedDecrement(&This->ref); + struct async_reader *reader = impl_from_IWMReader(iface);
- TRACE("(%p) ref=%d\n", This, ref); - - if(!ref) - free(This); - - return ref; + return IWMProfile3_Release(&reader->reader.IWMProfile3_iface); }
static HRESULT WINAPI WMReader_Open(IWMReader *iface, const WCHAR *url, IWMReaderCallback *callback, void *context) @@ -1692,289 +1600,6 @@ static const IReferenceClockVtbl ReferenceClockVtbl = refclock_Unadvise };
-static struct async_reader *impl_from_IWMProfile3(IWMProfile3 *iface) -{ - return CONTAINING_RECORD(iface, struct async_reader, IWMProfile3_iface); -} - -static HRESULT WINAPI profile3_QueryInterface(IWMProfile3 *iface, REFIID riid, void **ppv) -{ - struct async_reader *This = impl_from_IWMProfile3(iface); - return IWMReader_QueryInterface(&This->IWMReader_iface, riid, ppv); -} - -static ULONG WINAPI profile3_AddRef(IWMProfile3 *iface) -{ - struct async_reader *This = impl_from_IWMProfile3(iface); - return IWMReader_AddRef(&This->IWMReader_iface); -} - -static ULONG WINAPI profile3_Release(IWMProfile3 *iface) -{ - struct async_reader *This = impl_from_IWMProfile3(iface); - return IWMReader_Release(&This->IWMReader_iface); -} - -static HRESULT WINAPI profile3_GetVersion(IWMProfile3 *iface, WMT_VERSION *version) -{ - struct async_reader *This = impl_from_IWMProfile3(iface); - FIXME("%p, %p\n", This, version); - return E_NOTIMPL; -} - -static HRESULT WINAPI profile3_GetName(IWMProfile3 *iface, WCHAR *name, DWORD *length) -{ - struct async_reader *This = impl_from_IWMProfile3(iface); - FIXME("%p, %p, %p\n", This, name, length); - return E_NOTIMPL; -} - -static HRESULT WINAPI profile3_SetName(IWMProfile3 *iface, const WCHAR *name) -{ - struct async_reader *This = impl_from_IWMProfile3(iface); - FIXME("%p, %s\n", This, debugstr_w(name)); - return E_NOTIMPL; -} - -static HRESULT WINAPI profile3_GetDescription(IWMProfile3 *iface, WCHAR *description, DWORD *length) -{ - struct async_reader *This = impl_from_IWMProfile3(iface); - FIXME("%p, %p, %p\n", This, description, length); - return E_NOTIMPL; -} - -static HRESULT WINAPI profile3_SetDescription(IWMProfile3 *iface, const WCHAR *description) -{ - struct async_reader *This = impl_from_IWMProfile3(iface); - FIXME("%p, %s\n", This, debugstr_w(description)); - return E_NOTIMPL; -} - -static HRESULT WINAPI profile3_GetStreamCount(IWMProfile3 *iface, DWORD *count) -{ - struct async_reader *This = impl_from_IWMProfile3(iface); - FIXME("%p, %p\n", This, count); - - if (!count) - return E_INVALIDARG; - - *count = 0; - return S_OK; -} - -static HRESULT WINAPI profile3_GetStream(IWMProfile3 *iface, DWORD index, IWMStreamConfig **config) -{ - struct async_reader *This = impl_from_IWMProfile3(iface); - FIXME("%p, %d, %p\n", This, index, config); - return E_NOTIMPL; -} - -static HRESULT WINAPI profile3_GetStreamByNumber(IWMProfile3 *iface, WORD stream, IWMStreamConfig **config) -{ - struct async_reader *This = impl_from_IWMProfile3(iface); - FIXME("%p, %d, %p\n", This, stream, config); - return E_NOTIMPL; -} - -static HRESULT WINAPI profile3_RemoveStream(IWMProfile3 *iface, IWMStreamConfig *config) -{ - struct async_reader *This = impl_from_IWMProfile3(iface); - FIXME("%p, %p\n", This, config); - return E_NOTIMPL; -} - -static HRESULT WINAPI profile3_RemoveStreamByNumber(IWMProfile3 *iface, WORD stream) -{ - struct async_reader *This = impl_from_IWMProfile3(iface); - FIXME("%p, %d\n", This, stream); - return E_NOTIMPL; -} - -static HRESULT WINAPI profile3_AddStream(IWMProfile3 *iface, IWMStreamConfig *config) -{ - struct async_reader *This = impl_from_IWMProfile3(iface); - FIXME("%p, %p\n", This, config); - return E_NOTIMPL; -} - -static HRESULT WINAPI profile3_ReconfigStream(IWMProfile3 *iface, IWMStreamConfig *config) -{ - struct async_reader *This = impl_from_IWMProfile3(iface); - FIXME("%p, %p\n", This, config); - return E_NOTIMPL; -} - -static HRESULT WINAPI profile3_CreateNewStream(IWMProfile3 *iface, REFGUID type, IWMStreamConfig **config) -{ - struct async_reader *This = impl_from_IWMProfile3(iface); - FIXME("%p, %s, %p\n", This, debugstr_guid(type), config); - return E_NOTIMPL; -} - -static HRESULT WINAPI profile3_GetMutualExclusionCount(IWMProfile3 *iface, DWORD *count) -{ - struct async_reader *This = impl_from_IWMProfile3(iface); - FIXME("%p, %p\n", This, count); - return E_NOTIMPL; -} - -static HRESULT WINAPI profile3_GetMutualExclusion(IWMProfile3 *iface, DWORD index, IWMMutualExclusion **mutual) -{ - struct async_reader *This = impl_from_IWMProfile3(iface); - FIXME("%p, %d, %p\n", This, index, mutual); - return E_NOTIMPL; -} - -static HRESULT WINAPI profile3_RemoveMutualExclusion(IWMProfile3 *iface, IWMMutualExclusion *mutual) -{ - struct async_reader *This = impl_from_IWMProfile3(iface); - FIXME("%p, %p\n", This, mutual); - return E_NOTIMPL; -} - -static HRESULT WINAPI profile3_AddMutualExclusion(IWMProfile3 *iface, IWMMutualExclusion *mutual) -{ - struct async_reader *This = impl_from_IWMProfile3(iface); - FIXME("%p, %p\n", This, mutual); - return E_NOTIMPL; -} - -static HRESULT WINAPI profile3_CreateNewMutualExclusion(IWMProfile3 *iface, IWMMutualExclusion **mutual) -{ - struct async_reader *This = impl_from_IWMProfile3(iface); - FIXME("%p, %p\n", This, mutual); - return E_NOTIMPL; -} - -static HRESULT WINAPI profile3_GetProfileID(IWMProfile3 *iface, GUID *guid) -{ - struct async_reader *This = impl_from_IWMProfile3(iface); - FIXME("%p, %p\n", This, guid); - return E_NOTIMPL; -} - -static HRESULT WINAPI profile3_GetStorageFormat(IWMProfile3 *iface, WMT_STORAGE_FORMAT *storage) -{ - struct async_reader *This = impl_from_IWMProfile3(iface); - FIXME("%p, %p\n", This, storage); - return E_NOTIMPL; -} - -static HRESULT WINAPI profile3_SetStorageFormat(IWMProfile3 *iface, WMT_STORAGE_FORMAT storage) -{ - struct async_reader *This = impl_from_IWMProfile3(iface); - FIXME("%p, %d\n", This, storage); - return E_NOTIMPL; -} - -static HRESULT WINAPI profile3_GetBandwidthSharingCount(IWMProfile3 *iface, DWORD *count) -{ - struct async_reader *This = impl_from_IWMProfile3(iface); - FIXME("%p, %p\n", This, count); - return E_NOTIMPL; -} - -static HRESULT WINAPI profile3_GetBandwidthSharing(IWMProfile3 *iface, DWORD index, IWMBandwidthSharing **bandwidth) -{ - struct async_reader *This = impl_from_IWMProfile3(iface); - FIXME("%p, %d, %p\n", This, index, bandwidth); - return E_NOTIMPL; -} - -static HRESULT WINAPI profile3_RemoveBandwidthSharing( IWMProfile3 *iface, IWMBandwidthSharing *bandwidth) -{ - struct async_reader *This = impl_from_IWMProfile3(iface); - FIXME("%p, %p\n", This, bandwidth); - return E_NOTIMPL; -} - -static HRESULT WINAPI profile3_AddBandwidthSharing(IWMProfile3 *iface, IWMBandwidthSharing *bandwidth) -{ - struct async_reader *This = impl_from_IWMProfile3(iface); - FIXME("%p, %p\n", This, bandwidth); - return E_NOTIMPL; -} - -static HRESULT WINAPI profile3_CreateNewBandwidthSharing( IWMProfile3 *iface, IWMBandwidthSharing **bandwidth) -{ - struct async_reader *This = impl_from_IWMProfile3(iface); - FIXME("%p, %p\n", This, bandwidth); - return E_NOTIMPL; -} - -static HRESULT WINAPI profile3_GetStreamPrioritization(IWMProfile3 *iface, IWMStreamPrioritization **stream) -{ - struct async_reader *This = impl_from_IWMProfile3(iface); - FIXME("%p, %p\n", This, stream); - return E_NOTIMPL; -} - -static HRESULT WINAPI profile3_SetStreamPrioritization(IWMProfile3 *iface, IWMStreamPrioritization *stream) -{ - struct async_reader *This = impl_from_IWMProfile3(iface); - FIXME("%p, %p\n", This, stream); - return E_NOTIMPL; -} - -static HRESULT WINAPI profile3_RemoveStreamPrioritization(IWMProfile3 *iface) -{ - struct async_reader *This = impl_from_IWMProfile3(iface); - FIXME("%p\n", This); - return E_NOTIMPL; -} - -static HRESULT WINAPI profile3_CreateNewStreamPrioritization(IWMProfile3 *iface, IWMStreamPrioritization **stream) -{ - struct async_reader *This = impl_from_IWMProfile3(iface); - FIXME("%p, %p\n", This, stream); - return E_NOTIMPL; -} - -static HRESULT WINAPI profile3_GetExpectedPacketCount(IWMProfile3 *iface, QWORD duration, QWORD *packets) -{ - struct async_reader *This = impl_from_IWMProfile3(iface); - FIXME("%p, %s, %p\n", This, wine_dbgstr_longlong(duration), packets); - return E_NOTIMPL; -} - -static const IWMProfile3Vtbl WMProfile3Vtbl = -{ - profile3_QueryInterface, - profile3_AddRef, - profile3_Release, - profile3_GetVersion, - profile3_GetName, - profile3_SetName, - profile3_GetDescription, - profile3_SetDescription, - profile3_GetStreamCount, - profile3_GetStream, - profile3_GetStreamByNumber, - profile3_RemoveStream, - profile3_RemoveStreamByNumber, - profile3_AddStream, - profile3_ReconfigStream, - profile3_CreateNewStream, - profile3_GetMutualExclusionCount, - profile3_GetMutualExclusion, - profile3_RemoveMutualExclusion, - profile3_AddMutualExclusion, - profile3_CreateNewMutualExclusion, - profile3_GetProfileID, - profile3_GetStorageFormat, - profile3_SetStorageFormat, - profile3_GetBandwidthSharingCount, - profile3_GetBandwidthSharing, - profile3_RemoveBandwidthSharing, - profile3_AddBandwidthSharing, - profile3_CreateNewBandwidthSharing, - profile3_GetStreamPrioritization, - profile3_SetStreamPrioritization, - profile3_RemoveStreamPrioritization, - profile3_CreateNewStreamPrioritization, - profile3_GetExpectedPacketCount -}; - static struct async_reader *impl_from_IWMPacketSize2(IWMPacketSize2 *iface) { return CONTAINING_RECORD(iface, struct async_reader, IWMPacketSize2_iface); @@ -2037,6 +1662,80 @@ static const IWMPacketSize2Vtbl WMPacketSize2Vtbl = packetsize_SetMinPacketSize };
+static struct async_reader *impl_from_wm_reader(struct wm_reader *iface) +{ + return CONTAINING_RECORD(iface, struct async_reader, reader); +} + +static void *async_reader_query_interface(struct wm_reader *iface, REFIID iid) +{ + struct async_reader *reader = impl_from_wm_reader(iface); + + TRACE("reader %p, iid %s.\n", reader, debugstr_guid(iid)); + + if (IsEqualIID(iid, &IID_IReferenceClock)) + return &reader->IReferenceClock_iface; + + if (IsEqualIID(iid, &IID_IWMHeaderInfo) + || IsEqualIID(iid, &IID_IWMHeaderInfo2) + || IsEqualIID(iid, &IID_IWMHeaderInfo3)) + return &reader->IWMHeaderInfo3_iface; + + if (IsEqualIID(iid, &IID_IWMLanguageList)) + return &reader->IWMLanguageList_iface; + + if (IsEqualIID(iid, &IID_IWMPacketSize) + || IsEqualIID(iid, &IID_IWMPacketSize2)) + return &reader->IWMPacketSize2_iface; + + if (IsEqualIID(iid, &IID_IWMReader)) + return &reader->IWMReader_iface; + + if (IsEqualIID(iid, &IID_IWMReaderAccelerator)) + return &reader->IWMReaderAccelerator_iface; + + if (IsEqualIID(iid, &IID_IWMReaderAdvanced) + || IsEqualIID(iid, &IID_IWMReaderAdvanced2) + || IsEqualIID(iid, &IID_IWMReaderAdvanced3) + || IsEqualIID(iid, &IID_IWMReaderAdvanced4) + || IsEqualIID(iid, &IID_IWMReaderAdvanced5) + || IsEqualIID(iid, &IID_IWMReaderAdvanced6)) + return &reader->IWMReaderAdvanced6_iface; + + if (IsEqualIID(iid, &IID_IWMReaderNetworkConfig) + || IsEqualIID(iid, &IID_IWMReaderNetworkConfig2)) + return &reader->IWMReaderNetworkConfig2_iface; + + if (IsEqualIID(iid, &IID_IWMReaderPlaylistBurn)) + return &reader->IWMReaderPlaylistBurn_iface; + + if (IsEqualIID(iid, &IID_IWMReaderStreamClock)) + return &reader->IWMReaderStreamClock_iface; + + if (IsEqualIID(iid, &IID_IWMReaderTimecode)) + return &reader->IWMReaderTimecode_iface; + + if (IsEqualIID(iid, &IID_IWMReaderTypeNegotiation)) + return &reader->IWMReaderTypeNegotiation_iface; + + return NULL; +} + +static void async_reader_destroy(struct wm_reader *iface) +{ + struct async_reader *reader = impl_from_wm_reader(iface); + + TRACE("reader %p.\n", reader); + + free(reader); +} + +static const struct wm_reader_ops async_reader_ops = +{ + .query_interface = async_reader_query_interface, + .destroy = async_reader_destroy, +}; + HRESULT WINAPI winegstreamer_create_wm_async_reader(IWMReader **reader) { struct async_reader *object; @@ -2046,11 +1745,12 @@ HRESULT WINAPI winegstreamer_create_wm_async_reader(IWMReader **reader) if (!(object = calloc(1, sizeof(*object)))) return E_OUTOFMEMORY;
+ wm_reader_init(&object->reader, &async_reader_ops); + 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; @@ -2059,7 +1759,6 @@ HRESULT WINAPI winegstreamer_create_wm_async_reader(IWMReader **reader) object->IWMReaderStreamClock_iface.lpVtbl = &WMReaderStreamClockVtbl; object->IWMReaderTimecode_iface.lpVtbl = &WMReaderTimecodeVtbl; object->IWMReaderTypeNegotiation_iface.lpVtbl = &WMReaderTypeNegotiationVtbl; - object->ref = 1;
TRACE("Created async reader %p.\n", object); *reader = (IWMReader *)&object->IWMReader_iface; diff --git a/dlls/winegstreamer/wm_reader.c b/dlls/winegstreamer/wm_reader.c new file mode 100644 index 00000000000..2bab6eb462d --- /dev/null +++ b/dlls/winegstreamer/wm_reader.c @@ -0,0 +1,308 @@ +/* + * Copyright 2012 Austin English + * + * reader 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. + * + * reader 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 "gst_private.h" + +WINE_DEFAULT_DEBUG_CHANNEL(wmvcore); + +static struct wm_reader *impl_from_IWMProfile3(IWMProfile3 *iface) +{ + return CONTAINING_RECORD(iface, struct wm_reader, IWMProfile3_iface); +} + +static HRESULT WINAPI profile_QueryInterface(IWMProfile3 *iface, REFIID iid, void **out) +{ + struct wm_reader *reader = impl_from_IWMProfile3(iface); + + TRACE("reader %p, iid %s, out %p.\n", reader, debugstr_guid(iid), out); + + if (IsEqualIID(iid, &IID_IUnknown) + || IsEqualIID(iid, &IID_IWMProfile) + || IsEqualIID(iid, &IID_IWMProfile2) + || IsEqualIID(iid, &IID_IWMProfile3)) + { + *out = &reader->IWMProfile3_iface; + } + else if (!(*out = reader->ops->query_interface(reader, iid))) + { + WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(iid)); + return E_NOINTERFACE; + } + + IUnknown_AddRef((IUnknown *)*out); + return S_OK; +} + +static ULONG WINAPI profile_AddRef(IWMProfile3 *iface) +{ + struct wm_reader *reader = impl_from_IWMProfile3(iface); + ULONG refcount = InterlockedIncrement(&reader->refcount); + + TRACE("%p increasing refcount to %u.\n", reader, refcount); + + return refcount; +} + +static ULONG WINAPI profile_Release(IWMProfile3 *iface) +{ + struct wm_reader *reader = impl_from_IWMProfile3(iface); + ULONG refcount = InterlockedDecrement(&reader->refcount); + + TRACE("%p decreasing refcount to %u.\n", reader, refcount); + + if (!refcount) + reader->ops->destroy(reader); + + return refcount; +} + +static HRESULT WINAPI profile_GetVersion(IWMProfile3 *iface, WMT_VERSION *version) +{ + FIXME("iface %p, version %p, stub!\n", iface, version); + return E_NOTIMPL; +} + +static HRESULT WINAPI profile_GetName(IWMProfile3 *iface, WCHAR *name, DWORD *length) +{ + FIXME("iface %p, name %p, length %p, stub!\n", iface, name, length); + return E_NOTIMPL; +} + +static HRESULT WINAPI profile_SetName(IWMProfile3 *iface, const WCHAR *name) +{ + FIXME("iface %p, name %s, stub!\n", iface, debugstr_w(name)); + return E_NOTIMPL; +} + +static HRESULT WINAPI profile_GetDescription(IWMProfile3 *iface, WCHAR *description, DWORD *length) +{ + FIXME("iface %p, description %p, length %p, stub!\n", iface, description, length); + return E_NOTIMPL; +} + +static HRESULT WINAPI profile_SetDescription(IWMProfile3 *iface, const WCHAR *description) +{ + FIXME("iface %p, description %s, stub!\n", iface, debugstr_w(description)); + return E_NOTIMPL; +} + +static HRESULT WINAPI profile_GetStreamCount(IWMProfile3 *iface, DWORD *count) +{ + FIXME("iface %p, count %p, stub!\n", iface, count); + + if (!count) + return E_INVALIDARG; + + *count = 0; + return S_OK; +} + +static HRESULT WINAPI profile_GetStream(IWMProfile3 *iface, DWORD index, IWMStreamConfig **config) +{ + FIXME("iface %p, index %d, config %p, stub!\n", iface, index, config); + return E_NOTIMPL; +} + +static HRESULT WINAPI profile_GetStreamByNumber(IWMProfile3 *iface, WORD stream_number, IWMStreamConfig **config) +{ + FIXME("iface %p, stream_number %u, config %p, stub!\n", iface, stream_number, config); + return E_NOTIMPL; +} + +static HRESULT WINAPI profile_RemoveStream(IWMProfile3 *iface, IWMStreamConfig *config) +{ + FIXME("iface %p, config %p, stub!\n", iface, config); + return E_NOTIMPL; +} + +static HRESULT WINAPI profile_RemoveStreamByNumber(IWMProfile3 *iface, WORD stream_number) +{ + FIXME("iface %p, stream_number %u, stub!\n", iface, stream_number); + return E_NOTIMPL; +} + +static HRESULT WINAPI profile_AddStream(IWMProfile3 *iface, IWMStreamConfig *config) +{ + FIXME("iface %p, config %p, stub!\n", iface, config); + return E_NOTIMPL; +} + +static HRESULT WINAPI profile_ReconfigStream(IWMProfile3 *iface, IWMStreamConfig *config) +{ + FIXME("iface %p, config %p, stub!\n", iface, config); + return E_NOTIMPL; +} + +static HRESULT WINAPI profile_CreateNewStream(IWMProfile3 *iface, REFGUID type, IWMStreamConfig **config) +{ + FIXME("iface %p, type %s, config %p, stub!\n", iface, debugstr_guid(type), config); + return E_NOTIMPL; +} + +static HRESULT WINAPI profile_GetMutualExclusionCount(IWMProfile3 *iface, DWORD *count) +{ + FIXME("iface %p, count %p, stub!\n", iface, count); + return E_NOTIMPL; +} + +static HRESULT WINAPI profile_GetMutualExclusion(IWMProfile3 *iface, DWORD index, IWMMutualExclusion **excl) +{ + FIXME("iface %p, index %u, excl %p, stub!\n", iface, index, excl); + return E_NOTIMPL; +} + +static HRESULT WINAPI profile_RemoveMutualExclusion(IWMProfile3 *iface, IWMMutualExclusion *excl) +{ + FIXME("iface %p, excl %p, stub!\n", iface, excl); + return E_NOTIMPL; +} + +static HRESULT WINAPI profile_AddMutualExclusion(IWMProfile3 *iface, IWMMutualExclusion *excl) +{ + FIXME("iface %p, excl %p, stub!\n", iface, excl); + return E_NOTIMPL; +} + +static HRESULT WINAPI profile_CreateNewMutualExclusion(IWMProfile3 *iface, IWMMutualExclusion **excl) +{ + FIXME("iface %p, excl %p, stub!\n", iface, excl); + return E_NOTIMPL; +} + +static HRESULT WINAPI profile_GetProfileID(IWMProfile3 *iface, GUID *id) +{ + FIXME("iface %p, id %p, stub!\n", iface, id); + return E_NOTIMPL; +} + +static HRESULT WINAPI profile_GetStorageFormat(IWMProfile3 *iface, WMT_STORAGE_FORMAT *format) +{ + FIXME("iface %p, format %p, stub!\n", iface, format); + return E_NOTIMPL; +} + +static HRESULT WINAPI profile_SetStorageFormat(IWMProfile3 *iface, WMT_STORAGE_FORMAT format) +{ + FIXME("iface %p, format %#x, stub!\n", iface, format); + return E_NOTIMPL; +} + +static HRESULT WINAPI profile_GetBandwidthSharingCount(IWMProfile3 *iface, DWORD *count) +{ + FIXME("iface %p, count %p, stub!\n", iface, count); + return E_NOTIMPL; +} + +static HRESULT WINAPI profile_GetBandwidthSharing(IWMProfile3 *iface, DWORD index, IWMBandwidthSharing **sharing) +{ + FIXME("iface %p, index %d, sharing %p, stub!\n", iface, index, sharing); + return E_NOTIMPL; +} + +static HRESULT WINAPI profile_RemoveBandwidthSharing( IWMProfile3 *iface, IWMBandwidthSharing *sharing) +{ + FIXME("iface %p, sharing %p, stub!\n", iface, sharing); + return E_NOTIMPL; +} + +static HRESULT WINAPI profile_AddBandwidthSharing(IWMProfile3 *iface, IWMBandwidthSharing *sharing) +{ + FIXME("iface %p, sharing %p, stub!\n", iface, sharing); + return E_NOTIMPL; +} + +static HRESULT WINAPI profile_CreateNewBandwidthSharing( IWMProfile3 *iface, IWMBandwidthSharing **sharing) +{ + FIXME("iface %p, sharing %p, stub!\n", iface, sharing); + return E_NOTIMPL; +} + +static HRESULT WINAPI profile_GetStreamPrioritization(IWMProfile3 *iface, IWMStreamPrioritization **stream) +{ + FIXME("iface %p, stream %p, stub!\n", iface, stream); + return E_NOTIMPL; +} + +static HRESULT WINAPI profile_SetStreamPrioritization(IWMProfile3 *iface, IWMStreamPrioritization *stream) +{ + FIXME("iface %p, stream %p, stub!\n", iface, stream); + return E_NOTIMPL; +} + +static HRESULT WINAPI profile_RemoveStreamPrioritization(IWMProfile3 *iface) +{ + FIXME("iface %p, stub!\n", iface); + return E_NOTIMPL; +} + +static HRESULT WINAPI profile_CreateNewStreamPrioritization(IWMProfile3 *iface, IWMStreamPrioritization **stream) +{ + FIXME("iface %p, stream %p, stub!\n", iface, stream); + return E_NOTIMPL; +} + +static HRESULT WINAPI profile_GetExpectedPacketCount(IWMProfile3 *iface, QWORD duration, QWORD *count) +{ + FIXME("iface %p, duration %s, count %p, stub!\n", iface, debugstr_time(duration), count); + return E_NOTIMPL; +} + +static const IWMProfile3Vtbl profile_vtbl = +{ + profile_QueryInterface, + profile_AddRef, + profile_Release, + profile_GetVersion, + profile_GetName, + profile_SetName, + profile_GetDescription, + profile_SetDescription, + profile_GetStreamCount, + profile_GetStream, + profile_GetStreamByNumber, + profile_RemoveStream, + profile_RemoveStreamByNumber, + profile_AddStream, + profile_ReconfigStream, + profile_CreateNewStream, + profile_GetMutualExclusionCount, + profile_GetMutualExclusion, + profile_RemoveMutualExclusion, + profile_AddMutualExclusion, + profile_CreateNewMutualExclusion, + profile_GetProfileID, + profile_GetStorageFormat, + profile_SetStorageFormat, + profile_GetBandwidthSharingCount, + profile_GetBandwidthSharing, + profile_RemoveBandwidthSharing, + profile_AddBandwidthSharing, + profile_CreateNewBandwidthSharing, + profile_GetStreamPrioritization, + profile_SetStreamPrioritization, + profile_RemoveStreamPrioritization, + profile_CreateNewStreamPrioritization, + profile_GetExpectedPacketCount, +}; + +void wm_reader_init(struct wm_reader *reader, const struct wm_reader_ops *ops) +{ + reader->IWMProfile3_iface.lpVtbl = &profile_vtbl; + reader->refcount = 1; + reader->ops = ops; +} diff --git a/dlls/winegstreamer/wm_syncreader.c b/dlls/winegstreamer/wm_syncreader.c index 1d65820aa02..f4a5c9503ca 100644 --- a/dlls/winegstreamer/wm_syncreader.c +++ b/dlls/winegstreamer/wm_syncreader.c @@ -17,8 +17,6 @@ */
#include "gst_private.h" -#include "initguid.h" -#include "wmsdk.h"
WINE_DEFAULT_DEBUG_CHANNEL(wmvcore);
Signed-off-by: Zebediah Figura zfigura@codeweavers.com --- dlls/winegstreamer/wm_syncreader.c | 348 +++-------------------------- 1 file changed, 32 insertions(+), 316 deletions(-)
diff --git a/dlls/winegstreamer/wm_syncreader.c b/dlls/winegstreamer/wm_syncreader.c index f4a5c9503ca..0113ced1730 100644 --- a/dlls/winegstreamer/wm_syncreader.c +++ b/dlls/winegstreamer/wm_syncreader.c @@ -22,9 +22,9 @@ WINE_DEFAULT_DEBUG_CHANNEL(wmvcore);
struct sync_reader { - IWMProfile3 IWMProfile3_iface; + struct wm_reader reader; + IWMSyncReader2 IWMSyncReader2_iface; - LONG ref; };
static struct sync_reader *impl_from_IWMSyncReader2(IWMSyncReader2 *iface) @@ -32,59 +32,25 @@ static struct sync_reader *impl_from_IWMSyncReader2(IWMSyncReader2 *iface) return CONTAINING_RECORD(iface, struct sync_reader, IWMSyncReader2_iface); }
-static HRESULT WINAPI WMSyncReader_QueryInterface(IWMSyncReader2 *iface, REFIID riid, void **ppv) +static HRESULT WINAPI WMSyncReader_QueryInterface(IWMSyncReader2 *iface, REFIID iid, void **out) { - struct sync_reader *This = impl_from_IWMSyncReader2(iface); + struct sync_reader *reader = impl_from_IWMSyncReader2(iface);
- if(IsEqualGUID(riid, &IID_IUnknown)) { - TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv); - *ppv = &This->IWMSyncReader2_iface; - }else if(IsEqualGUID(riid, &IID_IWMProfile)) { - TRACE("(%p)->(IID_IWMProfile %p)\n", This, ppv); - *ppv = &This->IWMProfile3_iface; - }else if(IsEqualGUID(riid, &IID_IWMProfile2)) { - TRACE("(%p)->(IID_IWMProfile2 %p)\n", This, ppv); - *ppv = &This->IWMProfile3_iface; - }else if(IsEqualGUID(riid, &IID_IWMProfile3)) { - TRACE("(%p)->(IID_IWMProfile3 %p)\n", This, ppv); - *ppv = &This->IWMProfile3_iface; - }else if(IsEqualGUID(riid, &IID_IWMSyncReader)) { - TRACE("(%p)->(IID_IWMSyncReader %p)\n", This, ppv); - *ppv = &This->IWMSyncReader2_iface; - }else if(IsEqualGUID(riid, &IID_IWMSyncReader2)) { - TRACE("(%p)->(IID_IWMSyncReader2 %p)\n", This, ppv); - *ppv = &This->IWMSyncReader2_iface; - }else { - *ppv = NULL; - FIXME("(%p)->(%s %p)\n", This, debugstr_guid(riid), ppv); - return E_NOINTERFACE; - } - - IUnknown_AddRef((IUnknown*)*ppv); - return S_OK; + return IWMProfile3_QueryInterface(&reader->reader.IWMProfile3_iface, iid, out); }
static ULONG WINAPI WMSyncReader_AddRef(IWMSyncReader2 *iface) { - struct sync_reader *This = impl_from_IWMSyncReader2(iface); - LONG ref = InterlockedIncrement(&This->ref); + struct sync_reader *reader = impl_from_IWMSyncReader2(iface);
- TRACE("(%p) ref=%d\n", This, ref); - - return ref; + return IWMProfile3_AddRef(&reader->reader.IWMProfile3_iface); }
static ULONG WINAPI WMSyncReader_Release(IWMSyncReader2 *iface) { - struct sync_reader *This = impl_from_IWMSyncReader2(iface); - LONG ref = InterlockedDecrement(&This->ref); + struct sync_reader *reader = impl_from_IWMSyncReader2(iface);
- TRACE("(%p) ref=%d\n", This, ref); - - if(!ref) - free(This); - - return ref; + return IWMProfile3_Release(&reader->reader.IWMProfile3_iface); }
static HRESULT WINAPI WMSyncReader_Close(IWMSyncReader2 *iface) @@ -319,287 +285,37 @@ static const IWMSyncReader2Vtbl WMSyncReader2Vtbl = { WMSyncReader2_GetAllocateForStream };
-static struct sync_reader *impl_from_IWMProfile3(IWMProfile3 *iface) +static struct sync_reader *impl_from_wm_reader(struct wm_reader *iface) { - return CONTAINING_RECORD(iface, struct sync_reader, IWMProfile3_iface); + return CONTAINING_RECORD(iface, struct sync_reader, reader); }
-static HRESULT WINAPI WMProfile_QueryInterface(IWMProfile3 *iface, REFIID riid, void **ppv) +static void *sync_reader_query_interface(struct wm_reader *iface, REFIID iid) { - struct sync_reader *This = impl_from_IWMProfile3(iface); - return IWMSyncReader2_QueryInterface(&This->IWMSyncReader2_iface, riid, ppv); + struct sync_reader *reader = impl_from_wm_reader(iface); + + TRACE("reader %p, iid %s.\n", reader, debugstr_guid(iid)); + + if (IsEqualIID(iid, &IID_IWMSyncReader) + || IsEqualIID(iid, &IID_IWMSyncReader2)) + return &reader->IWMSyncReader2_iface; + + return NULL; }
-static ULONG WINAPI WMProfile_AddRef(IWMProfile3 *iface) +static void sync_reader_destroy(struct wm_reader *iface) { - struct sync_reader *This = impl_from_IWMProfile3(iface); - return IWMSyncReader2_AddRef(&This->IWMSyncReader2_iface); + struct sync_reader *reader = impl_from_wm_reader(iface); + + TRACE("reader %p.\n", reader); + + free(reader); }
-static ULONG WINAPI WMProfile_Release(IWMProfile3 *iface) +static const struct wm_reader_ops sync_reader_ops = { - struct sync_reader *This = impl_from_IWMProfile3(iface); - return IWMSyncReader2_Release(&This->IWMSyncReader2_iface); -} - -static HRESULT WINAPI WMProfile_GetVersion(IWMProfile3 *iface, WMT_VERSION *version) -{ - struct sync_reader *This = impl_from_IWMProfile3(iface); - FIXME("%p, %p\n", This, version); - return E_NOTIMPL; -} - -static HRESULT WINAPI WMProfile_GetName(IWMProfile3 *iface, WCHAR *name, DWORD *length) -{ - struct sync_reader *This = impl_from_IWMProfile3(iface); - FIXME("%p, %p, %p\n", This, name, length); - return E_NOTIMPL; -} - -static HRESULT WINAPI WMProfile_SetName(IWMProfile3 *iface, const WCHAR *name) -{ - struct sync_reader *This = impl_from_IWMProfile3(iface); - FIXME("%p, %s\n", This, debugstr_w(name)); - return E_NOTIMPL; -} - -static HRESULT WINAPI WMProfile_GetDescription(IWMProfile3 *iface, WCHAR *description, DWORD *length) -{ - struct sync_reader *This = impl_from_IWMProfile3(iface); - FIXME("%p, %p, %p\n", This, description, length); - return E_NOTIMPL; -} - -static HRESULT WINAPI WMProfile_SetDescription(IWMProfile3 *iface, const WCHAR *description) -{ - struct sync_reader *This = impl_from_IWMProfile3(iface); - FIXME("%p, %s\n", This, debugstr_w(description)); - return E_NOTIMPL; -} - -static HRESULT WINAPI WMProfile_GetStreamCount(IWMProfile3 *iface, DWORD *count) -{ - struct sync_reader *This = impl_from_IWMProfile3(iface); - FIXME("%p, %p\n", This, count); - - if (!count) - return E_INVALIDARG; - - *count = 0; - return S_OK; -} - -static HRESULT WINAPI WMProfile_GetStream(IWMProfile3 *iface, DWORD index, IWMStreamConfig **config) -{ - struct sync_reader *This = impl_from_IWMProfile3(iface); - FIXME("%p, %d, %p\n", This, index, config); - return E_NOTIMPL; -} - -static HRESULT WINAPI WMProfile_GetStreamByNumber(IWMProfile3 *iface, WORD stream, IWMStreamConfig **config) -{ - struct sync_reader *This = impl_from_IWMProfile3(iface); - FIXME("%p, %d, %p\n", This, stream, config); - return E_NOTIMPL; -} - -static HRESULT WINAPI WMProfile_RemoveStream(IWMProfile3 *iface, IWMStreamConfig *config) -{ - struct sync_reader *This = impl_from_IWMProfile3(iface); - FIXME("%p, %p\n", This, config); - return E_NOTIMPL; -} - -static HRESULT WINAPI WMProfile_RemoveStreamByNumber(IWMProfile3 *iface, WORD stream) -{ - struct sync_reader *This = impl_from_IWMProfile3(iface); - FIXME("%p, %d\n", This, stream); - return E_NOTIMPL; -} - -static HRESULT WINAPI WMProfile_AddStream(IWMProfile3 *iface, IWMStreamConfig *config) -{ - struct sync_reader *This = impl_from_IWMProfile3(iface); - FIXME("%p, %p\n", This, config); - return E_NOTIMPL; -} - -static HRESULT WINAPI WMProfile_ReconfigStream(IWMProfile3 *iface, IWMStreamConfig *config) -{ - struct sync_reader *This = impl_from_IWMProfile3(iface); - FIXME("%p, %p\n", This, config); - return E_NOTIMPL; -} - -static HRESULT WINAPI WMProfile_CreateNewStream(IWMProfile3 *iface, REFGUID type, IWMStreamConfig **config) -{ - struct sync_reader *This = impl_from_IWMProfile3(iface); - FIXME("%p, %s, %p\n", This, debugstr_guid(type), config); - return E_NOTIMPL; -} - -static HRESULT WINAPI WMProfile_GetMutualExclusionCount(IWMProfile3 *iface, DWORD *count) -{ - struct sync_reader *This = impl_from_IWMProfile3(iface); - FIXME("%p, %p\n", This, count); - return E_NOTIMPL; -} - -static HRESULT WINAPI WMProfile_GetMutualExclusion(IWMProfile3 *iface, DWORD index, IWMMutualExclusion **mutual) -{ - struct sync_reader *This = impl_from_IWMProfile3(iface); - FIXME("%p, %d, %p\n", This, index, mutual); - return E_NOTIMPL; -} - -static HRESULT WINAPI WMProfile_RemoveMutualExclusion(IWMProfile3 *iface, IWMMutualExclusion *mutual) -{ - struct sync_reader *This = impl_from_IWMProfile3(iface); - FIXME("%p, %p\n", This, mutual); - return E_NOTIMPL; -} - -static HRESULT WINAPI WMProfile_AddMutualExclusion(IWMProfile3 *iface, IWMMutualExclusion *mutual) -{ - struct sync_reader *This = impl_from_IWMProfile3(iface); - FIXME("%p, %p\n", This, mutual); - return E_NOTIMPL; -} - -static HRESULT WINAPI WMProfile_CreateNewMutualExclusion(IWMProfile3 *iface, IWMMutualExclusion **mutual) -{ - struct sync_reader *This = impl_from_IWMProfile3(iface); - FIXME("%p, %p\n", This, mutual); - return E_NOTIMPL; -} - -static HRESULT WINAPI WMProfile2_GetProfileID(IWMProfile3 *iface, GUID *guid) -{ - struct sync_reader *This = impl_from_IWMProfile3(iface); - FIXME("%p, %p\n", This, guid); - return E_NOTIMPL; -} - -static HRESULT WINAPI WMProfile3_GetStorageFormat(IWMProfile3 *iface, WMT_STORAGE_FORMAT *storage) -{ - struct sync_reader *This = impl_from_IWMProfile3(iface); - FIXME("%p, %p\n", This, storage); - return E_NOTIMPL; -} - -static HRESULT WINAPI WMProfile3_SetStorageFormat(IWMProfile3 *iface, WMT_STORAGE_FORMAT storage) -{ - struct sync_reader *This = impl_from_IWMProfile3(iface); - FIXME("%p, %d\n", This, storage); - return E_NOTIMPL; -} - -static HRESULT WINAPI WMProfile3_GetBandwidthSharingCount(IWMProfile3 *iface, DWORD *count) -{ - struct sync_reader *This = impl_from_IWMProfile3(iface); - FIXME("%p, %p\n", This, count); - return E_NOTIMPL; -} - -static HRESULT WINAPI WMProfile3_GetBandwidthSharing(IWMProfile3 *iface, DWORD index, IWMBandwidthSharing **bandwidth) -{ - struct sync_reader *This = impl_from_IWMProfile3(iface); - FIXME("%p, %d, %p\n", This, index, bandwidth); - return E_NOTIMPL; -} - -static HRESULT WINAPI WMProfile3_RemoveBandwidthSharing( IWMProfile3 *iface, IWMBandwidthSharing *bandwidth) -{ - struct sync_reader *This = impl_from_IWMProfile3(iface); - FIXME("%p, %p\n", This, bandwidth); - return E_NOTIMPL; -} - -static HRESULT WINAPI WMProfile3_AddBandwidthSharing(IWMProfile3 *iface, IWMBandwidthSharing *bandwidth) -{ - struct sync_reader *This = impl_from_IWMProfile3(iface); - FIXME("%p, %p\n", This, bandwidth); - return E_NOTIMPL; -} - -static HRESULT WINAPI WMProfile3_CreateNewBandwidthSharing( IWMProfile3 *iface, IWMBandwidthSharing **bandwidth) -{ - struct sync_reader *This = impl_from_IWMProfile3(iface); - FIXME("%p, %p\n", This, bandwidth); - return E_NOTIMPL; -} - -static HRESULT WINAPI WMProfile3_GetStreamPrioritization(IWMProfile3 *iface, IWMStreamPrioritization **stream) -{ - struct sync_reader *This = impl_from_IWMProfile3(iface); - FIXME("%p, %p\n", This, stream); - return E_NOTIMPL; -} - -static HRESULT WINAPI WMProfile3_SetStreamPrioritization(IWMProfile3 *iface, IWMStreamPrioritization *stream) -{ - struct sync_reader *This = impl_from_IWMProfile3(iface); - FIXME("%p, %p\n", This, stream); - return E_NOTIMPL; -} - -static HRESULT WINAPI WMProfile3_RemoveStreamPrioritization(IWMProfile3 *iface) -{ - struct sync_reader *This = impl_from_IWMProfile3(iface); - FIXME("%p\n", This); - return E_NOTIMPL; -} - -static HRESULT WINAPI WMProfile3_CreateNewStreamPrioritization(IWMProfile3 *iface, IWMStreamPrioritization **stream) -{ - struct sync_reader *This = impl_from_IWMProfile3(iface); - FIXME("%p, %p\n", This, stream); - return E_NOTIMPL; -} - -static HRESULT WINAPI WMProfile3_GetExpectedPacketCount(IWMProfile3 *iface, QWORD duration, QWORD *packets) -{ - struct sync_reader *This = impl_from_IWMProfile3(iface); - FIXME("%p, %s, %p\n", This, wine_dbgstr_longlong(duration), packets); - return E_NOTIMPL; -} - -static const IWMProfile3Vtbl WMProfile3Vtbl = -{ - WMProfile_QueryInterface, - WMProfile_AddRef, - WMProfile_Release, - WMProfile_GetVersion, - WMProfile_GetName, - WMProfile_SetName, - WMProfile_GetDescription, - WMProfile_SetDescription, - WMProfile_GetStreamCount, - WMProfile_GetStream, - WMProfile_GetStreamByNumber, - WMProfile_RemoveStream, - WMProfile_RemoveStreamByNumber, - WMProfile_AddStream, - WMProfile_ReconfigStream, - WMProfile_CreateNewStream, - WMProfile_GetMutualExclusionCount, - WMProfile_GetMutualExclusion, - WMProfile_RemoveMutualExclusion, - WMProfile_AddMutualExclusion, - WMProfile_CreateNewMutualExclusion, - WMProfile2_GetProfileID, - WMProfile3_GetStorageFormat, - WMProfile3_SetStorageFormat, - WMProfile3_GetBandwidthSharingCount, - WMProfile3_GetBandwidthSharing, - WMProfile3_RemoveBandwidthSharing, - WMProfile3_AddBandwidthSharing, - WMProfile3_CreateNewBandwidthSharing, - WMProfile3_GetStreamPrioritization, - WMProfile3_SetStreamPrioritization, - WMProfile3_RemoveStreamPrioritization, - WMProfile3_CreateNewStreamPrioritization, - WMProfile3_GetExpectedPacketCount + .query_interface = sync_reader_query_interface, + .destroy = sync_reader_destroy, };
HRESULT WINAPI winegstreamer_create_wm_sync_reader(IWMSyncReader **reader) @@ -611,9 +327,9 @@ HRESULT WINAPI winegstreamer_create_wm_sync_reader(IWMSyncReader **reader) if (!(object = calloc(1, sizeof(*object)))) return E_OUTOFMEMORY;
- object->IWMProfile3_iface.lpVtbl = &WMProfile3Vtbl; + wm_reader_init(&object->reader, &sync_reader_ops); + object->IWMSyncReader2_iface.lpVtbl = &WMSyncReader2Vtbl; - object->ref = 1;
TRACE("Created sync reader %p.\n", object); *reader = (IWMSyncReader *)&object->IWMSyncReader2_iface;
Signed-off-by: Zebediah Figura zfigura@codeweavers.com --- dlls/wmvcore/tests/wmvcore.c | 42 ++++++++++++++++++------------------ 1 file changed, 21 insertions(+), 21 deletions(-)
diff --git a/dlls/wmvcore/tests/wmvcore.c b/dlls/wmvcore/tests/wmvcore.c index 63509b8c93e..2b36c411262 100644 --- a/dlls/wmvcore/tests/wmvcore.c +++ b/dlls/wmvcore/tests/wmvcore.c @@ -86,30 +86,30 @@ static void test_wmreader_interfaces(void) check_interface(reader, &IID_IWMSyncReader, FALSE); check_interface(reader, &IID_IWMSyncReader2, FALSE);
+ check_interface(reader, &IID_IReferenceClock, TRUE); + check_interface(reader, &IID_IWMHeaderInfo, TRUE); + check_interface(reader, &IID_IWMHeaderInfo2, TRUE); + check_interface(reader, &IID_IWMHeaderInfo3, TRUE); + check_interface(reader, &IID_IWMLanguageList, TRUE); + check_interface(reader, &IID_IWMPacketSize, TRUE); + check_interface(reader, &IID_IWMPacketSize2, TRUE); + check_interface(reader, &IID_IWMProfile, TRUE); + check_interface(reader, &IID_IWMProfile2, TRUE); + check_interface(reader, &IID_IWMProfile3, TRUE); check_interface(reader, &IID_IWMReader, TRUE); + check_interface(reader, &IID_IWMReaderAccelerator, TRUE); check_interface(reader, &IID_IWMReaderAdvanced, TRUE); check_interface(reader, &IID_IWMReaderAdvanced2, TRUE); check_interface(reader, &IID_IWMReaderAdvanced3, TRUE); check_interface(reader, &IID_IWMReaderAdvanced4, TRUE); check_interface(reader, &IID_IWMReaderAdvanced5, TRUE); check_interface(reader, &IID_IWMReaderAdvanced6, TRUE); - check_interface(reader, &IID_IWMHeaderInfo, TRUE); - check_interface(reader, &IID_IWMHeaderInfo2, TRUE); - check_interface(reader, &IID_IWMHeaderInfo3, TRUE); - check_interface(reader, &IID_IWMProfile, TRUE); - check_interface(reader, &IID_IWMProfile2, TRUE); - check_interface(reader, &IID_IWMProfile3, TRUE); - check_interface(reader, &IID_IWMPacketSize, TRUE); - check_interface(reader, &IID_IWMPacketSize2, TRUE); - check_interface(reader, &IID_IWMReaderAccelerator, TRUE); - check_interface(reader, &IID_IWMReaderTimecode, TRUE); check_interface(reader, &IID_IWMReaderNetworkConfig, TRUE); check_interface(reader, &IID_IWMReaderNetworkConfig2, TRUE); - check_interface(reader, &IID_IWMReaderStreamClock, TRUE); - check_interface(reader, &IID_IWMReaderTypeNegotiation, TRUE); check_interface(reader, &IID_IWMReaderPlaylistBurn, TRUE); - check_interface(reader, &IID_IWMLanguageList, TRUE); - check_interface(reader, &IID_IReferenceClock, TRUE); + check_interface(reader, &IID_IWMReaderStreamClock, TRUE); + check_interface(reader, &IID_IWMReaderTimecode, TRUE); + check_interface(reader, &IID_IWMReaderTypeNegotiation, TRUE);
IWMReader_Release(reader); } @@ -127,6 +127,7 @@ static void test_wmsyncreader_interfaces(void) return; }
+ check_interface(reader, &IID_IReferenceClock, FALSE); check_interface(reader, &IID_IWMDRMReader, FALSE); check_interface(reader, &IID_IWMDRMReader2, FALSE); check_interface(reader, &IID_IWMDRMReader3, FALSE); @@ -142,21 +143,20 @@ static void test_wmsyncreader_interfaces(void) check_interface(reader, &IID_IWMReaderNetworkConfig2, FALSE); check_interface(reader, &IID_IWMReaderStreamClock, FALSE); check_interface(reader, &IID_IWMReaderTypeNegotiation, FALSE); - check_interface(reader, &IID_IReferenceClock, FALSE);
- check_interface(reader, &IID_IWMSyncReader, TRUE); - check_interface(reader, &IID_IWMSyncReader2, TRUE); todo_wine check_interface(reader, &IID_IWMHeaderInfo, TRUE); todo_wine check_interface(reader, &IID_IWMHeaderInfo2, TRUE); todo_wine check_interface(reader, &IID_IWMHeaderInfo3, TRUE); + todo_wine check_interface(reader, &IID_IWMLanguageList, TRUE); + todo_wine check_interface(reader, &IID_IWMPacketSize, TRUE); + todo_wine check_interface(reader, &IID_IWMPacketSize2, TRUE); check_interface(reader, &IID_IWMProfile, TRUE); check_interface(reader, &IID_IWMProfile2, TRUE); check_interface(reader, &IID_IWMProfile3, TRUE); - todo_wine check_interface(reader, &IID_IWMPacketSize, TRUE); - todo_wine check_interface(reader, &IID_IWMPacketSize2, TRUE); - todo_wine check_interface(reader, &IID_IWMReaderTimecode, TRUE); todo_wine check_interface(reader, &IID_IWMReaderPlaylistBurn, TRUE); - todo_wine check_interface(reader, &IID_IWMLanguageList, TRUE); + todo_wine check_interface(reader, &IID_IWMReaderTimecode, TRUE); + check_interface(reader, &IID_IWMSyncReader, TRUE); + check_interface(reader, &IID_IWMSyncReader2, TRUE);
IWMSyncReader_Release(reader); }
Signed-off-by: Zebediah Figura zfigura@codeweavers.com --- dlls/winegstreamer/gst_private.h | 1 + dlls/winegstreamer/wm_asyncreader.c | 227 ---------------------------- dlls/winegstreamer/wm_reader.c | 215 +++++++++++++++++++++++++- dlls/wmvcore/tests/wmvcore.c | 6 +- 4 files changed, 218 insertions(+), 231 deletions(-)
diff --git a/dlls/winegstreamer/gst_private.h b/dlls/winegstreamer/gst_private.h index 6c86031897e..71d3bb2b509 100644 --- a/dlls/winegstreamer/gst_private.h +++ b/dlls/winegstreamer/gst_private.h @@ -115,6 +115,7 @@ HRESULT audio_converter_create(REFIID riid, void **ret) DECLSPEC_HIDDEN;
struct wm_reader { + IWMHeaderInfo3 IWMHeaderInfo3_iface; IWMProfile3 IWMProfile3_iface; LONG refcount;
diff --git a/dlls/winegstreamer/wm_asyncreader.c b/dlls/winegstreamer/wm_asyncreader.c index 3e341ec41e9..1361b20932f 100644 --- a/dlls/winegstreamer/wm_asyncreader.c +++ b/dlls/winegstreamer/wm_asyncreader.c @@ -32,7 +32,6 @@ struct async_reader IWMReaderTypeNegotiation IWMReaderTypeNegotiation_iface; IWMReaderTimecode IWMReaderTimecode_iface; IWMReaderPlaylistBurn IWMReaderPlaylistBurn_iface; - IWMHeaderInfo3 IWMHeaderInfo3_iface; IWMLanguageList IWMLanguageList_iface; IReferenceClock IReferenceClock_iface; IWMPacketSize2 IWMPacketSize2_iface; @@ -1258,226 +1257,6 @@ static const IWMReaderPlaylistBurnVtbl WMReaderPlaylistBurnVtbl = playlist_EndPlaylistBurn };
-static struct async_reader *impl_from_IWMHeaderInfo3(IWMHeaderInfo3 *iface) -{ - return CONTAINING_RECORD(iface, struct async_reader, IWMHeaderInfo3_iface); -} - -static HRESULT WINAPI headerinfo_QueryInterface(IWMHeaderInfo3 *iface, REFIID riid, void **ppv) -{ - struct async_reader *This = impl_from_IWMHeaderInfo3(iface); - return IWMReader_QueryInterface(&This->IWMReader_iface, riid, ppv); -} - -static ULONG WINAPI headerinfo_AddRef(IWMHeaderInfo3 *iface) -{ - struct async_reader *This = impl_from_IWMHeaderInfo3(iface); - return IWMReader_AddRef(&This->IWMReader_iface); -} - -static ULONG WINAPI headerinfo_Release(IWMHeaderInfo3 *iface) -{ - struct async_reader *This = impl_from_IWMHeaderInfo3(iface); - return IWMReader_Release(&This->IWMReader_iface); -} - -static HRESULT WINAPI headerinfo_GetAttributeCount(IWMHeaderInfo3 *iface, WORD stream_num, WORD *attributes) -{ - struct async_reader *This = impl_from_IWMHeaderInfo3(iface); - FIXME("%p, %d, %p\n", This, stream_num, attributes); - return E_NOTIMPL; -} - -static HRESULT WINAPI headerinfo_GetAttributeByIndex(IWMHeaderInfo3 *iface, WORD index, WORD *stream_num, - WCHAR *name, WORD *name_len, WMT_ATTR_DATATYPE *type, BYTE *value, WORD *length) -{ - struct async_reader *This = impl_from_IWMHeaderInfo3(iface); - FIXME("%p, %d, %p, %p, %p, %p, %p, %p\n", This, index, stream_num, name, name_len, type, - value, length); - return E_NOTIMPL; -} - -static HRESULT WINAPI headerinfo_GetAttributeByName(IWMHeaderInfo3 *iface, WORD *stream_num, LPCWSTR name, - WMT_ATTR_DATATYPE *type, BYTE *value, WORD *length) -{ - struct async_reader *This = impl_from_IWMHeaderInfo3(iface); - FIXME("%p, %p, %s, %p, %p, %p\n", This, stream_num, debugstr_w(name), type, value, length); - return E_NOTIMPL; -} - -static HRESULT WINAPI headerinfo_SetAttribute(IWMHeaderInfo3 *iface, WORD stream_num, LPCWSTR name, - WMT_ATTR_DATATYPE type, const BYTE *value, WORD length) -{ - struct async_reader *This = impl_from_IWMHeaderInfo3(iface); - FIXME("%p, %d, %s, %d, %p, %d\n", This, stream_num, debugstr_w(name), type, value, length); - return E_NOTIMPL; -} - -static HRESULT WINAPI headerinfo_GetMarkerCount(IWMHeaderInfo3 *iface, WORD *markers) -{ - struct async_reader *This = impl_from_IWMHeaderInfo3(iface); - FIXME("%p, %p\n", This, markers); - return E_NOTIMPL; -} - -static HRESULT WINAPI headerinfo_GetMarker(IWMHeaderInfo3 *iface, WORD index, WCHAR *marker_name, - WORD *marker_len, QWORD *marker_time) -{ - struct async_reader *This = impl_from_IWMHeaderInfo3(iface); - FIXME("%p, %d, %p, %p, %p\n", This, index, marker_name, marker_len, marker_time); - return E_NOTIMPL; -} - -static HRESULT WINAPI headerinfo_AddMarker(IWMHeaderInfo3 *iface, LPCWSTR_WMSDK_TYPE_SAFE marker_name, - QWORD marker_time) -{ - struct async_reader *This = impl_from_IWMHeaderInfo3(iface); - FIXME("%p, %p, %s\n", This, marker_name, wine_dbgstr_longlong(marker_time)); - return E_NOTIMPL; -} - -static HRESULT WINAPI headerinfo_RemoveMarker(IWMHeaderInfo3 *iface, WORD index) -{ - struct async_reader *This = impl_from_IWMHeaderInfo3(iface); - FIXME("%p, %d\n", This, index); - return E_NOTIMPL; -} - -static HRESULT WINAPI headerinfo_GetScriptCount(IWMHeaderInfo3 *iface, WORD *scripts) -{ - struct async_reader *This = impl_from_IWMHeaderInfo3(iface); - FIXME("%p, %p\n", This, scripts); - return E_NOTIMPL; -} - -static HRESULT WINAPI headerinfo_GetScript(IWMHeaderInfo3 *iface, WORD index, WCHAR *type, - WORD *type_len, WCHAR *command, WORD *command_len, QWORD *script_time) -{ - struct async_reader *This = impl_from_IWMHeaderInfo3(iface); - FIXME("%p, %d, %p, %p, %p, %p, %p\n", This, index, type, type_len, command, command_len, script_time); - return E_NOTIMPL; -} - -static HRESULT WINAPI headerinfo_AddScript(IWMHeaderInfo3 *iface, LPCWSTR_WMSDK_TYPE_SAFE type, - LPCWSTR_WMSDK_TYPE_SAFE command, QWORD script_time) -{ - struct async_reader *This = impl_from_IWMHeaderInfo3(iface); - FIXME("%p, %s, %s, %s\n", This, debugstr_w(type), debugstr_w(command), wine_dbgstr_longlong(script_time)); - return E_NOTIMPL; -} - -static HRESULT WINAPI headerinfo_RemoveScript(IWMHeaderInfo3 *iface, WORD index) -{ - struct async_reader *This = impl_from_IWMHeaderInfo3(iface); - FIXME("%p, %d\n", This, index); - return E_NOTIMPL; -} - -static HRESULT WINAPI headerinfo_GetCodecInfoCount(IWMHeaderInfo3 *iface, DWORD *codec_infos) -{ - struct async_reader *This = impl_from_IWMHeaderInfo3(iface); - FIXME("%p, %p\n", This, codec_infos); - return E_NOTIMPL; -} - -static HRESULT WINAPI headerinfo_GetCodecInfo(IWMHeaderInfo3 *iface, DWORD index, WORD *name_len, - WCHAR *name, WORD *description_len, WCHAR *description, WMT_CODEC_INFO_TYPE *codec_type, - WORD *codec_info_cnt, BYTE *codec_info) -{ - struct async_reader *This = impl_from_IWMHeaderInfo3(iface); - FIXME("%p, %d, %p, %p, %p, %p, %p, %p, %p\n", This, index, name_len, name, description_len, - description, codec_type, codec_info_cnt, codec_info); - return E_NOTIMPL; -} - -static HRESULT WINAPI headerinfo_GetAttributeCountEx(IWMHeaderInfo3 *iface, WORD stream_num, WORD *attributes) -{ - struct async_reader *This = impl_from_IWMHeaderInfo3(iface); - FIXME("%p, %d, %p\n", This, stream_num, attributes); - return E_NOTIMPL; -} - -static HRESULT WINAPI headerinfo_GetAttributeIndices(IWMHeaderInfo3 *iface, WORD stream_num, LPCWSTR name, - WORD *lang_index, WORD *indices, WORD *count) -{ - struct async_reader *This = impl_from_IWMHeaderInfo3(iface); - FIXME("%p, %d, %s, %p, %p, %p\n", This, stream_num, debugstr_w(name), lang_index, indices, count); - return E_NOTIMPL; -} - -static HRESULT WINAPI headerinfo_GetAttributeByIndexEx(IWMHeaderInfo3 *iface, WORD stream_num, - WORD index, LPWSTR name, WORD *name_len, WMT_ATTR_DATATYPE *type, WORD *lang_index, - BYTE *value, DWORD *data_len) -{ - struct async_reader *This = impl_from_IWMHeaderInfo3(iface); - FIXME("%p, %d, %d, %s, %p, %p, %p, %p, %p\n", This, stream_num, index, debugstr_w(name), name_len, - type, lang_index, value, data_len); - return E_NOTIMPL; -} - -static HRESULT WINAPI headerinfo_ModifyAttribute(IWMHeaderInfo3 *iface, WORD stream_num, - WORD index, WMT_ATTR_DATATYPE type, WORD lang_index, const BYTE *value, DWORD length) -{ - struct async_reader *This = impl_from_IWMHeaderInfo3(iface); - FIXME("%p, %d, %d, %d, %d, %p, %d\n", This, stream_num, index, type, lang_index, value, length); - return E_NOTIMPL; -} - -static HRESULT WINAPI headerinfo_AddAttribute(IWMHeaderInfo3 *iface, WORD stream_num, LPCWSTR name, - WORD *index, WMT_ATTR_DATATYPE type, WORD lang_index, const BYTE *value, DWORD length) -{ - struct async_reader *This = impl_from_IWMHeaderInfo3(iface); - FIXME("%p, %d, %s, %p, %d, %d, %p, %d\n", This, stream_num, debugstr_w(name), index, - type, lang_index, value, length); - return E_NOTIMPL; -} - -static HRESULT WINAPI headerinfo_DeleteAttribute(IWMHeaderInfo3 *iface, WORD stream_num, WORD index) -{ - struct async_reader *This = impl_from_IWMHeaderInfo3(iface); - FIXME("%p, %d, %d\n", This, stream_num, index); - return E_NOTIMPL; -} - -static HRESULT WINAPI headerinfo_AddCodecInfo(IWMHeaderInfo3 *iface, LPCWSTR_WMSDK_TYPE_SAFE name, - LPCWSTR_WMSDK_TYPE_SAFE description, WMT_CODEC_INFO_TYPE codec_type, WORD codec_info_cnt, - BYTE *codec_info) -{ - struct async_reader *This = impl_from_IWMHeaderInfo3(iface); - FIXME("%p, %p, %p, %d, %d, %p\n", This, name, description, codec_type, codec_info_cnt, - codec_info); - return E_NOTIMPL; -} - -static const IWMHeaderInfo3Vtbl WMHeaderInfo3Vtbl = -{ - headerinfo_QueryInterface, - headerinfo_AddRef, - headerinfo_Release, - headerinfo_GetAttributeCount, - headerinfo_GetAttributeByIndex, - headerinfo_GetAttributeByName, - headerinfo_SetAttribute, - headerinfo_GetMarkerCount, - headerinfo_GetMarker, - headerinfo_AddMarker, - headerinfo_RemoveMarker, - headerinfo_GetScriptCount, - headerinfo_GetScript, - headerinfo_AddScript, - headerinfo_RemoveScript, - headerinfo_GetCodecInfoCount, - headerinfo_GetCodecInfo, - headerinfo_GetAttributeCountEx, - headerinfo_GetAttributeIndices, - headerinfo_GetAttributeByIndexEx, - headerinfo_ModifyAttribute, - headerinfo_AddAttribute, - headerinfo_DeleteAttribute, - headerinfo_AddCodecInfo -}; - - static struct async_reader *impl_from_IWMLanguageList(IWMLanguageList *iface) { return CONTAINING_RECORD(iface, struct async_reader, IWMLanguageList_iface); @@ -1676,11 +1455,6 @@ static void *async_reader_query_interface(struct wm_reader *iface, REFIID iid) if (IsEqualIID(iid, &IID_IReferenceClock)) return &reader->IReferenceClock_iface;
- if (IsEqualIID(iid, &IID_IWMHeaderInfo) - || IsEqualIID(iid, &IID_IWMHeaderInfo2) - || IsEqualIID(iid, &IID_IWMHeaderInfo3)) - return &reader->IWMHeaderInfo3_iface; - if (IsEqualIID(iid, &IID_IWMLanguageList)) return &reader->IWMLanguageList_iface;
@@ -1748,7 +1522,6 @@ HRESULT WINAPI winegstreamer_create_wm_async_reader(IWMReader **reader) wm_reader_init(&object->reader, &async_reader_ops);
object->IReferenceClock_iface.lpVtbl = &ReferenceClockVtbl; - object->IWMHeaderInfo3_iface.lpVtbl = &WMHeaderInfo3Vtbl; object->IWMLanguageList_iface.lpVtbl = &WMLanguageListVtbl; object->IWMPacketSize2_iface.lpVtbl = &WMPacketSize2Vtbl; object->IWMReader_iface.lpVtbl = &WMReaderVtbl; diff --git a/dlls/winegstreamer/wm_reader.c b/dlls/winegstreamer/wm_reader.c index 2bab6eb462d..bcc5ce41e9b 100644 --- a/dlls/winegstreamer/wm_reader.c +++ b/dlls/winegstreamer/wm_reader.c @@ -31,7 +31,13 @@ static HRESULT WINAPI profile_QueryInterface(IWMProfile3 *iface, REFIID iid, voi
TRACE("reader %p, iid %s, out %p.\n", reader, debugstr_guid(iid), out);
- if (IsEqualIID(iid, &IID_IUnknown) + if (IsEqualIID(iid, &IID_IWMHeaderInfo) + || IsEqualIID(iid, &IID_IWMHeaderInfo2) + || IsEqualIID(iid, &IID_IWMHeaderInfo3)) + { + *out = &reader->IWMHeaderInfo3_iface; + } + else if (IsEqualIID(iid, &IID_IUnknown) || IsEqualIID(iid, &IID_IWMProfile) || IsEqualIID(iid, &IID_IWMProfile2) || IsEqualIID(iid, &IID_IWMProfile3)) @@ -300,8 +306,215 @@ static const IWMProfile3Vtbl profile_vtbl = profile_GetExpectedPacketCount, };
+static struct wm_reader *impl_from_IWMHeaderInfo3(IWMHeaderInfo3 *iface) +{ + return CONTAINING_RECORD(iface, struct wm_reader, IWMHeaderInfo3_iface); +} + +static HRESULT WINAPI header_info_QueryInterface(IWMHeaderInfo3 *iface, REFIID iid, void **out) +{ + struct wm_reader *reader = impl_from_IWMHeaderInfo3(iface); + + return IWMProfile3_QueryInterface(&reader->IWMProfile3_iface, iid, out); +} + +static ULONG WINAPI header_info_AddRef(IWMHeaderInfo3 *iface) +{ + struct wm_reader *reader = impl_from_IWMHeaderInfo3(iface); + + return IWMProfile3_AddRef(&reader->IWMProfile3_iface); +} + +static ULONG WINAPI header_info_Release(IWMHeaderInfo3 *iface) +{ + struct wm_reader *reader = impl_from_IWMHeaderInfo3(iface); + + return IWMProfile3_Release(&reader->IWMProfile3_iface); +} + +static HRESULT WINAPI header_info_GetAttributeCount(IWMHeaderInfo3 *iface, WORD stream_number, WORD *count) +{ + FIXME("iface %p, stream_number %u, count %p, stub!\n", iface, stream_number, count); + return E_NOTIMPL; +} + +static HRESULT WINAPI header_info_GetAttributeByIndex(IWMHeaderInfo3 *iface, WORD index, WORD *stream_number, + WCHAR *name, WORD *name_len, WMT_ATTR_DATATYPE *type, BYTE *value, WORD *size) +{ + FIXME("iface %p, index %u, stream_number %p, name %p, name_len %p, type %p, value %p, size %p, stub!\n", + iface, index, stream_number, name, name_len, type, value, size); + return E_NOTIMPL; +} + +static HRESULT WINAPI header_info_GetAttributeByName(IWMHeaderInfo3 *iface, WORD *stream_number, + const WCHAR *name, WMT_ATTR_DATATYPE *type, BYTE *value, WORD *size) +{ + FIXME("iface %p, stream_number %p, name %s, type %p, value %p, size %p, stub!\n", + iface, stream_number, debugstr_w(name), type, value, size); + return E_NOTIMPL; +} + +static HRESULT WINAPI header_info_SetAttribute(IWMHeaderInfo3 *iface, WORD stream_number, + const WCHAR *name, WMT_ATTR_DATATYPE type, const BYTE *value, WORD size) +{ + FIXME("iface %p, stream_number %u, name %s, type %#x, value %p, size %u, stub!\n", + iface, stream_number, debugstr_w(name), type, value, size); + return E_NOTIMPL; +} + +static HRESULT WINAPI header_info_GetMarkerCount(IWMHeaderInfo3 *iface, WORD *count) +{ + FIXME("iface %p, count %p, stub!\n", iface, count); + return E_NOTIMPL; +} + +static HRESULT WINAPI header_info_GetMarker(IWMHeaderInfo3 *iface, + WORD index, WCHAR *name, WORD *len, QWORD *time) +{ + FIXME("iface %p, index %u, name %p, len %p, time %p, stub!\n", iface, index, name, len, time); + return E_NOTIMPL; +} + +static HRESULT WINAPI header_info_AddMarker(IWMHeaderInfo3 *iface, const WCHAR *name, QWORD time) +{ + FIXME("iface %p, name %s, time %s, stub!\n", iface, debugstr_w(name), debugstr_time(time)); + return E_NOTIMPL; +} + +static HRESULT WINAPI header_info_RemoveMarker(IWMHeaderInfo3 *iface, WORD index) +{ + FIXME("iface %p, index %u, stub!\n", iface, index); + return E_NOTIMPL; +} + +static HRESULT WINAPI header_info_GetScriptCount(IWMHeaderInfo3 *iface, WORD *count) +{ + FIXME("iface %p, count %p, stub!\n", iface, count); + return E_NOTIMPL; +} + +static HRESULT WINAPI header_info_GetScript(IWMHeaderInfo3 *iface, WORD index, WCHAR *type, + WORD *type_len, WCHAR *command, WORD *command_len, QWORD *time) +{ + FIXME("iface %p, index %u, type %p, type_len %p, command %p, command_len %p, time %p, stub!\n", + iface, index, type, type_len, command, command_len, time); + return E_NOTIMPL; +} + +static HRESULT WINAPI header_info_AddScript(IWMHeaderInfo3 *iface, + const WCHAR *type, const WCHAR *command, QWORD time) +{ + FIXME("iface %p, type %s, command %s, time %s, stub!\n", + iface, debugstr_w(type), debugstr_w(command), debugstr_time(time)); + return E_NOTIMPL; +} + +static HRESULT WINAPI header_info_RemoveScript(IWMHeaderInfo3 *iface, WORD index) +{ + FIXME("iface %p, index %u, stub!\n", iface, index); + return E_NOTIMPL; +} + +static HRESULT WINAPI header_info_GetCodecInfoCount(IWMHeaderInfo3 *iface, DWORD *count) +{ + FIXME("iface %p, count %p, stub!\n", iface, count); + return E_NOTIMPL; +} + +static HRESULT WINAPI header_info_GetCodecInfo(IWMHeaderInfo3 *iface, DWORD index, WORD *name_len, + WCHAR *name, WORD *desc_len, WCHAR *desc, WMT_CODEC_INFO_TYPE *type, WORD *size, BYTE *info) +{ + FIXME("iface %p, index %u, name_len %p, name %p, desc_len %p, desc %p, type %p, size %p, info %p, stub!\n", + iface, index, name_len, name, desc_len, desc, type, size, info); + return E_NOTIMPL; +} + +static HRESULT WINAPI header_info_GetAttributeCountEx(IWMHeaderInfo3 *iface, WORD stream_number, WORD *count) +{ + FIXME("iface %p, stream_number %u, count %p, stub!\n", iface, stream_number, count); + return E_NOTIMPL; +} + +static HRESULT WINAPI header_info_GetAttributeIndices(IWMHeaderInfo3 *iface, WORD stream_number, + const WCHAR *name, WORD *lang_index, WORD *indices, WORD *count) +{ + FIXME("iface %p, stream_number %u, name %s, lang_index %p, indices %p, count %p, stub!\n", + iface, stream_number, debugstr_w(name), lang_index, indices, count); + return E_NOTIMPL; +} + +static HRESULT WINAPI header_info_GetAttributeByIndexEx(IWMHeaderInfo3 *iface, + WORD stream_number, WORD index, WCHAR *name, WORD *name_len, + WMT_ATTR_DATATYPE *type, WORD *lang_index, BYTE *value, DWORD *size) +{ + FIXME("iface %p, stream_number %u, index %u, name %p, name_len %p," + " type %p, lang_index %p, value %p, size %p, stub!\n", + iface, stream_number, index, debugstr_w(name), name_len, type, lang_index, value, size); + return E_NOTIMPL; +} + +static HRESULT WINAPI header_info_ModifyAttribute(IWMHeaderInfo3 *iface, WORD stream_number, + WORD index, WMT_ATTR_DATATYPE type, WORD lang_index, const BYTE *value, DWORD size) +{ + FIXME("iface %p, stream_number %u, index %u, type %#x, lang_index %u, value %p, size %u, stub!\n", + iface, stream_number, index, type, lang_index, value, size); + return E_NOTIMPL; +} + +static HRESULT WINAPI header_info_AddAttribute(IWMHeaderInfo3 *iface, + WORD stream_number, const WCHAR *name, WORD *index, + WMT_ATTR_DATATYPE type, WORD lang_index, const BYTE *value, DWORD size) +{ + FIXME("iface %p, stream_number %u, name %s, index %p, type %#x, lang_index %u, value %p, size %u, stub!\n", + iface, stream_number, debugstr_w(name), index, type, lang_index, value, size); + return E_NOTIMPL; +} + +static HRESULT WINAPI header_info_DeleteAttribute(IWMHeaderInfo3 *iface, WORD stream_number, WORD index) +{ + FIXME("iface %p, stream_number %u, index %u, stub!\n", iface, stream_number, index); + return E_NOTIMPL; +} + +static HRESULT WINAPI header_info_AddCodecInfo(IWMHeaderInfo3 *iface, const WCHAR *name, + const WCHAR *desc, WMT_CODEC_INFO_TYPE type, WORD size, BYTE *info) +{ + FIXME("iface %p, name %s, desc %s, type %#x, size %u, info %p, stub!\n", + info, debugstr_w(name), debugstr_w(desc), type, size, info); + return E_NOTIMPL; +} + +static const IWMHeaderInfo3Vtbl header_info_vtbl = +{ + header_info_QueryInterface, + header_info_AddRef, + header_info_Release, + header_info_GetAttributeCount, + header_info_GetAttributeByIndex, + header_info_GetAttributeByName, + header_info_SetAttribute, + header_info_GetMarkerCount, + header_info_GetMarker, + header_info_AddMarker, + header_info_RemoveMarker, + header_info_GetScriptCount, + header_info_GetScript, + header_info_AddScript, + header_info_RemoveScript, + header_info_GetCodecInfoCount, + header_info_GetCodecInfo, + header_info_GetAttributeCountEx, + header_info_GetAttributeIndices, + header_info_GetAttributeByIndexEx, + header_info_ModifyAttribute, + header_info_AddAttribute, + header_info_DeleteAttribute, + header_info_AddCodecInfo, +}; + void wm_reader_init(struct wm_reader *reader, const struct wm_reader_ops *ops) { + reader->IWMHeaderInfo3_iface.lpVtbl = &header_info_vtbl; reader->IWMProfile3_iface.lpVtbl = &profile_vtbl; reader->refcount = 1; reader->ops = ops; diff --git a/dlls/wmvcore/tests/wmvcore.c b/dlls/wmvcore/tests/wmvcore.c index 2b36c411262..75d1f9e0c35 100644 --- a/dlls/wmvcore/tests/wmvcore.c +++ b/dlls/wmvcore/tests/wmvcore.c @@ -144,9 +144,9 @@ static void test_wmsyncreader_interfaces(void) check_interface(reader, &IID_IWMReaderStreamClock, FALSE); check_interface(reader, &IID_IWMReaderTypeNegotiation, FALSE);
- todo_wine check_interface(reader, &IID_IWMHeaderInfo, TRUE); - todo_wine check_interface(reader, &IID_IWMHeaderInfo2, TRUE); - todo_wine check_interface(reader, &IID_IWMHeaderInfo3, TRUE); + check_interface(reader, &IID_IWMHeaderInfo, TRUE); + check_interface(reader, &IID_IWMHeaderInfo2, TRUE); + check_interface(reader, &IID_IWMHeaderInfo3, TRUE); todo_wine check_interface(reader, &IID_IWMLanguageList, TRUE); todo_wine check_interface(reader, &IID_IWMPacketSize, TRUE); todo_wine check_interface(reader, &IID_IWMPacketSize2, TRUE);
Signed-off-by: Zebediah Figura zfigura@codeweavers.com --- dlls/winegstreamer/gst_private.h | 1 + dlls/winegstreamer/wm_asyncreader.c | 61 ----------------------------- dlls/winegstreamer/wm_reader.c | 61 +++++++++++++++++++++++++++++ dlls/wmvcore/tests/wmvcore.c | 2 +- 4 files changed, 63 insertions(+), 62 deletions(-)
diff --git a/dlls/winegstreamer/gst_private.h b/dlls/winegstreamer/gst_private.h index 71d3bb2b509..6dc0ad3e291 100644 --- a/dlls/winegstreamer/gst_private.h +++ b/dlls/winegstreamer/gst_private.h @@ -116,6 +116,7 @@ HRESULT audio_converter_create(REFIID riid, void **ret) DECLSPEC_HIDDEN; struct wm_reader { IWMHeaderInfo3 IWMHeaderInfo3_iface; + IWMLanguageList IWMLanguageList_iface; IWMProfile3 IWMProfile3_iface; LONG refcount;
diff --git a/dlls/winegstreamer/wm_asyncreader.c b/dlls/winegstreamer/wm_asyncreader.c index 1361b20932f..a36718ef453 100644 --- a/dlls/winegstreamer/wm_asyncreader.c +++ b/dlls/winegstreamer/wm_asyncreader.c @@ -32,7 +32,6 @@ struct async_reader IWMReaderTypeNegotiation IWMReaderTypeNegotiation_iface; IWMReaderTimecode IWMReaderTimecode_iface; IWMReaderPlaylistBurn IWMReaderPlaylistBurn_iface; - IWMLanguageList IWMLanguageList_iface; IReferenceClock IReferenceClock_iface; IWMPacketSize2 IWMPacketSize2_iface; }; @@ -1257,62 +1256,6 @@ static const IWMReaderPlaylistBurnVtbl WMReaderPlaylistBurnVtbl = playlist_EndPlaylistBurn };
-static struct async_reader *impl_from_IWMLanguageList(IWMLanguageList *iface) -{ - return CONTAINING_RECORD(iface, struct async_reader, IWMLanguageList_iface); -} - -static HRESULT WINAPI langlist_QueryInterface(IWMLanguageList *iface, REFIID riid, void **ppv) -{ - struct async_reader *This = impl_from_IWMLanguageList(iface); - return IWMReader_QueryInterface(&This->IWMReader_iface, riid, ppv); -} - -static ULONG WINAPI langlist_AddRef(IWMLanguageList *iface) -{ - struct async_reader *This = impl_from_IWMLanguageList(iface); - return IWMReader_AddRef(&This->IWMReader_iface); -} - -static ULONG WINAPI langlist_Release(IWMLanguageList *iface) -{ - struct async_reader *This = impl_from_IWMLanguageList(iface); - return IWMReader_Release(&This->IWMReader_iface); -} - -static HRESULT WINAPI langlist_GetLanguageCount(IWMLanguageList *iface, WORD *count) -{ - struct async_reader *This = impl_from_IWMLanguageList(iface); - FIXME("%p, %p\n", This, count); - return E_NOTIMPL; -} - -static HRESULT WINAPI langlist_GetLanguageDetails(IWMLanguageList *iface, WORD index, - WCHAR *language, WORD *length) -{ - struct async_reader *This = impl_from_IWMLanguageList(iface); - FIXME("%p, %d, %p, %p\n", This, index, language, length); - return E_NOTIMPL; -} - -static HRESULT WINAPI langlist_AddLanguageByRFC1766String(IWMLanguageList *iface, LPCWSTR_WMSDK_TYPE_SAFE language, - WORD *index) -{ - struct async_reader *This = impl_from_IWMLanguageList(iface); - FIXME("%p, %p, %p\n", This, language, index); - return E_NOTIMPL; -} - -static const IWMLanguageListVtbl WMLanguageListVtbl = -{ - langlist_QueryInterface, - langlist_AddRef, - langlist_Release, - langlist_GetLanguageCount, - langlist_GetLanguageDetails, - langlist_AddLanguageByRFC1766String -}; - static struct async_reader *impl_from_IReferenceClock(IReferenceClock *iface) { return CONTAINING_RECORD(iface, struct async_reader, IReferenceClock_iface); @@ -1455,9 +1398,6 @@ static void *async_reader_query_interface(struct wm_reader *iface, REFIID iid) if (IsEqualIID(iid, &IID_IReferenceClock)) return &reader->IReferenceClock_iface;
- if (IsEqualIID(iid, &IID_IWMLanguageList)) - return &reader->IWMLanguageList_iface; - if (IsEqualIID(iid, &IID_IWMPacketSize) || IsEqualIID(iid, &IID_IWMPacketSize2)) return &reader->IWMPacketSize2_iface; @@ -1522,7 +1462,6 @@ HRESULT WINAPI winegstreamer_create_wm_async_reader(IWMReader **reader) wm_reader_init(&object->reader, &async_reader_ops);
object->IReferenceClock_iface.lpVtbl = &ReferenceClockVtbl; - object->IWMLanguageList_iface.lpVtbl = &WMLanguageListVtbl; object->IWMPacketSize2_iface.lpVtbl = &WMPacketSize2Vtbl; object->IWMReader_iface.lpVtbl = &WMReaderVtbl; object->IWMReaderAdvanced6_iface.lpVtbl = &WMReaderAdvanced6Vtbl; diff --git a/dlls/winegstreamer/wm_reader.c b/dlls/winegstreamer/wm_reader.c index bcc5ce41e9b..d1e585d2462 100644 --- a/dlls/winegstreamer/wm_reader.c +++ b/dlls/winegstreamer/wm_reader.c @@ -37,6 +37,10 @@ static HRESULT WINAPI profile_QueryInterface(IWMProfile3 *iface, REFIID iid, voi { *out = &reader->IWMHeaderInfo3_iface; } + else if (IsEqualIID(iid, &IID_IWMLanguageList)) + { + *out = &reader->IWMLanguageList_iface; + } else if (IsEqualIID(iid, &IID_IUnknown) || IsEqualIID(iid, &IID_IWMProfile) || IsEqualIID(iid, &IID_IWMProfile2) @@ -512,9 +516,66 @@ static const IWMHeaderInfo3Vtbl header_info_vtbl = header_info_AddCodecInfo, };
+static struct wm_reader *impl_from_IWMLanguageList(IWMLanguageList *iface) +{ + return CONTAINING_RECORD(iface, struct wm_reader, IWMLanguageList_iface); +} + +static HRESULT WINAPI language_list_QueryInterface(IWMLanguageList *iface, REFIID iid, void **out) +{ + struct wm_reader *reader = impl_from_IWMLanguageList(iface); + + return IWMProfile3_QueryInterface(&reader->IWMProfile3_iface, iid, out); +} + +static ULONG WINAPI language_list_AddRef(IWMLanguageList *iface) +{ + struct wm_reader *reader = impl_from_IWMLanguageList(iface); + + return IWMProfile3_AddRef(&reader->IWMProfile3_iface); +} + +static ULONG WINAPI language_list_Release(IWMLanguageList *iface) +{ + struct wm_reader *reader = impl_from_IWMLanguageList(iface); + + return IWMProfile3_Release(&reader->IWMProfile3_iface); +} + +static HRESULT WINAPI language_list_GetLanguageCount(IWMLanguageList *iface, WORD *count) +{ + FIXME("iface %p, count %p, stub!\n", iface, count); + return E_NOTIMPL; +} + +static HRESULT WINAPI language_list_GetLanguageDetails(IWMLanguageList *iface, + WORD index, WCHAR *lang, WORD *len) +{ + FIXME("iface %p, index %u, lang %p, len %p, stub!\n", iface, index, lang, len); + return E_NOTIMPL; +} + +static HRESULT WINAPI language_list_AddLanguageByRFC1766String(IWMLanguageList *iface, + const WCHAR *lang, WORD *index) +{ + FIXME("iface %p, lang %s, index %p, stub!\n", iface, debugstr_w(lang), index); + return E_NOTIMPL; +} + +static const IWMLanguageListVtbl language_list_vtbl = +{ + language_list_QueryInterface, + language_list_AddRef, + language_list_Release, + language_list_GetLanguageCount, + language_list_GetLanguageDetails, + language_list_AddLanguageByRFC1766String, +}; + void wm_reader_init(struct wm_reader *reader, const struct wm_reader_ops *ops) { reader->IWMHeaderInfo3_iface.lpVtbl = &header_info_vtbl; + reader->IWMLanguageList_iface.lpVtbl = &language_list_vtbl; reader->IWMProfile3_iface.lpVtbl = &profile_vtbl; reader->refcount = 1; reader->ops = ops; diff --git a/dlls/wmvcore/tests/wmvcore.c b/dlls/wmvcore/tests/wmvcore.c index 75d1f9e0c35..9f9c5ed393f 100644 --- a/dlls/wmvcore/tests/wmvcore.c +++ b/dlls/wmvcore/tests/wmvcore.c @@ -147,7 +147,7 @@ static void test_wmsyncreader_interfaces(void) check_interface(reader, &IID_IWMHeaderInfo, TRUE); check_interface(reader, &IID_IWMHeaderInfo2, TRUE); check_interface(reader, &IID_IWMHeaderInfo3, TRUE); - todo_wine check_interface(reader, &IID_IWMLanguageList, TRUE); + check_interface(reader, &IID_IWMLanguageList, TRUE); todo_wine check_interface(reader, &IID_IWMPacketSize, TRUE); todo_wine check_interface(reader, &IID_IWMPacketSize2, TRUE); check_interface(reader, &IID_IWMProfile, TRUE);