ashpd::desktop

Module camera

Source
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.

Functions§

  • requestNon-pipewire
    Request access to the camera and return a file descriptor if one is available.