Selkies
Developer ReferenceWeb client coreLib

lib/stripe-clock

When a striped codec's frame can be taken as whole.

The striped paths composite partial-height stripes, so a frame is only known complete once the next frame id arrives — a capture period later. Presenting on socket quiet instead puts the frame on screen in the tick its stripes landed. A frame's stripes arrive in waves (the encoder's thread pool, then the event loop), so quiet shorter than the widest gap seen inside recent frames proves nothing; the clock tracks that gap and asks for it back, decaying it per frame so a one-off wave does not hold the stream back for long. Under a backlog the socket never goes quiet and the caller falls back to presenting at frame-id boundaries.

Variables

STRIPE_SETTLE_FLOOR_MS

const STRIPE_SETTLE_FLOOR_MS: 2 = 2;

Defined in: lib/stripe-clock.js:23

Quiet a frame must show on top of the tracked wave gap, in milliseconds.


STRIPE_WAVE_DECAY

const STRIPE_WAVE_DECAY: 0.9 = 0.9;

Defined in: lib/stripe-clock.js:25

Per-frame decay of the remembered wave gap.

Functions

createStripeClock()

function createStripeClock(clock?): object;

Defined in: lib/stripe-clock.js:33

Parameters

ParameterTypeDescription
clock?() => numberMillisecond clock; defaults to performance.now.

Returns

object

note
note: (arg0) => void;
Parameters
ParameterType
arg0number
Returns

void

settled
settled: () => boolean;
Returns

boolean

waveGapMs
waveGapMs: () => number;
Returns

number


waveGapMs()

function waveGapMs(): number;

Defined in: lib/stripe-clock.js:44

The gap a frame is currently allowed to leave between its stripes: the widest of recent frames, or of the one in flight.

Returns

number

On this page

Edit on GitHub