mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2023-10-10 13:36:59 +02:00
945f3d1c5b
No functional changes - except protobuffer is mandatory and not optional now. Former-commit-id: 1e6347e708707cc388cdedb8d0352a9f017030b8
45 lines
999 B
C++
45 lines
999 B
C++
|
|
// Hyperion-Dispmanx includes
|
|
#include "DispmanxWrapper.h"
|
|
|
|
DispmanxWrapper::DispmanxWrapper(const unsigned grabWidth, const unsigned grabHeight,
|
|
const VideoMode& videoMode,
|
|
const unsigned cropLeft, const unsigned cropRight,
|
|
const unsigned cropTop, const unsigned cropBottom,
|
|
const unsigned updateRate_Hz) :
|
|
_timer(this),
|
|
_grabber(grabWidth, grabHeight)
|
|
{
|
|
_grabber.setVideoMode(videoMode);
|
|
_grabber.setCropping(cropLeft, cropRight, cropTop, cropBottom);
|
|
_timer.setSingleShot(false);
|
|
_timer.setInterval(updateRate_Hz);
|
|
|
|
// Connect capturing to the timeout signal of the timer
|
|
connect(&_timer, SIGNAL(timeout()), this, SLOT(capture()));
|
|
}
|
|
|
|
const Image<ColorRgb> & DispmanxWrapper::getScreenshot()
|
|
{
|
|
capture();
|
|
return _screenshot_rgb;
|
|
}
|
|
|
|
void DispmanxWrapper::start()
|
|
{
|
|
_timer.start();
|
|
}
|
|
|
|
void DispmanxWrapper::stop()
|
|
{
|
|
_timer.stop();
|
|
}
|
|
|
|
void DispmanxWrapper::capture()
|
|
{
|
|
_grabber.grabFrame(_screenshot);
|
|
_screenshot.toRgb(_screenshot_rgb);
|
|
|
|
emit sig_screenshot(_screenshot_rgb);
|
|
}
|