strmbase: Move tracking of EOS state to the base renderer.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
8a05fe0fb5
commit
6773179a94
|
@ -690,8 +690,6 @@ HRESULT WINAPI BaseInputPinImpl_EndOfStream(IPin * iface)
|
|||
EnterCriticalSection(&This->pin.filter->csFilter);
|
||||
if (This->flushing)
|
||||
hr = S_FALSE;
|
||||
else
|
||||
This->end_of_stream = TRUE;
|
||||
LeaveCriticalSection(&This->pin.filter->csFilter);
|
||||
|
||||
if (hr == S_OK)
|
||||
|
@ -731,7 +729,7 @@ HRESULT WINAPI BaseInputPinImpl_EndFlush(IPin * iface)
|
|||
TRACE("(%p)->()\n", This);
|
||||
|
||||
EnterCriticalSection(&This->pin.filter->csFilter);
|
||||
This->flushing = This->end_of_stream = FALSE;
|
||||
This->flushing = FALSE;
|
||||
|
||||
hr = SendFurther(This, deliver_endflush, NULL);
|
||||
LeaveCriticalSection(&This->pin.filter->csFilter);
|
||||
|
|
|
@ -89,14 +89,11 @@ static HRESULT WINAPI BaseRenderer_InputPin_EndOfStream(IPin * iface)
|
|||
|
||||
EnterCriticalSection(&pFilter->csRenderLock);
|
||||
EnterCriticalSection(&pFilter->filter.csFilter);
|
||||
hr = BaseInputPinImpl_EndOfStream(iface);
|
||||
if (SUCCEEDED(hr))
|
||||
{
|
||||
if (pFilter->pFuncsTable->pfnEndOfStream)
|
||||
hr = pFilter->pFuncsTable->pfnEndOfStream(pFilter);
|
||||
else
|
||||
hr = BaseRendererImpl_EndOfStream(pFilter);
|
||||
}
|
||||
pFilter->eos = TRUE;
|
||||
if (pFilter->pFuncsTable->pfnEndOfStream)
|
||||
hr = pFilter->pFuncsTable->pfnEndOfStream(pFilter);
|
||||
else
|
||||
hr = BaseRendererImpl_EndOfStream(pFilter);
|
||||
LeaveCriticalSection(&pFilter->filter.csFilter);
|
||||
LeaveCriticalSection(&pFilter->csRenderLock);
|
||||
return hr;
|
||||
|
@ -128,6 +125,7 @@ static HRESULT WINAPI BaseRenderer_InputPin_EndFlush(IPin * iface)
|
|||
|
||||
EnterCriticalSection(&pFilter->csRenderLock);
|
||||
EnterCriticalSection(&pFilter->filter.csFilter);
|
||||
pFilter->eos = FALSE;
|
||||
hr = BaseInputPinImpl_EndFlush(iface);
|
||||
if (SUCCEEDED(hr))
|
||||
{
|
||||
|
@ -206,7 +204,7 @@ static HRESULT renderer_init_stream(struct strmbase_filter *iface)
|
|||
|
||||
if (filter->sink.pin.peer)
|
||||
ResetEvent(filter->state_event);
|
||||
filter->sink.end_of_stream = FALSE;
|
||||
filter->eos = FALSE;
|
||||
BaseRendererImpl_ClearPendingSample(filter);
|
||||
ResetEvent(filter->flush_event);
|
||||
if (filter->pFuncsTable->renderer_init_stream)
|
||||
|
@ -222,7 +220,7 @@ static HRESULT renderer_start_stream(struct strmbase_filter *iface, REFERENCE_TI
|
|||
filter->stream_start = start;
|
||||
SetEvent(filter->state_event);
|
||||
if (filter->sink.pin.peer)
|
||||
filter->sink.end_of_stream = FALSE;
|
||||
filter->eos = FALSE;
|
||||
QualityControlRender_Start(filter->qcimpl, filter->stream_start);
|
||||
if (filter->sink.pin.peer && filter->pFuncsTable->renderer_start_stream)
|
||||
filter->pFuncsTable->renderer_start_stream(filter);
|
||||
|
@ -339,7 +337,7 @@ HRESULT WINAPI BaseRendererImpl_Receive(struct strmbase_renderer *This, IMediaSa
|
|||
|
||||
TRACE("(%p)->%p\n", This, pSample);
|
||||
|
||||
if (This->sink.end_of_stream || This->sink.flushing)
|
||||
if (This->eos || This->sink.flushing)
|
||||
return S_FALSE;
|
||||
|
||||
if (This->filter.state == State_Stopped)
|
||||
|
|
|
@ -76,7 +76,7 @@ static HRESULT WINAPI TransformFilter_Input_Receive(struct strmbase_sink *This,
|
|||
return VFW_E_WRONG_STATE;
|
||||
}
|
||||
|
||||
if (This->end_of_stream || This->flushing)
|
||||
if (This->flushing)
|
||||
{
|
||||
LeaveCriticalSection(&pTransform->csReceive);
|
||||
return S_FALSE;
|
||||
|
@ -165,7 +165,6 @@ static HRESULT transform_init_stream(struct strmbase_filter *iface)
|
|||
|
||||
EnterCriticalSection(&filter->csReceive);
|
||||
|
||||
filter->sink.end_of_stream = FALSE;
|
||||
if (filter->pFuncsTable->pfnStartStreaming)
|
||||
hr = filter->pFuncsTable->pfnStartStreaming(filter);
|
||||
if (SUCCEEDED(hr))
|
||||
|
@ -183,7 +182,6 @@ static HRESULT transform_cleanup_stream(struct strmbase_filter *iface)
|
|||
|
||||
EnterCriticalSection(&filter->csReceive);
|
||||
|
||||
filter->sink.end_of_stream = FALSE;
|
||||
if (filter->pFuncsTable->pfnStopStreaming)
|
||||
hr = filter->pFuncsTable->pfnStopStreaming(filter);
|
||||
if (SUCCEEDED(hr))
|
||||
|
|
|
@ -81,7 +81,7 @@ struct strmbase_sink
|
|||
|
||||
IMemInputPin IMemInputPin_iface;
|
||||
IMemAllocator *pAllocator;
|
||||
BOOL flushing, end_of_stream;
|
||||
BOOL flushing;
|
||||
IMemAllocator *preferred_allocator;
|
||||
|
||||
const struct strmbase_sink_ops *pFuncsTable;
|
||||
|
@ -534,6 +534,8 @@ struct strmbase_renderer
|
|||
struct QualityControlImpl *qcimpl;
|
||||
|
||||
const struct strmbase_renderer_ops *pFuncsTable;
|
||||
|
||||
BOOL eos;
|
||||
};
|
||||
|
||||
typedef HRESULT (WINAPI *BaseRenderer_CheckMediaType)(struct strmbase_renderer *iface, const AM_MEDIA_TYPE *mt);
|
||||
|
|
Loading…
Reference in New Issue