#[non_exhaustive]pub enum Source {
Camera(Option<String>),
Display(DisplaySelection),
Window(String),
App(String),
Portal(Selection),
}Expand description
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Camera(Option<String>)
A camera / webcam. None opens the default camera.
The identifiers from cameras are an AVFoundation uniqueID on macOS,
a Media Foundation symbolic link on Windows, and on Linux a /dev/videoN
path or, with the pipewire feature, a pipewire:<node name> id. Bare
numeric indices remain accepted on Linux and Windows.
With the pipewire feature, Linux lists a webcam that a PipeWire node
fronts by the node’s id, since PipeWire shares the camera with other
clients while a V4L2 open holds it exclusively. Only devices no node
fronts list as /dev/videoN. pipewire alone opens the listed camera
with the highest session priority, which the session manager treats as
default.
The id picks the backend: a /dev/videoN path always opens V4L2, listed
or not, so an id saved from an earlier listing keeps working, and a
pipewire id always opens PipeWire.
With the pipewire feature, None opens PipeWire’s default camera when
PipeWire lists a camera, and /dev/video0 otherwise, such as on a host
without a PipeWire session. Inside a sandbox (Flatpak or Snap) it always
goes through the camera portal. Without the feature, None opens
/dev/video0.
Display(DisplaySelection)
A whole display. DisplaySelection::default opens the main display.
The id is the opaque value displays reports. Linux supports X11
displays only, including XWayland’s x11: ids; on Wayland the main
display and any other id are refused, so ask the system picker with
Source::Portal instead.
Window(String)
A single window, by the id windows reports. Supported on macOS,
Windows, and X11.
App(String)
Every window belonging to one application, by the id apps reports
(a bundle identifier). Windows that open later are included. macOS only.
Portal(Selection)
A screen or window chosen through the Linux system picker.
Clone the selection to reopen the same source, as an on-demand capture does for each viewer; create a new one to ask for a different source. Restoration depends on compositor support.
Trait Implementations§
impl Eq for Source
impl StructuralPartialEq for Source
Auto Trait Implementations§
impl Freeze for Source
impl RefUnwindSafe for Source
impl Send for Source
impl Sync for Source
impl Unpin for Source
impl UnsafeUnpin for Source
impl UnwindSafe for Source
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.