V4l2 input (#825)

This commit is contained in:
Paulchen Panther
2020-06-17 20:55:57 +02:00
committed by GitHub
parent 423a59fa34
commit 756247aa1e
18 changed files with 252 additions and 77 deletions

View File

@@ -14,6 +14,7 @@
#include <QByteArray>
#include <QTimer>
#include <QHostInfo>
#include <QMultiMap>
// hyperion includes
#include <leddevice/LedDeviceWrapper.h>
@@ -489,21 +490,32 @@ void JsonAPI::handleServerInfoCommand(const QJsonObject &message, const QString
QJsonArray availableV4L2devices;
for (auto devicePath : GrabberWrapper::getInstance()->getV4L2devices())
{
QJsonObject device;
device["device"] = devicePath;
device["name"] = GrabberWrapper::getInstance()->getV4L2deviceName(devicePath);
QJsonArray availableInputs;
QMultiMap<QString, int> inputs = GrabberWrapper::getInstance()->getV4L2deviceInputs(devicePath);
for (auto input = inputs.begin(); input != inputs.end(); input++)
{
QJsonObject availableInput;
availableInput["inputName"] = input.key();
availableInput["inputIndex"] = input.value();
availableInputs.append(availableInput);
}
device.insert("inputs", availableInputs);
QJsonArray availableResolutions;
for (auto resolution : GrabberWrapper::getInstance()->getResolutions(devicePath))
QStringList resolutions = GrabberWrapper::getInstance()->getResolutions(devicePath);
for (auto resolution : resolutions)
{
availableResolutions.append(resolution);
}
device.insert("resolutions", availableResolutions);
QJsonArray availableFramerates;
for (auto framerate : GrabberWrapper::getInstance()->getFramerates(devicePath))
QStringList framerates = GrabberWrapper::getInstance()->getFramerates(devicePath);
for (auto framerate : framerates)
{
availableFramerates.append(framerate);
}