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

Owner of a GBM device together with the render-node descriptor it was created from. More...

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

Public Member Functions

int fd () const
 gbm_device_t ()=default
 Construct an empty owner that holds neither a device nor a descriptor.
 gbm_device_t (const gbm_device_t &)=delete
 Copying is disabled: the descriptor and the device have exactly one owner.
gbm_device * get () const
bool init (const std::string &render_path, const gbm_device_accessors_t &accessors)
 Open the render node and create the GBM device on it.
 operator bool () const
gbm_device_t & operator= (const gbm_device_t &)=delete
 Copy assignment is disabled: the descriptor and the device have exactly one owner.
void reset ()
 Destroy the GBM device and close the render-node descriptor.
 ~gbm_device_t ()
 Destroy the GBM device and close the render-node descriptor.

Detailed Description

Owner of a GBM device together with the render-node descriptor it was created from.

gbm_device_destroy() does not close the descriptor passed to gbm_create_device(), so the descriptor has to be tracked and closed here once the device is gone.

Member Function Documentation

◆ fd()

int wl::gbm_device_t::fd ( ) const
inline
Returns
The render-node descriptor, or -1.

◆ get()

gbm_device * wl::gbm_device_t::get ( ) const
inline
Returns
The GBM device, or nullptr.

◆ init()

bool wl::gbm_device_t::init ( const std::string & render_path,
const gbm_device_accessors_t & accessors )

Open the render node and create the GBM device on it.

Parameters
render_pathPath of the DRM render node.
accessorsFunctions used to open the node and create the device.
Returns
true when the device is ready, false when nothing is held.

◆ operator bool()

wl::gbm_device_t::operator bool ( ) const
inlineexplicit
Returns
true when a GBM device is held.

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