Sunshine master
Self-hosted game stream host for Moonlight.
kwin::screencast_t Class Reference

Public Member Functions

std::vector< std::string > get_output_names ()
 Generate a sorted list of known output names.
 
int init (const bool setup_permissions=true)
 Connect to KWin wayland, enumerate outputs.
 
bool is_kwin_screencasting_available () const
 Check if kwin screencasting is currently available.
 
bool kwin_available () const
 Check if KWin is available for potential screencasting.
 
screencast_toperator= (screencast_t &&)=delete
 
int start (const std::string_view &output_name)
 Request a screencast stream.
 

Public Attributes

uint32_t out_node_id = PW_ID_ANY
 
uint64_t out_objectserial = SPA_ID_INVALID
 
std::shared_ptr< output_parameter_tout_params = nullptr
 

Detailed Description

Wayland KDE ScreenCast session

Owns its own wl_display connection. Binds zkde_screencast_unstable_v1 and wl_output from the registry, then calls stream_output() to start a ScreenCast. Waits for the created(node_id) event from KWin.

Member Function Documentation

◆ get_output_names()

std::vector< std::string > kwin::screencast_t::get_output_names ( )
inline

Generate a sorted list of known output names.

Returns
List of strings with output names to pass to start()

◆ init()

int kwin::screencast_t::init ( const bool setup_permissions = true)
inline

Connect to KWin wayland, enumerate outputs.

Parameters
setup_permissions- Try to setup KWin permissions (default: true)
Returns
0 on success, -1 on failure. On success, node_id and output width/height/x/y are populated.

◆ is_kwin_screencasting_available()

bool kwin::screencast_t::is_kwin_screencasting_available ( ) const
inline

Check if kwin screencasting is currently available.

Returns
true if screencast can be started, false otherwise

◆ kwin_available()

bool kwin::screencast_t::kwin_available ( ) const
inline

Check if KWin is available for potential screencasting.

Returns
True if KWin is detected

◆ start()

int kwin::screencast_t::start ( const std::string_view & output_name)
inline

Request a screencast stream.

Parameters
output_nameWhich wl_output to capture.
Returns
0 on success, -1 on failure. On success, node_id and output width/height/x/y are populated.

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