mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2023-10-10 13:36:59 +02:00
50 lines
960 B
C++
50 lines
960 B
C++
// QT includes
|
|
#include <QDebug>
|
|
#include <QDateTime>
|
|
|
|
// Hyperion includes
|
|
#include <hyperion/DispmanxWrapper.h>
|
|
#include <hyperion/ImageProcessorFactory.h>
|
|
#include <hyperion/ImageProcessor.h>
|
|
|
|
|
|
// Local-Hyperion includes
|
|
#include "DispmanxFrameGrabber.h"
|
|
|
|
DispmanxWrapper::DispmanxWrapper() :
|
|
_timer(),
|
|
_frameGrabber(new DispmanxFrameGrabber(64, 64)),
|
|
_processor(ImageProcessorFactory::getInstance().newImageProcessor())
|
|
{
|
|
_timer.setInterval(100);
|
|
_timer.setSingleShot(false);
|
|
|
|
_processor->setSize(64, 64);
|
|
|
|
QObject::connect(&_timer, SIGNAL(timeout()), this, SLOT(action()));
|
|
}
|
|
|
|
DispmanxWrapper::~DispmanxWrapper()
|
|
{
|
|
delete _processor;
|
|
delete _frameGrabber;
|
|
}
|
|
|
|
void DispmanxWrapper::start()
|
|
{
|
|
_timer.start();
|
|
}
|
|
|
|
void DispmanxWrapper::action()
|
|
{
|
|
qDebug() << "[" << QDateTime::currentDateTimeUtc() << "] Grabbing frame";
|
|
RgbImage image(64, 64);
|
|
_frameGrabber->grabFrame(image);
|
|
|
|
//_processor->
|
|
}
|
|
void DispmanxWrapper::stop()
|
|
{
|
|
_timer.stop();
|
|
}
|