Monado OpenXR Runtime
m_clock_tracking.c File Reference

Helpers to estimate offsets between clocks. More...

#include "util/u_misc.h"
#include "m_clock_tracking.h"
Include dependency graph for m_clock_tracking.c:

Data Structures

struct  m_clock_observation
 
struct  m_clock_windowed_skew_tracker
 

Functions

static struct m_clock_observation m_clock_observation_init (timepoint_ns local_ts, timepoint_ns remote_ts)
 
struct m_clock_windowed_skew_trackerm_clock_windowed_skew_tracker_alloc (const size_t window_samples)
 Allocate a struct m_clock_windowed_skew_tracker with a window of. More...
 
void m_clock_windowed_skew_tracker_reset (struct m_clock_windowed_skew_tracker *t)
 
void m_clock_windowed_skew_tracker_destroy (struct m_clock_windowed_skew_tracker *t)
 
void m_clock_windowed_skew_tracker_push (struct m_clock_windowed_skew_tracker *t, const timepoint_ns local_ts, const timepoint_ns remote_ts)
 
bool m_clock_windowed_skew_tracker_to_local (struct m_clock_windowed_skew_tracker *t, const timepoint_ns remote_ts, timepoint_ns *local_ts)
 
bool m_clock_windowed_skew_tracker_to_remote (struct m_clock_windowed_skew_tracker *t, const timepoint_ns local_ts, timepoint_ns *remote_ts)
 

Variables

const time_duration_ns CLOCK_RESET_THRESHOLD = 100 * U_TIME_1MS_IN_NS
 
const time_duration_ns CLOCK_RESET_HOLDOFF = 30 * U_TIME_1MS_IN_NS
 

Detailed Description

Helpers to estimate offsets between clocks.

Author
Jan Schmidt jan@c.nosp@m.entr.nosp@m.icula.nosp@m.r.co.nosp@m.m

Function Documentation

◆ m_clock_windowed_skew_tracker_alloc()

struct m_clock_windowed_skew_tracker * m_clock_windowed_skew_tracker_alloc ( const size_t  window_samples)

Allocate a struct m_clock_windowed_skew_tracker with a window of.

Parameters
window_samplessamples.

References U_TYPED_ARRAY_CALLOC, and U_TYPED_CALLOC.