1 #ifndef AGGREGATOR_TIMESTAMP_ESTIMATOR_HPP
2 #define AGGREGATOR_TIMESTAMP_ESTIMATOR_HPP
4 #include <base/Time.hpp>
5 #include <base/CircularBuffer.hpp>
8 #include <aggregator/TimestampEstimatorStatus.hpp>
33 boost::circular_buffer<double> m_samples;
49 std::vector<long> m_lost;
63 bool m_got_full_window;
65 double getPeriodInternal()
const;
73 double m_base_time_reset;
80 double m_base_time_reset_offset;
100 double m_latency_raw;
108 double m_initial_latency;
114 double m_initial_period;
117 int m_missing_samples_total;
120 unsigned int m_missing_samples;
123 int64_t m_last_index;
126 bool m_have_last_index;
129 base::Time m_last_reference;
134 int m_expected_losses;
139 int m_rejected_expected_losses;
144 int m_expected_loss_timeout;
149 void resetBaseTime(
double new_value,
double reset_time);
155 void internalReset(
double window,
156 double initial_period,
158 int lost_threshold = 2);
164 void pushSample(
double time);
189 base::Time initial_period,
190 base::Time min_latency,
191 int lost_threshold = 2);
193 base::Time initial_period,
194 int lost_threshold = 2);
196 int lost_threshold = 2);
207 void reset(base::Time window,
208 int lost_threshold = 2);
212 void reset(base::Time window,
213 base::Time initial_period,
214 int lost_threshold = 2);
220 void reset(base::Time window,
221 base::Time initial_period,
222 base::Time min_latency,
223 int lost_threshold = 2);
226 base::Time
update(base::Time ts);
231 base::Time
update(base::Time ts, int64_t index);
Definition: TimestampEstimator.hpp:18
TimestampEstimatorStatus getStatus() const
Definition: TimestampEstimator.cpp:483
int getLostSampleCount() const
Definition: TimestampEstimator.cpp:176
base::Time getLatency() const
Definition: TimestampEstimator.cpp:478
base::Time update(base::Time ts)
Definition: TimestampEstimator.cpp:250
base::Time getMaxJitter() const
void reset()
Definition: TimestampEstimator.cpp:33
void dumpInternalState() const
Definition: TimestampEstimator.cpp:159
void updateLoss()
Definition: TimestampEstimator.cpp:423
void shortenSampleList(double current)
Definition: TimestampEstimator.cpp:179
void updateReference(base::Time ts)
Definition: TimestampEstimator.cpp:429
base::Time getPeriod() const
Definition: TimestampEstimator.cpp:103
bool haveEstimate() const
Definition: TimestampEstimator.cpp:451
Definition: TimestampEstimatorStatus.hpp:10
TimestampEstimator(base::Time window, base::Time initial_period, base::Time min_latency, int lost_threshold=2)
Definition: TimestampEstimator.cpp:12