Commit 71bcdc90 authored by Chris Robinson's avatar Chris Robinson Committed by Alexandre Julliard

quartz: Connect input when the pins connect, not when querying.

And clean up when disconnecting input.
parent c28b5345
......@@ -97,11 +97,13 @@ static HRESULT TransformFilter_Sample(LPVOID iface, IMediaSample * pSample)
static HRESULT TransformFilter_Input_QueryAccept(LPVOID iface, const AM_MEDIA_TYPE * pmt)
{
TransformFilterImpl* This = (TransformFilterImpl*)iface;
/* TransformFilterImpl* This = (TransformFilterImpl*)iface; */
TRACE("%p\n", iface);
dump_AM_MEDIA_TYPE(pmt);
return This->pFuncsTable->pfnConnectInput(This, pmt);
/* FIXME: Add a function to verify media type with the actual filter */
/* return This->pFuncsTable->pfnConnectInput(This, pmt); */
return S_OK;
}
......@@ -294,8 +296,6 @@ static ULONG WINAPI TransformFilter_Release(IBaseFilter * iface)
CoTaskMemFree(This->ppPins);
This->lpVtbl = NULL;
This->pFuncsTable->pfnCleanup(This);
This->csFilter.DebugInfo->Spare[0] = 0;
DeleteCriticalSection(&This->csFilter);
......@@ -535,14 +535,48 @@ static HRESULT WINAPI TransformFilter_InputPin_EndOfStream(IPin * iface)
return hr;
}
static HRESULT WINAPI TransformFilter_InputPin_ReceiveConnection(IPin * iface, IPin * pReceivePin, const AM_MEDIA_TYPE * pmt)
{
InputPin* This = (InputPin*) iface;
TransformFilterImpl* pTransform;
HRESULT hr;
TRACE("(%p)->(%p, %p)\n", iface, pReceivePin, pmt);
pTransform = (TransformFilterImpl*)This->pin.pinInfo.pFilter;
hr = pTransform->pFuncsTable->pfnConnectInput(pTransform, pmt);
if (SUCCEEDED(hr))
{
hr = InputPin_ReceiveConnection(iface, pReceivePin, pmt);
if (FAILED(hr))
pTransform->pFuncsTable->pfnCleanup(pTransform);
}
return hr;
}
static HRESULT WINAPI TransformFilter_InputPin_Disconnect(IPin * iface)
{
InputPin* This = (InputPin*) iface;
TransformFilterImpl* pTransform;
TRACE("(%p)->()\n", iface);
pTransform = (TransformFilterImpl*)This->pin.pinInfo.pFilter;
pTransform->pFuncsTable->pfnCleanup(pTransform);
return IPinImpl_Disconnect(iface);
}
static const IPinVtbl TransformFilter_InputPin_Vtbl =
{
InputPin_QueryInterface,
IPinImpl_AddRef,
InputPin_Release,
InputPin_Connect,
InputPin_ReceiveConnection,
IPinImpl_Disconnect,
TransformFilter_InputPin_ReceiveConnection,
TransformFilter_InputPin_Disconnect,
IPinImpl_ConnectedTo,
IPinImpl_ConnectionMediaType,
IPinImpl_QueryPinInfo,
......@@ -570,32 +604,14 @@ static HRESULT WINAPI TransformFilter_Output_EnumMediaTypes(IPin * iface, IEnumM
return IEnumMediaTypesImpl_Construct(&emd, ppEnum);
}
static HRESULT WINAPI TransformFilter_Output_Disconnect(IPin * iface)
{
OutputPin* This = (OutputPin*)iface;
HRESULT hr;
TransformFilterImpl* pTransformFilter = (TransformFilterImpl*)This->pin.pinInfo.pFilter;
TRACE("(%p/%p)->()\n", This, iface);
hr = OutputPin_Disconnect(iface);
if (hr == S_OK)
{
pTransformFilter->pFuncsTable->pfnCleanup(pTransformFilter);
}
return hr;
}
static const IPinVtbl TransformFilter_OutputPin_Vtbl =
static const IPinVtbl TransformFilter_OutputPin_Vtbl =
{
OutputPin_QueryInterface,
IPinImpl_AddRef,
OutputPin_Release,
OutputPin_Connect,
OutputPin_ReceiveConnection,
TransformFilter_Output_Disconnect,
OutputPin_Disconnect,
IPinImpl_ConnectedTo,
IPinImpl_ConnectionMediaType,
IPinImpl_QueryPinInfo,
......
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