Boblight fix

- The default Boblight priority has been set to 128. If the sent priority differs from the default priority, it is registered (https://hyperion-project.org/threads/hyperion-ng-enigmalight-boblight-server.3558/#post-15006)
- Submodule flatbuffer updated to current master

Signed-off-by: Paulchen-Panther <16664240+Paulchen-Panther@users.noreply.github.com>
This commit is contained in:
Paulchen-Panther 2019-05-26 14:25:37 +02:00 committed by Paulchen-Panther
parent 97c03f3653
commit fe204a8a33
No known key found for this signature in database
GPG Key ID: 84E3B692456B6840
11 changed files with 50 additions and 24 deletions

View File

@ -432,6 +432,7 @@
"edt_conf_enum_bbdefault" : "Standard",
"edt_conf_enum_bbclassic" : "Klassisch",
"edt_conf_enum_bbosd" : "OSD",
"edt_conf_enum_automatic" : "Automatisch",
"edt_conf_gen_heading_title" : "Allgemeine Einstellungen",
"edt_conf_gen_name_title" : "Name der Konfiguration",
"edt_conf_gen_name_expl" : "Der Name wird verwendet, um Hyperion besser zu identifizieren. (Hilfreich bei mehreren Instanzen)",

View File

@ -433,6 +433,7 @@
"edt_conf_enum_bbdefault" : "Default",
"edt_conf_enum_bbclassic" : "Classic",
"edt_conf_enum_bbosd" : "OSD",
"edt_conf_enum_automatic" : "Automatic",
"edt_conf_gen_heading_title" : "General Settings",
"edt_conf_gen_name_title" : "Configuration name",
"edt_conf_gen_name_expl" : "A user defined name which is used to detect Hyperion. (Helpful with more than one Hyperion instance)",

View File

@ -253,12 +253,12 @@
/// The configuration of the boblight server which enables the boblight remote interface
/// * enable : Enable or disable the boblight server (true/false)
/// * port : Port at which the boblight server is started
/// * priority : Priority of the boblight server (Default=201) HINT: lower value result in HIGHER priority!
/// * priority : Priority of the boblight server (Default=128) HINT: lower value result in HIGHER priority!
"boblightServer" :
{
"enable" : false,
"port" : 19333,
"priority" : 201
"priority" : 128
},
/// The configuration of the udp listener

View File

@ -147,7 +147,7 @@
{
"enable" : false,
"port" : 19333,
"priority" : 201
"priority" : 128
},
"udpListener" :

View File

@ -105,7 +105,7 @@ private:
bool init();
void uninit();
void open_device();
bool open_device();
void close_device();

View File

@ -192,6 +192,9 @@ void BoblightClientConnection::handleMessage(const QString & message)
{
// clear the current channel
_hyperion->clear(_priority);
// register new priority
_hyperion->registerInput(prio, hyperion::COMP_BOBLIGHTSERVER, QString("Boblight@%1").arg(_socket->peerAddress().toString()));
}
_priority = prio;

View File

@ -23,8 +23,6 @@
#include "grabber/V4L2Grabber.h"
using namespace hyperion;
#define CLEAR(x) memset(&(x), 0, sizeof(x))
V4L2Grabber::V4L2Grabber(const QString & device
@ -140,10 +138,12 @@ bool V4L2Grabber::init()
// do not init with unknown device
if(_deviceName != "unknown")
{
open_device();
opened = true;
init_device(_videoStandard, _input);
_initialized = true;
if (open_device())
{
opened = true;
init_device(_videoStandard, _input);
_initialized = true;
}
}
}
catch(std::exception& e)
@ -239,20 +239,20 @@ void V4L2Grabber::stop()
}
}
void V4L2Grabber::open_device()
bool V4L2Grabber::open_device()
{
struct stat st;
if (-1 == stat(QSTRING_CSTR(_deviceName), &st))
{
throw_errno_exception("Cannot identify '" + _deviceName + "'");
return;
return false;
}
if (!S_ISCHR(st.st_mode))
{
throw_exception("'" + _deviceName + "' is no device");
return;
return false;
}
_fileDescriptor = open(QSTRING_CSTR(_deviceName), O_RDWR | O_NONBLOCK, 0);
@ -260,13 +260,14 @@ void V4L2Grabber::open_device()
if (-1 == _fileDescriptor)
{
throw_errno_exception("Cannot open '" + _deviceName + "'");
return;
return false;
}
// create the notifier for when a new frame is available
_streamNotifier = new QSocketNotifier(_fileDescriptor, QSocketNotifier::Read);
_streamNotifier->setEnabled(false);
connect(_streamNotifier, SIGNAL(activated(int)), this, SLOT(read_frame()));
return true;
}
void V4L2Grabber::close_device()
@ -1006,7 +1007,7 @@ void V4L2Grabber::process_image(const uint8_t * data, int size)
delete _decompress;
delete _error;
if (imageFrame.isNull())
if (imageFrame.isNull() || _error->pub.num_warnings > 0)
return;
QRect rect(_cropLeft, _cropTop, imageFrame.width() - _cropLeft - _cropRight, imageFrame.height() - _cropTop - _cropBottom);
@ -1132,9 +1133,9 @@ void V4L2Grabber::setDeviceVideoStandard(QString device, VideoStandard videoStan
}
}
void V4L2Grabber::componentStateChanged(const Components component, bool enable)
void V4L2Grabber::componentStateChanged(const hyperion::Components component, bool enable)
{
if (component == COMP_V4L)
if (component == hyperion::COMP_V4L)
{
if (_initialized != enable)
{

View File

@ -25,7 +25,7 @@
"title" : "edt_conf_general_priority_title",
"minimum" : 100,
"maximum" : 254,
"default" : 201,
"default" : 128,
"propertyOrder" : 3
}
},

View File

@ -8,6 +8,8 @@
{
"type" : "boolean",
"title" : "edt_conf_general_enable_title",
"required" : true,
"default" : false,
"propertyOrder" : 1
},
"json" :
@ -15,6 +17,7 @@
"type" : "array",
"title" : "edt_conf_fw_json_title",
"required" : true,
"default" : ["127.0.0.1:19446"],
"items" : {
"type": "string",
"title" : "edt_conf_fw_json_itemtitle"
@ -25,6 +28,8 @@
{
"type" : "array",
"title" : "edt_conf_fw_proto_title",
"required" : true,
"default" : ["127.0.0.1:19401"],
"items" : {
"type": "string",
"title" : "edt_conf_fw_proto_itemtitle"

View File

@ -8,6 +8,10 @@
"type" : "string",
"title" : "edt_conf_fg_type_title",
"enum" : ["auto","dispmanx","amlogic","x11","framebuffer","qt"],
"options":
{
"enum_titles": ["edt_conf_enum_automatic","DispmanX","AMLogic","X11","Framebuffer","QT"]
},
"default" : "auto",
"propertyOrder" : 2
},

View File

@ -5,12 +5,14 @@
"items":
{
"type":"object",
"required" : true,
"properties":
{
"index":
{
"type":"integer",
"required":true
"required":true,
"default" : 0
},
"clone":
{
@ -19,6 +21,7 @@
"hscan":
{
"type":"object",
"required" : true,
"properties":
{
"minimum":
@ -26,14 +29,16 @@
"type":"number",
"minimum" : 0,
"maximum" : 1,
"required":true
"required":true,
"default" : 0
},
"maximum":
{
"type":"number",
"minimum" : 0,
"maximum" : 1,
"required":true
"required":true,
"default" : 0.1
}
},
"additionalProperties" : false
@ -41,6 +46,7 @@
"vscan":
{
"type":"object",
"required" : true,
"properties":
{
"minimum":
@ -48,14 +54,16 @@
"type":"number",
"minimum" : 0,
"maximum" : 1,
"required":true
"required":true,
"default" : 0
},
"maximum":
{
"type":"number",
"minimum" : 0,
"maximum" : 1,
"required":true
"required":true,
"default" : 0.1
}
},
"additionalProperties" : false
@ -63,7 +71,10 @@
"colorOrder":
{
"type": "string",
"enum" : ["rgb", "bgr", "rbg", "brg", "gbr", "grb"]
"enum" : ["rgb", "bgr", "rbg", "brg", "gbr", "grb"],
"options" : {
"enum_titles" : ["edt_conf_enum_rgb", "edt_conf_enum_bgr", "edt_conf_enum_rbg", "edt_conf_enum_brg", "edt_conf_enum_gbr", "edt_conf_enum_grb"]
}
}
},
"additionalProperties" : false