mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2023-10-10 13:36:59 +02:00
f2eef4ecea
The OSD will use 20Hz for frame capture frequency The video capture frequency is based on the amlvideodri capture module
41 lines
715 B
C++
41 lines
715 B
C++
|
|
// Hyperion-AmLogic includes
|
|
#include "AmlogicWrapper.h"
|
|
|
|
// Linux includes
|
|
#include <unistd.h>
|
|
|
|
AmlogicWrapper::AmlogicWrapper(const unsigned grabWidth, const unsigned grabHeight) :
|
|
_thread(this),
|
|
_grabber(grabWidth, grabHeight)
|
|
{
|
|
// Connect capturing to the timeout signal of the timer
|
|
connect(&_thread, SIGNAL (started()), this, SLOT(capture()));
|
|
}
|
|
|
|
const Image<ColorRgb> & AmlogicWrapper::getScreenshot()
|
|
{
|
|
capture();
|
|
return _screenshot;
|
|
}
|
|
|
|
void AmlogicWrapper::start()
|
|
{
|
|
_thread.start();
|
|
}
|
|
|
|
void AmlogicWrapper::stop()
|
|
{
|
|
_thread.quit();
|
|
}
|
|
|
|
void AmlogicWrapper::capture()
|
|
{
|
|
while (_thread.isRunning())
|
|
{
|
|
_grabber.grabFrame(_screenshot);
|
|
emit sig_screenshot(_screenshot);
|
|
usleep(1 * 1000);
|
|
}
|
|
}
|