pub struct CameraSource(/* private fields */);Expand description
Video capture (video-core): cameras, screens, the OS picker, screen thumbnails and the
pre-join preview over a kessel-video backend, as the sources the publish side takes.
Video capture (video-core): cameras, screens, the OS picker, screen thumbnails and the
pre-join preview over a kessel-video backend, as the sources the publish side takes.
Video capture (video-core): cameras, screens, the OS picker, screen thumbnails and the
pre-join preview over a kessel-video backend, as the sources the publish side takes.
A running camera (VideoCapture::open_camera). Everything of Capture through Deref.
Implementations§
Source§impl CameraSource
impl CameraSource
Sourcepub fn into_capture(self) -> Capture
pub fn into_capture(self) -> Capture
The source as a plain Capture.
Methods from Deref<Target = Capture>§
Sourcepub fn kind(&self) -> CaptureKind
pub fn kind(&self) -> CaptureKind
Camera or screen.
Sourcepub fn content_hint(&self) -> ContentHint
pub fn content_hint(&self) -> ContentHint
The content hint for the encoders this source feeds: ContentHint::Camera (keep the
frame rate) or ContentHint::Screen (keep the detail).
Sourcepub fn device(&self) -> Option<&str>
pub fn device(&self) -> Option<&str>
The camera’s id as asked (None: the default camera), or the listed screen’s id
(None: the OS picker’s choice).
Sourcepub fn constraints(&self) -> CaptureConstraints
pub fn constraints(&self) -> CaptureConstraints
What the source was last asked for.
Sourcepub fn set_constraints(
&mut self,
c: CaptureConstraints,
) -> Result<(), CaptureError>
pub fn set_constraints( &mut self, c: CaptureConstraints, ) -> Result<(), CaptureError>
New size and rate without reopening (from the next frame; a
CaptureEvent::Started follows with the delivered values).
Sourcepub fn set_paused(&mut self, paused: bool)
pub fn set_paused(&mut self, paused: bool)
Stop delivering frames but keep the device open (nothing wants a layer and no self-view is open).
Sourcepub fn try_frame(&mut self) -> Option<VideoFrame>
pub fn try_frame(&mut self) -> Option<VideoFrame>
The next frame (CPU planes, or a native buffer when asked with prefer_native), if one
is queued. The queue is 2 deep, oldest dropped; None once ended.
Sourcepub fn try_event(&mut self) -> Option<CaptureEvent>
pub fn try_event(&mut self) -> Option<CaptureEvent>
The next event, if one is queued.
Sourcepub async fn ready(&self)
pub async fn ready(&self)
Waits until the source (or an encoder given Capture::wake) queued something. Drain
Capture::try_event and Capture::try_frame after each wake; one wake-up is kept
when nobody waits, so none is lost between a drain and the next wait.
Sourcepub fn wake(&self) -> Wake
pub fn wake(&self) -> Wake
The source’s wake-up as a kessel-video Wake, for the encoders this source feeds, so
one task waits on frames and encoded outputs alike.
Sourcepub fn ended(&self) -> Option<CaptureEnd>
pub fn ended(&self) -> Option<CaptureEnd>
Why it ended, once it has (CaptureEvent::Ended was read).
Sourcepub fn paused(&self) -> Option<CapturePause>
pub fn paused(&self) -> Option<CapturePause>
Why it is paused, while it is.
Sourcepub fn stats(&self) -> SourceStats
pub fn stats(&self) -> SourceStats
The source’s counters since open.
Trait Implementations§
Source§impl Debug for CameraSource
impl Debug for CameraSource
Source§impl Deref for CameraSource
impl Deref for CameraSource
Auto Trait Implementations§
impl !RefUnwindSafe for CameraSource
impl !Sync for CameraSource
impl !UnwindSafe for CameraSource
impl Forget for CameraSource
impl Freeze for CameraSource
impl Move for CameraSource
impl Send for CameraSource
impl Unpin for CameraSource
impl UnsafeUnpin for CameraSource
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<S, T> Duplex<S> for Twhere
T: FromSample<S> + ToSample<S>,
Source§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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> ⓘ
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> ⓘ
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