public class TimestampAligner
The TimestampAligner class helps translating camera timestamps into the same timescale as is
used by rtc::TimeNanos(). Some cameras have built in timestamping which is more accurate than
reading the system clock, but using a different epoch and unknown clock drift. Frame timestamps
in webrtc should use rtc::TimeNanos (system monotonic time), and this class provides a filter
which lets us use the rtc::TimeNanos timescale, and at the same time take advantage of higher
accuracy of the camera clock. This class is a wrapper on top of rtc::TimestampAligner.
Wrapper around rtc::TimeNanos(). This is normally same as System.nanoTime(), but call this
function to be safe.
public long translateTimestamp(long cameraTimeNs)
Translates camera timestamps to the same timescale as is used by rtc::TimeNanos().
|cameraTimeNs| is assumed to be accurate, but with an unknown epoch and clock drift. Returns
the translated timestamp.