Expand description
kithara-stream
Core streaming orchestration primitives for Kithara.
§Design goals
Reader: syncRead + Seekvia direct Source callsdl::Downloader: unified download orchestrator (ownsHttpClient, dispatchesFetchCmdwith per-chunk writer callbacks)
Modules§
- dl
- Unified download orchestrator.
Structs§
- Chunk
Position - Decoder-reported chunk position used to advance the timeline.
- Media
Info - Media format information.
- Segment
Descriptor - Per-segment metadata exposed by segmented sources (HLS).
- Source
Seek Anchor - Time-first seek anchor resolved by a segmented source.
- Stream
- Generic audio stream with sync
Read + Seek. - Stream
Pending - Typed payload of an
io::Error(kindErrorKind::Interrupted) emitted byimpl Read for Streamwhen the underlying source could not satisfy the read this call. BothSeekPendingandNotReady/Retrysurface asInterruptedso demuxers (notably Symphonia’s fragmented MP4 reader) treat the pause as a transient cooperative interruption and letkithara-decode::is_seek_pending_ioclassify the failure correctly — the previousWouldBlockmapping was treated as a hard “would block” by Symphonia’s seek path and corrupted the demuxer cursor on partial reads. Carries thePendingReasonverbatim plus a snapshot of source/timeline state at the wrap site, so callers downcasting fromio::Errorrecover both what stalled and why without having to instrument their own decoder. - Stream
Seek Past Eof - Typed error from
Stream::seekfor an absolute byte target that lands beyond the stream’s known length. - Timeline
- Shared playback timeline used across stream layers.
- Variant
Change Error - Non-retriable cross-variant boundary signal — the typed payload of
the
io::Errorproduced byimpl Read for Streamwhen the underlying source fenced on a variant change. Decoders that go throughstd::io::Read(Symphonia chain walker) downcast on this type to recover the precise classification without string-matching.
Enums§
- Audio
Codec - Audio codec type.
- Container
Format - Container format type.
- NotReady
Cause - Concrete cause for a
PendingReason::NotReady. - Pending
Reason - Reason a
ReadOutcome::Pendingwas returned — i.e. why the source did not make progress this call. Each variant maps to a distinct caller action; there is no overlap and no string-matching required. - Preroll
Hint - Read
Outcome - Outcome of a
Source::read_atcall. - Reader
Chunk Signal - Lightweight read-side signal fed into
DecoderHooks::on_chunk. - Reader
Seek Signal - Lightweight seek-side signal fed into
DecoderHooks::on_seek. - Source
Error - Unified source error, surfaced by every
Sourceimpl. - Source
Phase - Phase of a source’s wait/read lifecycle.
- Stream
Error - Errors produced by
kithara-stream. - Stream
Read Error - Real error from
Stream::try_read— the underlying source surfaced an I/O failure. - Stream
Read Outcome - Outcome of a
Stream::try_readcall.
Traits§
- Decoder
Hooks - Reader-side hooks invoked by the decoder layer’s
HookedDecoderright before it forwards the inner decoder’s typed outcome to the caller. - Segment
Layout - Segment-table view exposed by segmented sources (HLS, fragmented file-mp4).
- Source
- Sync random-access source.
- Stream
Type - Defines a stream type and how to create it.
Type Aliases§
- Shared
Hooks - Shared, lockable hook handle. Used so that
Source::take_reader_hookscan hand off Clone-able ownership and the hook implementation can hold&mut selfstate behind a single lock. - Stream
Result - Result type for
kithara-stream.