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 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
source§impl WindowsDx11VideoFrame for VideoFrame
impl WindowsDx11VideoFrame for VideoFrame
source§fn get_dx11_surface(
&self
) -> Result<(IDirect3DSurface, DirectXPixelFormat), WindowsDx11VideoFrameError>
fn get_dx11_surface( &self ) -> Result<(IDirect3DSurface, DirectXPixelFormat), WindowsDx11VideoFrameError>
Get the DX11 surface representing the video frame’s texture memory, as well as the pixel format
fn get_dx11_texture( &self ) -> Result<(ID3D11Texture2D, DirectXPixelFormat), WindowsDx11VideoFrameError>
source§impl WindowsDxgiVideoFrame for VideoFrame
impl WindowsDxgiVideoFrame for VideoFrame
source§fn get_dxgi_surface(
&self
) -> Result<(IDXGISurface, DirectXPixelFormat), WindowsDxgiVideoFrameError>
fn get_dxgi_surface( &self ) -> Result<(IDXGISurface, DirectXPixelFormat), WindowsDxgiVideoFrameError>
Get the surface texture for this 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