mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
create external framebuffer grabber
cleanup some cmakelist files fix qt5 build Former-commit-id: 024b5b6dc5dc96fcb16f6e8958ad3684a6728504
This commit is contained in:
37
src/hyperion-framebuffer/FramebufferWrapper.cpp
Normal file
37
src/hyperion-framebuffer/FramebufferWrapper.cpp
Normal file
@@ -0,0 +1,37 @@
|
||||
|
||||
// Hyperion-AmLogic includes
|
||||
#include "FramebufferWrapper.h"
|
||||
|
||||
FramebufferWrapper::FramebufferWrapper(const std::string & device, const unsigned grabWidth, const unsigned grabHeight, const unsigned updateRate_Hz) :
|
||||
_timer(this),
|
||||
_grabber(device,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> & FramebufferWrapper::getScreenshot()
|
||||
{
|
||||
capture();
|
||||
return _screenshot;
|
||||
}
|
||||
|
||||
void FramebufferWrapper::start()
|
||||
{
|
||||
_timer.start();
|
||||
}
|
||||
|
||||
void FramebufferWrapper::stop()
|
||||
{
|
||||
_timer.stop();
|
||||
}
|
||||
|
||||
void FramebufferWrapper::capture()
|
||||
{
|
||||
_grabber.grabFrame(_screenshot);
|
||||
|
||||
emit sig_screenshot(_screenshot);
|
||||
}
|
||||
Reference in New Issue
Block a user