• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 #ifndef foopulsetimesmootherhfoo
2 #define foopulsetimesmootherhfoo
3 
4 /***
5   This file is part of PulseAudio.
6 
7   Copyright 2007 Lennart Poettering
8 
9   PulseAudio is free software; you can redistribute it and/or modify
10   it under the terms of the GNU Lesser General Public License as
11   published by the Free Software Foundation; either version 2.1 of the
12   License, or (at your option) any later version.
13 
14   PulseAudio is distributed in the hope that it will be useful, but
15   WITHOUT ANY WARRANTY; without even the implied warranty of
16   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17   Lesser General Public License for more details.
18 
19   You should have received a copy of the GNU Lesser General Public
20   License along with PulseAudio; if not, see <http://www.gnu.org/licenses/>.
21 ***/
22 
23 #include <pulsecore/macro.h>
24 #include <pulse/sample.h>
25 
26 typedef struct pa_smoother pa_smoother;
27 
28 pa_smoother* pa_smoother_new(
29         pa_usec_t x_adjust_time,
30         pa_usec_t x_history_time,
31         bool monotonic,
32         bool smoothing,
33         unsigned min_history,
34         pa_usec_t x_offset,
35         bool paused);
36 
37 void pa_smoother_free(pa_smoother* s);
38 
39 /* Adds a new value to our dataset. x = local/system time, y = remote time */
40 void pa_smoother_put(pa_smoother *s, pa_usec_t x, pa_usec_t y);
41 
42 /* Returns an interpolated value based on the dataset. x = local/system time, return value = remote time */
43 pa_usec_t pa_smoother_get(pa_smoother *s, pa_usec_t x);
44 
45 /* Translates a time span from the remote time domain to the local one. x = local/system time when to estimate, y_delay = remote time span */
46 pa_usec_t pa_smoother_translate(pa_smoother *s, pa_usec_t x, pa_usec_t y_delay);
47 
48 void pa_smoother_set_time_offset(pa_smoother *s, pa_usec_t x_offset);
49 
50 void pa_smoother_pause(pa_smoother *s, pa_usec_t x);
51 void pa_smoother_resume(pa_smoother *s, pa_usec_t x, bool abrupt);
52 
53 void pa_smoother_reset(pa_smoother *s, pa_usec_t time_offset, bool paused);
54 
55 void pa_smoother_fix_now(pa_smoother *s);
56 
57 #endif
58