#[non_exhaustive]pub enum Event {
StartPlaying {
media_27mhz: Clock27,
lead: Duration,
},
Pause {
hold_at_27mhz: Clock27,
reason: Reason,
depth: Duration,
resume_target: Duration,
track: Option<u32>,
},
Resume {
media_27mhz: Clock27,
lead: Duration,
},
TargetChanged {
old: Duration,
new: Duration,
},
OverMax {
need: Duration,
max: Duration,
},
Rebaselined,
EventsDropped {
count: u32,
},
}Expand description
A decision for the caller. Media positions are in the playback (PTS)
domain as 27 MHz ticks (PTS90k x 300), i.e. the domain of on_media
and on_tick’s playback.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
StartPlaying
First fill complete. Set the renderer clock to media_27mhz (the
oldest buffered media) and rate 1.
Pause
Underrun or re-prime. Set the renderer rate to 0 and hold the clock at
hold_at_27mhz; keep queueing every chunk that arrives meanwhile.
Fields
Resume
Refilled. Re-seed the renderer clock to exactly media_27mhz and set
rate 1 in one step.
Resume is also a “go”. After a Hint::PcrDiscontinuity (or
SyncLoss/Reconnected) while Playing the controller emits Pause
then, once refilled, Resume, never a second StartPlaying
(StartPlaying happens once per controller until reset). A caller
must therefore treat StartPlaying and Resume identically as “set the
clock to media_27mhz and rate 1”. If that differs from the clock at pause (after a
discontinuity) it is a time jump on the caller’s side: re-enqueue
from there if the audio renderer flushes.
TargetChanged
The target moved by at least one histogram bucket (or hit a bound).
OverMax
The estimated need exceeds the configured max; the target is clamped
(the cap is a guarantee). Raised once per excursion.
Rebaselined
The baseline was reset (discontinuity, reconnect, sync loss).
EventsDropped
Events were lost because the caller did not poll in time.