hyperion.ng/libsrc/grabber/x11/X11Wrapper.cpp

40 lines
617 B
C++
Raw Normal View History

#include <grabber/X11Wrapper.h>
2020-08-08 13:09:15 +02:00
X11Wrapper::X11Wrapper(int cropLeft, int cropRight, int cropTop, int cropBottom, int pixelDecimation, unsigned updateRate_Hz)
2018-12-27 23:11:32 +01:00
: GrabberWrapper("X11", &_grabber, 0, 0, updateRate_Hz)
, _grabber(cropLeft, cropRight, cropTop, cropBottom, pixelDecimation)
, _init(false)
{}
X11Wrapper::~X11Wrapper()
{
if ( _init )
{
stop();
}
}
void X11Wrapper::action()
{
if (! _init )
{
_init = true;
if ( ! _grabber.Setup() )
{
stop();
}
else
{
if (_grabber.updateScreenDimensions() < 0 )
{
stop();
}
}
}
if (isActive())
{
transferFrame(_grabber);
}
}