|
aggregator
|
#include <TimestampEstimator.hpp>
Public Member Functions | |
| TimestampEstimator (base::Time window, base::Time initial_period, base::Time min_latency, int lost_threshold=2) | |
| TimestampEstimator (base::Time window, base::Time initial_period, int lost_threshold=2) | |
| TimestampEstimator (base::Time window=base::Time(), int lost_threshold=2) | |
| void | reset () |
| void | reset (base::Time window, int lost_threshold=2) |
| void | reset (base::Time window, base::Time initial_period, int lost_threshold=2) |
| void | reset (base::Time window, base::Time initial_period, base::Time min_latency, int lost_threshold=2) |
| base::Time | update (base::Time ts) |
| base::Time | update (base::Time ts, int64_t index) |
| void | updateLoss () |
| void | updateReference (base::Time ts) |
| base::Time | getPeriod () const |
| void | shortenSampleList (double current) |
| int | getLostSampleCount () const |
| bool | haveEstimate () const |
| base::Time | getLatency () const |
| base::Time | getMaxJitter () const |
| TimestampEstimatorStatus | getStatus () const |
| void | dumpInternalState () const |
The timestamp estimator takes a stream of samples and determines a best guess for each of the samples timestamp.
It assumes that most samples will be received at the right period. It will not work if the reception period is completely random.
| TimestampEstimator::TimestampEstimator | ( | base::Time | window, |
| base::Time | initial_period, | ||
| base::Time | min_latency, | ||
| int | lost_threshold = 2 |
||
| ) |
Creates a timestamp estimator
| TimestampEstimator::TimestampEstimator | ( | base::Time | window, |
| base::Time | initial_period, | ||
| int | lost_threshold = 2 |
||
| ) |
| TimestampEstimator::TimestampEstimator | ( | base::Time | window = base::Time(), |
| int | lost_threshold = 2 |
||
| ) |
| void TimestampEstimator::dumpInternalState | ( | ) | const |
Dumps part of the estimator's internal state to std::cout
| base::Time TimestampEstimator::getLatency | ( | ) | const |
Returns the current latency estimate. This is valid only if updateReference() is called
| int TimestampEstimator::getLostSampleCount | ( | ) | const |
The total estimated count of lost samples so far
| base::Time aggregator::TimestampEstimator::getMaxJitter | ( | ) | const |
Returns the maximum jitter duration estimated so far
It is reset to zero only on reset
| base::Time TimestampEstimator::getPeriod | ( | ) | const |
The currently estimated period
| TimestampEstimatorStatus TimestampEstimator::getStatus | ( | ) | const |
Returns a data structure that represents the estimator's internal status
This is constant time
| bool TimestampEstimator::haveEstimate | ( | ) | const |
Returns true if updateLoss and getPeriod can give valid estimates
| void TimestampEstimator::reset | ( | ) |
Resets this estimator to an initial state, reusing the same parameters
See the constructor documentation for parameter documentation
| void TimestampEstimator::reset | ( | base::Time | window, |
| int | lost_threshold = 2 |
||
| ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
| void TimestampEstimator::reset | ( | base::Time | window, |
| base::Time | initial_period, | ||
| int | lost_threshold = 2 |
||
| ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
| void TimestampEstimator::reset | ( | base::Time | window, |
| base::Time | initial_period, | ||
| base::Time | min_latency, | ||
| int | lost_threshold = 2 |
||
| ) |
Changes the estimator parameters, and resets it to an initial state
See the constructor documentation for parameter documentation
| void TimestampEstimator::shortenSampleList | ( | double | current | ) |
Shortens the sample list so that the addition of time would not overflow the window. Calling this is strongly recommended if there is a chance of only calling updateLoss for long stretches of time
| base::Time TimestampEstimator::update | ( | base::Time | ts | ) |
Updates the estimate and return the actual timestamp for +ts+
| base::Time TimestampEstimator::update | ( | base::Time | ts, |
| int64_t | index | ||
| ) |
Updates the estimate and return the actual timestamp for +ts+, calculating lost samples from the index
| void TimestampEstimator::updateLoss | ( | ) |
Updates the estimate for a known lost sample
| void TimestampEstimator::updateReference | ( | base::Time | ts | ) |
Updates the estimate using a reference
1.8.13