Sunshine master
Self-hosted game stream host for Moonlight.
wl::interface_t Class Reference

Wayland registry state for screencopy, DMA-BUF, and output globals. More...

#include <src/platform/linux/wayland.h>

Public Types

enum  interface_e { XDG_OUTPUT , WLR_EXPORT_DMABUF , LINUX_DMABUF , MAX_INTERFACES }
 Wayland globals required by the WLR capture backend. More...
 

Public Member Functions

void dmabuf_format (zwp_linux_dmabuf_v1 *zwp_linux_dmabuf, uint32_t format)
 Record a DMA-BUF format advertised by the compositor.
 
void dmabuf_modifier (zwp_linux_dmabuf_v1 *zwp_linux_dmabuf, uint32_t format, uint32_t modifier_hi, uint32_t modifier_lo)
 Record a DMA-BUF format modifier advertised by the compositor.
 
 interface_t (const interface_t &)=delete
 
 interface_t (interface_t &&)=delete
 
void listen (wl_registry *registry)
 Discover compositor globals from the Wayland registry.
 
interface_toperator= (const interface_t &)=delete
 
interface_toperator= (interface_t &&)=delete
 
bool operator[] (interface_e bit) const
 Test whether a required Wayland global was advertised.
 

Public Attributes

zwp_linux_dmabuf_v1 * dmabuf_interface {nullptr}
 Linux DMA-BUF global used to allocate frame buffers.
 
std::vector< std::unique_ptr< monitor_t > > monitors
 Outputs discovered from the Wayland registry.
 
zxdg_output_manager_v1 * output_manager {nullptr}
 xdg-output global used to query monitor names and sizes.
 
zwlr_screencopy_manager_v1 * screencopy_manager {nullptr}
 WLR screencopy global used to request frames.
 
std::map< std::uint32_t, std::vector< std::uint64_t > > supported_modifiers
 DRM format modifiers grouped by format.
 

Detailed Description

Wayland registry state for screencopy, DMA-BUF, and output globals.

Member Enumeration Documentation

◆ interface_e

Wayland globals required by the WLR capture backend.

Enumerator
XDG_OUTPUT 

xdg-output

WLR_EXPORT_DMABUF 

screencopy manager

LINUX_DMABUF 

linux-dmabuf protocol

MAX_INTERFACES 

Maximum number of interfaces.

Member Function Documentation

◆ dmabuf_format()

void wl::interface_t::dmabuf_format ( zwp_linux_dmabuf_v1 * zwp_linux_dmabuf,
uint32_t format )

Record a DMA-BUF format advertised by the compositor.

Parameters
zwp_linux_dmabufDMA-BUF interface that emitted the format event.
formatDRM format supported by the compositor.

◆ dmabuf_modifier()

void wl::interface_t::dmabuf_modifier ( zwp_linux_dmabuf_v1 * zwp_linux_dmabuf,
uint32_t format,
uint32_t modifier_hi,
uint32_t modifier_lo )

Record a DMA-BUF format modifier advertised by the compositor.

Parameters
zwp_linux_dmabufDMA-BUF interface that emitted the modifier event.
formatDRM format associated with the modifier.
modifier_hiHigh 32 bits of the DRM format modifier.
modifier_loLow 32 bits of the DRM format modifier.

◆ listen()

void wl::interface_t::listen ( wl_registry * registry)

Discover compositor globals from the Wayland registry.

Parameters
registryWayland registry announcing globals.

◆ operator[]()

bool wl::interface_t::operator[] ( interface_e bit) const
inline

Test whether a required Wayland global was advertised.

Parameters
bitInterface bit to test.
Returns
True when the requested Wayland interface bit is set.

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