PrismCore / API reference / Subtitles and captions
Enumeration
SubtitleCueHistory
enum SubtitleCueHistoryDeclared in Sources/PrismCore/Subtitles/TimedTextCue.swift · PrismCore 3.5.4
How much of the remux cue tap's past a session keeps for replay — what a handler registered late (setTimedTextCueHandler), or registered again to pick up a new subtitle delay, is handed before live delivery resumes.
Live delivery is the same under both: a cue produced while a handler is registered reaches it. Only the replay — and the dedup that keeps a re-demuxed region from reaching the host twice — depend on this.
Cases
case completeEvery cue the session produced, for its whole lifetime. A late handler starts complete and a re-demuxed region is never delivered twice. Memory grows with the text the title carries — fine for a film, not necessarily for a long captioned stream or a disc with many tracks.
case bounded(maxCues: Int, maxBytes: Int)The newest cues only, at most maxCues of them and at most maxBytes of UTF-8 between their text and their dedup keys (a key is the cue's stream, source times and text, so a cue costs a little over twice its text). The oldest go first, cue and key together.
What a host opting in takes on:
- A replay is the retained window, not the film: a late handler, or a re-registration after
setSubtitleDelaySeconds, sees only what is still held (with the delay in force now, as under.complete). - Dedup covers the retained window only. A seek far enough back that the region's cues were evicted re-demuxes them, and they are delivered again.
- A single cue larger than
maxBytesis delivered live and never retained (keeping it would mean evicting everything else for one cue that still would not fit). It is counted inevictedCues. - Cues produced before the presentation origin is known wait in a queue bounded the same way; what overflows it was never delivered and is counted in
droppedBeforeOrigin.
Both limits are clamped to at least 1 when the session is built, so Options.subtitleCueHistory reads back the bound in force. A maxBytes of 1 is a valid "no history": every cue is live-only.
Generated from the public symbols of PrismCore 3.5.4. All types