Struct rinvideo::Player [−][src]
pub struct Player { /* fields omitted */ }
Video player, allows to play a video file using several models like calling update or polling the frames port for available frames both in blocking and non-blocking modes
Methods
impl Player
[src]
impl Player
pub fn new<P: AsRef<Path>>(path: P, gl: &mut Renderer) -> Result<Player>
[src]
pub fn new<P: AsRef<Path>>(path: P, gl: &mut Renderer) -> Result<Player>
pub fn appsink(&self) -> &VideoAppSink
[src]
pub fn appsink(&self) -> &VideoAppSink
Reference to the internal VideoAppSink
pub fn appsink_mut(&mut self) -> &mut VideoAppSink
[src]
pub fn appsink_mut(&mut self) -> &mut VideoAppSink
Mutable reference to the internal VideoAppSink
pub fn play(&mut self)
[src]
pub fn play(&mut self)
Sets the player in play state
pub fn frames(&self) -> i64
[src]
pub fn frames(&self) -> i64
Total frames of the video
pub fn fps(&self) -> f64
[src]
pub fn fps(&self) -> f64
Frames per second of the video
pub fn duration_ns(&self) -> Option<i64>
[src]
pub fn duration_ns(&self) -> Option<i64>
Duration of the video in nanoseconds
pub fn duration_s(&self) -> Option<f64>
[src]
pub fn duration_s(&self) -> Option<f64>
Duration of the video in seconds
pub fn position_pct(&self) -> Option<f64>
[src]
pub fn position_pct(&self) -> Option<f64>
Current position in the video in 0..1
pub fn position_ns(&self) -> Option<i64>
[src]
pub fn position_ns(&self) -> Option<i64>
Current position in the video in nanoseconds
pub fn position_s(&self) -> Option<f64>
[src]
pub fn position_s(&self) -> Option<f64>
Current position in the video in seconds
pub fn position_pct_stream<'a: 'b, 'b, T: Clone + Debug>(
&self,
update_stream: Stream<'a, T>
) -> Stream<'b, f64>
[src]
pub fn position_pct_stream<'a: 'b, 'b, T: Clone + Debug>(
&self,
update_stream: Stream<'a, T>
) -> Stream<'b, f64>
pub fn speed(&self) -> f64
[src]
pub fn speed(&self) -> f64
Current playback speed of the video in 0..1
pub fn set_position_ns(&mut self, ns: i64)
[src]
pub fn set_position_ns(&mut self, ns: i64)
Sets current position in the video in nanoseconds
pub fn set_position_s(&mut self, s: f64)
[src]
pub fn set_position_s(&mut self, s: f64)
Sets current position in the video in seconds
pub fn set_position_pct(&mut self, pct: f64)
[src]
pub fn set_position_pct(&mut self, pct: f64)
Sets current position in the video in 0..1
pub fn set_speed(&mut self, speed: f64)
[src]
pub fn set_speed(&mut self, speed: f64)
Sets current playback speed of the video in 0..1
pub fn pause(&mut self)
[src]
pub fn pause(&mut self)
Sets the player in paused state
pub fn stop(&mut self)
[src]
pub fn stop(&mut self)
Sets the player in stopped state
pub fn is_paused(&self) -> bool
[src]
pub fn is_paused(&self) -> bool
Returns true if the player is in paused state
pub fn is_stopped(&self) -> bool
[src]
pub fn is_stopped(&self) -> bool
Returns true if the player is in stopped state
Trait Implementations
impl Video for Player
[src]
impl Video for Player
fn recv_frame(&self) -> Result<Rc<Frame>, RecvError>
[src]
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 Read more
fn try_recv_frame(&self) -> Result<Rc<Frame>, TryRecvError>
[src]
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 Read more
fn recv_last_frame(&self) -> Result<Rc<Frame>, RecvError>
[src]
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 Read more
fn try_recv_last_frame(&self) -> Result<Rc<Frame>, TryRecvError>
[src]
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 Read more
fn update(&mut self)
[src]
fn update(&mut self)
Tries to receive the last frame and stores it internally, it can be recovered using last_frame Read more
fn last_frame(&self) -> Option<&Rc<Frame>>
[src]
fn last_frame(&self) -> Option<&Rc<Frame>>
Returns a reference to the last frame if there's one available
fn width(&self) -> i32
[src]
fn width(&self) -> i32
Width of the video
fn height(&self) -> i32
[src]
fn height(&self) -> i32
Height of the video
fn fps(&self) -> f64
[src]
fn fps(&self) -> f64
fps of the video, this should be the reported framerate by the underlying backend not the real fps Read more
fn real_fps(&self) -> f64
[src]
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 Read more
fn size(&self) -> Vec2<i32>
[src]
fn size(&self) -> Vec2<i32>
Size (width x height) of the video
impl<'a> Render2d for &'a Player
[src]
impl<'a> Render2d for &'a Player
type Material = Material<'a>
fn default_material(&self) -> Material<'a>
[src]
fn default_material(&self) -> Material<'a>
fn render<R: RenderSurface>(&self, renderer: &Renderer<R>, pos: &Pnt2)
[src]
fn render<R: RenderSurface>(&self, renderer: &Renderer<R>, pos: &Pnt2)
fn render_size<R: RenderSurface>(
&self,
renderer: &Renderer<R>,
pos: &Pnt2,
size: &Vec2
)
[src]
fn render_size<R: RenderSurface>(
&self,
renderer: &Renderer<R>,
pos: &Pnt2,
size: &Vec2
)
fn render_with_material<R: RenderSurface, M: Material>(
&self,
renderer: &Renderer<R>,
pos: &Pnt2,
material: &M
)
[src]
fn render_with_material<R: RenderSurface, M: Material>(
&self,
renderer: &Renderer<R>,
pos: &Pnt2,
material: &M
)
fn render_size_with_material<R: RenderSurface, M: Material>(
&self,
renderer: &Renderer<R>,
pos: &Pnt2,
size: &Vec2,
material: &M
)
[src]
fn render_size_with_material<R: RenderSurface, M: Material>(
&self,
renderer: &Renderer<R>,
pos: &Pnt2,
size: &Vec2,
material: &M
)