Trait rinvideo::Video [−][src]
pub trait Video { fn recv_frame(&self) -> Result<Rc<Frame>, RecvError>; fn try_recv_frame(&self) -> Result<Rc<Frame>, TryRecvError>; fn recv_last_frame(&self) -> Result<Rc<Frame>, RecvError>; fn try_recv_last_frame(&self) -> Result<Rc<Frame>, TryRecvError>; fn update(&mut self); fn last_frame(&self) -> Option<&Rc<Frame>>; fn width(&self) -> i32; fn height(&self) -> i32; fn fps(&self) -> f64; fn real_fps(&self) -> f64; fn size(&self) -> Vec2<i32> { ... } }
Required Methods
fn recv_frame(&self) -> Result<Rc<Frame>, RecvError>
Blocks till a new frame is availble can return None if the output format is not supported
fn try_recv_frame(&self) -> Result<Rc<Frame>, TryRecvError>
Tries to receive a new frame and returns immediately if there's none available. It also returns Empty if the output format is not supported
fn recv_last_frame(&self) -> Result<Rc<Frame>, RecvError>
Blocks till a new frame is available, if there's more than one frame it discards them till the last one
fn try_recv_last_frame(&self) -> Result<Rc<Frame>, TryRecvError>
Tries to receive a new frame and returns immediately if there's none available. It also returns Empty if the output format is not supported. If there's more than one frame it discards them till the last one
fn update(&mut self)
Tries to receive the last frame and stores it internally, it can be recovered using last_frame
fn last_frame(&self) -> Option<&Rc<Frame>>
Returns a reference to the last frame if there's one available
fn width(&self) -> i32
Width of the video
fn height(&self) -> i32
Height of the video
fn fps(&self) -> f64
fps of the video, this should be the reported framerate by the underlying backend not the real fps
fn real_fps(&self) -> f64
fps of the video, this should be the real fps calculated when calling any of the functions to return a new frame or update
Provided Methods
Implementors
impl Video for Player
impl Video for Grabber
impl Video for VideoAppSink