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);
|
EnterCriticalSection(&This->pin.filter->csFilter);
|
||||||
if (This->flushing)
|
if (This->flushing)
|
||||||
hr = S_FALSE;
|
hr = S_FALSE;
|
||||||
else
|
|
||||||
This->end_of_stream = TRUE;
|
|
||||||
LeaveCriticalSection(&This->pin.filter->csFilter);
|
LeaveCriticalSection(&This->pin.filter->csFilter);
|
||||||
|
|
||||||
if (hr == S_OK)
|
if (hr == S_OK)
|
||||||
|
@ -731,7 +729,7 @@ HRESULT WINAPI BaseInputPinImpl_EndFlush(IPin * iface)
|
||||||
TRACE("(%p)->()\n", This);
|
TRACE("(%p)->()\n", This);
|
||||||
|
|
||||||
EnterCriticalSection(&This->pin.filter->csFilter);
|
EnterCriticalSection(&This->pin.filter->csFilter);
|
||||||
This->flushing = This->end_of_stream = FALSE;
|
This->flushing = FALSE;
|
||||||
|
|
||||||
hr = SendFurther(This, deliver_endflush, NULL);
|
hr = SendFurther(This, deliver_endflush, NULL);
|
||||||
LeaveCriticalSection(&This->pin.filter->csFilter);
|
LeaveCriticalSection(&This->pin.filter->csFilter);
|
||||||
|
|
|
@ -89,14 +89,11 @@ static HRESULT WINAPI BaseRenderer_InputPin_EndOfStream(IPin * iface)
|
||||||
|
|
||||||
EnterCriticalSection(&pFilter->csRenderLock);
|
EnterCriticalSection(&pFilter->csRenderLock);
|
||||||
EnterCriticalSection(&pFilter->filter.csFilter);
|
EnterCriticalSection(&pFilter->filter.csFilter);
|
||||||
hr = BaseInputPinImpl_EndOfStream(iface);
|
pFilter->eos = TRUE;
|
||||||
if (SUCCEEDED(hr))
|
|
||||||
{
|
|
||||||
if (pFilter->pFuncsTable->pfnEndOfStream)
|
if (pFilter->pFuncsTable->pfnEndOfStream)
|
||||||
hr = pFilter->pFuncsTable->pfnEndOfStream(pFilter);
|
hr = pFilter->pFuncsTable->pfnEndOfStream(pFilter);
|
||||||
else
|
else
|
||||||
hr = BaseRendererImpl_EndOfStream(pFilter);
|
hr = BaseRendererImpl_EndOfStream(pFilter);
|
||||||
}
|
|
||||||
LeaveCriticalSection(&pFilter->filter.csFilter);
|
LeaveCriticalSection(&pFilter->filter.csFilter);
|
||||||
LeaveCriticalSection(&pFilter->csRenderLock);
|
LeaveCriticalSection(&pFilter->csRenderLock);
|
||||||
return hr;
|
return hr;
|
||||||
|
@ -128,6 +125,7 @@ static HRESULT WINAPI BaseRenderer_InputPin_EndFlush(IPin * iface)
|
||||||
|
|
||||||
EnterCriticalSection(&pFilter->csRenderLock);
|
EnterCriticalSection(&pFilter->csRenderLock);
|
||||||
EnterCriticalSection(&pFilter->filter.csFilter);
|
EnterCriticalSection(&pFilter->filter.csFilter);
|
||||||
|
pFilter->eos = FALSE;
|
||||||
hr = BaseInputPinImpl_EndFlush(iface);
|
hr = BaseInputPinImpl_EndFlush(iface);
|
||||||
if (SUCCEEDED(hr))
|
if (SUCCEEDED(hr))
|
||||||
{
|
{
|
||||||
|
@ -206,7 +204,7 @@ static HRESULT renderer_init_stream(struct strmbase_filter *iface)
|
||||||
|
|
||||||
if (filter->sink.pin.peer)
|
if (filter->sink.pin.peer)
|
||||||
ResetEvent(filter->state_event);
|
ResetEvent(filter->state_event);
|
||||||
filter->sink.end_of_stream = FALSE;
|
filter->eos = FALSE;
|
||||||
BaseRendererImpl_ClearPendingSample(filter);
|
BaseRendererImpl_ClearPendingSample(filter);
|
||||||
ResetEvent(filter->flush_event);
|
ResetEvent(filter->flush_event);
|
||||||
if (filter->pFuncsTable->renderer_init_stream)
|
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;
|
filter->stream_start = start;
|
||||||
SetEvent(filter->state_event);
|
SetEvent(filter->state_event);
|
||||||
if (filter->sink.pin.peer)
|
if (filter->sink.pin.peer)
|
||||||
filter->sink.end_of_stream = FALSE;
|
filter->eos = FALSE;
|
||||||
QualityControlRender_Start(filter->qcimpl, filter->stream_start);
|
QualityControlRender_Start(filter->qcimpl, filter->stream_start);
|
||||||
if (filter->sink.pin.peer && filter->pFuncsTable->renderer_start_stream)
|
if (filter->sink.pin.peer && filter->pFuncsTable->renderer_start_stream)
|
||||||
filter->pFuncsTable->renderer_start_stream(filter);
|
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);
|
TRACE("(%p)->%p\n", This, pSample);
|
||||||
|
|
||||||
if (This->sink.end_of_stream || This->sink.flushing)
|
if (This->eos || This->sink.flushing)
|
||||||
return S_FALSE;
|
return S_FALSE;
|
||||||
|
|
||||||
if (This->filter.state == State_Stopped)
|
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;
|
return VFW_E_WRONG_STATE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (This->end_of_stream || This->flushing)
|
if (This->flushing)
|
||||||
{
|
{
|
||||||
LeaveCriticalSection(&pTransform->csReceive);
|
LeaveCriticalSection(&pTransform->csReceive);
|
||||||
return S_FALSE;
|
return S_FALSE;
|
||||||
|
@ -165,7 +165,6 @@ static HRESULT transform_init_stream(struct strmbase_filter *iface)
|
||||||
|
|
||||||
EnterCriticalSection(&filter->csReceive);
|
EnterCriticalSection(&filter->csReceive);
|
||||||
|
|
||||||
filter->sink.end_of_stream = FALSE;
|
|
||||||
if (filter->pFuncsTable->pfnStartStreaming)
|
if (filter->pFuncsTable->pfnStartStreaming)
|
||||||
hr = filter->pFuncsTable->pfnStartStreaming(filter);
|
hr = filter->pFuncsTable->pfnStartStreaming(filter);
|
||||||
if (SUCCEEDED(hr))
|
if (SUCCEEDED(hr))
|
||||||
|
@ -183,7 +182,6 @@ static HRESULT transform_cleanup_stream(struct strmbase_filter *iface)
|
||||||
|
|
||||||
EnterCriticalSection(&filter->csReceive);
|
EnterCriticalSection(&filter->csReceive);
|
||||||
|
|
||||||
filter->sink.end_of_stream = FALSE;
|
|
||||||
if (filter->pFuncsTable->pfnStopStreaming)
|
if (filter->pFuncsTable->pfnStopStreaming)
|
||||||
hr = filter->pFuncsTable->pfnStopStreaming(filter);
|
hr = filter->pFuncsTable->pfnStopStreaming(filter);
|
||||||
if (SUCCEEDED(hr))
|
if (SUCCEEDED(hr))
|
||||||
|
|
|
@ -81,7 +81,7 @@ struct strmbase_sink
|
||||||
|
|
||||||
IMemInputPin IMemInputPin_iface;
|
IMemInputPin IMemInputPin_iface;
|
||||||
IMemAllocator *pAllocator;
|
IMemAllocator *pAllocator;
|
||||||
BOOL flushing, end_of_stream;
|
BOOL flushing;
|
||||||
IMemAllocator *preferred_allocator;
|
IMemAllocator *preferred_allocator;
|
||||||
|
|
||||||
const struct strmbase_sink_ops *pFuncsTable;
|
const struct strmbase_sink_ops *pFuncsTable;
|
||||||
|
@ -534,6 +534,8 @@ struct strmbase_renderer
|
||||||
struct QualityControlImpl *qcimpl;
|
struct QualityControlImpl *qcimpl;
|
||||||
|
|
||||||
const struct strmbase_renderer_ops *pFuncsTable;
|
const struct strmbase_renderer_ops *pFuncsTable;
|
||||||
|
|
||||||
|
BOOL eos;
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef HRESULT (WINAPI *BaseRenderer_CheckMediaType)(struct strmbase_renderer *iface, const AM_MEDIA_TYPE *mt);
|
typedef HRESULT (WINAPI *BaseRenderer_CheckMediaType)(struct strmbase_renderer *iface, const AM_MEDIA_TYPE *mt);
|
||||||
|
|
Loading…
Reference in New Issue