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

@@ -11,6 +11,8 @@
#include <utils/Logger.h>
#include <utils/Components.h>
#include <QMultiMap>
///
/// @brief The Grabber class is responsible to apply image resizes (with or without ImageResampler)
/// Overwrite the videoMode with setVideoMode()
@@ -34,6 +36,12 @@ public:
///
virtual void setCropping(unsigned cropLeft, unsigned cropRight, unsigned cropTop, unsigned cropBottom);
///
/// @brief Apply new video input (used from v4l)
/// @param input device input
///
virtual bool setInput(int input);
///
/// @brief Apply new width/height values, on errors (collide with cropping) reject the values
/// @return True on success else false
@@ -116,6 +124,13 @@ public:
///
virtual QString getV4L2deviceName(QString devicePath) { return QString(); }
///
/// @brief Get a name/index pair of supported device inputs
/// @param devicePath The device path
/// @return multi pair of name/index on success else empty pair
///
virtual QMultiMap<QString, int> getV4L2deviceInputs(QString devicePath) { return QMultiMap<QString, int>(); }
///
/// @brief Get a list of supported device resolutions
/// @param devicePath The device path
@@ -144,9 +159,13 @@ protected:
/// Height of the captured snapshot [pixels]
int _height;
/// frame per second
int _fps;
// number of pixels to crop after capturing
/// device input
int _input;
/// number of pixels to crop after capturing
int _cropLeft, _cropRight, _cropTop, _cropBottom;
bool _enabled;

View File

@@ -5,6 +5,7 @@
#include <QJsonArray>
#include <QString>
#include <QStringList>
#include <QMultiMap>
#include <utils/Logger.h>
#include <utils/Components.h>
@@ -63,6 +64,13 @@ public:
///
virtual QString getV4L2deviceName(QString devicePath);
///
/// @brief Get a name/index pair of supported device inputs
/// @param devicePath The device path
/// @return multi pair of name/index on success else empty pair
///
virtual QMultiMap<QString, int> getV4L2deviceInputs(QString devicePath);
///
/// @brief Get a list of supported device resolutions
/// @param devicePath The device path