#[repr(C)]pub struct CameraWidget {
pub config: CameraConfig,
pub on_frame: OptionOnVideoFrame,
}Expand description
A camera-preview widget. create(config).dom() yields an <img> the
capture thread keeps fed.
Fields§
§config: CameraConfigRequested capture config (camera facing, resolution, fps, format).
on_frame: OptionOnVideoFrameOptional per-frame user hook (effects / save / send - azul-meet).
Implementations§
Source§impl CameraWidget
impl CameraWidget
Sourcepub fn create(config: CameraConfig) -> Self
pub fn create(config: CameraConfig) -> Self
Create a camera widget for the given capture config.
Sourcepub fn set_on_frame<C: Into<OnVideoFrameCallback>>(
&mut self,
data: RefAny,
on_frame: C,
)
pub fn set_on_frame<C: Into<OnVideoFrameCallback>>( &mut self, data: RefAny, on_frame: C, )
Set a hook invoked with every captured frame - for live effects, saving
frames into your data model, or sending them over the network
(azul-meet). The backreference DI pattern (see architecture.md).
Sourcepub fn with_on_frame<C: Into<OnVideoFrameCallback>>(
self,
data: RefAny,
on_frame: C,
) -> Self
pub fn with_on_frame<C: Into<OnVideoFrameCallback>>( self, data: RefAny, on_frame: C, ) -> Self
Builder form of set_on_frame.
Auto Trait Implementations§
impl Freeze for CameraWidget
impl RefUnwindSafe for CameraWidget
impl Send for CameraWidget
impl Sync for CameraWidget
impl Unpin for CameraWidget
impl UnsafeUnpin for CameraWidget
impl UnwindSafe for CameraWidget
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more