Sunshine master
Self-hosted game stream host for Moonlight.
portal::dbus_t Class Reference

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

Public Member Functions

int connect_to_portal ()
 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_toperator= (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

int pipewire_fd
 Pipewire fd.
 
std::vector< pipewire_streaminfo_tpipewire_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 ( )
inline

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

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: