Active grabber fix

This commit is contained in:
Paulchen Panther 2020-12-31 11:12:29 +01:00
parent 39f648087e
commit d72a59e981
2 changed files with 13 additions and 8 deletions

View File

@ -47,6 +47,7 @@ void CaptureCont::handleV4lImage(const QString& name, const Image<ColorRgb> & im
{ {
_hyperion->registerInput(_v4lCaptPrio, hyperion::COMP_V4L, "System", name); _hyperion->registerInput(_v4lCaptPrio, hyperion::COMP_V4L, "System", name);
_v4lCaptName = name; _v4lCaptName = name;
emit GlobalSignals::getInstance()->requestSource(hyperion::COMP_V4L, int(_hyperion->getInstanceIndex()), _v4lCaptEnabled);
} }
_v4lInactiveTimer->start(); _v4lInactiveTimer->start();
_hyperion->setInputImage(_v4lCaptPrio, image); _hyperion->setInputImage(_v4lCaptPrio, image);
@ -58,6 +59,7 @@ void CaptureCont::handleSystemImage(const QString& name, const Image<ColorRgb>&
{ {
_hyperion->registerInput(_systemCaptPrio, hyperion::COMP_GRABBER, "System", name); _hyperion->registerInput(_systemCaptPrio, hyperion::COMP_GRABBER, "System", name);
_systemCaptName = name; _systemCaptName = name;
emit GlobalSignals::getInstance()->requestSource(hyperion::COMP_GRABBER, int(_hyperion->getInstanceIndex()), _systemCaptEnabled);
} }
_systemInactiveTimer->start(); _systemInactiveTimer->start();
_hyperion->setInputImage(_systemCaptPrio, image); _hyperion->setInputImage(_systemCaptPrio, image);

View File

@ -44,10 +44,13 @@ GrabberWrapper::~GrabberWrapper()
bool GrabberWrapper::start() bool GrabberWrapper::start()
{ {
// Start the timer with the pre configured interval if (!_timer->isActive())
Debug(_log,"Grabber start()"); {
_timer->start(); // Start the timer with the pre configured interval
return _timer->isActive(); Debug(_log,"Grabber start()");
_timer->start();
return _timer->isActive();
}
} }
void GrabberWrapper::stop() void GrabberWrapper::stop()
@ -185,9 +188,9 @@ void GrabberWrapper::handleSourceRequest(hyperion::Components component, int hyp
{ {
if(component == hyperion::Components::COMP_GRABBER && !_grabberName.startsWith("V4L")) if(component == hyperion::Components::COMP_GRABBER && !_grabberName.startsWith("V4L"))
{ {
if(listen && !GRABBER_SYS_CLIENTS.contains(hyperionInd)) if(listen)
GRABBER_SYS_CLIENTS.insert(hyperionInd, _grabberName); GRABBER_SYS_CLIENTS.insert(hyperionInd, _grabberName);
else if (!listen) else
GRABBER_SYS_CLIENTS.remove(hyperionInd); GRABBER_SYS_CLIENTS.remove(hyperionInd);
if(GRABBER_SYS_CLIENTS.empty()) if(GRABBER_SYS_CLIENTS.empty())
@ -197,9 +200,9 @@ void GrabberWrapper::handleSourceRequest(hyperion::Components component, int hyp
} }
else if(component == hyperion::Components::COMP_V4L && _grabberName.startsWith("V4L")) else if(component == hyperion::Components::COMP_V4L && _grabberName.startsWith("V4L"))
{ {
if(listen && !GRABBER_V4L_CLIENTS.contains(hyperionInd)) if(listen)
GRABBER_V4L_CLIENTS.insert(hyperionInd, _grabberName); GRABBER_V4L_CLIENTS.insert(hyperionInd, _grabberName);
else if (!listen) else
GRABBER_V4L_CLIENTS.remove(hyperionInd); GRABBER_V4L_CLIENTS.remove(hyperionInd);
if(GRABBER_V4L_CLIENTS.empty()) if(GRABBER_V4L_CLIENTS.empty())