pub struct MockVideoStream {
width: u32,
height: u32,
frame_rate: f32,
total_frames: u64,
next_index: u64,
}Expand description
A scrolling-gradient mock: each frame phase-shifts a smooth RGB gradient across the surface. Visually obvious motion; mathematically deterministic.
Fields§
§width: u32§height: u32§frame_rate: f32§total_frames: u64§next_index: u64Implementations§
Source§impl MockVideoStream
impl MockVideoStream
Sourcepub fn scrolling_gradient(width: u32, height: u32, total_frames: u64) -> Self
pub fn scrolling_gradient(width: u32, height: u32, total_frames: u64) -> Self
Build a scrolling-gradient stream with the given dimensions and total frame count. Plays at 30 fps.
Sourcepub fn with_frame_rate(self, fps: f32) -> Self
pub fn with_frame_rate(self, fps: f32) -> Self
Override the frame rate (used by player-pacing tests).
Trait Implementations§
Source§impl VideoStream for MockVideoStream
impl VideoStream for MockVideoStream
Source§fn frame_rate(&self) -> f32
fn frame_rate(&self) -> f32
Source frame rate (frames per second). Used by the player loop to
time uploads; backends without a known fixed rate may return their
nominal rate (e.g.
AVFoundation’s nominalFrameRate on the track).Source§fn frame_count_hint(&self) -> Option<u64>
fn frame_count_hint(&self) -> Option<u64>
Total frame count, if known up-front.
None for live streams.Source§fn next_frame(&mut self) -> Option<VideoFrame>
fn next_frame(&mut self) -> Option<VideoFrame>
Pull the next frame. Returns
None at end-of-stream.Auto Trait Implementations§
impl Freeze for MockVideoStream
impl RefUnwindSafe for MockVideoStream
impl Send for MockVideoStream
impl Sync for MockVideoStream
impl Unpin for MockVideoStream
impl UnsafeUnpin for MockVideoStream
impl UnwindSafe for MockVideoStream
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