mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2023-10-10 13:36:59 +02:00
2c831c1110
fix standalone dispmanx grabber Former-commit-id: 5ace9bc90a6fe76f5a51ecef95d6e7119d1102db
39 lines
781 B
C++
39 lines
781 B
C++
|
|
// Hyperion-AmLogic includes
|
|
#include "AmlogicWrapper.h"
|
|
|
|
AmlogicWrapper::AmlogicWrapper(const unsigned grabWidth, const unsigned grabHeight, const unsigned updateRate_Hz) :
|
|
_timer(this),
|
|
_grabber(grabWidth, grabHeight)
|
|
{
|
|
_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> & AmlogicWrapper::getScreenshot()
|
|
{
|
|
capture();
|
|
return _screenshot_rgb;
|
|
}
|
|
|
|
void AmlogicWrapper::start()
|
|
{
|
|
_timer.start();
|
|
}
|
|
|
|
void AmlogicWrapper::stop()
|
|
{
|
|
_timer.stop();
|
|
}
|
|
|
|
void AmlogicWrapper::capture()
|
|
{
|
|
_grabber.grabFrame(_screenshot);
|
|
_screenshot.toRgb(_screenshot_rgb);
|
|
|
|
emit sig_screenshot(_screenshot_rgb);
|
|
}
|