make proto uses priorityRegister

This commit is contained in:
redpanther
2016-07-16 22:51:31 +02:00
parent 505b83f028
commit a8da7acd14
11 changed files with 69 additions and 37 deletions

View File

@@ -31,8 +31,6 @@ AmlogicWrapper::AmlogicWrapper(const unsigned grabWidth, const unsigned grabHeig
// Connect the QTimer to this
QObject::connect(&_timer, SIGNAL(timeout()), this, SLOT(action()));
_hyperion->registerPriority("Amlogic Grabber", _priority);
}
AmlogicWrapper::~AmlogicWrapper()
@@ -46,6 +44,7 @@ void AmlogicWrapper::start()
{
// Start the timer with the pre configured interval
_timer.start();
_hyperion->registerPriority("Amlogic Grabber");
}
void AmlogicWrapper::action()
@@ -72,6 +71,8 @@ void AmlogicWrapper::stop()
{
// Stop the timer, effectivly stopping the process
_timer.stop();
_hyperion->unRegisterPriority("Amlogic Grabber", _priority);
}
void AmlogicWrapper::setGrabbingMode(const GrabbingMode mode)

View File

@@ -31,8 +31,6 @@ DispmanxWrapper::DispmanxWrapper(const unsigned grabWidth, const unsigned grabHe
// Connect the QTimer to this
QObject::connect(&_timer, SIGNAL(timeout()), this, SLOT(action()));
_hyperion->registerPriority("Dispmanx Grabber", _priority);
}
DispmanxWrapper::~DispmanxWrapper()
@@ -46,6 +44,7 @@ void DispmanxWrapper::start()
{
// Start the timer with the pre configured interval
_timer.start();
_hyperion->registerPriority("Dispmanx Grabber", _priority);
}
void DispmanxWrapper::action()
@@ -68,6 +67,7 @@ void DispmanxWrapper::stop()
{
// Stop the timer, effectivly stopping the process
_timer.stop();
_hyperion->unRegisterPriority("Dispmanx Grabber");
}
void DispmanxWrapper::setGrabbingMode(const GrabbingMode mode)

View File

@@ -26,8 +26,6 @@ FramebufferWrapper::FramebufferWrapper(const std::string & device, const unsigne
// Connect the QTimer to this
QObject::connect(&_timer, SIGNAL(timeout()), this, SLOT(action()));
_hyperion->registerPriority("FrameBuffer Grabber", _priority);
}
FramebufferWrapper::~FramebufferWrapper()
@@ -41,6 +39,7 @@ void FramebufferWrapper::start()
{
// Start the timer with the pre configured interval
_timer.start();
_hyperion->registerPriority("FrameBuffer Grabber", _priority);
}
void FramebufferWrapper::action()
@@ -57,6 +56,7 @@ void FramebufferWrapper::stop()
{
// Stop the timer, effectivly stopping the process
_timer.stop();
_hyperion->unRegisterPriority("FrameBuffer Grabber");
}
void FramebufferWrapper::setGrabbingMode(const GrabbingMode mode)

View File

@@ -26,8 +26,6 @@ OsxWrapper::OsxWrapper(const unsigned display, const unsigned grabWidth, const u
// Connect the QTimer to this
QObject::connect(&_timer, SIGNAL(timeout()), this, SLOT(action()));
_hyperion->registerPriority("OsxFrameGrabber", _priority);
}
OsxWrapper::~OsxWrapper()
@@ -41,6 +39,7 @@ void OsxWrapper::start()
{
// Start the timer with the pre configured interval
_timer.start();
_hyperion->registerPriority("OsxFrameGrabber", _priority);
}
void OsxWrapper::action()
@@ -57,6 +56,7 @@ void OsxWrapper::stop()
{
// Stop the timer, effectivly stopping the process
_timer.stop();
_hyperion->unRegisterPriority("OsxFrameGrabber");
}
void OsxWrapper::setGrabbingMode(const GrabbingMode mode)

View File

@@ -35,8 +35,6 @@ V4L2Wrapper::V4L2Wrapper(const std::string &device,
// set the signal detection threshold of the grabber
_grabber.setSignalThreshold( redSignalThreshold, greenSignalThreshold, blueSignalThreshold, 50);
_hyperion->registerPriority("V4L2", _priority);
// register the image type
qRegisterMetaType<Image<ColorRgb>>("Image<ColorRgb>");
qRegisterMetaType<std::vector<ColorRgb>>("std::vector<ColorRgb>");
@@ -71,14 +69,21 @@ bool V4L2Wrapper::start()
{
bool grabber_started = _grabber.start();
if ( ! grabber_started )
{
_timer.stop();
}
else
{
_hyperion->registerPriority("V4L2", _priority);
}
return grabber_started;
}
void V4L2Wrapper::stop()
{
_grabber.stop();
_hyperion->unRegisterPriority("V4L2");
}
void V4L2Wrapper::setCropping(int cropLeft, int cropRight, int cropTop, int cropBottom)