Commit 4f10b95c authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

winegstreamer: Move the IWMPacketSize2 implementation to the wm_reader object.

parent d290362c
......@@ -117,6 +117,7 @@ struct wm_reader
{
IWMHeaderInfo3 IWMHeaderInfo3_iface;
IWMLanguageList IWMLanguageList_iface;
IWMPacketSize2 IWMPacketSize2_iface;
IWMProfile3 IWMProfile3_iface;
LONG refcount;
......
......@@ -33,7 +33,6 @@ struct async_reader
IWMReaderTimecode IWMReaderTimecode_iface;
IWMReaderPlaylistBurn IWMReaderPlaylistBurn_iface;
IReferenceClock IReferenceClock_iface;
IWMPacketSize2 IWMPacketSize2_iface;
};
static struct async_reader *impl_from_IWMReader(IWMReader *iface)
......@@ -1322,68 +1321,6 @@ static const IReferenceClockVtbl ReferenceClockVtbl =
refclock_Unadvise
};
static struct async_reader *impl_from_IWMPacketSize2(IWMPacketSize2 *iface)
{
return CONTAINING_RECORD(iface, struct async_reader, IWMPacketSize2_iface);
}
static HRESULT WINAPI packetsize_QueryInterface(IWMPacketSize2 *iface, REFIID riid, void **ppv)
{
struct async_reader *This = impl_from_IWMPacketSize2(iface);
return IWMReader_QueryInterface(&This->IWMReader_iface, riid, ppv);
}
static ULONG WINAPI packetsize_AddRef(IWMPacketSize2 *iface)
{
struct async_reader *This = impl_from_IWMPacketSize2(iface);
return IWMReader_AddRef(&This->IWMReader_iface);
}
static ULONG WINAPI packetsize_Release(IWMPacketSize2 *iface)
{
struct async_reader *This = impl_from_IWMPacketSize2(iface);
return IWMReader_Release(&This->IWMReader_iface);
}
static HRESULT WINAPI packetsize_GetMaxPacketSize(IWMPacketSize2 *iface, DWORD *size)
{
struct async_reader *This = impl_from_IWMPacketSize2(iface);
FIXME("%p, %p\n", This, size);
return E_NOTIMPL;
}
static HRESULT WINAPI packetsize_SetMaxPacketSize(IWMPacketSize2 *iface, DWORD size)
{
struct async_reader *This = impl_from_IWMPacketSize2(iface);
FIXME("%p, %d\n", This, size);
return E_NOTIMPL;
}
static HRESULT WINAPI packetsize_GetMinPacketSize(IWMPacketSize2 *iface, DWORD *size)
{
struct async_reader *This = impl_from_IWMPacketSize2(iface);
FIXME("%p, %p\n", This, size);
return E_NOTIMPL;
}
static HRESULT WINAPI packetsize_SetMinPacketSize(IWMPacketSize2 *iface, DWORD size)
{
struct async_reader *This = impl_from_IWMPacketSize2(iface);
FIXME("%p, %d\n", This, size);
return E_NOTIMPL;
}
static const IWMPacketSize2Vtbl WMPacketSize2Vtbl =
{
packetsize_QueryInterface,
packetsize_AddRef,
packetsize_Release,
packetsize_GetMaxPacketSize,
packetsize_SetMaxPacketSize,
packetsize_GetMinPacketSize,
packetsize_SetMinPacketSize
};
static struct async_reader *impl_from_wm_reader(struct wm_reader *iface)
{
return CONTAINING_RECORD(iface, struct async_reader, reader);
......@@ -1398,10 +1335,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_IWMPacketSize)
|| IsEqualIID(iid, &IID_IWMPacketSize2))
return &reader->IWMPacketSize2_iface;
if (IsEqualIID(iid, &IID_IWMReader))
return &reader->IWMReader_iface;
......@@ -1462,7 +1395,6 @@ HRESULT WINAPI winegstreamer_create_wm_async_reader(IWMReader **reader)
wm_reader_init(&object->reader, &async_reader_ops);
object->IReferenceClock_iface.lpVtbl = &ReferenceClockVtbl;
object->IWMPacketSize2_iface.lpVtbl = &WMPacketSize2Vtbl;
object->IWMReader_iface.lpVtbl = &WMReaderVtbl;
object->IWMReaderAdvanced6_iface.lpVtbl = &WMReaderAdvanced6Vtbl;
object->IWMReaderAccelerator_iface.lpVtbl = &WMReaderAcceleratorVtbl;
......
......@@ -41,6 +41,11 @@ static HRESULT WINAPI profile_QueryInterface(IWMProfile3 *iface, REFIID iid, voi
{
*out = &reader->IWMLanguageList_iface;
}
else if (IsEqualIID(iid, &IID_IWMPacketSize)
|| IsEqualIID(iid, &IID_IWMPacketSize2))
{
*out = &reader->IWMPacketSize2_iface;
}
else if (IsEqualIID(iid, &IID_IUnknown)
|| IsEqualIID(iid, &IID_IWMProfile)
|| IsEqualIID(iid, &IID_IWMProfile2)
......@@ -572,10 +577,72 @@ static const IWMLanguageListVtbl language_list_vtbl =
language_list_AddLanguageByRFC1766String,
};
static struct wm_reader *impl_from_IWMPacketSize2(IWMPacketSize2 *iface)
{
return CONTAINING_RECORD(iface, struct wm_reader, IWMPacketSize2_iface);
}
static HRESULT WINAPI packet_size_QueryInterface(IWMPacketSize2 *iface, REFIID iid, void **out)
{
struct wm_reader *reader = impl_from_IWMPacketSize2(iface);
return IWMProfile3_QueryInterface(&reader->IWMProfile3_iface, iid, out);
}
static ULONG WINAPI packet_size_AddRef(IWMPacketSize2 *iface)
{
struct wm_reader *reader = impl_from_IWMPacketSize2(iface);
return IWMProfile3_AddRef(&reader->IWMProfile3_iface);
}
static ULONG WINAPI packet_size_Release(IWMPacketSize2 *iface)
{
struct wm_reader *reader = impl_from_IWMPacketSize2(iface);
return IWMProfile3_Release(&reader->IWMProfile3_iface);
}
static HRESULT WINAPI packet_size_GetMaxPacketSize(IWMPacketSize2 *iface, DWORD *size)
{
FIXME("iface %p, size %p, stub!\n", iface, size);
return E_NOTIMPL;
}
static HRESULT WINAPI packet_size_SetMaxPacketSize(IWMPacketSize2 *iface, DWORD size)
{
FIXME("iface %p, size %u, stub!\n", iface, size);
return E_NOTIMPL;
}
static HRESULT WINAPI packet_size_GetMinPacketSize(IWMPacketSize2 *iface, DWORD *size)
{
FIXME("iface %p, size %p, stub!\n", iface, size);
return E_NOTIMPL;
}
static HRESULT WINAPI packet_size_SetMinPacketSize(IWMPacketSize2 *iface, DWORD size)
{
FIXME("iface %p, size %u, stub!\n", iface, size);
return E_NOTIMPL;
}
static const IWMPacketSize2Vtbl packet_size_vtbl =
{
packet_size_QueryInterface,
packet_size_AddRef,
packet_size_Release,
packet_size_GetMaxPacketSize,
packet_size_SetMaxPacketSize,
packet_size_GetMinPacketSize,
packet_size_SetMinPacketSize,
};
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->IWMPacketSize2_iface.lpVtbl = &packet_size_vtbl;
reader->IWMProfile3_iface.lpVtbl = &profile_vtbl;
reader->refcount = 1;
reader->ops = ops;
......
......@@ -148,8 +148,8 @@ static void test_wmsyncreader_interfaces(void)
check_interface(reader, &IID_IWMHeaderInfo2, TRUE);
check_interface(reader, &IID_IWMHeaderInfo3, 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_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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment