V4L2 enhanced (#766)

* fix v4l2 standard
* ignore v4l2 meta devices
* added resolution, framerate and device dropdown list to WebUI (thx to @Lord-Grey & @b1rdhous3)

* Fix for kernels prior to v4.16
* Device names added & WebUI adapted
This commit is contained in:
Paulchen Panther
2020-04-17 16:59:20 +02:00
committed by GitHub
parent b92af63cef
commit 10f11c2d89
20 changed files with 717 additions and 175 deletions

View File

@@ -9,6 +9,8 @@
// qt
#include <QTimer>
GrabberWrapper* GrabberWrapper::instance = nullptr;
GrabberWrapper::GrabberWrapper(QString grabberName, Grabber * ggrabber, unsigned width, unsigned height, const unsigned updateRate_Hz)
: _grabberName(grabberName)
, _timer(new QTimer(this))
@@ -17,6 +19,8 @@ GrabberWrapper::GrabberWrapper(QString grabberName, Grabber * ggrabber, unsigned
, _ggrabber(ggrabber)
, _image(0,0)
{
GrabberWrapper::instance = this;
// Configure the timer to generate events every n milliseconds
_timer->setInterval(_updateInterval_ms);
@@ -89,7 +93,6 @@ QStringList GrabberWrapper::availableGrabbers()
return grabbers;
}
void GrabberWrapper::setVideoMode(const VideoMode& mode)
{
if (_ggrabber != nullptr)
@@ -216,3 +219,35 @@ void GrabberWrapper::tryStart()
start();
}
}
QStringList GrabberWrapper::getV4L2devices()
{
if(_grabberName.startsWith("V4L"))
return _ggrabber->getV4L2devices();
return QStringList();
}
QString GrabberWrapper::getV4L2deviceName(QString devicePath)
{
if(_grabberName.startsWith("V4L"))
return _ggrabber->getV4L2deviceName(devicePath);
return QString();
}
QStringList GrabberWrapper::getResolutions(QString devicePath)
{
if(_grabberName.startsWith("V4L"))
return _ggrabber->getResolutions(devicePath);
return QStringList();
}
QStringList GrabberWrapper::getFramerates(QString devicePath)
{
if(_grabberName.startsWith("V4L"))
return _ggrabber->getFramerates(devicePath);
return QStringList();
}