Sunshine0.0.5917
Sunshine 0.0.5917
Self-hosted game stream host for Moonlight.
Loading...
Searching...
No Matches
wayland.cpp File Reference

Definitions for Wayland capture. More...

#include <drm_fourcc.h>
#include <fcntl.h>
#include <gbm.h>
#include <poll.h>
#include <unistd.h>
#include <wayland-client.h>
#include <wayland-util.h>
#include <xf86drm.h>
#include <lizardbyte/common/env.h>
#include "graphics.h"
#include "src/logging.h"
#include "src/platform/common.h"
#include "src/round_robin.h"
#include "src/utility.h"
#include "wayland.h"
Include dependency graph for wayland.cpp:

Macros

#define CLASS_CALL(c, m)
 Macro for CLASS CALL.

Functions

std::optional< std::uint32_t > wl::export_gbm_bo_planes (gbm_bo *bo, frame_t &frame, const gbm_bo_accessors_t &accessors)
 Export every GBM buffer plane into a captured frame descriptor.
int wl::init ()
 Initialize Wayland registry interfaces required for capture.
std::map< std::uint32_t, std::vector< std::uint64_t > > wl::intersect_modifiers (const std::map< std::uint32_t, std::vector< std::uint64_t > > &compositor_modifiers, const std::map< std::uint32_t, std::vector< std::uint64_t > > &encoder_modifiers)
 Intersect compositor and encoder modifiers to find common formats.
std::vector< std::unique_ptr< monitor_t > > wl::monitors (const char *display_name)
 Refresh the monitor list reported by the display server.

Variables

const wl_interface wl_output_interface
 Wayland output interface.

Detailed Description

Definitions for Wayland capture.

Macro Definition Documentation

◆ CLASS_CALL

#define CLASS_CALL ( c,
m )
Value:
classCall<c, decltype(&c::m), &c::m>

Macro for CLASS CALL.

Function Documentation

◆ export_gbm_bo_planes()

std::optional< std::uint32_t > wl::export_gbm_bo_planes ( gbm_bo * bo,
frame_t & frame,
const gbm_bo_accessors_t & accessors )

Export every GBM buffer plane into a captured frame descriptor.

Parameters
boGBM buffer whose DMA-BUF planes will be exported.
frameFrame that takes ownership of the exported file descriptors.
accessorsGBM accessors used to query the buffer.
Returns
Number of exported planes, or no value when the buffer cannot be exported.

◆ init()

int wl::init ( )

Initialize Wayland registry interfaces required for capture.

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

◆ intersect_modifiers()

std::map< std::uint32_t, std::vector< std::uint64_t > > wl::intersect_modifiers ( const std::map< std::uint32_t, std::vector< std::uint64_t > > & compositor_modifiers,
const std::map< std::uint32_t, std::vector< std::uint64_t > > & encoder_modifiers )

Intersect compositor and encoder modifiers to find common formats.

Parameters
compositor_modifiersModifiers supported by the compositor for each format.
encoder_modifiersModifiers supported by the encoder for each format.
Returns
Intersection of formats and modifiers supported by both.

◆ monitors()

std::vector< std::unique_ptr< monitor_t > > wl::monitors ( const char * display_name = nullptr)

Refresh the monitor list reported by the display server.

Parameters
display_nameDisplay name.
Returns
Monitors reported by the Wayland compositor, optionally filtered by name.