strmbase: Rename the "pClock" member of struct strmbase_filter to "clock".
Signed-off-by: Zebediah Figura <z.figura12@gmail.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
6f71e2c48d
commit
4a9893d4fc
|
@ -141,9 +141,9 @@ static HRESULT DSoundRender_GetWritePos(DSoundRenderImpl *This, DWORD *ret_write
|
||||||
|
|
||||||
DSoundRender_UpdatePositions(This, &writepos, &min_writepos);
|
DSoundRender_UpdatePositions(This, &writepos, &min_writepos);
|
||||||
playpos = This->last_playpos;
|
playpos = This->last_playpos;
|
||||||
if (This->renderer.filter.pClock)
|
if (This->renderer.filter.clock)
|
||||||
{
|
{
|
||||||
IReferenceClock_GetTime(This->renderer.filter.pClock, &cur);
|
IReferenceClock_GetTime(This->renderer.filter.clock, &cur);
|
||||||
cur -= This->renderer.stream_start;
|
cur -= This->renderer.stream_start;
|
||||||
} else
|
} else
|
||||||
write_at = -1;
|
write_at = -1;
|
||||||
|
@ -363,10 +363,10 @@ static HRESULT WINAPI DSoundRender_DoRenderSample(struct strmbase_renderer *ifac
|
||||||
TRACE("Sample data ptr = %p, size = %d\n", pbSrcStream, cbSrcStream);
|
TRACE("Sample data ptr = %p, size = %d\n", pbSrcStream, cbSrcStream);
|
||||||
|
|
||||||
hr = DSoundRender_SendSampleData(This, tStart, tStop, pbSrcStream, cbSrcStream);
|
hr = DSoundRender_SendSampleData(This, tStart, tStop, pbSrcStream, cbSrcStream);
|
||||||
if (This->renderer.filter.state == State_Running && This->renderer.filter.pClock && tStart >= 0) {
|
if (This->renderer.filter.state == State_Running && This->renderer.filter.clock && tStart >= 0) {
|
||||||
REFERENCE_TIME jitter, now = 0;
|
REFERENCE_TIME jitter, now = 0;
|
||||||
Quality q;
|
Quality q;
|
||||||
IReferenceClock_GetTime(This->renderer.filter.pClock, &now);
|
IReferenceClock_GetTime(This->renderer.filter.clock, &now);
|
||||||
jitter = now - This->renderer.stream_start - tStart;
|
jitter = now - This->renderer.stream_start - tStart;
|
||||||
if (jitter <= -DSoundRenderer_Max_Fill)
|
if (jitter <= -DSoundRenderer_Max_Fill)
|
||||||
jitter += DSoundRenderer_Max_Fill;
|
jitter += DSoundRenderer_Max_Fill;
|
||||||
|
|
|
@ -380,36 +380,38 @@ static HRESULT WINAPI filter_GetState(IBaseFilter *iface, DWORD timeout, FILTER_
|
||||||
return hr;
|
return hr;
|
||||||
}
|
}
|
||||||
|
|
||||||
static HRESULT WINAPI filter_SetSyncSource(IBaseFilter * iface, IReferenceClock *pClock)
|
static HRESULT WINAPI filter_SetSyncSource(IBaseFilter *iface, IReferenceClock *clock)
|
||||||
{
|
{
|
||||||
struct strmbase_filter *This = impl_from_IBaseFilter(iface);
|
struct strmbase_filter *filter = impl_from_IBaseFilter(iface);
|
||||||
TRACE("(%p)->(%p)\n", This, pClock);
|
|
||||||
|
|
||||||
EnterCriticalSection(&This->csFilter);
|
TRACE("filter %p, clock %p.\n", filter, clock);
|
||||||
{
|
|
||||||
if (This->pClock)
|
EnterCriticalSection(&filter->csFilter);
|
||||||
IReferenceClock_Release(This->pClock);
|
|
||||||
This->pClock = pClock;
|
if (filter->clock)
|
||||||
if (This->pClock)
|
IReferenceClock_Release(filter->clock);
|
||||||
IReferenceClock_AddRef(This->pClock);
|
filter->clock = clock;
|
||||||
}
|
if (filter->clock)
|
||||||
LeaveCriticalSection(&This->csFilter);
|
IReferenceClock_AddRef(filter->clock);
|
||||||
|
|
||||||
|
LeaveCriticalSection(&filter->csFilter);
|
||||||
|
|
||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
static HRESULT WINAPI filter_GetSyncSource(IBaseFilter *iface, IReferenceClock **ppClock)
|
static HRESULT WINAPI filter_GetSyncSource(IBaseFilter *iface, IReferenceClock **clock)
|
||||||
{
|
{
|
||||||
struct strmbase_filter *This = impl_from_IBaseFilter(iface);
|
struct strmbase_filter *filter = impl_from_IBaseFilter(iface);
|
||||||
TRACE("(%p)->(%p)\n", This, ppClock);
|
|
||||||
|
|
||||||
EnterCriticalSection(&This->csFilter);
|
TRACE("filter %p, clock %p.\n", filter, clock);
|
||||||
{
|
|
||||||
*ppClock = This->pClock;
|
EnterCriticalSection(&filter->csFilter);
|
||||||
if (This->pClock)
|
|
||||||
IReferenceClock_AddRef(This->pClock);
|
*clock = filter->clock;
|
||||||
}
|
if (filter->clock)
|
||||||
LeaveCriticalSection(&This->csFilter);
|
IReferenceClock_AddRef(filter->clock);
|
||||||
|
|
||||||
|
LeaveCriticalSection(&filter->csFilter);
|
||||||
|
|
||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
@ -528,8 +530,8 @@ void strmbase_filter_init(struct strmbase_filter *filter, IUnknown *outer,
|
||||||
|
|
||||||
void strmbase_filter_cleanup(struct strmbase_filter *This)
|
void strmbase_filter_cleanup(struct strmbase_filter *This)
|
||||||
{
|
{
|
||||||
if (This->pClock)
|
if (This->clock)
|
||||||
IReferenceClock_Release(This->pClock);
|
IReferenceClock_Release(This->clock);
|
||||||
|
|
||||||
This->IBaseFilter_iface.lpVtbl = NULL;
|
This->IBaseFilter_iface.lpVtbl = NULL;
|
||||||
DeleteCriticalSection(&This->csFilter);
|
DeleteCriticalSection(&This->csFilter);
|
||||||
|
|
|
@ -160,7 +160,7 @@ void QualityControlRender_DoQOS(QualityControlImpl *priv)
|
||||||
|
|
||||||
TRACE("%p\n", priv);
|
TRACE("%p\n", priv);
|
||||||
|
|
||||||
if (!priv->pin->filter->pClock || priv->current_rstart < 0)
|
if (!priv->pin->filter->clock || priv->current_rstart < 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
start = priv->current_rstart;
|
start = priv->current_rstart;
|
||||||
|
@ -276,7 +276,7 @@ void QualityControlRender_BeginRender(QualityControlImpl *This, REFERENCE_TIME s
|
||||||
if (start >= 0)
|
if (start >= 0)
|
||||||
{
|
{
|
||||||
REFERENCE_TIME now;
|
REFERENCE_TIME now;
|
||||||
IReferenceClock_GetTime(This->pin->filter->pClock, &now);
|
IReferenceClock_GetTime(This->pin->filter->clock, &now);
|
||||||
This->current_jitter = (now - This->clockstart) - start;
|
This->current_jitter = (now - This->clockstart) - start;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -291,10 +291,10 @@ void QualityControlRender_BeginRender(QualityControlImpl *This, REFERENCE_TIME s
|
||||||
else
|
else
|
||||||
This->rendered++;
|
This->rendered++;
|
||||||
|
|
||||||
if (!This->pin->filter->pClock)
|
if (!This->pin->filter->clock)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
IReferenceClock_GetTime(This->pin->filter->pClock, &This->start);
|
IReferenceClock_GetTime(This->pin->filter->clock, &This->start);
|
||||||
|
|
||||||
TRACE("Starting at %s.\n", debugstr_time(This->start));
|
TRACE("Starting at %s.\n", debugstr_time(This->start));
|
||||||
}
|
}
|
||||||
|
@ -305,8 +305,8 @@ void QualityControlRender_EndRender(QualityControlImpl *This)
|
||||||
|
|
||||||
TRACE("%p\n", This);
|
TRACE("%p\n", This);
|
||||||
|
|
||||||
if (!This->pin->filter->pClock || This->start < 0
|
if (!This->pin->filter->clock || This->start < 0
|
||||||
|| FAILED(IReferenceClock_GetTime(This->pin->filter->pClock, &This->stop)))
|
|| FAILED(IReferenceClock_GetTime(This->pin->filter->clock, &This->stop)))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
elapsed = This->start - This->stop;
|
elapsed = This->start - This->stop;
|
||||||
|
|
|
@ -331,7 +331,7 @@ HRESULT WINAPI BaseRendererImpl_Receive(struct strmbase_renderer *This, IMediaSa
|
||||||
SetEvent(This->state_event);
|
SetEvent(This->state_event);
|
||||||
|
|
||||||
/* Wait for render Time */
|
/* Wait for render Time */
|
||||||
if (This->filter.pClock && SUCCEEDED(IMediaSample_GetTime(pSample, &start, &stop)))
|
if (This->filter.clock && SUCCEEDED(IMediaSample_GetTime(pSample, &start, &stop)))
|
||||||
{
|
{
|
||||||
hr = S_FALSE;
|
hr = S_FALSE;
|
||||||
RendererPosPassThru_RegisterMediaTime(This->pPosition, start);
|
RendererPosPassThru_RegisterMediaTime(This->pPosition, start);
|
||||||
|
@ -345,20 +345,20 @@ HRESULT WINAPI BaseRendererImpl_Receive(struct strmbase_renderer *This, IMediaSa
|
||||||
REFERENCE_TIME now;
|
REFERENCE_TIME now;
|
||||||
DWORD_PTR cookie;
|
DWORD_PTR cookie;
|
||||||
|
|
||||||
IReferenceClock_GetTime(This->filter.pClock, &now);
|
IReferenceClock_GetTime(This->filter.clock, &now);
|
||||||
|
|
||||||
if (now - This->stream_start - start <= -10000)
|
if (now - This->stream_start - start <= -10000)
|
||||||
{
|
{
|
||||||
HANDLE handles[2] = {This->advise_event, This->flush_event};
|
HANDLE handles[2] = {This->advise_event, This->flush_event};
|
||||||
DWORD ret;
|
DWORD ret;
|
||||||
|
|
||||||
IReferenceClock_AdviseTime(This->filter.pClock, This->stream_start,
|
IReferenceClock_AdviseTime(This->filter.clock, This->stream_start,
|
||||||
start, (HEVENT)This->advise_event, &cookie);
|
start, (HEVENT)This->advise_event, &cookie);
|
||||||
|
|
||||||
LeaveCriticalSection(&This->csRenderLock);
|
LeaveCriticalSection(&This->csRenderLock);
|
||||||
|
|
||||||
ret = WaitForMultipleObjects(2, handles, FALSE, INFINITE);
|
ret = WaitForMultipleObjects(2, handles, FALSE, INFINITE);
|
||||||
IReferenceClock_Unadvise(This->filter.pClock, cookie);
|
IReferenceClock_Unadvise(This->filter.clock, cookie);
|
||||||
|
|
||||||
if (ret == 1)
|
if (ret == 1)
|
||||||
{
|
{
|
||||||
|
|
|
@ -129,7 +129,7 @@ struct strmbase_filter
|
||||||
CRITICAL_SECTION csFilter;
|
CRITICAL_SECTION csFilter;
|
||||||
|
|
||||||
FILTER_STATE state;
|
FILTER_STATE state;
|
||||||
IReferenceClock * pClock;
|
IReferenceClock *clock;
|
||||||
WCHAR name[128];
|
WCHAR name[128];
|
||||||
IFilterGraph *graph;
|
IFilterGraph *graph;
|
||||||
CLSID clsid;
|
CLSID clsid;
|
||||||
|
|
Loading…
Reference in New Issue