Expand description
Check if a camera is available, request access to it and open a PipeWire remote stream.
§Examples
use ashpd::desktop::camera::Camera;
pub async fn run() -> ashpd::Result<()> {
let camera = Camera::new().await?;
if camera.is_present().await? {
camera.request_access().await?;
let remote_fd = camera.open_pipe_wire_remote().await?;
// pass the remote fd to GStreamer for example
}
Ok(())
}
Structs§
- The interface lets sandboxed applications access camera devices, such as web cams.
- A PipeWire camera stream returned by
pipewire_streams
.
Functions§
- pipewire_
streams pipewire
A helper to get a list of PipeWire streams to use with the camera file descriptor returned byCamera::open_pipe_wire_remote
. - request
pipewire
Request access to the camera and return a file descriptor and a list of the available streams, one per camera.