pub struct TextSource { /* private fields */ }Expand description
Renders a TextSpec into a source-only rgba frame stream.
The output composites as a transparent overlay (text over a fully transparent
canvas). 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 spec plus the target canvas size and frame rate.
Implementations§
Source§impl TextSource
impl TextSource
Sourcepub fn new(
spec: &TextSpec,
width: u32,
height: u32,
fps: f64,
) -> Result<Self, FilterError>
pub fn new( spec: &TextSpec, width: u32, height: u32, fps: f64, ) -> Result<Self, FilterError>
Builds a text source for a width × height canvas at fps.
§Errors
FilterError::InvalidConfigwhen the text is empty.FilterErrorwhen the underlyingFFmpeggraph cannot be built (e.g.color/drawtextfilters are unavailable).
Sourcepub fn pull(&mut self) -> Result<Option<VideoFrame>, FilterError>
pub fn pull(&mut self) -> Result<Option<VideoFrame>, FilterError>
Pulls the next rendered 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 TextSource
impl Freeze for TextSource
impl RefUnwindSafe for TextSource
impl Send for TextSource
impl Unpin for TextSource
impl UnsafeUnpin for TextSource
impl UnwindSafe for TextSource
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