Commit eb5d8b96 authored by Aric Stewart's avatar Aric Stewart Committed by Alexandre Julliard

strmbase: COM cleanup for BasePin, BaseInputPin, and BaseOutputPin.

parent 29d3c754
......@@ -186,7 +186,7 @@ static HRESULT PullPin_Init(const IPinVtbl *PullPin_Vtbl, const PIN_INFO * pPinI
QUERYACCEPTPROC pQueryAccept, CLEANUPPROC pCleanUp, REQUESTPROC pCustomRequest, STOPPROCESSPROC pDone, LPCRITICAL_SECTION pCritSec, PullPin * pPinImpl)
{
/* Common attributes */
pPinImpl->pin.lpVtbl = PullPin_Vtbl;
pPinImpl->pin.IPin_iface.lpVtbl = PullPin_Vtbl;
pPinImpl->pin.refCount = 1;
pPinImpl->pin.pConnectedTo = NULL;
pPinImpl->pin.pCritSec = pCritSec;
......@@ -240,7 +240,7 @@ HRESULT PullPin_Construct(const IPinVtbl *PullPin_Vtbl, const PIN_INFO * pPinInf
if (SUCCEEDED(PullPin_Init(PullPin_Vtbl, pPinInfo, pSampleProc, pUserData, pQueryAccept, pCleanUp, pCustomRequest, pDone, pCritSec, pPinImpl)))
{
*ppPin = (IPin *)(&pPinImpl->pin.lpVtbl);
*ppPin = &pPinImpl->pin.IPin_iface;
return S_OK;
}
......
......@@ -118,7 +118,7 @@ HRESULT WINAPI EnumMediaTypes_Construct(BasePin *basePin, BasePin_GetMediaType e
pEnumMediaTypes->uIndex = 0;
pEnumMediaTypes->enumMediaFunction = enumFunc;
pEnumMediaTypes->mediaVersionFunction = versionFunc;
IPin_AddRef((IPin*)basePin);
IPin_AddRef(&basePin->IPin_iface);
pEnumMediaTypes->basePin = basePin;
i = 0;
......@@ -188,7 +188,7 @@ static ULONG WINAPI IEnumMediaTypesImpl_Release(IEnumMediaTypes * iface)
if (This->enumMediaDetails.pMediaTypes[i].pbFormat)
CoTaskMemFree(This->enumMediaDetails.pMediaTypes[i].pbFormat);
CoTaskMemFree(This->enumMediaDetails.pMediaTypes);
IPin_Release((IPin*)This->basePin);
IPin_Release(&This->basePin->IPin_iface);
CoTaskMemFree(This);
}
return refCount;
......
......@@ -97,7 +97,7 @@ HRESULT WINAPI OutputQueue_Construct(
list_init(This->SampleList);
This->pInputPin = pInputPin;
IPin_AddRef((IPin*)pInputPin);
IPin_AddRef(&pInputPin->pin.IPin_iface);
EnterCriticalSection(&This->csQueue);
if (bAuto && pInputPin->pMemInputPin)
......@@ -133,7 +133,7 @@ HRESULT WINAPI OutputQueue_Destroy(OutputQueue *pOutputQueue)
HeapFree(GetProcessHeap(),0,pOutputQueue->SampleList);
IPin_Release((IPin*)pOutputQueue->pInputPin);
IPin_Release(&pOutputQueue->pInputPin->pin.IPin_iface);
HeapFree(GetProcessHeap(),0,pOutputQueue);
return S_OK;
}
......@@ -219,7 +219,7 @@ VOID WINAPI OutputQueue_EOS(OutputQueue *pOutputQueue)
else
{
IPin* ppin = NULL;
IPin_ConnectedTo((IPin*)pOutputQueue->pInputPin, &ppin);
IPin_ConnectedTo(&pOutputQueue->pInputPin->pin.IPin_iface, &ppin);
if (ppin)
{
IPin_EndOfStream(ppin);
......@@ -285,7 +285,7 @@ DWORD WINAPI OutputQueueImpl_ThreadProc(OutputQueue *pOutputQueue)
if (qev->type == EOS_PACKET)
{
IPin* ppin = NULL;
IPin_ConnectedTo((IPin*)pOutputQueue->pInputPin, &ppin);
IPin_ConnectedTo(&pOutputQueue->pInputPin->pin.IPin_iface, &ppin);
if (ppin)
{
IPin_EndOfStream(ppin);
......
......@@ -1062,7 +1062,7 @@ IUnknown * CALLBACK Gstreamer_Splitter_create(IUnknown *punkout, HRESULT *phr) {
piInput->dir = PINDIR_INPUT;
piInput->pFilter = (IBaseFilter *)This;
lstrcpynW(piInput->achName, wcsInputPinName, sizeof(piInput->achName) / sizeof(piInput->achName[0]));
This->pInputPin.pin.lpVtbl = &GST_InputPin_Vtbl;
This->pInputPin.pin.IPin_iface.lpVtbl = &GST_InputPin_Vtbl;
This->pInputPin.pin.refCount = 1;
This->pInputPin.pin.pConnectedTo = NULL;
This->pInputPin.pin.pCritSec = &This->filter.csFilter;
......@@ -1604,7 +1604,7 @@ static ULONG WINAPI GSTInPin_Release(IPin *iface) {
if (This->pAlloc)
IMemAllocator_Release(This->pAlloc);
This->pAlloc = NULL;
This->pin.lpVtbl = NULL;
This->pin.IPin_iface.lpVtbl = NULL;
return 0;
} else
return refCount;
......
......@@ -266,7 +266,7 @@ IUnknown * CALLBACK QTSplitter_create(IUnknown *punkout, HRESULT *phr)
piInput->dir = PINDIR_INPUT;
piInput->pFilter = (IBaseFilter *)This;
lstrcpynW(piInput->achName, wcsInputPinName, sizeof(piInput->achName) / sizeof(piInput->achName[0]));
This->pInputPin.pin.lpVtbl = &QT_InputPin_Vtbl;
This->pInputPin.pin.IPin_iface.lpVtbl = &QT_InputPin_Vtbl;
This->pInputPin.pin.refCount = 1;
This->pInputPin.pin.pConnectedTo = NULL;
This->pInputPin.pin.pCritSec = &This->filter.csFilter;
......@@ -763,7 +763,7 @@ static ULONG WINAPI QTInPin_Release(IPin *iface)
if (This->pAlloc)
IMemAllocator_Release(This->pAlloc);
This->pAlloc = NULL;
This->pin.lpVtbl = NULL;
This->pin.IPin_iface.lpVtbl = NULL;
return 0;
}
else
......
......@@ -28,7 +28,7 @@ void WINAPI DeleteMediaType(AM_MEDIA_TYPE * pMediaType);
typedef struct BasePin
{
const struct IPinVtbl * lpVtbl;
IPin IPin_iface;
LONG refCount;
LPCRITICAL_SECTION pCritSec;
PIN_INFO pinInfo;
......@@ -82,7 +82,7 @@ typedef struct BaseInputPin
/* inheritance C style! */
BasePin pin;
const IMemInputPinVtbl * lpVtblMemInput;
IMemInputPin IMemInputPin_iface;
IMemAllocator * pAllocator;
BOOL flushing, end_of_stream;
IMemAllocator *preferred_allocator;
......
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