quartz: Make transform filter return hresult from running/pausing.
This commit is contained in:
parent
fa38a7e313
commit
db2ccf43d4
|
@ -316,6 +316,7 @@ static HRESULT WINAPI TransformFilter_GetClassID(IBaseFilter * iface, CLSID * pC
|
||||||
static HRESULT WINAPI TransformFilter_Stop(IBaseFilter * iface)
|
static HRESULT WINAPI TransformFilter_Stop(IBaseFilter * iface)
|
||||||
{
|
{
|
||||||
TransformFilterImpl *This = (TransformFilterImpl *)iface;
|
TransformFilterImpl *This = (TransformFilterImpl *)iface;
|
||||||
|
HRESULT hr = S_OK;
|
||||||
|
|
||||||
TRACE("(%p/%p)\n", This, iface);
|
TRACE("(%p/%p)\n", This, iface);
|
||||||
|
|
||||||
|
@ -323,29 +324,33 @@ static HRESULT WINAPI TransformFilter_Stop(IBaseFilter * iface)
|
||||||
{
|
{
|
||||||
This->state = State_Stopped;
|
This->state = State_Stopped;
|
||||||
if (This->pFuncsTable->pfnProcessEnd)
|
if (This->pFuncsTable->pfnProcessEnd)
|
||||||
This->pFuncsTable->pfnProcessEnd(This);
|
hr = This->pFuncsTable->pfnProcessEnd(This);
|
||||||
}
|
}
|
||||||
LeaveCriticalSection(&This->csFilter);
|
LeaveCriticalSection(&This->csFilter);
|
||||||
|
|
||||||
return S_OK;
|
return hr;
|
||||||
}
|
}
|
||||||
|
|
||||||
static HRESULT WINAPI TransformFilter_Pause(IBaseFilter * iface)
|
static HRESULT WINAPI TransformFilter_Pause(IBaseFilter * iface)
|
||||||
{
|
{
|
||||||
TransformFilterImpl *This = (TransformFilterImpl *)iface;
|
TransformFilterImpl *This = (TransformFilterImpl *)iface;
|
||||||
|
HRESULT hr;
|
||||||
|
|
||||||
TRACE("(%p/%p)->()\n", This, iface);
|
TRACE("(%p/%p)->()\n", This, iface);
|
||||||
|
|
||||||
EnterCriticalSection(&This->csFilter);
|
EnterCriticalSection(&This->csFilter);
|
||||||
{
|
{
|
||||||
if (This->state == State_Stopped)
|
if (This->state == State_Stopped)
|
||||||
IBaseFilter_Run(iface, -1);
|
hr = IBaseFilter_Run(iface, -1);
|
||||||
|
else
|
||||||
|
hr = S_OK;
|
||||||
|
|
||||||
|
if (SUCCEEDED(hr))
|
||||||
This->state = State_Paused;
|
This->state = State_Paused;
|
||||||
}
|
}
|
||||||
LeaveCriticalSection(&This->csFilter);
|
LeaveCriticalSection(&This->csFilter);
|
||||||
|
|
||||||
return S_OK;
|
return hr;
|
||||||
}
|
}
|
||||||
|
|
||||||
static HRESULT WINAPI TransformFilter_Run(IBaseFilter * iface, REFERENCE_TIME tStart)
|
static HRESULT WINAPI TransformFilter_Run(IBaseFilter * iface, REFERENCE_TIME tStart)
|
||||||
|
@ -361,13 +366,17 @@ static HRESULT WINAPI TransformFilter_Run(IBaseFilter * iface, REFERENCE_TIME tS
|
||||||
{
|
{
|
||||||
((InputPin *)This->ppPins[0])->end_of_stream = 0;
|
((InputPin *)This->ppPins[0])->end_of_stream = 0;
|
||||||
if (This->pFuncsTable->pfnProcessBegin)
|
if (This->pFuncsTable->pfnProcessBegin)
|
||||||
This->pFuncsTable->pfnProcessBegin(This);
|
hr = This->pFuncsTable->pfnProcessBegin(This);
|
||||||
OutputPin_CommitAllocator((OutputPin *)This->ppPins[1]);
|
if (SUCCEEDED(hr))
|
||||||
|
hr = OutputPin_CommitAllocator((OutputPin *)This->ppPins[1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (SUCCEEDED(hr))
|
||||||
|
{
|
||||||
This->rtStreamStart = tStart;
|
This->rtStreamStart = tStart;
|
||||||
This->state = State_Running;
|
This->state = State_Running;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
LeaveCriticalSection(&This->csFilter);
|
LeaveCriticalSection(&This->csFilter);
|
||||||
|
|
||||||
return hr;
|
return hr;
|
||||||
|
|
Loading…
Reference in New Issue