winegstreamer: Move the IWMHeaderInfo3 implementation to the wm_reader object.

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-20 11:09:48 -05:00 committed by Alexandre Julliard
parent c40613e81c
commit 3dd8eeeebd
4 changed files with 218 additions and 231 deletions

View File

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

View File

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

View File

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

View File

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