pub struct VideoPlaybackPipeline { /* private fields */ }Expand description
Asynchronous multi-threaded (native) / deterministic pumpable (wasm32) structured video playback pipeline.
Implementations§
Source§impl VideoPlaybackPipeline
Multi-threaded (native) / deterministic pumpable (wasm32) structured video playback pipeline implementation.
impl VideoPlaybackPipeline
Multi-threaded (native) / deterministic pumpable (wasm32) structured video playback pipeline implementation.
Sourcepub fn from_mp4_bytes<LabelValue>(bytes: LabelValue) -> Result<Self, String>
pub fn from_mp4_bytes<LabelValue>(bytes: LabelValue) -> Result<Self, String>
Sourcepub fn from_mp4_with_backend<LabelValue>(
bytes: LabelValue,
decoder: Box<dyn VideoDecoderBackend>,
queue_capacity: usize,
pool_capacity: usize,
) -> Result<Self, String>
pub fn from_mp4_with_backend<LabelValue>( bytes: LabelValue, decoder: Box<dyn VideoDecoderBackend>, queue_capacity: usize, pool_capacity: usize, ) -> Result<Self, String>
Opens an MP4 byte stream using a custom hardware or software VideoDecoderBackend.
§Arguments
LabelValue- Complete MP4 container bytes convertible intoArc<[u8]>.Box<dyn VideoDecoderBackend>- Hardware zero-copy or software decoder backend.usize- Bounded PTS frame queue capacity.usize- Bounded CPU RGBA8 frame pool capacity.
§Returns
Result<Self, String>- Initialized video playback pipeline or error.
Sourcepub fn demuxer(&self) -> &Mp4Demuxer
pub fn demuxer(&self) -> &Mp4Demuxer
Sourcepub fn frame_pool(&self) -> &VideoFramePool
pub fn frame_pool(&self) -> &VideoFramePool
Sourcepub fn scheduler(&self) -> &AvSyncScheduler
pub fn scheduler(&self) -> &AvSyncScheduler
Sourcepub fn scheduler_mut(&mut self) -> &mut AvSyncScheduler
pub fn scheduler_mut(&mut self) -> &mut AvSyncScheduler
Sourcepub const fn backend_kind(&self) -> HardwareDecoderKind
pub const fn backend_kind(&self) -> HardwareDecoderKind
Sourcepub const fn color_info(&self) -> VideoColorInfo
pub const fn color_info(&self) -> VideoColorInfo
Sourcepub const fn playback_state(&self) -> PlaybackState
pub const fn playback_state(&self) -> PlaybackState
Sourcepub fn current_frame(&self) -> Option<&DecodedVideoFrame>
pub fn current_frame(&self) -> Option<&DecodedVideoFrame>
Sourcepub const fn active_generation(&self) -> u64
pub const fn active_generation(&self) -> u64
Sourcepub fn pause(&mut self)
pub fn pause(&mut self)
Pauses playback and suspends background worker decoding until resumed.
§Arguments
&Self- Mutable pipeline.
Sourcepub fn wait_until_queued(&mut self, min_frames: usize, timeout_ms: u64) -> usize
pub fn wait_until_queued(&mut self, min_frames: usize, timeout_ms: u64) -> usize
Waits on native targets (or pumps on wasm32) until at least min_frames frames of the active generation are queued or EOS/timeout occurs.
§Arguments
&Self- Mutable pipeline.usize- Minimum queued frames desired.u64- Maximum wait timeout in milliseconds.
§Returns
usize- Number of queued frames currently ready.
Sourcepub fn pump_decode_once(&mut self) -> bool
pub fn pump_decode_once(&mut self) -> bool
Sourcepub fn present_vsync(
&mut self,
audio_master_pts_us: Option<i64>,
vsync_dt_us: u64,
) -> VideoPresentOutcome
pub fn present_vsync( &mut self, audio_master_pts_us: Option<i64>, vsync_dt_us: u64, ) -> VideoPresentOutcome
Evaluates one display VSync tick against the A/V sync scheduler, moving a due frame into current_frame() with zero pixel copies and recycling the previous CPU frame.
§Arguments
&Self- Mutable pipeline.Option<i64>- Optional hardware audio master timestamp in microseconds (Noneuses monotonicvsync_dt_us).u64- Elapsed display VSync interval in microseconds (e.g. 6_944at 144Hz or16_667at 60Hz).
§Returns
VideoPresentOutcome- Whether a new frame replacedcurrent_frame(), held current frame, buffered, or ended.
Sourcepub fn queued_frame_count(&self) -> usize
pub fn queued_frame_count(&self) -> usize
Sourcepub fn reached_eos(&self) -> bool
pub fn reached_eos(&self) -> bool
Sourcepub fn packets_decoded(&self) -> u64
pub fn packets_decoded(&self) -> u64
Sourcepub fn seek_preroll_frames_discarded(&self) -> u64
pub fn seek_preroll_frames_discarded(&self) -> u64
Trait Implementations§
Source§impl Debug for VideoPlaybackPipeline
Implements impl #impl_generics ::std::fmt::Debug for #name #ty_generics #where_clause.
impl Debug for VideoPlaybackPipeline
Implements impl #impl_generics ::std::fmt::Debug for #name #ty_generics #where_clause.
Source§impl Drop for VideoPlaybackPipeline
Clean shutdown and background thread join on Drop for VideoPlaybackPipeline.
impl Drop for VideoPlaybackPipeline
Clean shutdown and background thread join on Drop for VideoPlaybackPipeline.