Trait BrowserVideoCapture

Source
pub trait BrowserVideoCapture: CaptureArea {
    // Required methods
    fn capture(
        &self,
        source: &HtmlVideoElement,
        mode: CaptureMode,
    ) -> (u32, u32);
    fn retrieve(&self, buffer: &mut [u8]);
    fn clear(&self);

    // Provided methods
    fn channels_count(&self) -> u32 { ... }
    fn buffer_size(&self) -> usize { ... }
    fn data(&self) -> Vec<u8>  { ... }
    fn read(&self, source: &HtmlVideoElement, mode: CaptureMode) -> Vec<u8>  { ... }
}

Required Methods§

Source

fn capture(&self, source: &HtmlVideoElement, mode: CaptureMode) -> (u32, u32)

Capture a frame from the video element.

Source

fn retrieve(&self, buffer: &mut [u8])

Retrieve the grabbed frame raw data into the buffer.

Source

fn clear(&self)

Clear the capture area.

Provided Methods§

Source

fn channels_count(&self) -> u32

Get the number of channels in the capture buffer.

Source

fn buffer_size(&self) -> usize

Get the size of the capture buffer in bytes.

Source

fn data(&self) -> Vec<u8>

Get the raw data from the captured frame.

Source

fn read(&self, source: &HtmlVideoElement, mode: CaptureMode) -> Vec<u8>

Read the raw data from the video element.

Trait Implementations§

Source§

impl From<BrowserCapture> for Box<dyn BrowserVideoCapture>

Source§

fn from(value: BrowserCapture) -> Self

Converts to this type from the input type.

Implementors§