fix: Resolve enable state for v4l and screen capture (#728)

* fix: Resolve the enable state for v4l and screen capture

* Use instance index instead of pointer

* Second try

* fix(QtGrabber): QScreen ownership

* Remove v4l2 compState listener
This commit is contained in:
brindosch
2020-03-26 17:49:36 +01:00
committed by GitHub
parent 49b30c47f7
commit cb98d51a9c
12 changed files with 109 additions and 52 deletions

View File

@@ -58,10 +58,6 @@ V4L2Grabber::V4L2Grabber(const QString & device
setPixelDecimation(pixelDecimation);
getV4Ldevices();
// connect componentStateChange only for build-in grabber
if (HyperionIManager::HIMinstance)
connect(this, &Grabber::compStateChangeRequest, this, &V4L2Grabber::compStateChangeRequest);
// init
setDeviceVideoStandard(device, videoStandard);
}
@@ -1175,17 +1171,3 @@ void V4L2Grabber::setDeviceVideoStandard(QString device, VideoStandard videoStan
if(started) start();
}
}
void V4L2Grabber::compStateChangeRequest(const hyperion::Components component, bool enable)
{
if (component == hyperion::COMP_V4L)
{
if (_initialized != enable)
{
if (enable)
start();
else
stop();
}
}
}

View File

@@ -23,8 +23,6 @@ V4L2Wrapper::V4L2Wrapper(const QString &device,
// Handle the image in the captured thread using a direct connection
connect(&_grabber, SIGNAL(newFrame(Image<ColorRgb>)), this, SLOT(newFrame(Image<ColorRgb>)), Qt::DirectConnection);
connect(&_grabber, SIGNAL(readError(const char*)), this, SLOT(readError(const char*)), Qt::DirectConnection);
connect(this, &V4L2Wrapper::compStateChangeRequest, _ggrabber, &Grabber::compStateChangeRequest);
}
bool V4L2Wrapper::start()