portal-screencast-waycap

Crates.ioportal-screencast-waycap
lib.rsportal-screencast-waycap
version1.0.0
created_at2025-05-26 04:58:18.063393+00
updated_at2025-05-26 05:02:11.866783+00
descriptionRustic interface to the ScreenCast Desktop Portal
homepage
repositoryhttps://github.com/Adonca2203/waycap-rs
max_upload_size
id1688953
size46,316
Adonis Carvajal (Adonca2203)

documentation

https://docs.rs/portal_screencast_waycap

README

Rust API to the ScreenCast Desktop Portal

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.

Simple Use

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()?;

Structure

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.

Commit count: 26

cargo fmt