pub struct ChunkRequest {
pub start: StreamInstant,
pub pps: u32,
pub min_points: usize,
pub target_points: usize,
pub buffered_points: u64,
pub buffered: Duration,
pub device_queued_points: Option<u64>,
}Expand description
A request to fill a buffer with points for streaming.
This is the streaming API with pure buffer-driven timing.
The callback receives a ChunkRequest describing buffer state and requirements,
and fills points into a library-owned buffer.
§Point Tiers
min_points: Minimum points needed to avoid imminent underrun (ceiling rounded)target_points: Ideal number of points to reach target buffer level (clamped to buffer length)buffer.len()(passed separately): Maximum points the callback may write
§Rounding Rules
min_points: Always ceiling (underrun prevention)target_points: ceiling, then clamped to buffer length
Fields§
§start: StreamInstantEstimated playback time when this chunk starts.
Calculated as: playhead + buffered_points Use this for audio synchronization.
pps: u32Points per second (fixed for stream duration).
min_points: usizeMinimum points needed to avoid imminent underrun.
Calculated with ceiling to prevent underrun: ceil((min_buffer - buffered) * pps)
If 0, buffer is healthy.
target_points: usizeIdeal number of points to reach target buffer level.
Calculated as: ceil((target_buffer - buffered) * pps), clamped to buffer length.
buffered_points: u64Current buffer level in points (for diagnostics/adaptive content).
buffered: DurationCurrent buffer level as duration (for audio sync convenience).
device_queued_points: Option<u64>Raw device queue if available (best-effort, may differ from buffered_points).
Trait Implementations§
Source§impl Clone for ChunkRequest
impl Clone for ChunkRequest
Source§fn clone(&self) -> ChunkRequest
fn clone(&self) -> ChunkRequest
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more