Sunshine0.0.5917
Sunshine 0.0.5917
Self-hosted game stream host for Moonlight.
Loading...
Searching...
No Matches
portal::dbus_t Class Reference

DBus connection and portal request helpers for screencast setup. More...

Public Member Functions

int connect_to_portal (bool allow_start_timeout)
 Connect to xdg-desktop-portal and restore or create a screencast session.
int init ()
 Open DBus and prepare portal screencast request handling.
bool is_session_closed () const
 Check whether session closed.
dbus_t & operator= (dbus_t &&)=delete
bool try_remote_desktop_session (GMainLoop *loop, gchar **session_path, const gchar *session_token)
 Try to create a RemoteDesktop portal session.
int try_screencast_only_session (GMainLoop *loop, gchar **session_path)
 Create a screencast-only portal session without remote-desktop control.

Public Attributes

guint dbus_timeout = 10
 Timeout in seconds for DBus calls.
int pipewire_fd
 Pipewire fd.
std::vector< pipewire_streaminfo_t > pipewire_streams
 Pipewire streams.

Detailed Description

DBus connection and portal request helpers for screencast setup.

Member Function Documentation

◆ connect_to_portal()

int portal::dbus_t::connect_to_portal ( bool allow_start_timeout)
inline

Connect to xdg-desktop-portal and restore or create a screencast session.

Parameters
allow_start_timeoutTrue if "Start" DBus call is allowed to time out.
Returns
0 when a portal session is ready; nonzero when D-Bus or portal setup fails.

◆ init()

int portal::dbus_t::init ( )
inline

Open DBus and prepare portal screencast request handling.

Returns
0 on success; nonzero or negative platform status on failure.

◆ is_session_closed()

bool portal::dbus_t::is_session_closed ( ) const
inline

Check whether session closed.

Returns
True when the portal session has been closed.

◆ try_remote_desktop_session()

bool portal::dbus_t::try_remote_desktop_session ( GMainLoop * loop,
gchar ** session_path,
const gchar * session_token )
inline

Try to create a RemoteDesktop portal session.

Parameters
loopGLib main loop associated with the portal request.
session_pathSession path.
session_tokenSession token.
Returns
True when the portal request or state check succeeds.

◆ try_screencast_only_session()

int portal::dbus_t::try_screencast_only_session ( GMainLoop * loop,
gchar ** session_path )
inline

Create a screencast-only portal session without remote-desktop control.

Parameters
loopGLib main loop associated with the portal request.
session_pathSession path.
Returns
0 when the portal returns a session path; nonzero on request failure.

The documentation for this class was generated from the following file: