| Crates.io | portal-screencast-waycap |
| lib.rs | portal-screencast-waycap |
| version | 1.0.0 |
| created_at | 2025-05-26 04:58:18.063393+00 |
| updated_at | 2025-05-26 05:02:11.866783+00 |
| description | Rustic interface to the ScreenCast Desktop Portal |
| homepage | |
| repository | https://github.com/Adonca2203/waycap-rs |
| max_upload_size | |
| id | 1688953 |
| size | 46,316 |
Access to system resources on Linux can be negotitated in some environments
through calls to D-Bus 'portal' APIs. One such portal is the ScreenCast
portal. This portal allows a user to choose which windows or screens to share
and provides access to raw video data through PipeWire.
This is a fork of the one found in https://github.com/iwillspeak/obs-screencap which adds the ability to set cursor visibility and additonal stream metadata.
In the simples case this crate can be used to open a new screen cast with the default settings:
let screen_cast = ScreenCast::new()?.Start()?;
There are three main objects to interact with: ScreenCast, ActiveScreenCast,
and ScreenCastStream. The ScreenCast type is used to configure what type
of screen cast to prompt the user for. It is tramsformed into an
ActiveScreenCast by calling start(). Once active interaction with the cast
takes place over a Pipewire session using the pipewire_fd() and streams().
Under the hood this is be backed by some private structs: ConnectionState to
manage our D-Bus connection; Request, and Session to handle interacting with
request and session proxies.