mirror of
				https://github.com/hyperion-project/hyperion.ng.git
				synced 2025-03-01 10:33:28 +00:00 
			
		
		
		
	make all prios settable and make prios more consistent
Former-commit-id: f1d1c35063e98389d627f3535d2a94da33a22da4
This commit is contained in:
		@@ -406,7 +406,7 @@
 | 
			
		||||
		"color"       : [0,0,0],
 | 
			
		||||
		"effect"      : "Rainbow swirl fast",
 | 
			
		||||
		"duration_ms" : 3000,
 | 
			
		||||
		"priority"    : 0
 | 
			
		||||
		"priority"    : 990
 | 
			
		||||
	},
 | 
			
		||||
 | 
			
		||||
	///  The configuration for the frame-grabber, contains the following items: 
 | 
			
		||||
@@ -415,9 +415,10 @@
 | 
			
		||||
	///   * frequency_Hz : The frequency of the frame grab [Hz]
 | 
			
		||||
	"framegrabber" : 
 | 
			
		||||
	{
 | 
			
		||||
		"width" : 64,
 | 
			
		||||
		"height" : 64,
 | 
			
		||||
		"frequency_Hz" : 10.0
 | 
			
		||||
		"width"        : 64,
 | 
			
		||||
		"height"       : 64,
 | 
			
		||||
		"frequency_Hz" : 10.0,
 | 
			
		||||
		"priority"     : 900
 | 
			
		||||
	},
 | 
			
		||||
 | 
			
		||||
	/// The configuration of the XBMC connection used to enable and disable the frame-grabber. Contains the following fields: 
 | 
			
		||||
@@ -459,7 +460,8 @@
 | 
			
		||||
	///  * port : Port at which the boblight server is started
 | 
			
		||||
// 	"boblightServer" : 
 | 
			
		||||
// 	{
 | 
			
		||||
// 		"port" : 19333
 | 
			
		||||
// 		"port"     : 19333,
 | 
			
		||||
//		"priority" : 900
 | 
			
		||||
// 	},
 | 
			
		||||
 | 
			
		||||
	"endOfJson" : "endOfJson"
 | 
			
		||||
 
 | 
			
		||||
@@ -391,19 +391,20 @@
 | 
			
		||||
		"color"       : [0,0,0],
 | 
			
		||||
		"effect"      : "Rainbow swirl fast",
 | 
			
		||||
		"duration_ms" : 3000,
 | 
			
		||||
		"priority"    : 900
 | 
			
		||||
		"priority"    : 990
 | 
			
		||||
	},
 | 
			
		||||
 | 
			
		||||
	///  The configuration for the frame-grabber, contains the following items: 
 | 
			
		||||
	///   * width        : The width of the grabbed frames [pixels]
 | 
			
		||||
	///   * height       : The height of the grabbed frames [pixels]
 | 
			
		||||
	///   * frequency_Hz : The frequency of the frame grab [Hz]
 | 
			
		||||
// 	"framegrabber" : 
 | 
			
		||||
// 	{
 | 
			
		||||
// 		"width" : 64,
 | 
			
		||||
// 		"height" : 64,
 | 
			
		||||
// 		"frequency_Hz" : 10.0
 | 
			
		||||
// 	},
 | 
			
		||||
///	"framegrabber" : 
 | 
			
		||||
///	{
 | 
			
		||||
///		"width"        : 64,
 | 
			
		||||
///		"height"       : 64,
 | 
			
		||||
///		"frequency_Hz" : 10.0,
 | 
			
		||||
///		"priority"     : 900
 | 
			
		||||
///	},
 | 
			
		||||
 | 
			
		||||
	/// The configuration of the XBMC connection used to enable and disable the frame-grabber. Contains the following fields: 
 | 
			
		||||
	///  * xbmcAddress       : The IP address of the XBMC-host
 | 
			
		||||
@@ -444,7 +445,8 @@
 | 
			
		||||
	///  * port : Port at which the boblight server is started
 | 
			
		||||
// 	"boblightServer" : 
 | 
			
		||||
// 	{
 | 
			
		||||
// 		"port" : 19333
 | 
			
		||||
// 		"port" : 19333,
 | 
			
		||||
//		"priority" : 900
 | 
			
		||||
// 	},
 | 
			
		||||
 | 
			
		||||
	"endOfJson" : "endOfJson"
 | 
			
		||||
 
 | 
			
		||||
@@ -25,7 +25,7 @@ public:
 | 
			
		||||
	/// @param hyperion Hyperion instance
 | 
			
		||||
	/// @param port port number on which to start listening for connections
 | 
			
		||||
	///
 | 
			
		||||
	BoblightServer(Hyperion * hyperion, uint16_t port = 19333);
 | 
			
		||||
	BoblightServer(Hyperion * hyperion, const int priority, uint16_t port = 19333);
 | 
			
		||||
	~BoblightServer();
 | 
			
		||||
 | 
			
		||||
	///
 | 
			
		||||
@@ -54,4 +54,7 @@ private:
 | 
			
		||||
 | 
			
		||||
	/// List with open connections
 | 
			
		||||
	QSet<BoblightClientConnection *> _openConnections;
 | 
			
		||||
 | 
			
		||||
	/// hyperion priority
 | 
			
		||||
	const int _priority;
 | 
			
		||||
};
 | 
			
		||||
 
 | 
			
		||||
@@ -33,7 +33,7 @@ public:
 | 
			
		||||
	/// @param[in] updateRate_Hz  The image grab rate [Hz]
 | 
			
		||||
	/// @param[in] hyperion  The instance of Hyperion used to write the led values
 | 
			
		||||
	///
 | 
			
		||||
	AmlogicWrapper(const unsigned grabWidth, const unsigned grabHeight, const unsigned updateRate_Hz, Hyperion * hyperion);
 | 
			
		||||
	AmlogicWrapper(const unsigned grabWidth, const unsigned grabHeight, const unsigned updateRate_Hz, const int priority, Hyperion * hyperion);
 | 
			
		||||
 | 
			
		||||
	///
 | 
			
		||||
	/// Destructor of this dispmanx frame grabber. Releases any claimed resources.
 | 
			
		||||
 
 | 
			
		||||
@@ -33,7 +33,7 @@ public:
 | 
			
		||||
	/// @param[in] updateRate_Hz  The image grab rate [Hz]
 | 
			
		||||
	/// @param[in] hyperion  The instance of Hyperion used to write the led values
 | 
			
		||||
	///
 | 
			
		||||
	DispmanxWrapper(const unsigned grabWidth, const unsigned grabHeight, const unsigned updateRate_Hz, Hyperion * hyperion);
 | 
			
		||||
	DispmanxWrapper(const unsigned grabWidth, const unsigned grabHeight, const unsigned updateRate_Hz, const int priority, Hyperion * hyperion);
 | 
			
		||||
 | 
			
		||||
	///
 | 
			
		||||
	/// Destructor of this dispmanx frame grabber. Releases any claimed resources.
 | 
			
		||||
 
 | 
			
		||||
@@ -33,7 +33,7 @@ public:
 | 
			
		||||
	/// @param[in] updateRate_Hz  The image grab rate [Hz]
 | 
			
		||||
	/// @param[in] hyperion  The instance of Hyperion used to write the led values
 | 
			
		||||
	///
 | 
			
		||||
	FramebufferWrapper(const std::string & device, const unsigned grabWidth, const unsigned grabHeight, const unsigned updateRate_Hz, Hyperion * hyperion);
 | 
			
		||||
	FramebufferWrapper(const std::string & device, const unsigned grabWidth, const unsigned grabHeight, const unsigned updateRate_Hz, const int priority, Hyperion * hyperion);
 | 
			
		||||
 | 
			
		||||
	///
 | 
			
		||||
	/// Destructor of this framebuffer frame grabber. Releases any claimed resources.
 | 
			
		||||
 
 | 
			
		||||
@@ -34,7 +34,7 @@ public:
 | 
			
		||||
	/// @param[in] updateRate_Hz  The image grab rate [Hz]
 | 
			
		||||
	/// @param[in] hyperion  The instance of Hyperion used to write the led values
 | 
			
		||||
	///
 | 
			
		||||
	OsxWrapper(const unsigned display, const unsigned grabWidth, const unsigned grabHeight, const unsigned updateRate_Hz, Hyperion * hyperion);
 | 
			
		||||
	OsxWrapper(const unsigned display, const unsigned grabWidth, const unsigned grabHeight, const unsigned updateRate_Hz, const int priority, Hyperion * hyperion);
 | 
			
		||||
 | 
			
		||||
	///
 | 
			
		||||
	/// Destructor of this osx frame grabber. Releases any claimed resources.
 | 
			
		||||
 
 | 
			
		||||
@@ -21,14 +21,14 @@
 | 
			
		||||
// project includes
 | 
			
		||||
#include "BoblightClientConnection.h"
 | 
			
		||||
 | 
			
		||||
BoblightClientConnection::BoblightClientConnection(QTcpSocket *socket, Hyperion * hyperion) :
 | 
			
		||||
BoblightClientConnection::BoblightClientConnection(QTcpSocket *socket, const int priority, Hyperion * hyperion) :
 | 
			
		||||
	QObject(),
 | 
			
		||||
	_locale(QLocale::C),
 | 
			
		||||
	_socket(socket),
 | 
			
		||||
	_imageProcessor(ImageProcessorFactory::getInstance().newImageProcessor()),
 | 
			
		||||
	_hyperion(hyperion),
 | 
			
		||||
	_receiveBuffer(),
 | 
			
		||||
	_priority(255),
 | 
			
		||||
	_priority(priority),
 | 
			
		||||
	_ledColors(hyperion->getLedCount(), ColorRgb::BLACK)
 | 
			
		||||
{
 | 
			
		||||
	// initalize the locale. Start with the default C-locale
 | 
			
		||||
 
 | 
			
		||||
@@ -26,7 +26,7 @@ public:
 | 
			
		||||
	/// @param socket The Socket object for this connection
 | 
			
		||||
	/// @param hyperion The Hyperion server
 | 
			
		||||
	///
 | 
			
		||||
	BoblightClientConnection(QTcpSocket * socket, Hyperion * hyperion);
 | 
			
		||||
	BoblightClientConnection(QTcpSocket * socket, const int priority, Hyperion * hyperion);
 | 
			
		||||
 | 
			
		||||
	///
 | 
			
		||||
	/// Destructor
 | 
			
		||||
 
 | 
			
		||||
@@ -5,11 +5,12 @@
 | 
			
		||||
#include <boblightserver/BoblightServer.h>
 | 
			
		||||
#include "BoblightClientConnection.h"
 | 
			
		||||
 | 
			
		||||
BoblightServer::BoblightServer(Hyperion *hyperion, uint16_t port) :
 | 
			
		||||
BoblightServer::BoblightServer(Hyperion *hyperion, const int priority,uint16_t port) :
 | 
			
		||||
	QObject(),
 | 
			
		||||
	_hyperion(hyperion),
 | 
			
		||||
	_server(),
 | 
			
		||||
	_openConnections()
 | 
			
		||||
	_openConnections(),
 | 
			
		||||
	_priority(priority)
 | 
			
		||||
{
 | 
			
		||||
	if (!_server.listen(QHostAddress::Any, port))
 | 
			
		||||
	{
 | 
			
		||||
@@ -39,7 +40,7 @@ void BoblightServer::newConnection()
 | 
			
		||||
	if (socket != nullptr)
 | 
			
		||||
	{
 | 
			
		||||
		std::cout << "New boblight connection" << std::endl;
 | 
			
		||||
		BoblightClientConnection * connection = new BoblightClientConnection(socket, _hyperion);
 | 
			
		||||
		BoblightClientConnection * connection = new BoblightClientConnection(socket, _priority, _hyperion);
 | 
			
		||||
		_openConnections.insert(connection);
 | 
			
		||||
 | 
			
		||||
		// register slot for cleaning up after the connection closed
 | 
			
		||||
 
 | 
			
		||||
@@ -12,10 +12,10 @@
 | 
			
		||||
#include <grabber/AmlogicGrabber.h>
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
AmlogicWrapper::AmlogicWrapper(const unsigned grabWidth, const unsigned grabHeight, const unsigned updateRate_Hz, Hyperion * hyperion) :
 | 
			
		||||
AmlogicWrapper::AmlogicWrapper(const unsigned grabWidth, const unsigned grabHeight, const unsigned updateRate_Hz, const int priority, Hyperion * hyperion) :
 | 
			
		||||
	_updateInterval_ms(1000/updateRate_Hz),
 | 
			
		||||
	_timeout_ms(2 * _updateInterval_ms),
 | 
			
		||||
	_priority(999),
 | 
			
		||||
	_priority(priority),
 | 
			
		||||
	_timer(),
 | 
			
		||||
	_image(grabWidth, grabHeight),
 | 
			
		||||
	_frameGrabber(new AmlogicGrabber(grabWidth, grabHeight)),
 | 
			
		||||
 
 | 
			
		||||
@@ -12,10 +12,10 @@
 | 
			
		||||
#include <grabber/DispmanxFrameGrabber.h>
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
DispmanxWrapper::DispmanxWrapper(const unsigned grabWidth, const unsigned grabHeight, const unsigned updateRate_Hz, Hyperion * hyperion) :
 | 
			
		||||
DispmanxWrapper::DispmanxWrapper(const unsigned grabWidth, const unsigned grabHeight, const unsigned updateRate_Hz, const int priority, Hyperion * hyperion) :
 | 
			
		||||
	_updateInterval_ms(1000/updateRate_Hz),
 | 
			
		||||
	_timeout_ms(2 * _updateInterval_ms),
 | 
			
		||||
	_priority(1000),
 | 
			
		||||
	_priority(priority),
 | 
			
		||||
	_timer(),
 | 
			
		||||
	_image(grabWidth, grabHeight),
 | 
			
		||||
	_frameGrabber(new DispmanxFrameGrabber(grabWidth, grabHeight)),
 | 
			
		||||
 
 | 
			
		||||
@@ -7,10 +7,10 @@
 | 
			
		||||
#include <grabber/FramebufferWrapper.h>
 | 
			
		||||
#include "FramebufferFrameGrabber.h"
 | 
			
		||||
 | 
			
		||||
FramebufferWrapper::FramebufferWrapper(const std::string & device, const unsigned grabWidth, const unsigned grabHeight, const unsigned updateRate_Hz, Hyperion * hyperion) :
 | 
			
		||||
FramebufferWrapper::FramebufferWrapper(const std::string & device, const unsigned grabWidth, const unsigned grabHeight, const unsigned updateRate_Hz, const int priority, Hyperion * hyperion) :
 | 
			
		||||
	_updateInterval_ms(1000/updateRate_Hz),
 | 
			
		||||
	_timeout_ms(2 * _updateInterval_ms),
 | 
			
		||||
	_priority(1000),
 | 
			
		||||
	_priority(priority),
 | 
			
		||||
	_timer(),
 | 
			
		||||
	_image(grabWidth, grabHeight),
 | 
			
		||||
	_frameGrabber(new FramebufferFrameGrabber(device, grabWidth, grabHeight)),
 | 
			
		||||
 
 | 
			
		||||
@@ -7,10 +7,10 @@
 | 
			
		||||
#include <grabber/OsxWrapper.h>
 | 
			
		||||
#include "OsxFrameGrabber.h"
 | 
			
		||||
 | 
			
		||||
OsxWrapper::OsxWrapper(const unsigned display, const unsigned grabWidth, const unsigned grabHeight, const unsigned updateRate_Hz, Hyperion * hyperion) :
 | 
			
		||||
OsxWrapper::OsxWrapper(const unsigned display, const unsigned grabWidth, const unsigned grabHeight, const unsigned updateRate_Hz, const int priority, Hyperion * hyperion) :
 | 
			
		||||
	_updateInterval_ms(1000/updateRate_Hz),
 | 
			
		||||
	_timeout_ms(2 * _updateInterval_ms),
 | 
			
		||||
	_priority(1000),
 | 
			
		||||
	_priority(priority),
 | 
			
		||||
	_timer(),
 | 
			
		||||
	_image(grabWidth, grabHeight),
 | 
			
		||||
	_frameGrabber(new OsxFrameGrabber(display, grabWidth, grabHeight)),
 | 
			
		||||
 
 | 
			
		||||
@@ -127,7 +127,7 @@ int main(int argc, char** argv)
 | 
			
		||||
		// Get the parameters for the bootsequence
 | 
			
		||||
		const std::string effectName = effectConfig["effect"].asString();
 | 
			
		||||
		const unsigned duration_ms   = effectConfig["duration_ms"].asUInt();
 | 
			
		||||
		const int priority           = effectConfig["priority"].asUInt();
 | 
			
		||||
		const int priority           = effectConfig.get("priority",990).asInt();
 | 
			
		||||
		const int bootcolor_priority = (priority > 990) ? priority+1 : 990;
 | 
			
		||||
 | 
			
		||||
		if ( ! effectConfig["color"].isNull() && effectConfig["color"].isArray() && effectConfig["color"].size() == 3 )
 | 
			
		||||
@@ -216,7 +216,7 @@ int main(int argc, char** argv)
 | 
			
		||||
	if (config.isMember("boblightServer"))
 | 
			
		||||
	{
 | 
			
		||||
		const Json::Value & boblightServerConfig = config["boblightServer"];
 | 
			
		||||
		boblightServer = new BoblightServer(&hyperion, boblightServerConfig["port"].asUInt());
 | 
			
		||||
		boblightServer = new BoblightServer(&hyperion, boblightServerConfig.get("priority",900).asInt(), boblightServerConfig["port"].asUInt());
 | 
			
		||||
		std::cout << "Boblight server created and started on port " << boblightServer->getPort() << std::endl;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
@@ -232,6 +232,7 @@ int main(int argc, char** argv)
 | 
			
		||||
			frameGrabberConfig["width"].asUInt(),
 | 
			
		||||
			frameGrabberConfig["height"].asUInt(),
 | 
			
		||||
			frameGrabberConfig["frequency_Hz"].asUInt(),
 | 
			
		||||
			frameGrabberConfig.get("priority",900).asInt(),
 | 
			
		||||
			&hyperion);
 | 
			
		||||
 | 
			
		||||
		if (xbmcVideoChecker != nullptr)
 | 
			
		||||
@@ -275,7 +276,7 @@ int main(int argc, char** argv)
 | 
			
		||||
					grabberConfig.get("greenSignalThreshold", 0.0).asDouble(),
 | 
			
		||||
					grabberConfig.get("blueSignalThreshold", 0.0).asDouble(),
 | 
			
		||||
					&hyperion,
 | 
			
		||||
					grabberConfig.get("priority", 800).asInt());
 | 
			
		||||
					grabberConfig.get("priority", 900).asInt());
 | 
			
		||||
		v4l2Grabber->set3D(parse3DMode(grabberConfig.get("mode", "2D").asString()));
 | 
			
		||||
		v4l2Grabber->setCropping(
 | 
			
		||||
					grabberConfig.get("cropLeft", 0).asInt(),
 | 
			
		||||
@@ -308,6 +309,7 @@ int main(int argc, char** argv)
 | 
			
		||||
			grabberConfig["width"].asUInt(),
 | 
			
		||||
			grabberConfig["height"].asUInt(),
 | 
			
		||||
			grabberConfig["frequency_Hz"].asUInt(),
 | 
			
		||||
			grabberConfig.get("priority",900).asInt(),
 | 
			
		||||
			&hyperion);
 | 
			
		||||
 | 
			
		||||
		if (xbmcVideoChecker != nullptr)
 | 
			
		||||
@@ -341,6 +343,7 @@ int main(int argc, char** argv)
 | 
			
		||||
			grabberConfig["width"].asUInt(),
 | 
			
		||||
			grabberConfig["height"].asUInt(),
 | 
			
		||||
			grabberConfig["frequency_Hz"].asUInt(),
 | 
			
		||||
			grabberConfig.get("priority",900).asInt(),
 | 
			
		||||
			&hyperion);
 | 
			
		||||
 | 
			
		||||
		if (xbmcVideoChecker != nullptr)
 | 
			
		||||
@@ -376,11 +379,12 @@ int main(int argc, char** argv)
 | 
			
		||||
	{
 | 
			
		||||
		const Json::Value & grabberConfig = config.isMember("osxgrabber")? config["osxgrabber"] : config["framegrabber"];
 | 
			
		||||
		osxGrabber = new OsxWrapper(
 | 
			
		||||
										   grabberConfig.get("display", 0).asUInt(),
 | 
			
		||||
										   grabberConfig["width"].asUInt(),
 | 
			
		||||
										   grabberConfig["height"].asUInt(),
 | 
			
		||||
										   grabberConfig["frequency_Hz"].asUInt(),
 | 
			
		||||
										   &hyperion);
 | 
			
		||||
									grabberConfig.get("display", 0).asUInt(),
 | 
			
		||||
									grabberConfig["width"].asUInt(),
 | 
			
		||||
									grabberConfig["height"].asUInt(),
 | 
			
		||||
									grabberConfig["frequency_Hz"].asUInt(),
 | 
			
		||||
									grabberConfig.get("priority",900).asInt(),
 | 
			
		||||
									&hyperion );
 | 
			
		||||
 | 
			
		||||
		if (xbmcVideoChecker != nullptr)
 | 
			
		||||
		{
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user