Expand description
Deterministic timeline primitives.
Structs§
- Audio
Frame Grid - The source samples an audio stream’s frames start at, read from its first
packets’ timestamps (
audio_frame_grid): everyperiodsamples fromanchor, at the stream’s rate. - Frame
Rate - A positive rational frame rate in reduced form, at most one frame per tick (120 000 frames per second).
- Media
Time - A signed position or duration in timeline ticks (120 000 per second).
- Time
Range - A half-open timeline interval
[start, end).
Enums§
- Frame
Rate Error - Invalid rational frame rate.
- Time
Range Error - Invalid time range.
Constants§
- MAX_
SERIALIZED_ TICKS - The largest number of ticks a serialized time holds, either way: the largest integer a JavaScript number holds exactly (about 2,378 years). A document read from JSON is read the same by every host.
- PRESENTATION_
SLACK - How much later than a source time
ta decoded frame’s timestamp may be and still be the frame shown att, for a stream whose time base is not known: 0.5 ms and one tick (61 ticks), a millisecond time base’spresentation_slack. It is also the most a stream whose timestamps show no rounding of their own is given. - ROUNDING_
SCAN_ BYTES - The packet bytes past which a host reads no more of a stream’s first
packets for
rounding_quantum(16 MiB): a native decoder keeps the packets it read until it decodes them, so a 4K stream is held to about a second of them. - ROUNDING_
SCAN_ FRAMES - How many of a stream’s first packets
rounding_quantumreads the timestamps of: at most this many, and none once the packets read holdROUNDING_SCAN_BYTES. - TICKS_
PER_ SECOND - Fixed alpha2 timeline ticks per second.
Functions§
- audio_
frame_ grid - The frame grid an audio stream’s first packet timestamps show, at
sample_rate, in a stream whose timestamps are whole multiples ofnum / denseconds;Nonewhen they show none to place frames on. - presentation_
slack - How much later than a source time
ta decoded frame’s timestamp may be and still be the frame shown att, for a stream whose timestamps are whole multiples ofnum / denseconds and are rounded toquantumof those units (rounding_quantum; 0 for none shown). - rounding_
quantum - The unit a stream’s timestamps are rounded to, as their spacing shows, in the units of the stream’s time base; 0 when they show none.