From 781cb486534145ca39c97c22185a4114057819b1 Mon Sep 17 00:00:00 2001 From: Maarten Lankhorst Date: Wed, 12 May 2010 17:10:04 +0200 Subject: [PATCH] quartz: Add additional notifications to transform filter. --- dlls/quartz/transform.c | 60 ++++++++++++++++++++++++++++++++++++++++++++++--- dlls/quartz/transform.h | 4 ++++ 2 files changed, 61 insertions(+), 3 deletions(-) diff --git a/dlls/quartz/transform.c b/dlls/quartz/transform.c index b6ec768eba9..e8056b0b341 100644 --- a/dlls/quartz/transform.c +++ b/dlls/quartz/transform.c @@ -515,6 +515,60 @@ static HRESULT WINAPI TransformFilter_InputPin_Disconnect(IPin * iface) return IPinImpl_Disconnect(iface); } +static HRESULT WINAPI TransformFilter_InputPin_BeginFlush(IPin * iface) +{ + InputPin* This = (InputPin*) iface; + TransformFilterImpl* pTransform; + HRESULT hr = S_OK; + + TRACE("(%p)->()\n", iface); + + pTransform = (TransformFilterImpl*)This->pin.pinInfo.pFilter; + EnterCriticalSection(&pTransform->csFilter); + if (pTransform->pFuncsTable->pfnBeginFlush) + hr = pTransform->pFuncsTable->pfnBeginFlush(This); + if (SUCCEEDED(hr)) + hr = InputPin_BeginFlush(iface); + LeaveCriticalSection(&pTransform->csFilter); + return hr; +} + +static HRESULT WINAPI TransformFilter_InputPin_EndFlush(IPin * iface) +{ + InputPin* This = (InputPin*) iface; + TransformFilterImpl* pTransform; + HRESULT hr = S_OK; + + TRACE("(%p)->()\n", iface); + + pTransform = (TransformFilterImpl*)This->pin.pinInfo.pFilter; + EnterCriticalSection(&pTransform->csFilter); + if (pTransform->pFuncsTable->pfnEndFlush) + hr = pTransform->pFuncsTable->pfnEndFlush(This); + if (SUCCEEDED(hr)) + hr = InputPin_EndFlush(iface); + LeaveCriticalSection(&pTransform->csFilter); + return hr; +} + +static HRESULT WINAPI TransformFilter_InputPin_NewSegment(IPin * iface, REFERENCE_TIME tStart, REFERENCE_TIME tStop, double dRate) +{ + InputPin* This = (InputPin*) iface; + TransformFilterImpl* pTransform; + HRESULT hr = S_OK; + + TRACE("(%p)->()\n", iface); + + pTransform = (TransformFilterImpl*)This->pin.pinInfo.pFilter; + EnterCriticalSection(&pTransform->csFilter); + if (pTransform->pFuncsTable->pfnNewSegment) + hr = pTransform->pFuncsTable->pfnNewSegment(This, tStart, tStop, dRate); + if (SUCCEEDED(hr)) + hr = InputPin_NewSegment(iface, tStart, tStop, dRate); + LeaveCriticalSection(&pTransform->csFilter); + return hr; +} + static const IPinVtbl TransformFilter_InputPin_Vtbl = { InputPin_QueryInterface, @@ -532,9 +586,9 @@ static const IPinVtbl TransformFilter_InputPin_Vtbl = IPinImpl_EnumMediaTypes, IPinImpl_QueryInternalConnections, TransformFilter_InputPin_EndOfStream, - InputPin_BeginFlush, - InputPin_EndFlush, - InputPin_NewSegment + TransformFilter_InputPin_BeginFlush, + TransformFilter_InputPin_EndFlush, + TransformFilter_InputPin_NewSegment }; static HRESULT WINAPI TransformFilter_Output_EnumMediaTypes(IPin * iface, IEnumMediaTypes ** ppEnum) diff --git a/dlls/quartz/transform.h b/dlls/quartz/transform.h index 8d3a3a0a152..e2486cd84af 100644 --- a/dlls/quartz/transform.h +++ b/dlls/quartz/transform.h @@ -29,6 +29,10 @@ typedef struct TransformFuncsTable { HRESULT (*pfnQueryConnect) (TransformFilterImpl *This, const AM_MEDIA_TYPE * pmt); HRESULT (*pfnConnectInput) (InputPin *pin, const AM_MEDIA_TYPE * pmt); HRESULT (*pfnCleanup) (InputPin *pin); + HRESULT (*pfnEndOfStream) (InputPin *pin); + HRESULT (*pfnBeginFlush) (InputPin *pin); + HRESULT (*pfnEndFlush) (InputPin *pin); + HRESULT (*pfnNewSegment) (InputPin *pin, REFERENCE_TIME tStart, REFERENCE_TIME tStop, double dRate); } TransformFuncsTable; struct TransformFilterImpl -- 2.11.4.GIT