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.

Functions

createStripeClock()

function createStripeClock(clock?): object;

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

Self-contained by design: the video worker embeds this factory by toString(), so a reference to anything in module scope would arrive there minified and unbound.

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

settleWaitMs
settleWaitMs: () => number;
Returns

number


waveGapMs()

function waveGapMs(): number;

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

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