pub enum ControlMsg {
Pause,
Resume,
Stop,
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.
Seek(Duration)
Jump to an absolute position from the start of the media.
Handled in two parts, both inside drain_control: the source
itself repositions via crate::element::SourceElement::seek
before this is forwarded downstream, then the forward cascades
as usual — a crate::queue::Queue drops whatever it has
buffered (it predates the seek) instead of delivering it, and a
decoder flushes its internal reference-frame state. Unlike
Pause, this doesn’t block waiting for anything further: it’s a
one-shot repositioning, not a state to later undo with Resume.
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