mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
Feature/xcb grabber (#912)
* Add Xcb grabber * update compile instruction Signed-off-by: Paulchen Panther <Paulchen-Panter@protonmail.com> * Fix problem on resolution change + Make XCB default if X11 is not avaialable * Fix decimation problem Co-authored-by: Paulchen Panther <16664240+Paulchen-Panther@users.noreply.github.com> Co-authored-by: Paulchen Panther <Paulchen-Panter@protonmail.com>
This commit is contained in:
39
libsrc/grabber/xcb/XcbWrapper.cpp
Normal file
39
libsrc/grabber/xcb/XcbWrapper.cpp
Normal file
@@ -0,0 +1,39 @@
|
||||
#include <grabber/XcbWrapper.h>
|
||||
|
||||
XcbWrapper::XcbWrapper(int cropLeft, int cropRight, int cropTop, int cropBottom, int pixelDecimation, const unsigned updateRate_Hz)
|
||||
: GrabberWrapper("Xcb", &_grabber, 0, 0, updateRate_Hz)
|
||||
, _grabber(cropLeft, cropRight, cropTop, cropBottom, pixelDecimation)
|
||||
, _init(false)
|
||||
{}
|
||||
|
||||
XcbWrapper::~XcbWrapper()
|
||||
{
|
||||
if ( _init )
|
||||
{
|
||||
stop();
|
||||
}
|
||||
}
|
||||
|
||||
void XcbWrapper::action()
|
||||
{
|
||||
if (! _init )
|
||||
{
|
||||
_init = true;
|
||||
if ( ! _grabber.Setup() )
|
||||
{
|
||||
stop();
|
||||
}
|
||||
else
|
||||
{
|
||||
if (_grabber.updateScreenDimensions() < 0 )
|
||||
{
|
||||
stop();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (isActive())
|
||||
{
|
||||
transferFrame(_grabber);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user