From 465feb7a9ef971717f338fec9ae2682ac8723fe5 Mon Sep 17 00:00:00 2001 From: Alistair Leslie-Hughes Date: Wed, 12 Jul 2017 06:48:14 +0000 Subject: [PATCH] wmvcore: Support IWMReaderTypeNegotiation interface in IWMReader. Signed-off-by: Alistair Leslie-Hughes Signed-off-by: Alexandre Julliard --- dlls/wmvcore/tests/wmvcore.c | 2 +- dlls/wmvcore/wmvcore_main.c | 43 ++++++++++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+), 1 deletion(-) diff --git a/dlls/wmvcore/tests/wmvcore.c b/dlls/wmvcore/tests/wmvcore.c index c4d81150b4e..4369748db9b 100644 --- a/dlls/wmvcore/tests/wmvcore.c +++ b/dlls/wmvcore/tests/wmvcore.c @@ -136,7 +136,7 @@ static void test_wmreader_interfaces(void) ok(hr == S_OK, "Failed 0x%08x\n", hr); hr = IWMReader_QueryInterface(reader, &IID_IWMReaderTypeNegotiation, (void **)&negotiation); - todo_wine ok(hr == S_OK, "Failed 0x%08x\n", hr); + ok(hr == S_OK, "Failed 0x%08x\n", hr); hr = IWMReader_QueryInterface(reader, &IID_IWMDRMReader, (void **)&drmreader); ok(hr == E_NOINTERFACE, "Failed 0x%08x\n", hr); diff --git a/dlls/wmvcore/wmvcore_main.c b/dlls/wmvcore/wmvcore_main.c index f7fa6e95416..296966803ef 100644 --- a/dlls/wmvcore/wmvcore_main.c +++ b/dlls/wmvcore/wmvcore_main.c @@ -69,6 +69,7 @@ typedef struct { IWMReaderAccelerator IWMReaderAccelerator_iface; IWMReaderNetworkConfig2 IWMReaderNetworkConfig2_iface; IWMReaderStreamClock IWMReaderStreamClock_iface; + IWMReaderTypeNegotiation IWMReaderTypeNegotiation_iface; LONG ref; } WMReader; @@ -117,6 +118,9 @@ static HRESULT WINAPI WMReader_QueryInterface(IWMReader *iface, REFIID riid, voi }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 { *ppv = NULL; FIXME("(%p)->(%s %p)\n", This, debugstr_guid(riid), ppv); @@ -1190,6 +1194,44 @@ static const IWMReaderStreamClockVtbl WMReaderStreamClockVtbl = readclock_KillTimer }; +static inline WMReader *impl_from_IWMReaderTypeNegotiation(IWMReaderTypeNegotiation *iface) +{ + return CONTAINING_RECORD(iface, WMReader, IWMReaderTypeNegotiation_iface); +} + +static HRESULT WINAPI negotiation_QueryInterface(IWMReaderTypeNegotiation *iface, REFIID riid, void **ppv) +{ + WMReader *This = impl_from_IWMReaderTypeNegotiation(iface); + return IWMReader_QueryInterface(&This->IWMReader_iface, riid, ppv); +} + +static ULONG WINAPI negotiation_AddRef(IWMReaderTypeNegotiation *iface) +{ + WMReader *This = impl_from_IWMReaderTypeNegotiation(iface); + return IWMReader_AddRef(&This->IWMReader_iface); +} + +static ULONG WINAPI negotiation_Release(IWMReaderTypeNegotiation *iface) +{ + WMReader *This = impl_from_IWMReaderTypeNegotiation(iface); + return IWMReader_Release(&This->IWMReader_iface); +} + +static HRESULT WINAPI negotiation_TryOutputProps(IWMReaderTypeNegotiation *iface, DWORD output, IWMOutputMediaProps *props) +{ + WMReader *This = impl_from_IWMReaderTypeNegotiation(iface); + FIXME("%p, %d, %p\n", This, output, props); + return E_NOTIMPL; +} + +static const IWMReaderTypeNegotiationVtbl WMReaderTypeNegotiationVtbl = +{ + negotiation_QueryInterface, + negotiation_AddRef, + negotiation_Release, + negotiation_TryOutputProps +}; + HRESULT WINAPI WMCreateReader(IUnknown *reserved, DWORD rights, IWMReader **ret_reader) { WMReader *reader; @@ -1205,6 +1247,7 @@ HRESULT WINAPI WMCreateReader(IUnknown *reserved, DWORD rights, IWMReader **ret_ reader->IWMReaderAccelerator_iface.lpVtbl = &WMReaderAcceleratorVtbl; reader->IWMReaderNetworkConfig2_iface.lpVtbl = &WMReaderNetworkConfig2Vtbl; reader->IWMReaderStreamClock_iface.lpVtbl = &WMReaderStreamClockVtbl; + reader->IWMReaderTypeNegotiation_iface.lpVtbl = &WMReaderTypeNegotiationVtbl; reader->ref = 1; *ret_reader = &reader->IWMReader_iface;