qcap/avimux: Use BaseFilterImpl_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-05-30 22:59:34 -05:00 committed by Alexandre Julliard
parent 144e97bbd5
commit 1df475674f

View file

@ -155,9 +155,31 @@ static void avi_mux_destroy(BaseFilter *iface)
ObjectRefCount(FALSE);
}
static HRESULT avi_mux_query_interface(BaseFilter *iface, REFIID iid, void **out)
{
AviMux *filter = impl_from_BaseFilter(iface);
if (IsEqualGUID(iid, &IID_IConfigAviMux))
*out = &filter->IConfigAviMux_iface;
else if (IsEqualGUID(iid, &IID_IConfigInterleaving))
*out = &filter->IConfigInterleaving_iface;
else if (IsEqualGUID(iid, &IID_IMediaSeeking))
*out = &filter->IMediaSeeking_iface;
else if (IsEqualGUID(iid, &IID_IPersistMediaPropertyBag))
*out = &filter->IPersistMediaPropertyBag_iface;
else if (IsEqualGUID(iid, &IID_ISpecifyPropertyPages))
*out = &filter->ISpecifyPropertyPages_iface;
else
return E_NOINTERFACE;
IUnknown_AddRef((IUnknown *)*out);
return S_OK;
}
static const BaseFilterFuncTable filter_func_table = {
.filter_get_pin = avi_mux_get_pin,
.filter_destroy = avi_mux_destroy,
.filter_query_interface = avi_mux_query_interface,
};
static inline AviMux* impl_from_IBaseFilter(IBaseFilter *iface)
@ -166,35 +188,6 @@ static inline AviMux* impl_from_IBaseFilter(IBaseFilter *iface)
return impl_from_BaseFilter(filter);
}
static HRESULT WINAPI AviMux_QueryInterface(IBaseFilter *iface, REFIID riid, void **ppv)
{
AviMux *This = impl_from_IBaseFilter(iface);
TRACE("(%p)->(%s %p)\n", This, debugstr_guid(riid), ppv);
if(IsEqualIID(riid, &IID_IUnknown) || IsEqualIID(riid, &IID_IPersist) ||
IsEqualIID(riid, &IID_IMediaFilter) || IsEqualIID(riid, &IID_IBaseFilter))
*ppv = &This->filter.IBaseFilter_iface;
else if(IsEqualIID(riid, &IID_IConfigAviMux))
*ppv = &This->IConfigAviMux_iface;
else if(IsEqualIID(riid, &IID_IConfigInterleaving))
*ppv = &This->IConfigInterleaving_iface;
else if(IsEqualIID(riid, &IID_IMediaSeeking))
*ppv = &This->IMediaSeeking_iface;
else if(IsEqualIID(riid, &IID_IPersistMediaPropertyBag))
*ppv = &This->IPersistMediaPropertyBag_iface;
else if(IsEqualIID(riid, &IID_ISpecifyPropertyPages))
*ppv = &This->ISpecifyPropertyPages_iface;
else {
FIXME("no interface for %s\n", debugstr_guid(riid));
*ppv = NULL;
return E_NOINTERFACE;
}
IUnknown_AddRef((IUnknown*)*ppv);
return S_OK;
}
static HRESULT out_flush(AviMux *This)
{
ULONG written;
@ -710,7 +703,7 @@ static HRESULT WINAPI AviMux_Run(IBaseFilter *iface, REFERENCE_TIME tStart)
}
static const IBaseFilterVtbl AviMuxVtbl = {
AviMux_QueryInterface,
BaseFilterImpl_QueryInterface,
BaseFilterImpl_AddRef,
BaseFilterImpl_Release,
BaseFilterImpl_GetClassID,