39#define XTIME_FMT "%u.%03u"
40#define XTIME(u) (int)(u/10000000), (int)((u / 10000)%1000)
54 This->current_rstart =
This->current_rstop = -1;
72 return IBaseFilter_QueryInterface(
This->self,
riid,
ppv);
78 return IBaseFilter_AddRef(
This->self);
84 return IBaseFilter_Release(
This->self);
97 return IQualityControl_Notify(
This->tonotify,
This->self, qm);
101 IPin_ConnectedTo(
This->input, &to);
104 IPin_QueryInterface(to, &IID_IQualityControl, (
void**)&qc);
106 hr = IQualityControl_Notify(qc,
This->self, qm);
107 IQualityControl_Release(qc);
120 This->tonotify = tonotify;
125#define DO_RUNNING_AVG(avg,val,size) (((val) + ((size)-1) * (avg)) / (size))
128#define UPDATE_RUNNING_AVG(avg,val) DO_RUNNING_AVG(avg,val,8)
133#define UPDATE_RUNNING_AVG_P(avg,val) DO_RUNNING_AVG(avg,val,16)
134#define UPDATE_RUNNING_AVG_N(avg,val) DO_RUNNING_AVG(avg,val,4)
139 This->avg_render =
This->last_in_time =
This->last_left =
This->avg_duration =
This->avg_pt = -1;
140 This->clockstart = tStart;
141 This->avg_rate = -1.0;
164 max_lateness += stop;
166 max_lateness +=
start;
169 if (
start + jitter > max_lateness) {
170 WARN(
"buffer is too late %i > %i\n", (
int)((
start + jitter)/10000), (
int)(max_lateness/10000));
173 if (
This->last_in_time < 0 ||
176 FIXME(
"A lot of buffers are being dropped.\n");
177 FIXME(
"There may be a timestamping problem, or this computer is too slow.\n");
189 This->current_rstart =
This->current_rstop = -1;
190 This->current_jitter = 0;
191 if (!
This->clock ||
FAILED(IMediaSample_GetTime(sample, &
start, &stop)))
200 if (jitter <= -10000) {
211 This->current_jitter = jitter;
213 TRACE(
"Dropped: %i %i %i %i\n",
This->is_dropped, (
int)(
start/10000), (
int)(stop/10000), (
int)(jitter / 10000));
214 if (
This->is_dropped) {
216 if (!
This->qos_handled)
242 entered =
start + jitter;
246 entered =
start + jitter;
253 duration = stop -
start;
318 q.Type = (jitter > 0 ? Famine : Flood);
320 if (
q.Proportion < 200)
322 else if (
q.Proportion > 5000)
326 TRACE(
"Late: %i from %i, rate: %g\n", (
int)(
q.Late/10000), (
int)(
q.TimeStamp/10000), 1./priv->
avg_rate);
361 if (
This->avg_render < 0)
362 This->avg_render = elapsed;
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
#define HeapFree(x, y, z)
#define IReferenceClock_AdviseTime(p, a, b, c, d)
#define IReferenceClock_Unadvise(p, a)
#define IReferenceClock_GetTime(p, a)
GLdouble GLdouble GLdouble GLdouble q
GLenum GLenum GLenum input
static const char mbstate_t *static wchar_t const char mbstate_t *static const wchar_t int *static double
void QualityControlRender_EndRender(QualityControlImpl *This)
void QualityControlRender_BeginRender(QualityControlImpl *This)
ULONG WINAPI QualityControlImpl_AddRef(IQualityControl *iface)
void QualityControlRender_Start(QualityControlImpl *This, REFERENCE_TIME tStart)
HRESULT WINAPI QualityControlImpl_Notify(IQualityControl *iface, IBaseFilter *sender, Quality qm)
void QualityControlImpl_Destroy(QualityControlImpl *This)
HRESULT WINAPI QualityControlImpl_QueryInterface(IQualityControl *iface, REFIID riid, void **ppv)
ULONG WINAPI QualityControlImpl_Release(IQualityControl *iface)
void QualityControlRender_DoQOS(QualityControlImpl *priv)
HRESULT QualityControlRender_WaitFor(QualityControlImpl *This, IMediaSample *sample, HANDLE ev)
HRESULT QualityControlImpl_Create(IPin *input, IBaseFilter *self, QualityControlImpl **ppv)
#define UPDATE_RUNNING_AVG_N(avg, val)
static BOOL QualityControlRender_IsLate(QualityControlImpl *This, REFERENCE_TIME jitter, REFERENCE_TIME start, REFERENCE_TIME stop)
static QualityControlImpl * impl_from_IQualityControl(IQualityControl *iface)
#define UPDATE_RUNNING_AVG(avg, val)
void QualityControlRender_SetClock(QualityControlImpl *This, IReferenceClock *clock)
HRESULT WINAPI QualityControlImpl_SetSink(IQualityControl *iface, IQualityControl *tonotify)
#define UPDATE_RUNNING_AVG_P(avg, val)
_Check_return_ _CRTIMP clock_t __cdecl clock(void)
IQualityControl IQualityControl_iface
REFERENCE_TIME avg_duration
REFERENCE_TIME current_jitter
REFERENCE_TIME current_rstart
REFERENCE_TIME current_rstop
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
#define CONTAINING_RECORD(address, type, field)