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

Decides when a captured plane that has lost its framebuffer should be picked again. More...

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

Public Member Functions

std::chrono::steady_clock::duration empty_for (std::chrono::steady_clock::time_point now) const
 How long the plane has had no framebuffer.
 empty_plane_timer_t (std::chrono::steady_clock::duration delay)
 Construct a timer.
bool update (bool has_fb, std::chrono::steady_clock::time_point now)
 Record whether the plane has a framebuffer now.

Detailed Description

Decides when a captured plane that has lost its framebuffer should be picked again.

A compositor may move its picture to another plane while a stream is running, or restart. The plane being captured then has no framebuffer, and capturing it again only repeats the last frame. Once it has stayed empty for the given delay, capture should be reinitialized so a plane is chosen again.

Constructor & Destructor Documentation

◆ empty_plane_timer_t()

platf::kms::empty_plane_timer_t::empty_plane_timer_t ( std::chrono::steady_clock::duration delay)
inlineexplicit

Construct a timer.

Parameters
delayHow long the plane may have no framebuffer before a reinit is due.

Member Function Documentation

◆ empty_for()

std::chrono::steady_clock::duration platf::kms::empty_plane_timer_t::empty_for ( std::chrono::steady_clock::time_point now) const
inline

How long the plane has had no framebuffer.

Parameters
nowThe current time.
Returns
The time since the plane lost its framebuffer, or zero when it has one.

◆ update()

bool platf::kms::empty_plane_timer_t::update ( bool has_fb,
std::chrono::steady_clock::time_point now )
inline

Record whether the plane has a framebuffer now.

Parameters
has_fbTrue when the plane currently scans out a framebuffer.
nowThe current time.
Returns
True once the plane has had no framebuffer for at least the delay.

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