mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
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:
@@ -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();
|
||||
}
|
||||
|
Reference in New Issue
Block a user