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<B>(bytes: B) -> Result<Self, String>
pub fn from_mp4_bytes<B>(bytes: B) -> Result<Self, String>
Sourcepub fn from_mp4_with_backend<B>(
bytes: B,
decoder: Box<dyn VideoDecoderBackend>,
queue_capacity: usize,
pool_capacity: usize,
) -> Result<Self, String>
pub fn from_mp4_with_backend<B>( bytes: B, 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
B- 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
impl Debug for VideoPlaybackPipeline
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.
Auto Trait Implementations§
impl !RefUnwindSafe for VideoPlaybackPipeline
impl !UnwindSafe for VideoPlaybackPipeline
impl Forget for VideoPlaybackPipeline
impl Freeze for VideoPlaybackPipelinewhere
*const ArcInner<Mp4Demuxer> is !null: Freeze,
PhantomData<ArcInner<Mp4Demuxer>>: Freeze,
*const ArcInner<Mutex<VideoFramePoolState>> is !null: Freeze,
PhantomData<ArcInner<Mutex<VideoFramePoolState>>>: Freeze,
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
*const ArcInner<(Mutex<VideoWorkerShared>, Condvar, Atomic<u64>)> is !null: Freeze,
PhantomData<ArcInner<(Mutex<VideoWorkerShared>, Condvar, Atomic<u64>)>>: Freeze,
*const ArcInner<Inner> is !null: Freeze,
PhantomData<ArcInner<Inner>>: Freeze,
*const ArcInner<Packet<'static, ()>> is !null: Freeze,
PhantomData<ArcInner<Packet<'static, ()>>>: Freeze,
impl Move for VideoPlaybackPipeline
impl Send for VideoPlaybackPipeline
impl Sync for VideoPlaybackPipeline
impl Unpin for VideoPlaybackPipeline
impl UnsafeUnpin for VideoPlaybackPipelinewhere
*const ArcInner<Mp4Demuxer> is !null: UnsafeUnpin,
PhantomData<ArcInner<Mp4Demuxer>>: UnsafeUnpin,
*const ArcInner<Mutex<VideoFramePoolState>> is !null: UnsafeUnpin,
PhantomData<ArcInner<Mutex<VideoFramePoolState>>>: UnsafeUnpin,
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
*const ArcInner<(Mutex<VideoWorkerShared>, Condvar, Atomic<u64>)> is !null: UnsafeUnpin,
PhantomData<ArcInner<(Mutex<VideoWorkerShared>, Condvar, Atomic<u64>)>>: UnsafeUnpin,
*const ArcInner<Inner> is !null: UnsafeUnpin,
PhantomData<ArcInner<Inner>>: UnsafeUnpin,
*const ArcInner<Packet<'static, ()>> is !null: UnsafeUnpin,
PhantomData<ArcInner<Packet<'static, ()>>>: UnsafeUnpin,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more