diff --git a/assets/webconfig/i18n/de.json b/assets/webconfig/i18n/de.json index 771add89..fb8241f1 100644 --- a/assets/webconfig/i18n/de.json +++ b/assets/webconfig/i18n/de.json @@ -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)", diff --git a/assets/webconfig/i18n/en.json b/assets/webconfig/i18n/en.json index a0046765..d063c41a 100644 --- a/assets/webconfig/i18n/en.json +++ b/assets/webconfig/i18n/en.json @@ -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)", diff --git a/config/hyperion.config.json.commented b/config/hyperion.config.json.commented index 001c62c5..b387dbd0 100644 --- a/config/hyperion.config.json.commented +++ b/config/hyperion.config.json.commented @@ -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 diff --git a/config/hyperion.config.json.default b/config/hyperion.config.json.default index 3a9c67c5..d863fb0d 100644 --- a/config/hyperion.config.json.default +++ b/config/hyperion.config.json.default @@ -147,7 +147,7 @@ { "enable" : false, "port" : 19333, - "priority" : 201 + "priority" : 128 }, "udpListener" : diff --git a/include/grabber/V4L2Grabber.h b/include/grabber/V4L2Grabber.h index 6dde7b35..f76c00ed 100644 --- a/include/grabber/V4L2Grabber.h +++ b/include/grabber/V4L2Grabber.h @@ -105,7 +105,7 @@ private: bool init(); void uninit(); - void open_device(); + bool open_device(); void close_device(); diff --git a/libsrc/boblightserver/BoblightClientConnection.cpp b/libsrc/boblightserver/BoblightClientConnection.cpp index 92828df2..40bd1c38 100644 --- a/libsrc/boblightserver/BoblightClientConnection.cpp +++ b/libsrc/boblightserver/BoblightClientConnection.cpp @@ -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; diff --git a/libsrc/grabber/v4l2/V4L2Grabber.cpp b/libsrc/grabber/v4l2/V4L2Grabber.cpp index 1a46c029..69a72bda 100644 --- a/libsrc/grabber/v4l2/V4L2Grabber.cpp +++ b/libsrc/grabber/v4l2/V4L2Grabber.cpp @@ -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) { diff --git a/libsrc/hyperion/schema/schema-boblightServer.json b/libsrc/hyperion/schema/schema-boblightServer.json index 04e74161..c5817732 100644 --- a/libsrc/hyperion/schema/schema-boblightServer.json +++ b/libsrc/hyperion/schema/schema-boblightServer.json @@ -25,7 +25,7 @@ "title" : "edt_conf_general_priority_title", "minimum" : 100, "maximum" : 254, - "default" : 201, + "default" : 128, "propertyOrder" : 3 } }, diff --git a/libsrc/hyperion/schema/schema-forwarder.json b/libsrc/hyperion/schema/schema-forwarder.json index 9ee2d67b..283ec40a 100644 --- a/libsrc/hyperion/schema/schema-forwarder.json +++ b/libsrc/hyperion/schema/schema-forwarder.json @@ -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" diff --git a/libsrc/hyperion/schema/schema-framegrabber.json b/libsrc/hyperion/schema/schema-framegrabber.json index c616c0bc..a5836485 100644 --- a/libsrc/hyperion/schema/schema-framegrabber.json +++ b/libsrc/hyperion/schema/schema-framegrabber.json @@ -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 }, diff --git a/libsrc/hyperion/schema/schema-leds.json b/libsrc/hyperion/schema/schema-leds.json index 146d77bc..c4557e74 100644 --- a/libsrc/hyperion/schema/schema-leds.json +++ b/libsrc/hyperion/schema/schema-leds.json @@ -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