Modify smoothing code to make cubic interpolation optional and allow 'quick fixups' on resuming

The primary reason for this change is to allow time graphs that do not
go through the origin and hence smoothing starting from the origin is
not desired. This change will allow passing time data into the smoother
while paused and then abruptly use that data without smoothing using the
'quick fixup' flag when resuming.

Primary use case is allowing recording time graphs where the data
recorded originates from a time before the stream was created. The
resulting graft will be shifted and should not be smoothened to go
through the origin.
This commit is contained in:
Lennart Poettering 2009-04-05 02:26:02 +02:00
parent 1c26d7e174
commit d035f4a3f3
12 changed files with 136 additions and 43 deletions

View file

@ -27,7 +27,15 @@
typedef struct pa_smoother pa_smoother;
pa_smoother* pa_smoother_new(pa_usec_t x_adjust_time, pa_usec_t x_history_time, pa_bool_t monotonic, unsigned min_history);
pa_smoother* pa_smoother_new(
pa_usec_t x_adjust_time,
pa_usec_t x_history_time,
pa_bool_t monotonic,
pa_bool_t smoothing,
unsigned min_history,
pa_usec_t x_offset,
pa_bool_t paused);
void pa_smoother_free(pa_smoother* s);
/* Adds a new value to our dataset. x = local/system time, y = remote time */
@ -42,8 +50,10 @@ pa_usec_t pa_smoother_translate(pa_smoother *s, pa_usec_t x, pa_usec_t y_delay);
void pa_smoother_set_time_offset(pa_smoother *s, pa_usec_t x_offset);
void pa_smoother_pause(pa_smoother *s, pa_usec_t x);
void pa_smoother_resume(pa_smoother *s, pa_usec_t x);
void pa_smoother_resume(pa_smoother *s, pa_usec_t x, pa_bool_t abrupt);
void pa_smoother_reset(pa_smoother *s);
void pa_smoother_fix_now(pa_smoother *s);
#endif