Struct crabgrab::frame::VideoFrame
source · pub struct VideoFrame { /* private fields */ }
Expand description
A frame of captured video
Implementations§
source§impl VideoFrame
impl VideoFrame
sourcepub fn frame_id(&self) -> u64
pub fn frame_id(&self) -> u64
Get the sequence id of this video frame (monotonically increasing)
Note: This is separate from audio frame ids
sourcepub fn capture_time(&self) -> Instant
pub fn capture_time(&self) -> Instant
Get the Instant that this frame was delivered to the application
sourcepub fn origin_time(&self) -> Duration
pub fn origin_time(&self) -> Duration
Get the time since the start of the stream that this frame was generated
sourcepub fn size(&self) -> Size
pub fn size(&self) -> Size
Get the raw size of the frame
For planar image formats, this is the size of the largest plane
sourcepub fn dpi(&self) -> f64
pub fn dpi(&self) -> f64
Get the dpi of the contents of the frame (accounting for capture scaling)
sourcepub fn content_rect(&self) -> Rect
pub fn content_rect(&self) -> Rect
Get the rectangle of the frame representing containing the captured contents
Trait Implementations§
source§impl Debug for VideoFrame
impl Debug for VideoFrame
source§impl MacosIoSurfaceVideoFrameExt for VideoFrame
impl MacosIoSurfaceVideoFrameExt for VideoFrame
source§fn get_iosurface(&self) -> Result<IoSurface, GetIoSurfaceError>
fn get_iosurface(&self) -> Result<IoSurface, GetIoSurfaceError>
Get the IOSurface representing the video frame’s texture
source§impl MetalVideoFrameExt for VideoFrame
impl MetalVideoFrameExt for VideoFrame
source§fn get_metal_texture(
&self,
plane: MetalVideoFramePlaneTexture
) -> Result<Texture, MacosVideoFrameError>
fn get_metal_texture( &self, plane: MetalVideoFramePlaneTexture ) -> Result<Texture, MacosVideoFrameError>
Get the texture for the given plane of the video frame
source§impl VideoFrameBitmap for VideoFrame
impl VideoFrameBitmap for VideoFrame
source§fn get_bitmap(&self) -> Result<BoxedSliceFrameBitmap, VideoFrameBitmapError>
fn get_bitmap(&self) -> Result<BoxedSliceFrameBitmap, VideoFrameBitmapError>
Create a bitmap image from this frame. This usually involves a memory transfer from VRAM to system RAM,
and is an expensive operation.
source§fn get_pooled_bitmap(
&self,
bitmap_pool: &FrameBitmapPool
) -> Result<PooledFrameBitmap, VideoFrameBitmapError>
fn get_pooled_bitmap( &self, bitmap_pool: &FrameBitmapPool ) -> Result<PooledFrameBitmap, VideoFrameBitmapError>
Get a pooled bitmap, waiting for one to become available if
max
pooled bitmaps are checked outsource§fn try_get_pooled_bitmap(
&self,
bitmap_pool: &FrameBitmapPool
) -> Result<Option<PooledFrameBitmap>, VideoFrameBitmapError>
fn try_get_pooled_bitmap( &self, bitmap_pool: &FrameBitmapPool ) -> Result<Option<PooledFrameBitmap>, VideoFrameBitmapError>
Try and get a pooled bitmap using the given bitmap pool, and return Ok(None) if there are no pooled bitmaps available
and
max
pooled bitmaps existsource§impl WgpuVideoFrameExt for VideoFrame
impl WgpuVideoFrameExt for VideoFrame
source§fn get_wgpu_texture(
&self,
plane: WgpuVideoFramePlaneTexture,
label: Option<&'static str>
) -> Result<Texture, WgpuVideoFrameError>
fn get_wgpu_texture( &self, plane: WgpuVideoFramePlaneTexture, label: Option<&'static str> ) -> Result<Texture, WgpuVideoFrameError>
Get the texture for the given plane of the video frame
impl Send for VideoFrame
impl Sync for VideoFrame
Auto Trait Implementations§
impl !Freeze for VideoFrame
impl !RefUnwindSafe for VideoFrame
impl Unpin for VideoFrame
impl !UnwindSafe for VideoFrame
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