Struct VideoPipe

Source
struct VideoPipe {
    path: String,
    size: (u32, u32),
    fps: f64,
    duration: f64,
    child: Option<(Child, ChildStdout)>,
    out_size: (u32, u32),
    next: i64,
    cur: Frame,
    have: bool,
    end: f64,
    scaled: Vec<u8>,
    skey: (i64, u32, u32),
}

Fields§

§path: String§size: (u32, u32)§fps: f64§duration: f64§child: Option<(Child, ChildStdout)>§out_size: (u32, u32)

Output size of the running process.

§next: i64

Absolute frame index of the next frame the pipe will deliver.

§cur: Frame

Last delivered frame (index next-1), valid when have is true.

§have: bool§end: f64

Earliest known end (set when the pipe hits EOF) — avoids respawn storms past the end.

§scaled: Vec<u8>

cur shrunk to skey = (frame index, w, h): repeated calls at the same t and size are free.

§skey: (i64, u32, u32)

Implementations§

Source§

impl VideoPipe

Source

fn respawn(&mut self, idx: i64, w: u32, h: u32) -> bool

Source

fn read_next(&mut self) -> bool

Read the next frame into cur. False at EOF (child is reaped, end updated).

Trait Implementations§

Source§

impl Drop for VideoPipe

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl VideoSource for VideoPipe

Source§

fn size(&self) -> (u32, u32)

Native (coded) size.
Source§

fn frame_at(&mut self, t: f64, w: u32, h: u32, out: &mut Frame) -> bool

Decode the frame displayed at source time t, scaled (aspect-ignorant, caller picks w/h; the compositor never asks for more than native size, so upscaling need only be correct) into out. Returns false at/after EOF or on error (then out is untouched). Must be cheap for sequential increasing t (playback: keep decoding forward); may seek for other jumps.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<S> FromSample<S> for S

§

fn from_sample_(s: S) -> S

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
§

impl<T, U> ToSample<U> for T
where U: FromSample<T>,

§

fn to_sample_(self) -> U

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<S, T> Duplex<S> for T
where T: FromSample<S> + ToSample<S>,

§

impl<T> MaybeSend for T

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,