Screen Cast Portal
Wrapper around the org.freedesktop.portal.ScreenCast D-Bus interface. Provides convenient methods to capture screen content via PipeWire streams.
This portal maintains an active session internally. After calling startSession, the PipeWire remote can be opened with openPipeWireRemote.
Properties
The currently active session handle, set automatically by startSession.
Returns the available cursor modes as a set of CursorMode values.
Returns the available source types as a set of SourceType values.
Functions
Clears the active session.
Creates a new screencast session.
Returns a Flow that emits when the active session is closed.
Opens a PipeWire remote using the active session handle.
Opens a PipeWire remote for the given session, returning a file descriptor that can be passed to a PipeWire client to access the stream.
Select sources to capture for the given session. This must be called before starting the session, and an application may only attempt to select sources once per session.
Start the screencast session. This will typically present a dialog for the user to confirm the selection configured via selectSources.
Convenience function that performs the complete screencast session flow: creates a session, selects sources, and starts the session.