pub struct PipelineProgress { /* private fields */ }Expand description
A cloneable handle to a running pipeline’s progress. The application
constructs one, passes it to
run_graph_with_progress, and
polls position / duration while the
pipeline runs. Every clone shares one set of values.
Implementations§
Source§impl PipelineProgress
impl PipelineProgress
Sourcepub fn position(&self) -> Option<u64>
pub fn position(&self) -> Option<u64>
Application side: the current playback position in nanoseconds (stream
time), or None before the first buffer reaches a sink.
Sourcepub fn duration(&self) -> Option<u64>
pub fn duration(&self) -> Option<u64>
Application side: the total stream duration in nanoseconds, or None if
unknown (not yet reported, or a live / open-ended stream).
Sourcepub fn set_position(&self, ns: u64)
pub fn set_position(&self, ns: u64)
Runner side: publish the latest position (the stream time of the buffer just consumed at a sink). Latest-writer-wins, matching GStreamer answering position from the sink’s most recent buffer; a seek that rewinds simply publishes a smaller value next.
Sourcepub fn publish_duration(&self, ns: u64) -> bool
pub fn publish_duration(&self, ns: u64) -> bool
Runner side: report a source’s duration. Takes the maximum across
sources (the pipeline runs until its longest stream ends). Returns true
when this changed the stored duration, so the caller posts a single
DurationChanged on a real change.
A 0 (unknown) report is ignored.
Trait Implementations§
Source§impl Clone for PipelineProgress
impl Clone for PipelineProgress
Source§fn clone(&self) -> PipelineProgress
fn clone(&self) -> PipelineProgress
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more