2013-08-13 11:10:45 +02:00
|
|
|
// QT includes
|
|
|
|
#include <QDebug>
|
|
|
|
#include <QDateTime>
|
|
|
|
|
|
|
|
// Hyperion includes
|
|
|
|
#include <hyperion/DispmanxWrapper.h>
|
|
|
|
#include <hyperion/ImageProcessorFactory.h>
|
2013-08-13 12:03:00 +02:00
|
|
|
#include <hyperion/ImageProcessor.h>
|
2013-08-13 11:10:45 +02:00
|
|
|
|
|
|
|
|
|
|
|
// Local-Hyperion includes
|
|
|
|
#include "DispmanxFrameGrabber.h"
|
|
|
|
|
|
|
|
DispmanxWrapper::DispmanxWrapper() :
|
|
|
|
_timer(),
|
2013-08-13 12:03:00 +02:00
|
|
|
_frameGrabber(new DispmanxFrameGrabber(64, 64)),
|
|
|
|
_processor(ImageProcessorFactory::getInstance().newImageProcessor())
|
2013-08-13 11:10:45 +02:00
|
|
|
{
|
|
|
|
_timer.setInterval(100);
|
|
|
|
_timer.setSingleShot(false);
|
|
|
|
|
2013-08-13 12:03:00 +02:00
|
|
|
_processor->setSize(64, 64);
|
|
|
|
|
2013-08-13 11:10:45 +02:00
|
|
|
QObject::connect(&_timer, SIGNAL(timeout()), this, SLOT(action()));
|
|
|
|
}
|
|
|
|
|
|
|
|
DispmanxWrapper::~DispmanxWrapper()
|
|
|
|
{
|
|
|
|
delete _processor;
|
2013-08-13 12:03:00 +02:00
|
|
|
delete _frameGrabber;
|
2013-08-13 11:10:45 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
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();
|
|
|
|
}
|