pub struct ControlOutcome {
pub stopped: bool,
pub paused_for: Duration,
}Expand description
What draining pending source requests actually did — whether Stop or
source-only Finish ended it, and how long (if any) was spent frozen
inside a Pause/Resume pair. A source built on wall-clock scheduling (an elapsed-time
budget like crate::elements::TestAudioSource/
crate::elements::AudioMixer, or an absolute next-tick deadline like
crate::elements::TestVideoSource/DxgiCaptureSource)
has to fold paused_for back into its own schedule after every
drain_control call — real (Instant) time keeps moving during a
Pause, but the media timeline must not, or Resume would look like a
burst of catch-up work owed all at once.
Fields§
§stopped: booltrue if either Stop or source-only Finish was seen: the caller
should return Ok(()) immediately. Stop abandons without EOS;
Finish has already pushed ordered EOS from the source boundary.
Keeping this terminal flag true for both also makes existing custom
source loops honor the new graceful request without continuing to emit
after EOS.
paused_for: DurationWall-clock time from starting the synchronous downstream Pause
cascade through finishing the matching Resume (or terminating
Stop) cascade during this call — Duration::ZERO if no Pause
was seen. Still meaningful
even when stopped is true (the sender simply going away while
paused is treated the same as Stop, see wait_out_pause), so a
caller that also tracks its own paused-time total can fold this in
unconditionally rather than only on the non-stopped path.
Trait Implementations§
Source§impl Clone for ControlOutcome
impl Clone for ControlOutcome
Source§fn clone(&self) -> ControlOutcome
fn clone(&self) -> ControlOutcome
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more