pub enum ControlMsg {
Pause,
Resume,
Stop,
Flush,
CheckSeek(Arc<SeekCheckContext>),
Preroll(Arc<PrerollContext>),
Seek(Duration),
}Expand description
A command that can be sent down a running crate::pipeline::Pipeline
— travels the same pad-to-pad path MediaBuffer does (see
crate::element::Sink::control), but through a dedicated channel
instead of riding along as data: unlike Eos, it has to be able to
reach every element even mid-stream, and (for Queue) jump ahead of
whatever data is already backed up rather than wait in line behind it.
Variants§
Pause
Freeze in place. Every crate::queue::Queue downstream stops
pulling from its data channel until Resume/Stop — which also
backpressures anything feeding it, since a full queue blocks the
sender. Pairs with crate::clock::Clock::pause, which
crate::pipeline::Pipeline::pause calls at the same time so
paced elements don’t see a jump once resumed.
Resume
Undoes Pause.
Stop
Abandon immediately rather than draining to a natural Eos —
whatever’s in flight is dropped, not flushed. The pipeline isn’t
reusable afterward; build a new one for the next run.
Flush
Discard buffered data and reset state that belongs to the current
timeline without changing the source position. Pipelines issue this
before Seek; keeping the two controls separate lets paused preroll
and future timeline operations compose the same flush boundary.
CheckSeek(Arc<SeekCheckContext>)
Ask every reachable element whether it can participate in a seek. Rejections are collected without mutating playback state; the caller inspects the shared context after the synchronous cascade returns.
Preroll(Arc<PrerollContext>)
Temporarily lets paused source and queue workers process data until every expected terminal reports its first new-timeline sample.
Seek(Duration)
Jump to an absolute position from the start of the media.
The source repositions via crate::element::SourceElement::seek
before this is forwarded downstream. Timeline state is discarded by
the preceding Flush, not implicitly by this message.
Trait Implementations§
Source§impl Clone for ControlMsg
impl Clone for ControlMsg
Source§fn clone(&self) -> ControlMsg
fn clone(&self) -> ControlMsg
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more