#[non_exhaustive]pub enum Input {
Chunk {
now_us: Duration,
bytes: u32,
pcr: Option<Clock27>,
},
TrackMedia {
now_us: Duration,
track: u32,
end: Clock27,
},
Tick {
now_us: Duration,
pts: Option<Clock27>,
},
Register {
now_us: Duration,
track: u32,
},
Unregister {
now_us: Duration,
track: u32,
},
Hint {
now_us: Duration,
hint: Hint,
},
}Expand description
One call a host made into a BufferController.
Times are the host’s monotonic microseconds; positions and media ends are 27 MHz ticks.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Chunk
BufferController::on_chunk: bytes arrived.
Fields
TrackMedia
BufferController::on_track_media: a track’s buffered media now ends at end.
Tick
BufferController::on_tick: the renderer’s playback position.
Register
Unregister
Hint
Implementations§
Source§impl Input
impl Input
Sourcepub const CSV_HEADER: &'static str = "kind,now_us,a,b"
pub const CSV_HEADER: &'static str = "kind,now_us,a,b"
Header row of a text log.
Sourcepub fn rebased(self, origin_us: Duration) -> Self
pub fn rebased(self, origin_us: Duration) -> Self
The same input with its time moved origin earlier (saturating).
Sourcepub fn apply(&self, controller: &mut BufferController)
pub fn apply(&self, controller: &mut BufferController)
Makes the call this input records on controller. Replay is a loop over this.
Sourcepub fn write_row(&self, out: &mut impl Write) -> Result
pub fn write_row(&self, out: &mut impl Write) -> Result
Writes one row (columns of Input::CSV_HEADER) without a trailing newline.
§Errors
Whatever out reports.
Sourcepub fn parse_row(line: &str) -> Result<Self, InputLogError>
pub fn parse_row(line: &str) -> Result<Self, InputLogError>
Parses one input row; the inverse of Input::write_row. A missing trailing column is
read as empty.
§Errors
InputLogError naming the row and the reason; config, seed and header rows are not
inputs.