mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
Merge remote-tracking branch 'origin/grabberDiscovery' into mediafoundation
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
#include <utils/Logger.h>
|
||||
#include <hyperion/Hyperion.h>
|
||||
#include <utils/settings.h>
|
||||
#include <effectengine/Effect.h>
|
||||
|
||||
///
|
||||
/// @brief Handle the background Effect settings, reacts on runtime to settings changes
|
||||
@@ -37,7 +38,7 @@ private slots:
|
||||
|
||||
#define BGCONFIG_ARRAY bgColorConfig.toArray()
|
||||
// clear background priority
|
||||
_hyperion->clear(254);
|
||||
_hyperion->clear(PriorityMuxer::BG_PRIORITY);
|
||||
// initial background effect/color
|
||||
if (BGEffectConfig["enable"].toBool(true))
|
||||
{
|
||||
@@ -53,12 +54,12 @@ private slots:
|
||||
static_cast<uint8_t>(BGCONFIG_ARRAY.at(2).toInt(0))
|
||||
}
|
||||
};
|
||||
_hyperion->setColor(254, bg_color);
|
||||
_hyperion->setColor(PriorityMuxer::BG_PRIORITY, bg_color);
|
||||
Info(Logger::getInstance("HYPERION"),"Initial background color set (%d %d %d)",bg_color.at(0).red, bg_color.at(0).green, bg_color.at(0).blue);
|
||||
}
|
||||
else
|
||||
{
|
||||
int result = _hyperion->setEffect(bgEffectConfig, 254);
|
||||
int result = _hyperion->setEffect(bgEffectConfig, PriorityMuxer::BG_PRIORITY, Effect::ENDLESS);
|
||||
Info(Logger::getInstance("HYPERION"),"Initial background effect '%s' %s", QSTRING_CSTR(bgEffectConfig), ((result == 0) ? "started" : "failed"));
|
||||
}
|
||||
}
|
||||
|
@@ -41,7 +41,7 @@ public:
|
||||
virtual void setCropping(unsigned cropLeft, unsigned cropRight, unsigned cropTop, unsigned cropBottom);
|
||||
|
||||
///
|
||||
/// @brief Apply new video input (used from v4l)
|
||||
/// @brief Apply new video input (used from v4l2/MediaFoundation)
|
||||
/// @param input device input
|
||||
///
|
||||
virtual bool setInput(int input);
|
||||
@@ -53,52 +53,26 @@ public:
|
||||
virtual bool setWidthHeight(int width, int height);
|
||||
|
||||
///
|
||||
/// @brief Apply new framerate (used from v4l)
|
||||
/// @brief Apply new framerate (used from v4l2/MediaFoundation)
|
||||
/// @param fps framesPerSecond
|
||||
///
|
||||
virtual bool setFramerate(int fps);
|
||||
|
||||
///
|
||||
/// @brief Apply new pixelDecimation (used from x11, xcb and qt)
|
||||
/// @brief Apply new framerate software decimation (used from v4l2/MediaFoundation)
|
||||
/// @param decimation how many frames per second to omit
|
||||
///
|
||||
virtual void setPixelDecimation(int pixelDecimation) {}
|
||||
virtual void setFpsSoftwareDecimation(int decimation);
|
||||
|
||||
///
|
||||
/// @brief Apply new signalThreshold (used from v4l)
|
||||
/// @brief Apply videoStandard (used from v4l2)
|
||||
///
|
||||
virtual void setSignalThreshold(
|
||||
double redSignalThreshold,
|
||||
double greenSignalThreshold,
|
||||
double blueSignalThreshold,
|
||||
int noSignalCounterThreshold = 50) {}
|
||||
///
|
||||
/// @brief Apply new SignalDetectionOffset (used from v4l)
|
||||
///
|
||||
virtual void setSignalDetectionOffset(
|
||||
double verticalMin,
|
||||
double horizontalMin,
|
||||
double verticalMax,
|
||||
double horizontalMax) {}
|
||||
virtual void setVideoStandard(VideoStandard videoStandard);
|
||||
|
||||
///
|
||||
/// @brief Apply SignalDetectionEnable (used from v4l)
|
||||
/// @brief Apply new pixelDecimation (used from v4l2, MediaFoundation, x11, xcb and qt)
|
||||
///
|
||||
virtual void setSignalDetectionEnable(bool enable) {}
|
||||
|
||||
///
|
||||
/// @brief Apply CecDetectionEnable (used from v4l)
|
||||
///
|
||||
virtual void setCecDetectionEnable(bool enable) {}
|
||||
|
||||
///
|
||||
/// @brief Apply device and videoStandard (used from v4l)
|
||||
///
|
||||
virtual void setDeviceVideoStandard(QString device, VideoStandard videoStandard) {}
|
||||
|
||||
///
|
||||
/// @brief Apply device (used from MediaFoundation)
|
||||
///
|
||||
virtual bool setDevice(QString device) { return false; }
|
||||
virtual bool setPixelDecimation(int pixelDecimation);
|
||||
|
||||
///
|
||||
/// @brief Apply display index (used from qt)
|
||||
@@ -125,71 +99,26 @@ public:
|
||||
///
|
||||
void setEnabled(bool enable);
|
||||
|
||||
///
|
||||
/// @brief Get a list of all available devices
|
||||
/// @return List of all available devices on success else empty List
|
||||
///
|
||||
virtual QStringList getDevices() const { return QStringList(); }
|
||||
|
||||
///
|
||||
/// @brief Get the device name by path
|
||||
/// @param devicePath The device path
|
||||
/// @return The name of the device on success else empty String
|
||||
///
|
||||
virtual QString getDeviceName(const QString& /*devicePath*/) const { 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> getDeviceInputs(const QString& /*devicePath*/) const { return QMultiMap<QString, int>(); }
|
||||
|
||||
///
|
||||
/// @brief Get a list of available device video standards depends on device input
|
||||
/// @param devicePath The device path
|
||||
/// @param inputIndex The device input index
|
||||
/// @return List of video standards on success else empty List
|
||||
///
|
||||
virtual QList<VideoStandard> getAvailableDeviceStandards(const QString& /*devicePath*/, const int& /*deviceInput*/) const { return QList<VideoStandard>(); }
|
||||
|
||||
///
|
||||
/// @brief Get a list of all available device encoding formats depends on device input
|
||||
/// @param devicePath The device path
|
||||
/// @param inputIndex The device input index
|
||||
/// @return List of device encoding formats on success else empty List
|
||||
///
|
||||
virtual QStringList getAvailableEncodingFormats(const QString& /*devicePath*/, const int& /*deviceInput*/) const { return QStringList(); }
|
||||
|
||||
///
|
||||
/// @brief Get a map of available device resolutions (width/heigth) depends on device input and encoding format
|
||||
/// @param devicePath The device path
|
||||
/// @param inputIndex The device input index
|
||||
/// @param encFormat The device encoding format
|
||||
/// @return Map of resolutions (width/heigth) on success else empty List
|
||||
///
|
||||
virtual QMultiMap<int, int> getAvailableDeviceResolutions(const QString& /*devicePath*/, const int& /*deviceInput*/, const PixelFormat& /*encFormat*/) const { return QMultiMap<int, int>(); }
|
||||
|
||||
///
|
||||
/// @brief Get a list of available device framerates depends on device input, encoding format and resolution
|
||||
/// @param devicePath The device path
|
||||
/// @param inputIndex The device input index
|
||||
/// @param encFormat The device encoding format
|
||||
/// @param width The device width
|
||||
/// @param heigth The device heigth
|
||||
/// @return List of framerates on success else empty List
|
||||
///
|
||||
virtual QIntList getAvailableDeviceFramerates(const QString& /*devicePath*/, const int& /*deviceInput*/, const PixelFormat& /*encFormat*/, const unsigned /*width*/, const unsigned /*height*/) const { return QIntList(); }
|
||||
QString getGrabberName() const { return _grabberName; }
|
||||
|
||||
protected:
|
||||
|
||||
QString _grabberName;
|
||||
|
||||
ImageResampler _imageResampler;
|
||||
|
||||
bool _useImageResampler;
|
||||
|
||||
/// The selected VideoMode
|
||||
/// the selected VideoMode
|
||||
VideoMode _videoMode;
|
||||
|
||||
/// The used Flip Mode
|
||||
/// the used video standard
|
||||
VideoStandard _videoStandard;
|
||||
|
||||
/// Image size decimation
|
||||
int _pixelDecimation;
|
||||
|
||||
/// the used Flip Mode
|
||||
FlipMode _flipMode;
|
||||
|
||||
/// With of the captured snapshot [pixels]
|
||||
@@ -201,6 +130,9 @@ protected:
|
||||
/// frame per second
|
||||
int _fps;
|
||||
|
||||
/// fps software decimation
|
||||
int _fpsSoftwareDecimation;
|
||||
|
||||
/// device input
|
||||
int _input;
|
||||
|
||||
|
@@ -58,62 +58,6 @@ public:
|
||||
///
|
||||
virtual bool isActive() const;
|
||||
|
||||
///
|
||||
/// @brief Get a list of all available devices
|
||||
/// @return List of all available devices on success else empty List
|
||||
///
|
||||
virtual QStringList getDevices() const;
|
||||
|
||||
///
|
||||
/// @brief Get the device name by path
|
||||
/// @param devicePath The device path
|
||||
/// @return The name of the device on success else empty String
|
||||
///
|
||||
virtual QString getDeviceName(const QString& devicePath) const;
|
||||
|
||||
///
|
||||
/// @brief Get a map of 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> getDeviceInputs(const QString& devicePath) const;
|
||||
|
||||
///
|
||||
/// @brief Get a list of available device video standards depends on device input
|
||||
/// @param devicePath The device path
|
||||
/// @param inputIndex The device input index
|
||||
/// @return List of video standards on success else empty List
|
||||
///
|
||||
virtual QList<VideoStandard> getAvailableDeviceStandards(const QString& devicePath, const int& deviceInput) const;
|
||||
|
||||
///
|
||||
/// @brief Get a list of all available device encoding formats depends on device input
|
||||
/// @param devicePath The device path
|
||||
/// @param inputIndex The device input index
|
||||
/// @return List of device encoding formats on success else empty List
|
||||
///
|
||||
virtual QStringList getAvailableEncodingFormats(const QString& devicePath, const int& deviceInput) const;
|
||||
|
||||
///
|
||||
/// @brief Get a map of available device resolutions (width/heigth) depends on device input and encoding format
|
||||
/// @param devicePath The device path
|
||||
/// @param inputIndex The device input index
|
||||
/// @param encFormat The device encoding format
|
||||
/// @return Map of resolutions (width/heigth) on success else empty List
|
||||
///
|
||||
virtual QMultiMap<int, int> getAvailableDeviceResolutions(const QString& devicePath, const int& deviceInput, const PixelFormat& encFormat) const;
|
||||
|
||||
///
|
||||
/// @brief Get a list of available device framerates depends on device input, encoding format and resolution
|
||||
/// @param devicePath The device path
|
||||
/// @param inputIndex The device input index
|
||||
/// @param encFormat The device encoding format
|
||||
/// @param width The device width
|
||||
/// @param heigth The device heigth
|
||||
/// @return List of framerates on success else empty List
|
||||
///
|
||||
virtual QIntList getAvailableDeviceFramerates(const QString& devicePath, const int& deviceInput, const PixelFormat& encFormat, const unsigned width, const unsigned height) const;
|
||||
|
||||
///
|
||||
/// @brief Get active grabber name
|
||||
/// @param hyperionInd The instance index
|
||||
@@ -155,6 +99,12 @@ public slots:
|
||||
///
|
||||
virtual void setVideoMode(VideoMode videoMode);
|
||||
|
||||
///
|
||||
/// Set the Flip mode
|
||||
/// @param flipMode The new flip mode
|
||||
///
|
||||
virtual void setFlipMode(QString flipMode);
|
||||
|
||||
///
|
||||
/// Set the crop values
|
||||
/// @param cropLeft Left pixel crop
|
||||
@@ -166,7 +116,7 @@ public slots:
|
||||
|
||||
///
|
||||
/// @brief Handle settings update from HyperionDaemon Settingsmanager emit
|
||||
/// @param type settingyType from enum
|
||||
/// @param type settingsType from enum
|
||||
/// @param config configuration object
|
||||
///
|
||||
virtual void handleSettingsUpdate(settings::type type, const QJsonDocument& config);
|
||||
@@ -189,6 +139,22 @@ private slots:
|
||||
void updateTimer(int interval);
|
||||
|
||||
protected:
|
||||
|
||||
///
|
||||
/// @brief Opens the input device.
|
||||
///
|
||||
/// @return True, on success (i.e. device is ready)
|
||||
///
|
||||
virtual bool open() { return true; }
|
||||
|
||||
///
|
||||
/// @brief Closes the input device.
|
||||
///
|
||||
/// @return True on success (i.e. device is closed)
|
||||
///
|
||||
virtual bool close() { return true; }
|
||||
|
||||
|
||||
QString _grabberName;
|
||||
|
||||
/// The timer for generating events with the specified update rate
|
||||
|
@@ -26,6 +26,7 @@
|
||||
|
||||
// Effect engine includes
|
||||
#include <effectengine/EffectDefinition.h>
|
||||
#include <effectengine/Effect.h>
|
||||
#include <effectengine/ActiveEffectDefinition.h>
|
||||
#include <effectengine/EffectSchema.h>
|
||||
|
||||
@@ -217,7 +218,7 @@ public slots:
|
||||
/// @param effectName Name of the effec to run
|
||||
/// @param priority The priority channel of the effect
|
||||
/// @param timeout The timeout of the effect (after the timout, the effect will be cleared)
|
||||
int setEffect(const QString & effectName, int priority, int timeout = -1, const QString & origin="System");
|
||||
int setEffect(const QString & effectName, int priority, int timeout = Effect::ENDLESS, const QString & origin="System");
|
||||
|
||||
/// Run the specified effect on the given priority channel and optionally specify a timeout
|
||||
/// @param effectName Name of the effec to run
|
||||
@@ -227,7 +228,7 @@ public slots:
|
||||
int setEffect(const QString &effectName
|
||||
, const QJsonObject &args
|
||||
, int priority
|
||||
, int timeout = -1
|
||||
, int timeout = Effect::ENDLESS
|
||||
, const QString &pythonScript = ""
|
||||
, const QString &origin="System"
|
||||
, const QString &imageData = ""
|
||||
|
@@ -54,6 +54,9 @@ public:
|
||||
QString owner;
|
||||
};
|
||||
|
||||
//Foreground and Background priorities
|
||||
const static int FG_PRIORITY;
|
||||
const static int BG_PRIORITY;
|
||||
/// The lowest possible priority, which is used when no priority channels are active
|
||||
const static int LOWEST_PRIORITY;
|
||||
|
||||
|
Reference in New Issue
Block a user