pub struct Timebase<E: CatalogExt = ()> { /* private fields */ }Expand description
One source’s timestamp base on a catalog, shared by every importer reading it.
Made via Producer::timebase. A source on a timeline of its own (a container’s, an RTP
session’s) shifts its timestamps onto the catalog’s Clock by
one offset fixed on its first frame: zero when that frame places the clock (the catalog was not
yet published, nor its clock taken), so the timestamps stay verbatim, and the gap between the
clock’s reading and the frame’s timestamp otherwise. A source that knows when its timestamps
happened places them first instead of landing at its first frame’s arrival.
Every track shifted through one timebase shares that offset, so renditions on one timestamp
base (an HLS import’s variants, or the importer replacing one on a new init segment) stay in
sync, while separate timebases each get their own. A container importer shifts through a fresh
one unless handed a shared one with its with_timebase; codec importers and
Reserved write timestamps verbatim, already on the catalog’s clock.
Clones share the offset. Holding one never withholds the catalog: only a live
Reserved does.
Implementations§
Source§impl<E: CatalogExt> Timebase<E>
impl<E: CatalogExt> Timebase<E>
Sourcepub fn place(&self, pts: Timestamp, wall: Wall) -> Result<()>
pub fn place(&self, pts: Timestamp, wall: Wall) -> Result<()>
Place this timebase’s pts at the wall-clock instant wall, instead of at the arrival of its
first frame.
For a source whose timestamps say when they happened, such as a program clock. Like a first frame, this places the catalog’s clock if it is not yet fixed and offsets onto it otherwise. A placement alone publishes nothing: the clock goes out with the catalog’s first track. Refused once this timebase has an offset, and when the host’s wall clock was unset, leaving no wall to place it on.