(window_size: usize)
| 31 | |
| 32 | impl ClockSynchronizer { |
| 33 | pub fn new(window_size: usize) -> Self { |
| 34 | Self { |
| 35 | window_size: window_size.max(2), // 至少两点决定一条直线 |
| 36 | history: VecDeque::with_capacity(window_size), |
| 37 | baseline_established: false, |
| 38 | estimated_slope: 1.0, |
| 39 | estimated_offset: 0.0, |
| 40 | } |
| 41 | } |
| 42 | |
| 43 | /// 输入一帧的原始硬件时间戳,返回矫正后的系统时间 |
| 44 | /// |
nothing calls this directly
no outgoing calls
no test coverage detected