Commit 487472b3 authored by Michael Stefaniuc's avatar Michael Stefaniuc Committed by Alexandre Julliard

qcap: COM cleanup for the IKsPropertySet iface.

parent 22848359
......@@ -44,9 +44,6 @@
WINE_DEFAULT_DEBUG_CHANNEL(qcap);
#define ICOM_THIS_MULTI(impl,field,iface) \
impl* const This=(impl*)((char*)(iface) - offsetof(impl,field))
static const IBaseFilterVtbl VfwCapture_Vtbl;
static const IAMStreamConfigVtbl IAMStreamConfig_VTable;
static const IAMVideoProcAmpVtbl IAMVideoProcAmp_VTable;
......@@ -103,8 +100,8 @@ static inline VfwCapture *impl_from_IPersistPropertyBag(IPersistPropertyBag *ifa
typedef struct VfwPinImpl
{
BaseOutputPin pin;
IKsPropertySet IKsPropertySet_iface;
VfwCapture *parent;
const IKsPropertySetVtbl * KSP_VT;
} VfwPinImpl;
......@@ -585,37 +582,30 @@ static const IPersistPropertyBagVtbl IPersistPropertyBag_VTable =
};
/* IKsPropertySet interface */
static HRESULT WINAPI
KSP_QueryInterface( IKsPropertySet * iface, REFIID riid, LPVOID * ppv )
static inline VfwPinImpl *impl_from_IKsPropertySet(IKsPropertySet *iface)
{
if (IsEqualIID(riid, &IID_IUnknown) ||
IsEqualIID(riid, &IID_IKsPropertySet))
{
*ppv = iface;
IKsPropertySet_AddRef( iface );
return S_OK;
}
return CONTAINING_RECORD(iface, VfwPinImpl, IKsPropertySet_iface);
}
FIXME("No interface for iid %s\n", debugstr_guid(riid));
return E_NOINTERFACE;
static HRESULT WINAPI KSP_QueryInterface(IKsPropertySet * iface, REFIID riid, void **ret_iface)
{
VfwPinImpl *This = impl_from_IKsPropertySet(iface);
return IPin_QueryInterface(&This->pin.pin.IPin_iface, riid, ret_iface);
}
static ULONG WINAPI KSP_AddRef(IKsPropertySet * iface)
{
ICOM_THIS_MULTI(VfwPinImpl, KSP_VT, iface);
VfwPinImpl *This = impl_from_IKsPropertySet(iface);
TRACE("%p --> Forwarding to VfwPin (%p)\n", iface, This);
return IUnknown_AddRef((IUnknown *)This);
return IPin_AddRef(&This->pin.pin.IPin_iface);
}
static ULONG WINAPI KSP_Release(IKsPropertySet * iface)
{
ICOM_THIS_MULTI(VfwPinImpl, KSP_VT, iface);
TRACE("%p --> Forwarding to VfwPin (%p)\n", iface, This);
VfwPinImpl *This = impl_from_IKsPropertySet(iface);
return IUnknown_Release((IUnknown *)This);
return IPin_Release(&This->pin.pin.IPin_iface);
}
static HRESULT WINAPI
......@@ -660,7 +650,7 @@ KSP_QuerySupported( IKsPropertySet * iface, REFGUID guidPropSet,
return E_NOTIMPL;
}
static const IKsPropertySetVtbl KSP_VTable =
static const IKsPropertySetVtbl IKsPropertySet_VTable =
{
KSP_QueryInterface,
KSP_AddRef,
......@@ -746,7 +736,7 @@ VfwPin_Construct( IBaseFilter * pBaseFilter, LPCRITICAL_SECTION pCritSec,
if (SUCCEEDED(hr))
{
VfwPinImpl *pPinImpl = (VfwPinImpl*)*ppPin;
pPinImpl->KSP_VT = &KSP_VTable;
pPinImpl->IKsPropertySet_iface.lpVtbl = &IKsPropertySet_VTable;
ObjectRefCount(TRUE);
}
......@@ -768,7 +758,7 @@ static HRESULT WINAPI VfwPin_QueryInterface(IPin * iface, REFIID riid, LPVOID *
if (IsEqualIID(riid, &IID_IUnknown) || IsEqualIID(riid, &IID_IPin))
*ppv = This;
else if (IsEqualIID(riid, &IID_IKsPropertySet))
*ppv = &(This->KSP_VT);
*ppv = &This->IKsPropertySet_iface;
else if (IsEqualIID(riid, &IID_IAMStreamConfig))
return IUnknown_QueryInterface((IUnknown *)This->parent, riid, ppv);
......
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