wmvcore: Support IWMReaderTypeNegotiation interface in IWMReader.

Signed-off-by: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Alistair Leslie-Hughes 2017-07-12 06:48:14 +00:00 committed by Alexandre Julliard
parent 474f9ff1fa
commit 465feb7a9e
2 changed files with 44 additions and 1 deletions

View File

@ -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);

View File

@ -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;