pub struct SeekTarget {
pub position: f64,
pub stream_index: Option<usize>,
pub flags: SeekFlags,
}Expand description
Target for a seek operation.
Specifies where to seek and which stream to use as reference.
Fields§
§position: f64Target timestamp in seconds, or byte offset if SeekFlags::BYTE is set.
stream_index: Option<usize>Stream index to use for seeking, or None for the default stream.
The default stream is typically the first video stream, or the first audio stream if there are no video streams.
flags: SeekFlagsSeek flags controlling behavior.
Implementations§
Source§impl SeekTarget
impl SeekTarget
Sourcepub const fn time(position: f64) -> Self
pub const fn time(position: f64) -> Self
Creates a new seek target to a timestamp in seconds.
§Arguments
position- Target timestamp in seconds
Sourcepub const fn sample_accurate(position: f64) -> Self
pub const fn sample_accurate(position: f64) -> Self
Creates a sample-accurate seek target.
This will seek to the exact position, decoding from the preceding keyframe and discarding intermediate frames.
Sourcepub const fn with_stream(self, stream_index: usize) -> Self
pub const fn with_stream(self, stream_index: usize) -> Self
Sets the stream index for this seek target.
Sourcepub const fn with_flags(self, flags: SeekFlags) -> Self
pub const fn with_flags(self, flags: SeekFlags) -> Self
Sets the seek flags for this seek target.
Sourcepub const fn add_flags(self, flags: SeekFlags) -> Self
pub const fn add_flags(self, flags: SeekFlags) -> Self
Adds additional flags to this seek target.
Sourcepub const fn is_backward(&self) -> bool
pub const fn is_backward(&self) -> bool
Returns true if this is a backward seek.
Sourcepub const fn is_keyframe(&self) -> bool
pub const fn is_keyframe(&self) -> bool
Returns true if this seeks to a keyframe.
Sourcepub const fn is_frame_accurate(&self) -> bool
pub const fn is_frame_accurate(&self) -> bool
Returns true if this is a frame-accurate seek.
Trait Implementations§
Source§impl Clone for SeekTarget
impl Clone for SeekTarget
Source§fn clone(&self) -> SeekTarget
fn clone(&self) -> SeekTarget
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more