pub struct SolidSource { /* private fields */ }Expand description
Generates a solid-color rgba frame stream.
Frames are produced sequentially via pull; the source exposes
no seek, so a host that seeks rebuilds it. It is model-agnostic: it takes only
a color plus the target canvas size and frame rate (a clip’s duration is the
consumer’s concern, not the source’s).
Implementations§
Source§impl SolidSource
impl SolidSource
Sourcepub fn new(
color: Color,
width: u32,
height: u32,
fps: f64,
) -> Result<Self, FilterError>
pub fn new( color: Color, width: u32, height: u32, fps: f64, ) -> Result<Self, FilterError>
Builds a solid-color source for a width × height canvas at fps.
§Errors
Returns FilterError when the underlying FFmpeg graph cannot be built
(e.g. the color filter is unavailable).
Sourcepub fn pull(&mut self) -> Result<Option<VideoFrame>, FilterError>
pub fn pull(&mut self) -> Result<Option<VideoFrame>, FilterError>
Pulls the next generated frame (rgba), or None when none is buffered yet
or at end-of-stream.
§Errors
Returns FilterError on an unexpected FFmpeg error.
Auto Trait Implementations§
impl !Sync for SolidSource
impl Freeze for SolidSource
impl RefUnwindSafe for SolidSource
impl Send for SolidSource
impl Unpin for SolidSource
impl UnsafeUnpin for SolidSource
impl UnwindSafe for SolidSource
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