Struct crabgrab::frame::VideoFrame

source ·
pub struct VideoFrame { /* private fields */ }
Expand description

A frame of captured video

Implementations§

source§

impl VideoFrame

source

pub fn frame_id(&self) -> u64

Get the sequence id of this video frame (monotonically increasing)

Note: This is separate from audio frame ids

source

pub fn capture_time(&self) -> Instant

Get the Instant that this frame was delivered to the application

source

pub fn origin_time(&self) -> Duration

Get the time since the start of the stream that this frame was generated

source

pub fn size(&self) -> Size

Get the raw size of the frame

For planar image formats, this is the size of the largest plane

source

pub fn dpi(&self) -> f64

Get the dpi of the contents of the frame (accounting for capture scaling)

source

pub fn content_rect(&self) -> Rect

Get the rectangle of the frame representing containing the captured contents

Trait Implementations§

source§

impl Debug for VideoFrame

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl VideoFrameBitmap for VideoFrame

source§

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>

Get a pooled bitmap, waiting for one to become available if max pooled bitmaps are checked out
source§

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 exist
source§

impl WgpuVideoFrameExt for VideoFrame

source§

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

source§

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
source§

fn get_dx11_texture( &self ) -> Result<(ID3D11Texture2D, DirectXPixelFormat), WindowsDx11VideoFrameError>

source§

impl WindowsDxgiVideoFrame for VideoFrame

source§

fn get_dxgi_surface( &self ) -> Result<(IDXGISurface, DirectXPixelFormat), WindowsDxgiVideoFrameError>

Get the surface texture for this video frame
source§

impl Send for VideoFrame

source§

impl Sync for VideoFrame

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.

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, U> TryFrom<U> for T
where U: Into<T>,

§

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>,

§

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> WasmNotSend for T
where T: Send,

§

impl<T> WasmNotSendSync for T
where T: WasmNotSend + WasmNotSync,

§

impl<T> WasmNotSync for T
where T: Sync,