strmbase: Introduce BasePinImpl_QueryInterface().

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Zebediah Figura 2019-09-25 22:36:22 -05:00 committed by Alexandre Julliard
parent df509be8c6
commit fa280172e8
2 changed files with 27 additions and 0 deletions

View file

@ -157,6 +157,31 @@ HRESULT strmbase_pin_get_media_type(struct strmbase_pin *iface, unsigned int ind
return VFW_S_NO_MORE_ITEMS;
}
HRESULT WINAPI BasePinImpl_QueryInterface(IPin *iface)
{
struct strmbase_pin *pin = impl_from_IPin(iface);
HRESULT hr;
TRACE("iface %p, iid %s, out %p.\n", iface, debugstr_guid(iid), out);
*out = NULL;
if (pin->pFuncsTable->pin_query_interface
&& SUCCEEDED(hr = pin->pFuncsTable->pin_query_interface(filter, iid, out)))
return hr;
if (IsEqualIID(iid, &IID_IUnknown) || IsEqualIID(iid, &IID_IPin))
*out = iface;
else
{
WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(iid));
return E_NOINTERFACE;
}
IUnknown_AddRef((IUnknown *)*out);
return S_OK;
}
ULONG WINAPI BasePinImpl_AddRef(IPin *iface)
{
struct strmbase_pin *pin = impl_from_IPin(iface);

View file

@ -47,6 +47,7 @@ typedef struct BasePinFuncTable {
HRESULT (*pin_query_accept)(struct strmbase_pin *pin, const AM_MEDIA_TYPE *mt);
/* Required for EnumMediaTypes(). */
HRESULT (*pin_get_media_type)(struct strmbase_pin *pin, unsigned int index, AM_MEDIA_TYPE *mt);
HRESULT (*pin_query_interface)(struct strmbase_pin *pin, REFIID iid, void **out);
} BasePinFuncTable;
struct strmbase_source
@ -97,6 +98,7 @@ typedef struct BaseInputPinFuncTable {
/* Base Pin */
HRESULT strmbase_pin_get_media_type(struct strmbase_pin *pin, unsigned int index, AM_MEDIA_TYPE *mt);
LONG WINAPI BasePinImpl_GetMediaTypeVersion(struct strmbase_pin *pin);
HRESULT WINAPI BasePinImpl_QueryInterface(IPin *iface, REFIID iid, void **out);
ULONG WINAPI BasePinImpl_AddRef(IPin *iface);
ULONG WINAPI BasePinImpl_Release(IPin *iface);
HRESULT WINAPI BasePinImpl_Disconnect(IPin * iface);