2018-12-27 23:11:32 +01:00
// proj
# include <hyperion/SettingsManager.h>
// util
# include <utils/JsonUtils.h>
2021-11-17 21:30:43 +01:00
# include <utils/QStringUtils.h>
2019-07-12 16:54:26 +02:00
# include <db/SettingsTable.h>
2021-04-24 19:37:29 +02:00
# include "HyperionConfig.h"
2018-12-27 23:11:32 +01:00
// json schema process
# include <utils/jsonschema/QJsonFactory.h>
# include <utils/jsonschema/QJsonSchemaChecker.h>
// write config to filesystem
# include <utils/JsonUtils.h>
2021-04-24 19:37:29 +02:00
# include <utils/version.hpp>
2021-11-17 21:30:43 +01:00
2021-04-24 19:37:29 +02:00
using namespace semver ;
// Constants
namespace {
const char DEFAULT_VERSION [ ] = " 2.0.0-alpha.8 " ;
} //End of constants
2018-12-27 23:11:32 +01:00
QJsonObject SettingsManager : : schemaJson ;
2020-11-01 19:47:30 +01:00
SettingsManager : : SettingsManager ( quint8 instance , QObject * parent , bool readonlyMode )
2019-07-14 22:43:22 +02:00
: QObject ( parent )
2022-01-22 17:48:03 +01:00
, _log ( Logger : : getInstance ( " SETTINGSMGR " , " I " + QString : : number ( instance ) ) )
2021-11-17 21:30:43 +01:00
, _instance ( instance )
, _sTable ( new SettingsTable ( instance , this ) )
, _configVersion ( DEFAULT_VERSION )
, _previousVersion ( DEFAULT_VERSION )
, _readonlyMode ( readonlyMode )
2018-12-27 23:11:32 +01:00
{
2020-11-01 19:47:30 +01:00
_sTable - > setReadonlyMode ( _readonlyMode ) ;
2018-12-27 23:11:32 +01:00
// get schema
2021-11-17 21:30:43 +01:00
if ( schemaJson . isEmpty ( ) )
2018-12-27 23:11:32 +01:00
{
2018-12-30 22:07:53 +01:00
Q_INIT_RESOURCE ( resource ) ;
2018-12-27 23:11:32 +01:00
try
{
schemaJson = QJsonFactory : : readSchema ( " :/hyperion-schema " ) ;
}
2021-11-17 21:30:43 +01:00
catch ( const std : : runtime_error & error )
2018-12-27 23:11:32 +01:00
{
throw std : : runtime_error ( error . what ( ) ) ;
}
}
2019-07-12 16:54:26 +02:00
2018-12-27 23:11:32 +01:00
// get default config
QJsonObject defaultConfig ;
2021-11-17 21:30:43 +01:00
if ( ! JsonUtils : : readFile ( " :/hyperion_default.config " , defaultConfig , _log ) )
2021-04-24 19:37:29 +02:00
{
2018-12-27 23:11:32 +01:00
throw std : : runtime_error ( " Failed to read default config " ) ;
2021-04-24 19:37:29 +02:00
}
2018-12-27 23:11:32 +01:00
2019-07-12 16:54:26 +02:00
// transform json to string lists
2023-09-09 22:10:22 +02:00
const QStringList keyList = defaultConfig . keys ( ) ;
2019-07-12 16:54:26 +02:00
QStringList defValueList ;
2023-09-09 22:10:22 +02:00
for ( const auto & key : keyList )
2018-12-27 23:11:32 +01:00
{
2021-11-17 21:30:43 +01:00
if ( defaultConfig [ key ] . isObject ( ) )
2018-12-27 23:11:32 +01:00
{
2019-07-12 16:54:26 +02:00
defValueList < < QString ( QJsonDocument ( defaultConfig [ key ] . toObject ( ) ) . toJson ( QJsonDocument : : Compact ) ) ;
2018-12-27 23:11:32 +01:00
}
2021-11-17 21:30:43 +01:00
else if ( defaultConfig [ key ] . isArray ( ) )
2018-12-27 23:11:32 +01:00
{
2019-07-12 16:54:26 +02:00
defValueList < < QString ( QJsonDocument ( defaultConfig [ key ] . toArray ( ) ) . toJson ( QJsonDocument : : Compact ) ) ;
2018-12-27 23:11:32 +01:00
}
}
2019-07-12 16:54:26 +02:00
// fill database with default data if required
2023-09-09 22:10:22 +02:00
for ( const auto & key : keyList )
2019-07-12 16:54:26 +02:00
{
QString val = defValueList . takeFirst ( ) ;
// prevent overwrite
2021-11-17 21:30:43 +01:00
if ( ! _sTable - > recordExist ( key ) )
{
_sTable - > createSettingsRecord ( key , val ) ;
}
2019-07-12 16:54:26 +02:00
}
2018-12-27 23:11:32 +01:00
2021-04-24 19:37:29 +02:00
// need to validate all data in database construct the entire data object
2019-07-12 16:54:26 +02:00
// TODO refactor schemaChecker to accept QJsonArray in validate(); QJsonDocument container? To validate them per entry...
QJsonObject dbConfig ;
2023-09-09 22:10:22 +02:00
for ( const auto & key : keyList )
2019-07-12 16:54:26 +02:00
{
QJsonDocument doc = _sTable - > getSettingsRecord ( key ) ;
2021-11-17 21:30:43 +01:00
if ( doc . isArray ( ) )
{
2019-07-12 16:54:26 +02:00
dbConfig [ key ] = doc . array ( ) ;
2021-11-17 21:30:43 +01:00
}
2019-07-12 16:54:26 +02:00
else
2021-11-17 21:30:43 +01:00
{
2019-07-12 16:54:26 +02:00
dbConfig [ key ] = doc . object ( ) ;
2021-11-17 21:30:43 +01:00
}
2019-07-12 16:54:26 +02:00
}
2018-12-27 23:11:32 +01:00
2021-04-24 19:37:29 +02:00
//Check, if database requires migration
bool isNewRelease = false ;
// Use instance independent SettingsManager to track migration status
2021-11-17 21:30:43 +01:00
if ( _instance = = GLOABL_INSTANCE_ID )
2021-04-24 19:37:29 +02:00
{
2021-11-17 21:30:43 +01:00
if ( resolveConfigVersion ( dbConfig ) )
2021-04-24 19:37:29 +02:00
{
QJsonObject newGeneralConfig = dbConfig [ " general " ] . toObject ( ) ;
semver : : version BUILD_VERSION ( HYPERION_VERSION ) ;
2021-10-05 23:22:19 +02:00
if ( ! BUILD_VERSION . isValid ( ) )
{
Error ( _log , " Current Hyperion version [%s] is invalid. Exiting... " , BUILD_VERSION . getVersion ( ) . c_str ( ) ) ;
exit ( 1 ) ;
}
2021-11-17 21:30:43 +01:00
if ( _configVersion > BUILD_VERSION )
2021-04-24 19:37:29 +02:00
{
2021-10-05 23:22:19 +02:00
Error ( _log , " Database version [%s] is greater than current Hyperion version [%s] " , _configVersion . getVersion ( ) . c_str ( ) , BUILD_VERSION . getVersion ( ) . c_str ( ) ) ;
2021-04-24 19:37:29 +02:00
// TODO: Remove version checking and Settingsmanager from components' constructor to be able to stop hyperion.
}
else
{
2021-11-17 21:30:43 +01:00
if ( _previousVersion < BUILD_VERSION )
2021-04-24 19:37:29 +02:00
{
2021-11-17 21:30:43 +01:00
if ( _configVersion = = BUILD_VERSION )
2021-04-24 19:37:29 +02:00
{
newGeneralConfig [ " previousVersion " ] = BUILD_VERSION . getVersion ( ) . c_str ( ) ;
dbConfig [ " general " ] = newGeneralConfig ;
isNewRelease = true ;
Info ( _log , " Migration completed to version [%s] " , BUILD_VERSION . getVersion ( ) . c_str ( ) ) ;
}
else
{
Info ( _log , " Migration from current version [%s] to new version [%s] started " , _previousVersion . getVersion ( ) . c_str ( ) , BUILD_VERSION . getVersion ( ) . c_str ( ) ) ;
newGeneralConfig [ " previousVersion " ] = _configVersion . getVersion ( ) . c_str ( ) ;
newGeneralConfig [ " configVersion " ] = BUILD_VERSION . getVersion ( ) . c_str ( ) ;
dbConfig [ " general " ] = newGeneralConfig ;
isNewRelease = true ;
}
}
}
}
}
2020-02-26 18:54:56 +01:00
// possible data upgrade steps to prevent data loss
2021-04-24 19:37:29 +02:00
bool migrated = handleConfigUpgrade ( dbConfig ) ;
2021-11-17 21:30:43 +01:00
if ( isNewRelease | | migrated )
2020-02-26 18:54:56 +01:00
{
saveSettings ( dbConfig , true ) ;
}
2019-07-12 16:54:26 +02:00
// validate full dbconfig against schema, on error we need to rewrite entire table
QJsonSchemaChecker schemaChecker ;
schemaChecker . setSchema ( schemaJson ) ;
2021-11-17 21:30:43 +01:00
QPair < bool , bool > valid = schemaChecker . validate ( dbConfig ) ;
2019-07-12 16:54:26 +02:00
// check if our main schema syntax is IO
if ( ! valid . second )
2018-12-27 23:11:32 +01:00
{
2021-11-17 21:30:43 +01:00
for ( auto & schemaError : schemaChecker . getMessages ( ) )
{
2018-12-27 23:11:32 +01:00
Error ( _log , " Schema Syntax Error: %s " , QSTRING_CSTR ( schemaError ) ) ;
2021-11-17 21:30:43 +01:00
}
2019-07-12 16:54:26 +02:00
throw std : : runtime_error ( " The config schema has invalid syntax. This should never happen! Go fix it! " ) ;
2018-12-27 23:11:32 +01:00
}
2019-07-12 16:54:26 +02:00
if ( ! valid . first )
2018-12-27 23:11:32 +01:00
{
2021-11-17 21:30:43 +01:00
Info ( _log , " Table upgrade required... " ) ;
2019-07-12 16:54:26 +02:00
dbConfig = schemaChecker . getAutoCorrectedConfig ( dbConfig ) ;
2018-12-27 23:11:32 +01:00
2021-11-17 21:30:43 +01:00
for ( auto & schemaError : schemaChecker . getMessages ( ) )
{
2018-12-27 23:11:32 +01:00
Warning ( _log , " Config Fix: %s " , QSTRING_CSTR ( schemaError ) ) ;
2021-11-17 21:30:43 +01:00
}
2018-12-27 23:11:32 +01:00
2021-11-17 21:30:43 +01:00
saveSettings ( dbConfig , true ) ;
2018-12-27 23:11:32 +01:00
}
2019-07-12 16:54:26 +02:00
else
2021-11-17 21:30:43 +01:00
{
2019-07-12 16:54:26 +02:00
_qconfig = dbConfig ;
2021-11-17 21:30:43 +01:00
}
2018-12-27 23:11:32 +01:00
2021-11-17 21:30:43 +01:00
Debug ( _log , " Settings database initialized " ) ;
2018-12-27 23:11:32 +01:00
}
2020-08-08 13:09:15 +02:00
QJsonDocument SettingsManager : : getSetting ( settings : : type type ) const
2018-12-27 23:11:32 +01:00
{
2019-07-12 16:54:26 +02:00
return _sTable - > getSettingsRecord ( settings : : typeToString ( type ) ) ;
2018-12-27 23:11:32 +01:00
}
2021-02-11 19:45:22 +01:00
QJsonObject SettingsManager : : getSettings ( ) const
{
QJsonObject config ;
2021-11-17 21:30:43 +01:00
for ( const auto & key : _qconfig . keys ( ) )
2021-02-11 19:45:22 +01:00
{
//Read all records from database to ensure that global settings are read across instances
2021-02-17 12:29:53 +01:00
QJsonDocument doc = _sTable - > getSettingsRecord ( key ) ;
2021-11-17 21:30:43 +01:00
if ( doc . isArray ( ) )
2021-02-17 12:29:53 +01:00
{
config . insert ( key , doc . array ( ) ) ;
}
else
{
config . insert ( key , doc . object ( ) ) ;
}
2021-02-11 19:45:22 +01:00
}
return config ;
}
2021-11-17 21:30:43 +01:00
bool SettingsManager : : restoreSettings ( QJsonObject config , bool correct )
2018-12-27 23:11:32 +01:00
{
2020-02-26 18:54:56 +01:00
// optional data upgrades e.g. imported legacy/older configs
2021-11-17 21:30:43 +01:00
handleConfigUpgrade ( config ) ;
return saveSettings ( config , correct ) ;
}
2020-02-26 18:54:56 +01:00
2021-11-17 21:30:43 +01:00
bool SettingsManager : : saveSettings ( QJsonObject config , bool correct )
{
2018-12-27 23:11:32 +01:00
// we need to validate data against schema
QJsonSchemaChecker schemaChecker ;
schemaChecker . setSchema ( schemaJson ) ;
if ( ! schemaChecker . validate ( config ) . first )
{
2021-11-17 21:30:43 +01:00
if ( ! correct )
2018-12-27 23:11:32 +01:00
{
2021-11-17 21:30:43 +01:00
Error ( _log , " Failed to save configuration, errors during validation " ) ;
2018-12-27 23:11:32 +01:00
return false ;
}
2021-11-17 21:30:43 +01:00
Warning ( _log , " Fixing json data! " ) ;
2018-12-27 23:11:32 +01:00
config = schemaChecker . getAutoCorrectedConfig ( config ) ;
2021-11-17 21:30:43 +01:00
for ( const auto & schemaError : schemaChecker . getMessages ( ) )
{
2018-12-27 23:11:32 +01:00
Warning ( _log , " Config Fix: %s " , QSTRING_CSTR ( schemaError ) ) ;
2021-11-17 21:30:43 +01:00
}
2018-12-27 23:11:32 +01:00
}
2019-07-12 16:54:26 +02:00
// store the new config
_qconfig = config ;
2018-12-28 18:12:45 +01:00
2019-07-12 16:54:26 +02:00
// extract keys and data
2023-09-09 22:10:22 +02:00
const QStringList keyList = config . keys ( ) ;
2019-07-12 16:54:26 +02:00
QStringList newValueList ;
2023-09-09 22:10:22 +02:00
for ( const auto & key : keyList )
2019-07-12 16:54:26 +02:00
{
2021-11-17 21:30:43 +01:00
if ( config [ key ] . isObject ( ) )
2019-07-12 16:54:26 +02:00
{
newValueList < < QString ( QJsonDocument ( config [ key ] . toObject ( ) ) . toJson ( QJsonDocument : : Compact ) ) ;
}
2021-11-17 21:30:43 +01:00
else if ( config [ key ] . isArray ( ) )
2019-07-12 16:54:26 +02:00
{
newValueList < < QString ( QJsonDocument ( config [ key ] . toArray ( ) ) . toJson ( QJsonDocument : : Compact ) ) ;
}
2018-12-28 18:12:45 +01:00
}
2021-11-17 21:30:43 +01:00
bool rc = true ;
2019-07-12 16:54:26 +02:00
// compare database data with new data to emit/save changes accordingly
2023-09-09 22:10:22 +02:00
for ( const auto & key : keyList )
2019-07-12 16:54:26 +02:00
{
QString data = newValueList . takeFirst ( ) ;
2021-11-17 21:30:43 +01:00
if ( _sTable - > getSettingsRecordString ( key ) ! = data )
2019-07-12 16:54:26 +02:00
{
2021-11-17 21:30:43 +01:00
if ( ! _sTable - > createSettingsRecord ( key , data ) )
2020-11-01 19:47:30 +01:00
{
rc = false ;
}
else
{
emit settingsChanged ( settings : : stringToType ( key ) , QJsonDocument : : fromJson ( data . toLocal8Bit ( ) ) ) ;
}
2019-07-12 16:54:26 +02:00
}
}
2020-11-01 19:47:30 +01:00
return rc ;
2018-12-27 23:11:32 +01:00
}
2020-02-26 18:54:56 +01:00
2021-11-17 21:30:43 +01:00
inline QString fixVersion ( const QString & version )
2021-10-16 13:54:18 +02:00
{
QString newVersion ;
//Try fixing version number, remove dot separated pre-release identifiers not supported
QRegularExpression regEx ( " ( \\ d+ \\ . \\ d+ \\ . \\ d+-?[a-zA-Z- \\ d]* \\ .?[ \\ d]*) " , QRegularExpression::CaseInsensitiveOption | QRegularExpression::MultilineOption) ;
QRegularExpressionMatch match ;
match = regEx . match ( version ) ;
if ( match . hasMatch ( ) )
{
newVersion = match . captured ( 1 ) ;
}
return newVersion ;
}
2021-04-24 19:37:29 +02:00
bool SettingsManager : : resolveConfigVersion ( QJsonObject & config )
{
bool isValid = false ;
if ( config . contains ( " general " ) )
{
QJsonObject generalConfig = config [ " general " ] . toObject ( ) ;
QString configVersion = generalConfig [ " configVersion " ] . toString ( ) ;
QString previousVersion = generalConfig [ " previousVersion " ] . toString ( ) ;
2021-11-17 21:30:43 +01:00
if ( ! configVersion . isEmpty ( ) )
2021-04-24 19:37:29 +02:00
{
isValid = _configVersion . setVersion ( configVersion . toStdString ( ) ) ;
2021-10-16 13:54:18 +02:00
if ( ! isValid )
{
2021-11-17 21:30:43 +01:00
isValid = _configVersion . setVersion ( fixVersion ( configVersion ) . toStdString ( ) ) ;
2021-10-16 13:54:18 +02:00
if ( isValid )
{
Info ( _log , " Invalid config version [%s] fixed. Updated to [%s] " , QSTRING_CSTR ( configVersion ) , _configVersion . getVersion ( ) . c_str ( ) ) ;
}
}
2021-04-24 19:37:29 +02:00
}
else
{
isValid = true ;
}
2021-11-17 21:30:43 +01:00
if ( ! previousVersion . isEmpty ( ) & & isValid )
2021-04-24 19:37:29 +02:00
{
isValid = _previousVersion . setVersion ( previousVersion . toStdString ( ) ) ;
2021-10-16 13:54:18 +02:00
if ( ! isValid )
{
2021-11-17 21:30:43 +01:00
isValid = _previousVersion . setVersion ( fixVersion ( previousVersion ) . toStdString ( ) ) ;
2021-10-16 13:54:18 +02:00
if ( isValid )
{
Info ( _log , " Invalid previous version [%s] fixed. Updated to [%s] " , QSTRING_CSTR ( previousVersion ) , _previousVersion . getVersion ( ) . c_str ( ) ) ;
}
}
2021-04-24 19:37:29 +02:00
}
else
{
_previousVersion . setVersion ( DEFAULT_VERSION ) ;
isValid = true ;
}
}
return isValid ;
}
2020-02-26 18:54:56 +01:00
bool SettingsManager : : handleConfigUpgrade ( QJsonObject & config )
{
bool migrated = false ;
2021-10-16 13:54:18 +02:00
//Only migrate, if valid versions are available
2021-11-17 21:30:43 +01:00
if ( ! resolveConfigVersion ( config ) )
2021-10-16 13:54:18 +02:00
{
Warning ( _log , " Invalid version information found in configuration. No database migration executed. " ) ;
}
else
2021-04-24 19:37:29 +02:00
{
2021-10-16 13:54:18 +02:00
//Do only migrate, if configuration is not up to date
if ( _previousVersion < _configVersion )
2020-02-26 18:54:56 +01:00
{
2021-10-16 13:54:18 +02:00
//Migration steps for versions <= alpha 9
2021-11-17 21:30:43 +01:00
semver : : version targetVersion { " 2.0.0-alpha.9 " } ;
if ( _previousVersion < = targetVersion )
2020-02-26 18:54:56 +01:00
{
2021-11-17 21:30:43 +01:00
Info ( _log , " Instance [%u]: Migrate from version [%s] to version [%s] or later " , _instance , _previousVersion . getVersion ( ) . c_str ( ) , targetVersion . getVersion ( ) . c_str ( ) ) ;
2021-04-24 19:37:29 +02:00
2021-10-16 13:54:18 +02:00
// LED LAYOUT UPGRADE
// from { hscan: { minimum: 0.2, maximum: 0.3 }, vscan: { minimum: 0.2, maximum: 0.3 } }
// from { h: { min: 0.2, max: 0.3 }, v: { min: 0.2, max: 0.3 } }
// to { hmin: 0.2, hmax: 0.3, vmin: 0.2, vmax: 0.3}
2021-11-17 21:30:43 +01:00
if ( config . contains ( " leds " ) )
2020-02-26 18:54:56 +01:00
{
2021-10-16 13:54:18 +02:00
const QJsonArray ledarr = config [ " leds " ] . toArray ( ) ;
const QJsonObject led = ledarr [ 0 ] . toObject ( ) ;
2021-04-24 19:37:29 +02:00
2021-11-17 21:30:43 +01:00
if ( led . contains ( " hscan " ) | | led . contains ( " h " ) )
2021-04-24 19:37:29 +02:00
{
2021-10-16 13:54:18 +02:00
const bool whscan = led . contains ( " hscan " ) ;
QJsonArray newLedarr ;
2021-11-17 21:30:43 +01:00
for ( const auto & entry : ledarr )
2021-04-24 19:37:29 +02:00
{
2021-10-16 13:54:18 +02:00
const QJsonObject led = entry . toObject ( ) ;
QJsonObject hscan ;
QJsonObject vscan ;
QJsonValue hmin ;
QJsonValue hmax ;
QJsonValue vmin ;
QJsonValue vmax ;
QJsonObject nL ;
2021-11-17 21:30:43 +01:00
if ( whscan )
2021-10-16 13:54:18 +02:00
{
hscan = led [ " hscan " ] . toObject ( ) ;
vscan = led [ " vscan " ] . toObject ( ) ;
hmin = hscan [ " minimum " ] ;
hmax = hscan [ " maximum " ] ;
vmin = vscan [ " minimum " ] ;
vmax = vscan [ " maximum " ] ;
}
else
{
hscan = led [ " h " ] . toObject ( ) ;
vscan = led [ " v " ] . toObject ( ) ;
hmin = hscan [ " min " ] ;
hmax = hscan [ " max " ] ;
vmin = vscan [ " min " ] ;
vmax = vscan [ " max " ] ;
}
// append to led object
nL [ " hmin " ] = hmin ;
nL [ " hmax " ] = hmax ;
nL [ " vmin " ] = vmin ;
nL [ " vmax " ] = vmax ;
newLedarr . append ( nL ) ;
2021-04-24 19:37:29 +02:00
}
2021-10-16 13:54:18 +02:00
// replace
config [ " leds " ] = newLedarr ;
migrated = true ;
2021-11-17 21:30:43 +01:00
Info ( _log , " Instance [%u]: LED Layout migrated " , _instance ) ;
2021-04-24 19:37:29 +02:00
}
2020-02-26 18:54:56 +01:00
}
2021-04-24 19:37:29 +02:00
2021-11-17 21:30:43 +01:00
if ( config . contains ( " ledConfig " ) )
2020-02-26 18:54:56 +01:00
{
2021-10-16 13:54:18 +02:00
QJsonObject oldLedConfig = config [ " ledConfig " ] . toObject ( ) ;
2021-11-17 21:30:43 +01:00
if ( ! oldLedConfig . contains ( " classic " ) )
2021-10-16 13:54:18 +02:00
{
QJsonObject newLedConfig ;
2021-11-17 21:30:43 +01:00
newLedConfig . insert ( " classic " , oldLedConfig ) ;
QJsonObject defaultMatrixConfig { { " ledshoriz " , 1 }
2021-10-16 13:54:18 +02:00
, { " ledsvert " , 1 }
, { " cabling " , " snake " }
, { " start " , " top-left " }
} ;
2021-11-17 21:30:43 +01:00
newLedConfig . insert ( " matrix " , defaultMatrixConfig ) ;
2021-10-16 13:54:18 +02:00
config [ " ledConfig " ] = newLedConfig ;
migrated = true ;
2021-11-17 21:30:43 +01:00
Info ( _log , " Instance [%u]: LED-Config migrated " , _instance ) ;
2021-10-16 13:54:18 +02:00
}
2020-02-26 18:54:56 +01:00
}
2021-02-17 12:29:53 +01:00
2021-10-16 13:54:18 +02:00
// LED Hardware count is leading for versions after alpha 9
// Setting Hardware LED count to number of LEDs configured via layout, if layout number is greater than number of hardware LEDs
if ( config . contains ( " device " ) )
2021-04-24 19:37:29 +02:00
{
2021-10-16 13:54:18 +02:00
QJsonObject newDeviceConfig = config [ " device " ] . toObject ( ) ;
2021-04-24 19:37:29 +02:00
2021-10-16 13:54:18 +02:00
if ( newDeviceConfig . contains ( " hardwareLedCount " ) )
{
int hwLedcount = newDeviceConfig [ " hardwareLedCount " ] . toInt ( ) ;
if ( config . contains ( " leds " ) )
2021-04-24 19:37:29 +02:00
{
2021-10-16 13:54:18 +02:00
const QJsonArray ledarr = config [ " leds " ] . toArray ( ) ;
int layoutLedCount = ledarr . size ( ) ;
2021-11-17 21:30:43 +01:00
if ( hwLedcount < layoutLedCount )
2021-10-16 13:54:18 +02:00
{
Warning ( _log , " Instance [%u]: HwLedCount/Layout mismatch! Setting Hardware LED count to number of LEDs configured via layout " , _instance ) ;
hwLedcount = layoutLedCount ;
newDeviceConfig [ " hardwareLedCount " ] = hwLedcount ;
migrated = true ;
}
Media Foundation/V4L2 grabber ... (#1119)
* - New Media Foundation grabber
- JsonAPI available grabber fix
- commented json config removed
* Added libjpeg-turbo to dependencies
* Fix OSX build
Removed Azure Pipelines from build scripts
* Remove Platform from Dashboard
* Correct Grabber Namings
* Grabber UI improvements, generic JSONEditor Selection Update
* Active grabber fix
* Stop Framebuffer grabber on failure
* - Image format NV12 and I420 added
- Flip mode
- Scaling factor for MJPEG
- VSCode (compile before run)
- CI (push) dependency libjpeg-turbo added
* Refactor MediaFoundation (Part 1)
* Remove QDebug output
* Added image flipping ability to MF Grabber
* fix issue 1160
* -Reload MF Grabber only once per WebUI update
- Cleanup
* Improvements
* - Set 'Software Frame Decimation' begin to 0
- Removed grabber specific device name from Log
- Keep pixel format when switching resolution
- Display 'Flip mode' correct in Log
- BGR24 images always flipped
* Refactor MediaFoundation (Part 2)
* Refactor V4L2 grabber (part 1) (#62)
* Media Foundation grabber adapted to V4L2 change
* Enable Media Foundation grabber on windows
* Have fps as int, fix height typo
* Added video standards to JsonAPI output
* Error handling in source reader improved
* Fix "Frame to small" error
* Discovery VideoSources and Dynamically Update Editor
* Hide all element when no video grabber discovered, upate naming
* Do not show unsupported grabbers
* Copy Log to Clipboard
* Update Grabber schema and Defaults
* Update access levels and validate crop ranges
* Height and width in Qt grabber corrected
* Correct formatting
* Untabify
* Global component states across instances
* Components divided on the dashboard
* refactor
* Fix Merge-issues
* Database migration aligning with updated grabber model
* Align Grabber.js with new utility functions
* Allow editor-validation for enum-lists
* Handle "Show Explainations scenario" correctly
* Grabber - Ensure save is only possible on valid content
* Dashboard update + fix GlobalSignal connection
* Ensure default database is populated with current release
* Correct grabber4L2 access level
* Display Signal detection area in preview
* Write Hyperion version into default config on compiling.
* Create defaultconfig.json dynamically
* WebUI changes
* Correct grabber config look-ups
* Refactor i18n language loading
* Fix en.json
* Split global capture from instance capture config
* Update grabber default values
* Standalone grabber: Add --debug switch
* Enhance showInputOptionsForKey for multiple keys
* Add grabber instance link to system grabber config
* Only show signal detection area, if grabber is enabled
* Always show Active element on grabber page
* Remote control - Only display gabber status, if global grabber is enabled
* WebUI optimization (thx to @mkcologne)
Start Grabber only when global settings are enabled
Fixed an issue in the WebUI preview
* V4L2/MF changes
* Jsoneditor, Correct translation for default values
* Refactor LED-Device handling in UI and make element naming consistent
* MF Discovery extended
* Fix LGTM finding
* Support Grabber Bri, Hue, Sat and Con in UI, plus their defaults
* Concider Access level for item filtering
* Concider Access level for item filtering
* Revert "Concider Access level for item filtering"
This reverts commit 5b0ce3c0f2de67e0c43788190cfff45614706129.
* Disable fpsSoftwareDecimation for framegrabber, as not supported yet
* JSON-Editor- Add updated schema for validation on dynamic elements
* added V4L2 color IDs
* LGTM findings fix
* destroy SR callback only on exit
* Grabber.js - Hide elements not supported by platform
* Fixed freezing start effect
* Grabber UI - Hardware controls - Show current values and allow to reset to defaults
* Grabber - Discovery - Add current values to properties
* Small things
* Clean-up Effects and have ENDLESS consistently defined
* Fix on/off/on priority during startup, by initializing _prevVisComp in line with background priority
* Add missing translation mappings
* DirectX Grabber reactivated/ QT Grabber size decimation fixed
* typo in push-master workflow
* Use PreciseTimer for Grabber to ensure stable FPS timing
* Set default Screencapture rate consistently
* Fix libjpeg-turbo download
* Remove Zero character from file
* docker-compile Add PLATFORM parameter, only copy output file after successful compile
* Framebuffer, Dispmanx, OSX, AML Grabber discovery, various clean-up and consistencies across grabbers
* Fix merge problem - on docker-compile Add PLATFORM parameter, only copy output file after successful compile
* Fix definition
* OSXFRameGrabber - Revert cast
* Clean-ups nach Feedback
* Disable certain libraries when building armlogic via standard stretch image as developer
* Add CEC availability to ServerInfo to have it platform independent
* Grabber UI - Fix problem that crop values are not populated when refining editor rage
* Preserve value when updating json-editor range
* LEDVisualisation - Clear image when source changes
* Fix - Preserve value when updating json-editor range
* LEDVisualisation - Clear image when no component is active
* Allow to have password handled by Password-Manager (#1263)
* Update default signal detection area to green assuming rainbow grabber
* LED Visualisation - Handle empty priority update
* Fix yuv420 in v4l2 grabber
* V4L2-Grabber discovery - Only report grabbers with valid video input information
* Grabber - Update static variables to have them working in release build
* LED Visualisation - ClearImage when no priorities
* LED Visualisation - Fix Logo resizing issue
* LED Visualisation - Have nearly black background and negative logo
Co-authored-by: LordGrey <lordgrey.emmel@gmail.com>
Co-authored-by: LordGrey <48840279+Lord-Grey@users.noreply.github.com>
2021-07-14 20:48:33 +02:00
}
}
2021-04-24 19:37:29 +02:00
2021-10-16 13:54:18 +02:00
if ( newDeviceConfig . contains ( " type " ) )
Media Foundation/V4L2 grabber ... (#1119)
* - New Media Foundation grabber
- JsonAPI available grabber fix
- commented json config removed
* Added libjpeg-turbo to dependencies
* Fix OSX build
Removed Azure Pipelines from build scripts
* Remove Platform from Dashboard
* Correct Grabber Namings
* Grabber UI improvements, generic JSONEditor Selection Update
* Active grabber fix
* Stop Framebuffer grabber on failure
* - Image format NV12 and I420 added
- Flip mode
- Scaling factor for MJPEG
- VSCode (compile before run)
- CI (push) dependency libjpeg-turbo added
* Refactor MediaFoundation (Part 1)
* Remove QDebug output
* Added image flipping ability to MF Grabber
* fix issue 1160
* -Reload MF Grabber only once per WebUI update
- Cleanup
* Improvements
* - Set 'Software Frame Decimation' begin to 0
- Removed grabber specific device name from Log
- Keep pixel format when switching resolution
- Display 'Flip mode' correct in Log
- BGR24 images always flipped
* Refactor MediaFoundation (Part 2)
* Refactor V4L2 grabber (part 1) (#62)
* Media Foundation grabber adapted to V4L2 change
* Enable Media Foundation grabber on windows
* Have fps as int, fix height typo
* Added video standards to JsonAPI output
* Error handling in source reader improved
* Fix "Frame to small" error
* Discovery VideoSources and Dynamically Update Editor
* Hide all element when no video grabber discovered, upate naming
* Do not show unsupported grabbers
* Copy Log to Clipboard
* Update Grabber schema and Defaults
* Update access levels and validate crop ranges
* Height and width in Qt grabber corrected
* Correct formatting
* Untabify
* Global component states across instances
* Components divided on the dashboard
* refactor
* Fix Merge-issues
* Database migration aligning with updated grabber model
* Align Grabber.js with new utility functions
* Allow editor-validation for enum-lists
* Handle "Show Explainations scenario" correctly
* Grabber - Ensure save is only possible on valid content
* Dashboard update + fix GlobalSignal connection
* Ensure default database is populated with current release
* Correct grabber4L2 access level
* Display Signal detection area in preview
* Write Hyperion version into default config on compiling.
* Create defaultconfig.json dynamically
* WebUI changes
* Correct grabber config look-ups
* Refactor i18n language loading
* Fix en.json
* Split global capture from instance capture config
* Update grabber default values
* Standalone grabber: Add --debug switch
* Enhance showInputOptionsForKey for multiple keys
* Add grabber instance link to system grabber config
* Only show signal detection area, if grabber is enabled
* Always show Active element on grabber page
* Remote control - Only display gabber status, if global grabber is enabled
* WebUI optimization (thx to @mkcologne)
Start Grabber only when global settings are enabled
Fixed an issue in the WebUI preview
* V4L2/MF changes
* Jsoneditor, Correct translation for default values
* Refactor LED-Device handling in UI and make element naming consistent
* MF Discovery extended
* Fix LGTM finding
* Support Grabber Bri, Hue, Sat and Con in UI, plus their defaults
* Concider Access level for item filtering
* Concider Access level for item filtering
* Revert "Concider Access level for item filtering"
This reverts commit 5b0ce3c0f2de67e0c43788190cfff45614706129.
* Disable fpsSoftwareDecimation for framegrabber, as not supported yet
* JSON-Editor- Add updated schema for validation on dynamic elements
* added V4L2 color IDs
* LGTM findings fix
* destroy SR callback only on exit
* Grabber.js - Hide elements not supported by platform
* Fixed freezing start effect
* Grabber UI - Hardware controls - Show current values and allow to reset to defaults
* Grabber - Discovery - Add current values to properties
* Small things
* Clean-up Effects and have ENDLESS consistently defined
* Fix on/off/on priority during startup, by initializing _prevVisComp in line with background priority
* Add missing translation mappings
* DirectX Grabber reactivated/ QT Grabber size decimation fixed
* typo in push-master workflow
* Use PreciseTimer for Grabber to ensure stable FPS timing
* Set default Screencapture rate consistently
* Fix libjpeg-turbo download
* Remove Zero character from file
* docker-compile Add PLATFORM parameter, only copy output file after successful compile
* Framebuffer, Dispmanx, OSX, AML Grabber discovery, various clean-up and consistencies across grabbers
* Fix merge problem - on docker-compile Add PLATFORM parameter, only copy output file after successful compile
* Fix definition
* OSXFRameGrabber - Revert cast
* Clean-ups nach Feedback
* Disable certain libraries when building armlogic via standard stretch image as developer
* Add CEC availability to ServerInfo to have it platform independent
* Grabber UI - Fix problem that crop values are not populated when refining editor rage
* Preserve value when updating json-editor range
* LEDVisualisation - Clear image when source changes
* Fix - Preserve value when updating json-editor range
* LEDVisualisation - Clear image when no component is active
* Allow to have password handled by Password-Manager (#1263)
* Update default signal detection area to green assuming rainbow grabber
* LED Visualisation - Handle empty priority update
* Fix yuv420 in v4l2 grabber
* V4L2-Grabber discovery - Only report grabbers with valid video input information
* Grabber - Update static variables to have them working in release build
* LED Visualisation - ClearImage when no priorities
* LED Visualisation - Fix Logo resizing issue
* LED Visualisation - Have nearly black background and negative logo
Co-authored-by: LordGrey <lordgrey.emmel@gmail.com>
Co-authored-by: LordGrey <48840279+Lord-Grey@users.noreply.github.com>
2021-07-14 20:48:33 +02:00
{
2021-10-16 13:54:18 +02:00
QString type = newDeviceConfig [ " type " ] . toString ( ) ;
2021-11-17 21:30:43 +01:00
if ( type = = " atmoorb " | | type = = " fadecandy " | | type = = " philipshue " )
Media Foundation/V4L2 grabber ... (#1119)
* - New Media Foundation grabber
- JsonAPI available grabber fix
- commented json config removed
* Added libjpeg-turbo to dependencies
* Fix OSX build
Removed Azure Pipelines from build scripts
* Remove Platform from Dashboard
* Correct Grabber Namings
* Grabber UI improvements, generic JSONEditor Selection Update
* Active grabber fix
* Stop Framebuffer grabber on failure
* - Image format NV12 and I420 added
- Flip mode
- Scaling factor for MJPEG
- VSCode (compile before run)
- CI (push) dependency libjpeg-turbo added
* Refactor MediaFoundation (Part 1)
* Remove QDebug output
* Added image flipping ability to MF Grabber
* fix issue 1160
* -Reload MF Grabber only once per WebUI update
- Cleanup
* Improvements
* - Set 'Software Frame Decimation' begin to 0
- Removed grabber specific device name from Log
- Keep pixel format when switching resolution
- Display 'Flip mode' correct in Log
- BGR24 images always flipped
* Refactor MediaFoundation (Part 2)
* Refactor V4L2 grabber (part 1) (#62)
* Media Foundation grabber adapted to V4L2 change
* Enable Media Foundation grabber on windows
* Have fps as int, fix height typo
* Added video standards to JsonAPI output
* Error handling in source reader improved
* Fix "Frame to small" error
* Discovery VideoSources and Dynamically Update Editor
* Hide all element when no video grabber discovered, upate naming
* Do not show unsupported grabbers
* Copy Log to Clipboard
* Update Grabber schema and Defaults
* Update access levels and validate crop ranges
* Height and width in Qt grabber corrected
* Correct formatting
* Untabify
* Global component states across instances
* Components divided on the dashboard
* refactor
* Fix Merge-issues
* Database migration aligning with updated grabber model
* Align Grabber.js with new utility functions
* Allow editor-validation for enum-lists
* Handle "Show Explainations scenario" correctly
* Grabber - Ensure save is only possible on valid content
* Dashboard update + fix GlobalSignal connection
* Ensure default database is populated with current release
* Correct grabber4L2 access level
* Display Signal detection area in preview
* Write Hyperion version into default config on compiling.
* Create defaultconfig.json dynamically
* WebUI changes
* Correct grabber config look-ups
* Refactor i18n language loading
* Fix en.json
* Split global capture from instance capture config
* Update grabber default values
* Standalone grabber: Add --debug switch
* Enhance showInputOptionsForKey for multiple keys
* Add grabber instance link to system grabber config
* Only show signal detection area, if grabber is enabled
* Always show Active element on grabber page
* Remote control - Only display gabber status, if global grabber is enabled
* WebUI optimization (thx to @mkcologne)
Start Grabber only when global settings are enabled
Fixed an issue in the WebUI preview
* V4L2/MF changes
* Jsoneditor, Correct translation for default values
* Refactor LED-Device handling in UI and make element naming consistent
* MF Discovery extended
* Fix LGTM finding
* Support Grabber Bri, Hue, Sat and Con in UI, plus their defaults
* Concider Access level for item filtering
* Concider Access level for item filtering
* Revert "Concider Access level for item filtering"
This reverts commit 5b0ce3c0f2de67e0c43788190cfff45614706129.
* Disable fpsSoftwareDecimation for framegrabber, as not supported yet
* JSON-Editor- Add updated schema for validation on dynamic elements
* added V4L2 color IDs
* LGTM findings fix
* destroy SR callback only on exit
* Grabber.js - Hide elements not supported by platform
* Fixed freezing start effect
* Grabber UI - Hardware controls - Show current values and allow to reset to defaults
* Grabber - Discovery - Add current values to properties
* Small things
* Clean-up Effects and have ENDLESS consistently defined
* Fix on/off/on priority during startup, by initializing _prevVisComp in line with background priority
* Add missing translation mappings
* DirectX Grabber reactivated/ QT Grabber size decimation fixed
* typo in push-master workflow
* Use PreciseTimer for Grabber to ensure stable FPS timing
* Set default Screencapture rate consistently
* Fix libjpeg-turbo download
* Remove Zero character from file
* docker-compile Add PLATFORM parameter, only copy output file after successful compile
* Framebuffer, Dispmanx, OSX, AML Grabber discovery, various clean-up and consistencies across grabbers
* Fix merge problem - on docker-compile Add PLATFORM parameter, only copy output file after successful compile
* Fix definition
* OSXFRameGrabber - Revert cast
* Clean-ups nach Feedback
* Disable certain libraries when building armlogic via standard stretch image as developer
* Add CEC availability to ServerInfo to have it platform independent
* Grabber UI - Fix problem that crop values are not populated when refining editor rage
* Preserve value when updating json-editor range
* LEDVisualisation - Clear image when source changes
* Fix - Preserve value when updating json-editor range
* LEDVisualisation - Clear image when no component is active
* Allow to have password handled by Password-Manager (#1263)
* Update default signal detection area to green assuming rainbow grabber
* LED Visualisation - Handle empty priority update
* Fix yuv420 in v4l2 grabber
* V4L2-Grabber discovery - Only report grabbers with valid video input information
* Grabber - Update static variables to have them working in release build
* LED Visualisation - ClearImage when no priorities
* LED Visualisation - Fix Logo resizing issue
* LED Visualisation - Have nearly black background and negative logo
Co-authored-by: LordGrey <lordgrey.emmel@gmail.com>
Co-authored-by: LordGrey <48840279+Lord-Grey@users.noreply.github.com>
2021-07-14 20:48:33 +02:00
{
2021-10-16 13:54:18 +02:00
if ( newDeviceConfig . contains ( " output " ) )
{
newDeviceConfig [ " host " ] = newDeviceConfig [ " output " ] . toString ( ) ;
newDeviceConfig . remove ( " output " ) ;
migrated = true ;
}
2021-04-24 19:37:29 +02:00
}
}
2021-10-16 13:54:18 +02:00
if ( migrated )
{
config [ " device " ] = newDeviceConfig ;
Debug ( _log , " LED-Device records migrated " ) ;
}
2021-04-24 19:37:29 +02:00
}
Media Foundation/V4L2 grabber ... (#1119)
* - New Media Foundation grabber
- JsonAPI available grabber fix
- commented json config removed
* Added libjpeg-turbo to dependencies
* Fix OSX build
Removed Azure Pipelines from build scripts
* Remove Platform from Dashboard
* Correct Grabber Namings
* Grabber UI improvements, generic JSONEditor Selection Update
* Active grabber fix
* Stop Framebuffer grabber on failure
* - Image format NV12 and I420 added
- Flip mode
- Scaling factor for MJPEG
- VSCode (compile before run)
- CI (push) dependency libjpeg-turbo added
* Refactor MediaFoundation (Part 1)
* Remove QDebug output
* Added image flipping ability to MF Grabber
* fix issue 1160
* -Reload MF Grabber only once per WebUI update
- Cleanup
* Improvements
* - Set 'Software Frame Decimation' begin to 0
- Removed grabber specific device name from Log
- Keep pixel format when switching resolution
- Display 'Flip mode' correct in Log
- BGR24 images always flipped
* Refactor MediaFoundation (Part 2)
* Refactor V4L2 grabber (part 1) (#62)
* Media Foundation grabber adapted to V4L2 change
* Enable Media Foundation grabber on windows
* Have fps as int, fix height typo
* Added video standards to JsonAPI output
* Error handling in source reader improved
* Fix "Frame to small" error
* Discovery VideoSources and Dynamically Update Editor
* Hide all element when no video grabber discovered, upate naming
* Do not show unsupported grabbers
* Copy Log to Clipboard
* Update Grabber schema and Defaults
* Update access levels and validate crop ranges
* Height and width in Qt grabber corrected
* Correct formatting
* Untabify
* Global component states across instances
* Components divided on the dashboard
* refactor
* Fix Merge-issues
* Database migration aligning with updated grabber model
* Align Grabber.js with new utility functions
* Allow editor-validation for enum-lists
* Handle "Show Explainations scenario" correctly
* Grabber - Ensure save is only possible on valid content
* Dashboard update + fix GlobalSignal connection
* Ensure default database is populated with current release
* Correct grabber4L2 access level
* Display Signal detection area in preview
* Write Hyperion version into default config on compiling.
* Create defaultconfig.json dynamically
* WebUI changes
* Correct grabber config look-ups
* Refactor i18n language loading
* Fix en.json
* Split global capture from instance capture config
* Update grabber default values
* Standalone grabber: Add --debug switch
* Enhance showInputOptionsForKey for multiple keys
* Add grabber instance link to system grabber config
* Only show signal detection area, if grabber is enabled
* Always show Active element on grabber page
* Remote control - Only display gabber status, if global grabber is enabled
* WebUI optimization (thx to @mkcologne)
Start Grabber only when global settings are enabled
Fixed an issue in the WebUI preview
* V4L2/MF changes
* Jsoneditor, Correct translation for default values
* Refactor LED-Device handling in UI and make element naming consistent
* MF Discovery extended
* Fix LGTM finding
* Support Grabber Bri, Hue, Sat and Con in UI, plus their defaults
* Concider Access level for item filtering
* Concider Access level for item filtering
* Revert "Concider Access level for item filtering"
This reverts commit 5b0ce3c0f2de67e0c43788190cfff45614706129.
* Disable fpsSoftwareDecimation for framegrabber, as not supported yet
* JSON-Editor- Add updated schema for validation on dynamic elements
* added V4L2 color IDs
* LGTM findings fix
* destroy SR callback only on exit
* Grabber.js - Hide elements not supported by platform
* Fixed freezing start effect
* Grabber UI - Hardware controls - Show current values and allow to reset to defaults
* Grabber - Discovery - Add current values to properties
* Small things
* Clean-up Effects and have ENDLESS consistently defined
* Fix on/off/on priority during startup, by initializing _prevVisComp in line with background priority
* Add missing translation mappings
* DirectX Grabber reactivated/ QT Grabber size decimation fixed
* typo in push-master workflow
* Use PreciseTimer for Grabber to ensure stable FPS timing
* Set default Screencapture rate consistently
* Fix libjpeg-turbo download
* Remove Zero character from file
* docker-compile Add PLATFORM parameter, only copy output file after successful compile
* Framebuffer, Dispmanx, OSX, AML Grabber discovery, various clean-up and consistencies across grabbers
* Fix merge problem - on docker-compile Add PLATFORM parameter, only copy output file after successful compile
* Fix definition
* OSXFRameGrabber - Revert cast
* Clean-ups nach Feedback
* Disable certain libraries when building armlogic via standard stretch image as developer
* Add CEC availability to ServerInfo to have it platform independent
* Grabber UI - Fix problem that crop values are not populated when refining editor rage
* Preserve value when updating json-editor range
* LEDVisualisation - Clear image when source changes
* Fix - Preserve value when updating json-editor range
* LEDVisualisation - Clear image when no component is active
* Allow to have password handled by Password-Manager (#1263)
* Update default signal detection area to green assuming rainbow grabber
* LED Visualisation - Handle empty priority update
* Fix yuv420 in v4l2 grabber
* V4L2-Grabber discovery - Only report grabbers with valid video input information
* Grabber - Update static variables to have them working in release build
* LED Visualisation - ClearImage when no priorities
* LED Visualisation - Fix Logo resizing issue
* LED Visualisation - Have nearly black background and negative logo
Co-authored-by: LordGrey <lordgrey.emmel@gmail.com>
Co-authored-by: LordGrey <48840279+Lord-Grey@users.noreply.github.com>
2021-07-14 20:48:33 +02:00
2021-10-16 13:54:18 +02:00
if ( config . contains ( " grabberV4L2 " ) )
Media Foundation/V4L2 grabber ... (#1119)
* - New Media Foundation grabber
- JsonAPI available grabber fix
- commented json config removed
* Added libjpeg-turbo to dependencies
* Fix OSX build
Removed Azure Pipelines from build scripts
* Remove Platform from Dashboard
* Correct Grabber Namings
* Grabber UI improvements, generic JSONEditor Selection Update
* Active grabber fix
* Stop Framebuffer grabber on failure
* - Image format NV12 and I420 added
- Flip mode
- Scaling factor for MJPEG
- VSCode (compile before run)
- CI (push) dependency libjpeg-turbo added
* Refactor MediaFoundation (Part 1)
* Remove QDebug output
* Added image flipping ability to MF Grabber
* fix issue 1160
* -Reload MF Grabber only once per WebUI update
- Cleanup
* Improvements
* - Set 'Software Frame Decimation' begin to 0
- Removed grabber specific device name from Log
- Keep pixel format when switching resolution
- Display 'Flip mode' correct in Log
- BGR24 images always flipped
* Refactor MediaFoundation (Part 2)
* Refactor V4L2 grabber (part 1) (#62)
* Media Foundation grabber adapted to V4L2 change
* Enable Media Foundation grabber on windows
* Have fps as int, fix height typo
* Added video standards to JsonAPI output
* Error handling in source reader improved
* Fix "Frame to small" error
* Discovery VideoSources and Dynamically Update Editor
* Hide all element when no video grabber discovered, upate naming
* Do not show unsupported grabbers
* Copy Log to Clipboard
* Update Grabber schema and Defaults
* Update access levels and validate crop ranges
* Height and width in Qt grabber corrected
* Correct formatting
* Untabify
* Global component states across instances
* Components divided on the dashboard
* refactor
* Fix Merge-issues
* Database migration aligning with updated grabber model
* Align Grabber.js with new utility functions
* Allow editor-validation for enum-lists
* Handle "Show Explainations scenario" correctly
* Grabber - Ensure save is only possible on valid content
* Dashboard update + fix GlobalSignal connection
* Ensure default database is populated with current release
* Correct grabber4L2 access level
* Display Signal detection area in preview
* Write Hyperion version into default config on compiling.
* Create defaultconfig.json dynamically
* WebUI changes
* Correct grabber config look-ups
* Refactor i18n language loading
* Fix en.json
* Split global capture from instance capture config
* Update grabber default values
* Standalone grabber: Add --debug switch
* Enhance showInputOptionsForKey for multiple keys
* Add grabber instance link to system grabber config
* Only show signal detection area, if grabber is enabled
* Always show Active element on grabber page
* Remote control - Only display gabber status, if global grabber is enabled
* WebUI optimization (thx to @mkcologne)
Start Grabber only when global settings are enabled
Fixed an issue in the WebUI preview
* V4L2/MF changes
* Jsoneditor, Correct translation for default values
* Refactor LED-Device handling in UI and make element naming consistent
* MF Discovery extended
* Fix LGTM finding
* Support Grabber Bri, Hue, Sat and Con in UI, plus their defaults
* Concider Access level for item filtering
* Concider Access level for item filtering
* Revert "Concider Access level for item filtering"
This reverts commit 5b0ce3c0f2de67e0c43788190cfff45614706129.
* Disable fpsSoftwareDecimation for framegrabber, as not supported yet
* JSON-Editor- Add updated schema for validation on dynamic elements
* added V4L2 color IDs
* LGTM findings fix
* destroy SR callback only on exit
* Grabber.js - Hide elements not supported by platform
* Fixed freezing start effect
* Grabber UI - Hardware controls - Show current values and allow to reset to defaults
* Grabber - Discovery - Add current values to properties
* Small things
* Clean-up Effects and have ENDLESS consistently defined
* Fix on/off/on priority during startup, by initializing _prevVisComp in line with background priority
* Add missing translation mappings
* DirectX Grabber reactivated/ QT Grabber size decimation fixed
* typo in push-master workflow
* Use PreciseTimer for Grabber to ensure stable FPS timing
* Set default Screencapture rate consistently
* Fix libjpeg-turbo download
* Remove Zero character from file
* docker-compile Add PLATFORM parameter, only copy output file after successful compile
* Framebuffer, Dispmanx, OSX, AML Grabber discovery, various clean-up and consistencies across grabbers
* Fix merge problem - on docker-compile Add PLATFORM parameter, only copy output file after successful compile
* Fix definition
* OSXFRameGrabber - Revert cast
* Clean-ups nach Feedback
* Disable certain libraries when building armlogic via standard stretch image as developer
* Add CEC availability to ServerInfo to have it platform independent
* Grabber UI - Fix problem that crop values are not populated when refining editor rage
* Preserve value when updating json-editor range
* LEDVisualisation - Clear image when source changes
* Fix - Preserve value when updating json-editor range
* LEDVisualisation - Clear image when no component is active
* Allow to have password handled by Password-Manager (#1263)
* Update default signal detection area to green assuming rainbow grabber
* LED Visualisation - Handle empty priority update
* Fix yuv420 in v4l2 grabber
* V4L2-Grabber discovery - Only report grabbers with valid video input information
* Grabber - Update static variables to have them working in release build
* LED Visualisation - ClearImage when no priorities
* LED Visualisation - Fix Logo resizing issue
* LED Visualisation - Have nearly black background and negative logo
Co-authored-by: LordGrey <lordgrey.emmel@gmail.com>
Co-authored-by: LordGrey <48840279+Lord-Grey@users.noreply.github.com>
2021-07-14 20:48:33 +02:00
{
2021-10-16 13:54:18 +02:00
QJsonObject newGrabberV4L2Config = config [ " grabberV4L2 " ] . toObject ( ) ;
Media Foundation/V4L2 grabber ... (#1119)
* - New Media Foundation grabber
- JsonAPI available grabber fix
- commented json config removed
* Added libjpeg-turbo to dependencies
* Fix OSX build
Removed Azure Pipelines from build scripts
* Remove Platform from Dashboard
* Correct Grabber Namings
* Grabber UI improvements, generic JSONEditor Selection Update
* Active grabber fix
* Stop Framebuffer grabber on failure
* - Image format NV12 and I420 added
- Flip mode
- Scaling factor for MJPEG
- VSCode (compile before run)
- CI (push) dependency libjpeg-turbo added
* Refactor MediaFoundation (Part 1)
* Remove QDebug output
* Added image flipping ability to MF Grabber
* fix issue 1160
* -Reload MF Grabber only once per WebUI update
- Cleanup
* Improvements
* - Set 'Software Frame Decimation' begin to 0
- Removed grabber specific device name from Log
- Keep pixel format when switching resolution
- Display 'Flip mode' correct in Log
- BGR24 images always flipped
* Refactor MediaFoundation (Part 2)
* Refactor V4L2 grabber (part 1) (#62)
* Media Foundation grabber adapted to V4L2 change
* Enable Media Foundation grabber on windows
* Have fps as int, fix height typo
* Added video standards to JsonAPI output
* Error handling in source reader improved
* Fix "Frame to small" error
* Discovery VideoSources and Dynamically Update Editor
* Hide all element when no video grabber discovered, upate naming
* Do not show unsupported grabbers
* Copy Log to Clipboard
* Update Grabber schema and Defaults
* Update access levels and validate crop ranges
* Height and width in Qt grabber corrected
* Correct formatting
* Untabify
* Global component states across instances
* Components divided on the dashboard
* refactor
* Fix Merge-issues
* Database migration aligning with updated grabber model
* Align Grabber.js with new utility functions
* Allow editor-validation for enum-lists
* Handle "Show Explainations scenario" correctly
* Grabber - Ensure save is only possible on valid content
* Dashboard update + fix GlobalSignal connection
* Ensure default database is populated with current release
* Correct grabber4L2 access level
* Display Signal detection area in preview
* Write Hyperion version into default config on compiling.
* Create defaultconfig.json dynamically
* WebUI changes
* Correct grabber config look-ups
* Refactor i18n language loading
* Fix en.json
* Split global capture from instance capture config
* Update grabber default values
* Standalone grabber: Add --debug switch
* Enhance showInputOptionsForKey for multiple keys
* Add grabber instance link to system grabber config
* Only show signal detection area, if grabber is enabled
* Always show Active element on grabber page
* Remote control - Only display gabber status, if global grabber is enabled
* WebUI optimization (thx to @mkcologne)
Start Grabber only when global settings are enabled
Fixed an issue in the WebUI preview
* V4L2/MF changes
* Jsoneditor, Correct translation for default values
* Refactor LED-Device handling in UI and make element naming consistent
* MF Discovery extended
* Fix LGTM finding
* Support Grabber Bri, Hue, Sat and Con in UI, plus their defaults
* Concider Access level for item filtering
* Concider Access level for item filtering
* Revert "Concider Access level for item filtering"
This reverts commit 5b0ce3c0f2de67e0c43788190cfff45614706129.
* Disable fpsSoftwareDecimation for framegrabber, as not supported yet
* JSON-Editor- Add updated schema for validation on dynamic elements
* added V4L2 color IDs
* LGTM findings fix
* destroy SR callback only on exit
* Grabber.js - Hide elements not supported by platform
* Fixed freezing start effect
* Grabber UI - Hardware controls - Show current values and allow to reset to defaults
* Grabber - Discovery - Add current values to properties
* Small things
* Clean-up Effects and have ENDLESS consistently defined
* Fix on/off/on priority during startup, by initializing _prevVisComp in line with background priority
* Add missing translation mappings
* DirectX Grabber reactivated/ QT Grabber size decimation fixed
* typo in push-master workflow
* Use PreciseTimer for Grabber to ensure stable FPS timing
* Set default Screencapture rate consistently
* Fix libjpeg-turbo download
* Remove Zero character from file
* docker-compile Add PLATFORM parameter, only copy output file after successful compile
* Framebuffer, Dispmanx, OSX, AML Grabber discovery, various clean-up and consistencies across grabbers
* Fix merge problem - on docker-compile Add PLATFORM parameter, only copy output file after successful compile
* Fix definition
* OSXFRameGrabber - Revert cast
* Clean-ups nach Feedback
* Disable certain libraries when building armlogic via standard stretch image as developer
* Add CEC availability to ServerInfo to have it platform independent
* Grabber UI - Fix problem that crop values are not populated when refining editor rage
* Preserve value when updating json-editor range
* LEDVisualisation - Clear image when source changes
* Fix - Preserve value when updating json-editor range
* LEDVisualisation - Clear image when no component is active
* Allow to have password handled by Password-Manager (#1263)
* Update default signal detection area to green assuming rainbow grabber
* LED Visualisation - Handle empty priority update
* Fix yuv420 in v4l2 grabber
* V4L2-Grabber discovery - Only report grabbers with valid video input information
* Grabber - Update static variables to have them working in release build
* LED Visualisation - ClearImage when no priorities
* LED Visualisation - Fix Logo resizing issue
* LED Visualisation - Have nearly black background and negative logo
Co-authored-by: LordGrey <lordgrey.emmel@gmail.com>
Co-authored-by: LordGrey <48840279+Lord-Grey@users.noreply.github.com>
2021-07-14 20:48:33 +02:00
2021-10-16 13:54:18 +02:00
if ( newGrabberV4L2Config . contains ( " encoding_format " ) )
{
newGrabberV4L2Config . remove ( " encoding_format " ) ;
newGrabberV4L2Config [ " grabberV4L2 " ] = newGrabberV4L2Config ;
migrated = true ;
}
Media Foundation/V4L2 grabber ... (#1119)
* - New Media Foundation grabber
- JsonAPI available grabber fix
- commented json config removed
* Added libjpeg-turbo to dependencies
* Fix OSX build
Removed Azure Pipelines from build scripts
* Remove Platform from Dashboard
* Correct Grabber Namings
* Grabber UI improvements, generic JSONEditor Selection Update
* Active grabber fix
* Stop Framebuffer grabber on failure
* - Image format NV12 and I420 added
- Flip mode
- Scaling factor for MJPEG
- VSCode (compile before run)
- CI (push) dependency libjpeg-turbo added
* Refactor MediaFoundation (Part 1)
* Remove QDebug output
* Added image flipping ability to MF Grabber
* fix issue 1160
* -Reload MF Grabber only once per WebUI update
- Cleanup
* Improvements
* - Set 'Software Frame Decimation' begin to 0
- Removed grabber specific device name from Log
- Keep pixel format when switching resolution
- Display 'Flip mode' correct in Log
- BGR24 images always flipped
* Refactor MediaFoundation (Part 2)
* Refactor V4L2 grabber (part 1) (#62)
* Media Foundation grabber adapted to V4L2 change
* Enable Media Foundation grabber on windows
* Have fps as int, fix height typo
* Added video standards to JsonAPI output
* Error handling in source reader improved
* Fix "Frame to small" error
* Discovery VideoSources and Dynamically Update Editor
* Hide all element when no video grabber discovered, upate naming
* Do not show unsupported grabbers
* Copy Log to Clipboard
* Update Grabber schema and Defaults
* Update access levels and validate crop ranges
* Height and width in Qt grabber corrected
* Correct formatting
* Untabify
* Global component states across instances
* Components divided on the dashboard
* refactor
* Fix Merge-issues
* Database migration aligning with updated grabber model
* Align Grabber.js with new utility functions
* Allow editor-validation for enum-lists
* Handle "Show Explainations scenario" correctly
* Grabber - Ensure save is only possible on valid content
* Dashboard update + fix GlobalSignal connection
* Ensure default database is populated with current release
* Correct grabber4L2 access level
* Display Signal detection area in preview
* Write Hyperion version into default config on compiling.
* Create defaultconfig.json dynamically
* WebUI changes
* Correct grabber config look-ups
* Refactor i18n language loading
* Fix en.json
* Split global capture from instance capture config
* Update grabber default values
* Standalone grabber: Add --debug switch
* Enhance showInputOptionsForKey for multiple keys
* Add grabber instance link to system grabber config
* Only show signal detection area, if grabber is enabled
* Always show Active element on grabber page
* Remote control - Only display gabber status, if global grabber is enabled
* WebUI optimization (thx to @mkcologne)
Start Grabber only when global settings are enabled
Fixed an issue in the WebUI preview
* V4L2/MF changes
* Jsoneditor, Correct translation for default values
* Refactor LED-Device handling in UI and make element naming consistent
* MF Discovery extended
* Fix LGTM finding
* Support Grabber Bri, Hue, Sat and Con in UI, plus their defaults
* Concider Access level for item filtering
* Concider Access level for item filtering
* Revert "Concider Access level for item filtering"
This reverts commit 5b0ce3c0f2de67e0c43788190cfff45614706129.
* Disable fpsSoftwareDecimation for framegrabber, as not supported yet
* JSON-Editor- Add updated schema for validation on dynamic elements
* added V4L2 color IDs
* LGTM findings fix
* destroy SR callback only on exit
* Grabber.js - Hide elements not supported by platform
* Fixed freezing start effect
* Grabber UI - Hardware controls - Show current values and allow to reset to defaults
* Grabber - Discovery - Add current values to properties
* Small things
* Clean-up Effects and have ENDLESS consistently defined
* Fix on/off/on priority during startup, by initializing _prevVisComp in line with background priority
* Add missing translation mappings
* DirectX Grabber reactivated/ QT Grabber size decimation fixed
* typo in push-master workflow
* Use PreciseTimer for Grabber to ensure stable FPS timing
* Set default Screencapture rate consistently
* Fix libjpeg-turbo download
* Remove Zero character from file
* docker-compile Add PLATFORM parameter, only copy output file after successful compile
* Framebuffer, Dispmanx, OSX, AML Grabber discovery, various clean-up and consistencies across grabbers
* Fix merge problem - on docker-compile Add PLATFORM parameter, only copy output file after successful compile
* Fix definition
* OSXFRameGrabber - Revert cast
* Clean-ups nach Feedback
* Disable certain libraries when building armlogic via standard stretch image as developer
* Add CEC availability to ServerInfo to have it platform independent
* Grabber UI - Fix problem that crop values are not populated when refining editor rage
* Preserve value when updating json-editor range
* LEDVisualisation - Clear image when source changes
* Fix - Preserve value when updating json-editor range
* LEDVisualisation - Clear image when no component is active
* Allow to have password handled by Password-Manager (#1263)
* Update default signal detection area to green assuming rainbow grabber
* LED Visualisation - Handle empty priority update
* Fix yuv420 in v4l2 grabber
* V4L2-Grabber discovery - Only report grabbers with valid video input information
* Grabber - Update static variables to have them working in release build
* LED Visualisation - ClearImage when no priorities
* LED Visualisation - Fix Logo resizing issue
* LED Visualisation - Have nearly black background and negative logo
Co-authored-by: LordGrey <lordgrey.emmel@gmail.com>
Co-authored-by: LordGrey <48840279+Lord-Grey@users.noreply.github.com>
2021-07-14 20:48:33 +02:00
2021-10-16 13:54:18 +02:00
//Add new element enable
if ( ! newGrabberV4L2Config . contains ( " enable " ) )
{
newGrabberV4L2Config [ " enable " ] = false ;
migrated = true ;
}
config [ " grabberV4L2 " ] = newGrabberV4L2Config ;
Debug ( _log , " GrabberV4L2 records migrated " ) ;
Media Foundation/V4L2 grabber ... (#1119)
* - New Media Foundation grabber
- JsonAPI available grabber fix
- commented json config removed
* Added libjpeg-turbo to dependencies
* Fix OSX build
Removed Azure Pipelines from build scripts
* Remove Platform from Dashboard
* Correct Grabber Namings
* Grabber UI improvements, generic JSONEditor Selection Update
* Active grabber fix
* Stop Framebuffer grabber on failure
* - Image format NV12 and I420 added
- Flip mode
- Scaling factor for MJPEG
- VSCode (compile before run)
- CI (push) dependency libjpeg-turbo added
* Refactor MediaFoundation (Part 1)
* Remove QDebug output
* Added image flipping ability to MF Grabber
* fix issue 1160
* -Reload MF Grabber only once per WebUI update
- Cleanup
* Improvements
* - Set 'Software Frame Decimation' begin to 0
- Removed grabber specific device name from Log
- Keep pixel format when switching resolution
- Display 'Flip mode' correct in Log
- BGR24 images always flipped
* Refactor MediaFoundation (Part 2)
* Refactor V4L2 grabber (part 1) (#62)
* Media Foundation grabber adapted to V4L2 change
* Enable Media Foundation grabber on windows
* Have fps as int, fix height typo
* Added video standards to JsonAPI output
* Error handling in source reader improved
* Fix "Frame to small" error
* Discovery VideoSources and Dynamically Update Editor
* Hide all element when no video grabber discovered, upate naming
* Do not show unsupported grabbers
* Copy Log to Clipboard
* Update Grabber schema and Defaults
* Update access levels and validate crop ranges
* Height and width in Qt grabber corrected
* Correct formatting
* Untabify
* Global component states across instances
* Components divided on the dashboard
* refactor
* Fix Merge-issues
* Database migration aligning with updated grabber model
* Align Grabber.js with new utility functions
* Allow editor-validation for enum-lists
* Handle "Show Explainations scenario" correctly
* Grabber - Ensure save is only possible on valid content
* Dashboard update + fix GlobalSignal connection
* Ensure default database is populated with current release
* Correct grabber4L2 access level
* Display Signal detection area in preview
* Write Hyperion version into default config on compiling.
* Create defaultconfig.json dynamically
* WebUI changes
* Correct grabber config look-ups
* Refactor i18n language loading
* Fix en.json
* Split global capture from instance capture config
* Update grabber default values
* Standalone grabber: Add --debug switch
* Enhance showInputOptionsForKey for multiple keys
* Add grabber instance link to system grabber config
* Only show signal detection area, if grabber is enabled
* Always show Active element on grabber page
* Remote control - Only display gabber status, if global grabber is enabled
* WebUI optimization (thx to @mkcologne)
Start Grabber only when global settings are enabled
Fixed an issue in the WebUI preview
* V4L2/MF changes
* Jsoneditor, Correct translation for default values
* Refactor LED-Device handling in UI and make element naming consistent
* MF Discovery extended
* Fix LGTM finding
* Support Grabber Bri, Hue, Sat and Con in UI, plus their defaults
* Concider Access level for item filtering
* Concider Access level for item filtering
* Revert "Concider Access level for item filtering"
This reverts commit 5b0ce3c0f2de67e0c43788190cfff45614706129.
* Disable fpsSoftwareDecimation for framegrabber, as not supported yet
* JSON-Editor- Add updated schema for validation on dynamic elements
* added V4L2 color IDs
* LGTM findings fix
* destroy SR callback only on exit
* Grabber.js - Hide elements not supported by platform
* Fixed freezing start effect
* Grabber UI - Hardware controls - Show current values and allow to reset to defaults
* Grabber - Discovery - Add current values to properties
* Small things
* Clean-up Effects and have ENDLESS consistently defined
* Fix on/off/on priority during startup, by initializing _prevVisComp in line with background priority
* Add missing translation mappings
* DirectX Grabber reactivated/ QT Grabber size decimation fixed
* typo in push-master workflow
* Use PreciseTimer for Grabber to ensure stable FPS timing
* Set default Screencapture rate consistently
* Fix libjpeg-turbo download
* Remove Zero character from file
* docker-compile Add PLATFORM parameter, only copy output file after successful compile
* Framebuffer, Dispmanx, OSX, AML Grabber discovery, various clean-up and consistencies across grabbers
* Fix merge problem - on docker-compile Add PLATFORM parameter, only copy output file after successful compile
* Fix definition
* OSXFRameGrabber - Revert cast
* Clean-ups nach Feedback
* Disable certain libraries when building armlogic via standard stretch image as developer
* Add CEC availability to ServerInfo to have it platform independent
* Grabber UI - Fix problem that crop values are not populated when refining editor rage
* Preserve value when updating json-editor range
* LEDVisualisation - Clear image when source changes
* Fix - Preserve value when updating json-editor range
* LEDVisualisation - Clear image when no component is active
* Allow to have password handled by Password-Manager (#1263)
* Update default signal detection area to green assuming rainbow grabber
* LED Visualisation - Handle empty priority update
* Fix yuv420 in v4l2 grabber
* V4L2-Grabber discovery - Only report grabbers with valid video input information
* Grabber - Update static variables to have them working in release build
* LED Visualisation - ClearImage when no priorities
* LED Visualisation - Fix Logo resizing issue
* LED Visualisation - Have nearly black background and negative logo
Co-authored-by: LordGrey <lordgrey.emmel@gmail.com>
Co-authored-by: LordGrey <48840279+Lord-Grey@users.noreply.github.com>
2021-07-14 20:48:33 +02:00
}
2021-07-17 20:55:16 +02:00
2023-02-19 09:36:39 +01:00
if ( config . contains ( " grabberAudio " ) )
{
QJsonObject newGrabberAudioConfig = config [ " grabberAudio " ] . toObject ( ) ;
//Add new element enable
if ( ! newGrabberAudioConfig . contains ( " enable " ) )
{
newGrabberAudioConfig [ " enable " ] = false ;
migrated = true ;
}
config [ " grabberAudio " ] = newGrabberAudioConfig ;
Debug ( _log , " GrabberAudio records migrated " ) ;
}
2021-10-16 13:54:18 +02:00
if ( config . contains ( " framegrabber " ) )
2021-07-17 20:55:16 +02:00
{
2021-10-16 13:54:18 +02:00
QJsonObject newFramegrabberConfig = config [ " framegrabber " ] . toObject ( ) ;
Media Foundation/V4L2 grabber ... (#1119)
* - New Media Foundation grabber
- JsonAPI available grabber fix
- commented json config removed
* Added libjpeg-turbo to dependencies
* Fix OSX build
Removed Azure Pipelines from build scripts
* Remove Platform from Dashboard
* Correct Grabber Namings
* Grabber UI improvements, generic JSONEditor Selection Update
* Active grabber fix
* Stop Framebuffer grabber on failure
* - Image format NV12 and I420 added
- Flip mode
- Scaling factor for MJPEG
- VSCode (compile before run)
- CI (push) dependency libjpeg-turbo added
* Refactor MediaFoundation (Part 1)
* Remove QDebug output
* Added image flipping ability to MF Grabber
* fix issue 1160
* -Reload MF Grabber only once per WebUI update
- Cleanup
* Improvements
* - Set 'Software Frame Decimation' begin to 0
- Removed grabber specific device name from Log
- Keep pixel format when switching resolution
- Display 'Flip mode' correct in Log
- BGR24 images always flipped
* Refactor MediaFoundation (Part 2)
* Refactor V4L2 grabber (part 1) (#62)
* Media Foundation grabber adapted to V4L2 change
* Enable Media Foundation grabber on windows
* Have fps as int, fix height typo
* Added video standards to JsonAPI output
* Error handling in source reader improved
* Fix "Frame to small" error
* Discovery VideoSources and Dynamically Update Editor
* Hide all element when no video grabber discovered, upate naming
* Do not show unsupported grabbers
* Copy Log to Clipboard
* Update Grabber schema and Defaults
* Update access levels and validate crop ranges
* Height and width in Qt grabber corrected
* Correct formatting
* Untabify
* Global component states across instances
* Components divided on the dashboard
* refactor
* Fix Merge-issues
* Database migration aligning with updated grabber model
* Align Grabber.js with new utility functions
* Allow editor-validation for enum-lists
* Handle "Show Explainations scenario" correctly
* Grabber - Ensure save is only possible on valid content
* Dashboard update + fix GlobalSignal connection
* Ensure default database is populated with current release
* Correct grabber4L2 access level
* Display Signal detection area in preview
* Write Hyperion version into default config on compiling.
* Create defaultconfig.json dynamically
* WebUI changes
* Correct grabber config look-ups
* Refactor i18n language loading
* Fix en.json
* Split global capture from instance capture config
* Update grabber default values
* Standalone grabber: Add --debug switch
* Enhance showInputOptionsForKey for multiple keys
* Add grabber instance link to system grabber config
* Only show signal detection area, if grabber is enabled
* Always show Active element on grabber page
* Remote control - Only display gabber status, if global grabber is enabled
* WebUI optimization (thx to @mkcologne)
Start Grabber only when global settings are enabled
Fixed an issue in the WebUI preview
* V4L2/MF changes
* Jsoneditor, Correct translation for default values
* Refactor LED-Device handling in UI and make element naming consistent
* MF Discovery extended
* Fix LGTM finding
* Support Grabber Bri, Hue, Sat and Con in UI, plus their defaults
* Concider Access level for item filtering
* Concider Access level for item filtering
* Revert "Concider Access level for item filtering"
This reverts commit 5b0ce3c0f2de67e0c43788190cfff45614706129.
* Disable fpsSoftwareDecimation for framegrabber, as not supported yet
* JSON-Editor- Add updated schema for validation on dynamic elements
* added V4L2 color IDs
* LGTM findings fix
* destroy SR callback only on exit
* Grabber.js - Hide elements not supported by platform
* Fixed freezing start effect
* Grabber UI - Hardware controls - Show current values and allow to reset to defaults
* Grabber - Discovery - Add current values to properties
* Small things
* Clean-up Effects and have ENDLESS consistently defined
* Fix on/off/on priority during startup, by initializing _prevVisComp in line with background priority
* Add missing translation mappings
* DirectX Grabber reactivated/ QT Grabber size decimation fixed
* typo in push-master workflow
* Use PreciseTimer for Grabber to ensure stable FPS timing
* Set default Screencapture rate consistently
* Fix libjpeg-turbo download
* Remove Zero character from file
* docker-compile Add PLATFORM parameter, only copy output file after successful compile
* Framebuffer, Dispmanx, OSX, AML Grabber discovery, various clean-up and consistencies across grabbers
* Fix merge problem - on docker-compile Add PLATFORM parameter, only copy output file after successful compile
* Fix definition
* OSXFRameGrabber - Revert cast
* Clean-ups nach Feedback
* Disable certain libraries when building armlogic via standard stretch image as developer
* Add CEC availability to ServerInfo to have it platform independent
* Grabber UI - Fix problem that crop values are not populated when refining editor rage
* Preserve value when updating json-editor range
* LEDVisualisation - Clear image when source changes
* Fix - Preserve value when updating json-editor range
* LEDVisualisation - Clear image when no component is active
* Allow to have password handled by Password-Manager (#1263)
* Update default signal detection area to green assuming rainbow grabber
* LED Visualisation - Handle empty priority update
* Fix yuv420 in v4l2 grabber
* V4L2-Grabber discovery - Only report grabbers with valid video input information
* Grabber - Update static variables to have them working in release build
* LED Visualisation - ClearImage when no priorities
* LED Visualisation - Fix Logo resizing issue
* LED Visualisation - Have nearly black background and negative logo
Co-authored-by: LordGrey <lordgrey.emmel@gmail.com>
Co-authored-by: LordGrey <48840279+Lord-Grey@users.noreply.github.com>
2021-07-14 20:48:33 +02:00
2021-10-16 13:54:18 +02:00
//Align element namings with grabberV4L2
//Rename element type -> device
if ( newFramegrabberConfig . contains ( " type " ) )
{
newFramegrabberConfig [ " device " ] = newFramegrabberConfig [ " type " ] . toString ( ) ;
newFramegrabberConfig . remove ( " type " ) ;
migrated = true ;
}
//Rename element frequency_Hz -> fps
if ( newFramegrabberConfig . contains ( " frequency_Hz " ) )
{
newFramegrabberConfig [ " fps " ] = newFramegrabberConfig [ " frequency_Hz " ] . toInt ( 25 ) ;
newFramegrabberConfig . remove ( " frequency_Hz " ) ;
migrated = true ;
}
Media Foundation/V4L2 grabber ... (#1119)
* - New Media Foundation grabber
- JsonAPI available grabber fix
- commented json config removed
* Added libjpeg-turbo to dependencies
* Fix OSX build
Removed Azure Pipelines from build scripts
* Remove Platform from Dashboard
* Correct Grabber Namings
* Grabber UI improvements, generic JSONEditor Selection Update
* Active grabber fix
* Stop Framebuffer grabber on failure
* - Image format NV12 and I420 added
- Flip mode
- Scaling factor for MJPEG
- VSCode (compile before run)
- CI (push) dependency libjpeg-turbo added
* Refactor MediaFoundation (Part 1)
* Remove QDebug output
* Added image flipping ability to MF Grabber
* fix issue 1160
* -Reload MF Grabber only once per WebUI update
- Cleanup
* Improvements
* - Set 'Software Frame Decimation' begin to 0
- Removed grabber specific device name from Log
- Keep pixel format when switching resolution
- Display 'Flip mode' correct in Log
- BGR24 images always flipped
* Refactor MediaFoundation (Part 2)
* Refactor V4L2 grabber (part 1) (#62)
* Media Foundation grabber adapted to V4L2 change
* Enable Media Foundation grabber on windows
* Have fps as int, fix height typo
* Added video standards to JsonAPI output
* Error handling in source reader improved
* Fix "Frame to small" error
* Discovery VideoSources and Dynamically Update Editor
* Hide all element when no video grabber discovered, upate naming
* Do not show unsupported grabbers
* Copy Log to Clipboard
* Update Grabber schema and Defaults
* Update access levels and validate crop ranges
* Height and width in Qt grabber corrected
* Correct formatting
* Untabify
* Global component states across instances
* Components divided on the dashboard
* refactor
* Fix Merge-issues
* Database migration aligning with updated grabber model
* Align Grabber.js with new utility functions
* Allow editor-validation for enum-lists
* Handle "Show Explainations scenario" correctly
* Grabber - Ensure save is only possible on valid content
* Dashboard update + fix GlobalSignal connection
* Ensure default database is populated with current release
* Correct grabber4L2 access level
* Display Signal detection area in preview
* Write Hyperion version into default config on compiling.
* Create defaultconfig.json dynamically
* WebUI changes
* Correct grabber config look-ups
* Refactor i18n language loading
* Fix en.json
* Split global capture from instance capture config
* Update grabber default values
* Standalone grabber: Add --debug switch
* Enhance showInputOptionsForKey for multiple keys
* Add grabber instance link to system grabber config
* Only show signal detection area, if grabber is enabled
* Always show Active element on grabber page
* Remote control - Only display gabber status, if global grabber is enabled
* WebUI optimization (thx to @mkcologne)
Start Grabber only when global settings are enabled
Fixed an issue in the WebUI preview
* V4L2/MF changes
* Jsoneditor, Correct translation for default values
* Refactor LED-Device handling in UI and make element naming consistent
* MF Discovery extended
* Fix LGTM finding
* Support Grabber Bri, Hue, Sat and Con in UI, plus their defaults
* Concider Access level for item filtering
* Concider Access level for item filtering
* Revert "Concider Access level for item filtering"
This reverts commit 5b0ce3c0f2de67e0c43788190cfff45614706129.
* Disable fpsSoftwareDecimation for framegrabber, as not supported yet
* JSON-Editor- Add updated schema for validation on dynamic elements
* added V4L2 color IDs
* LGTM findings fix
* destroy SR callback only on exit
* Grabber.js - Hide elements not supported by platform
* Fixed freezing start effect
* Grabber UI - Hardware controls - Show current values and allow to reset to defaults
* Grabber - Discovery - Add current values to properties
* Small things
* Clean-up Effects and have ENDLESS consistently defined
* Fix on/off/on priority during startup, by initializing _prevVisComp in line with background priority
* Add missing translation mappings
* DirectX Grabber reactivated/ QT Grabber size decimation fixed
* typo in push-master workflow
* Use PreciseTimer for Grabber to ensure stable FPS timing
* Set default Screencapture rate consistently
* Fix libjpeg-turbo download
* Remove Zero character from file
* docker-compile Add PLATFORM parameter, only copy output file after successful compile
* Framebuffer, Dispmanx, OSX, AML Grabber discovery, various clean-up and consistencies across grabbers
* Fix merge problem - on docker-compile Add PLATFORM parameter, only copy output file after successful compile
* Fix definition
* OSXFRameGrabber - Revert cast
* Clean-ups nach Feedback
* Disable certain libraries when building armlogic via standard stretch image as developer
* Add CEC availability to ServerInfo to have it platform independent
* Grabber UI - Fix problem that crop values are not populated when refining editor rage
* Preserve value when updating json-editor range
* LEDVisualisation - Clear image when source changes
* Fix - Preserve value when updating json-editor range
* LEDVisualisation - Clear image when no component is active
* Allow to have password handled by Password-Manager (#1263)
* Update default signal detection area to green assuming rainbow grabber
* LED Visualisation - Handle empty priority update
* Fix yuv420 in v4l2 grabber
* V4L2-Grabber discovery - Only report grabbers with valid video input information
* Grabber - Update static variables to have them working in release build
* LED Visualisation - ClearImage when no priorities
* LED Visualisation - Fix Logo resizing issue
* LED Visualisation - Have nearly black background and negative logo
Co-authored-by: LordGrey <lordgrey.emmel@gmail.com>
Co-authored-by: LordGrey <48840279+Lord-Grey@users.noreply.github.com>
2021-07-14 20:48:33 +02:00
2021-10-16 13:54:18 +02:00
//Rename element display -> input
if ( newFramegrabberConfig . contains ( " display " ) )
{
newFramegrabberConfig [ " input " ] = newFramegrabberConfig [ " display " ] ;
newFramegrabberConfig . remove ( " display " ) ;
migrated = true ;
}
Media Foundation/V4L2 grabber ... (#1119)
* - New Media Foundation grabber
- JsonAPI available grabber fix
- commented json config removed
* Added libjpeg-turbo to dependencies
* Fix OSX build
Removed Azure Pipelines from build scripts
* Remove Platform from Dashboard
* Correct Grabber Namings
* Grabber UI improvements, generic JSONEditor Selection Update
* Active grabber fix
* Stop Framebuffer grabber on failure
* - Image format NV12 and I420 added
- Flip mode
- Scaling factor for MJPEG
- VSCode (compile before run)
- CI (push) dependency libjpeg-turbo added
* Refactor MediaFoundation (Part 1)
* Remove QDebug output
* Added image flipping ability to MF Grabber
* fix issue 1160
* -Reload MF Grabber only once per WebUI update
- Cleanup
* Improvements
* - Set 'Software Frame Decimation' begin to 0
- Removed grabber specific device name from Log
- Keep pixel format when switching resolution
- Display 'Flip mode' correct in Log
- BGR24 images always flipped
* Refactor MediaFoundation (Part 2)
* Refactor V4L2 grabber (part 1) (#62)
* Media Foundation grabber adapted to V4L2 change
* Enable Media Foundation grabber on windows
* Have fps as int, fix height typo
* Added video standards to JsonAPI output
* Error handling in source reader improved
* Fix "Frame to small" error
* Discovery VideoSources and Dynamically Update Editor
* Hide all element when no video grabber discovered, upate naming
* Do not show unsupported grabbers
* Copy Log to Clipboard
* Update Grabber schema and Defaults
* Update access levels and validate crop ranges
* Height and width in Qt grabber corrected
* Correct formatting
* Untabify
* Global component states across instances
* Components divided on the dashboard
* refactor
* Fix Merge-issues
* Database migration aligning with updated grabber model
* Align Grabber.js with new utility functions
* Allow editor-validation for enum-lists
* Handle "Show Explainations scenario" correctly
* Grabber - Ensure save is only possible on valid content
* Dashboard update + fix GlobalSignal connection
* Ensure default database is populated with current release
* Correct grabber4L2 access level
* Display Signal detection area in preview
* Write Hyperion version into default config on compiling.
* Create defaultconfig.json dynamically
* WebUI changes
* Correct grabber config look-ups
* Refactor i18n language loading
* Fix en.json
* Split global capture from instance capture config
* Update grabber default values
* Standalone grabber: Add --debug switch
* Enhance showInputOptionsForKey for multiple keys
* Add grabber instance link to system grabber config
* Only show signal detection area, if grabber is enabled
* Always show Active element on grabber page
* Remote control - Only display gabber status, if global grabber is enabled
* WebUI optimization (thx to @mkcologne)
Start Grabber only when global settings are enabled
Fixed an issue in the WebUI preview
* V4L2/MF changes
* Jsoneditor, Correct translation for default values
* Refactor LED-Device handling in UI and make element naming consistent
* MF Discovery extended
* Fix LGTM finding
* Support Grabber Bri, Hue, Sat and Con in UI, plus their defaults
* Concider Access level for item filtering
* Concider Access level for item filtering
* Revert "Concider Access level for item filtering"
This reverts commit 5b0ce3c0f2de67e0c43788190cfff45614706129.
* Disable fpsSoftwareDecimation for framegrabber, as not supported yet
* JSON-Editor- Add updated schema for validation on dynamic elements
* added V4L2 color IDs
* LGTM findings fix
* destroy SR callback only on exit
* Grabber.js - Hide elements not supported by platform
* Fixed freezing start effect
* Grabber UI - Hardware controls - Show current values and allow to reset to defaults
* Grabber - Discovery - Add current values to properties
* Small things
* Clean-up Effects and have ENDLESS consistently defined
* Fix on/off/on priority during startup, by initializing _prevVisComp in line with background priority
* Add missing translation mappings
* DirectX Grabber reactivated/ QT Grabber size decimation fixed
* typo in push-master workflow
* Use PreciseTimer for Grabber to ensure stable FPS timing
* Set default Screencapture rate consistently
* Fix libjpeg-turbo download
* Remove Zero character from file
* docker-compile Add PLATFORM parameter, only copy output file after successful compile
* Framebuffer, Dispmanx, OSX, AML Grabber discovery, various clean-up and consistencies across grabbers
* Fix merge problem - on docker-compile Add PLATFORM parameter, only copy output file after successful compile
* Fix definition
* OSXFRameGrabber - Revert cast
* Clean-ups nach Feedback
* Disable certain libraries when building armlogic via standard stretch image as developer
* Add CEC availability to ServerInfo to have it platform independent
* Grabber UI - Fix problem that crop values are not populated when refining editor rage
* Preserve value when updating json-editor range
* LEDVisualisation - Clear image when source changes
* Fix - Preserve value when updating json-editor range
* LEDVisualisation - Clear image when no component is active
* Allow to have password handled by Password-Manager (#1263)
* Update default signal detection area to green assuming rainbow grabber
* LED Visualisation - Handle empty priority update
* Fix yuv420 in v4l2 grabber
* V4L2-Grabber discovery - Only report grabbers with valid video input information
* Grabber - Update static variables to have them working in release build
* LED Visualisation - ClearImage when no priorities
* LED Visualisation - Fix Logo resizing issue
* LED Visualisation - Have nearly black background and negative logo
Co-authored-by: LordGrey <lordgrey.emmel@gmail.com>
Co-authored-by: LordGrey <48840279+Lord-Grey@users.noreply.github.com>
2021-07-14 20:48:33 +02:00
2021-10-16 13:54:18 +02:00
//Add new element enable
if ( ! newFramegrabberConfig . contains ( " enable " ) )
{
newFramegrabberConfig [ " enable " ] = false ;
migrated = true ;
}
2021-07-17 20:55:16 +02:00
2021-10-16 13:54:18 +02:00
config [ " framegrabber " ] = newFramegrabberConfig ;
Debug ( _log , " Framegrabber records migrated " ) ;
2021-07-17 20:55:16 +02:00
}
2021-04-24 19:37:29 +02:00
}
2021-11-17 21:30:43 +01:00
//Migration steps for versions <= 2.0.12
_previousVersion = targetVersion ;
targetVersion . setVersion ( " 2.0.12 " ) ;
if ( _previousVersion < = targetVersion )
{
Info ( _log , " Instance [%u]: Migrate from version [%s] to version [%s] or later " , _instance , _previousVersion . getVersion ( ) . c_str ( ) , targetVersion . getVersion ( ) . c_str ( ) ) ;
// Have Hostname/IP-address separate from port for LED-Devices
if ( config . contains ( " device " ) )
{
QJsonObject newDeviceConfig = config [ " device " ] . toObject ( ) ;
if ( newDeviceConfig . contains ( " host " ) )
{
QString oldHost = newDeviceConfig [ " host " ] . toString ( ) ;
// Resolve hostname and port
QStringList addressparts = QStringUtils : : split ( oldHost , " : " , QStringUtils : : SplitBehavior : : SkipEmptyParts ) ;
newDeviceConfig [ " host " ] = addressparts [ 0 ] ;
if ( addressparts . size ( ) > 1 )
{
if ( ! newDeviceConfig . contains ( " port " ) )
{
newDeviceConfig [ " port " ] = addressparts [ 1 ] . toInt ( ) ;
}
migrated = true ;
}
2021-11-20 16:20:01 +01:00
}
2021-11-17 21:30:43 +01:00
2021-11-20 16:20:01 +01:00
if ( newDeviceConfig . contains ( " type " ) )
{
QString type = newDeviceConfig [ " type " ] . toString ( ) ;
if ( type = = " apa102 " )
2021-11-17 21:30:43 +01:00
{
2021-11-20 16:20:01 +01:00
if ( newDeviceConfig . contains ( " colorOrder " ) )
{
QString colorOrder = newDeviceConfig [ " colorOrder " ] . toString ( ) ;
if ( colorOrder = = " bgr " )
{
newDeviceConfig [ " colorOrder " ] = " rgb " ;
migrated = true ;
}
}
2021-11-17 21:30:43 +01:00
}
}
2021-11-20 16:20:01 +01:00
if ( migrated )
{
config [ " device " ] = newDeviceConfig ;
Debug ( _log , " LED-Device records migrated " ) ;
}
2021-11-17 21:30:43 +01:00
}
// Have Hostname/IP-address separate from port for Forwarder
if ( config . contains ( " forwarder " ) )
{
QJsonObject newForwarderConfig = config [ " forwarder " ] . toObject ( ) ;
QJsonArray json ;
if ( newForwarderConfig . contains ( " json " ) )
{
2023-09-09 22:10:22 +02:00
const QJsonArray oldJson = newForwarderConfig [ " json " ] . toArray ( ) ;
2021-11-17 21:30:43 +01:00
QJsonObject newJsonConfig ;
2023-09-09 22:10:22 +02:00
for ( const QJsonValue & value : oldJson )
2021-11-17 21:30:43 +01:00
{
if ( value . isString ( ) )
{
QString oldHost = value . toString ( ) ;
// Resolve hostname and port
QStringList addressparts = QStringUtils : : split ( oldHost , " : " , QStringUtils : : SplitBehavior : : SkipEmptyParts ) ;
QString host = addressparts [ 0 ] ;
if ( host ! = " 127.0.0.1 " )
{
newJsonConfig [ " host " ] = host ;
if ( addressparts . size ( ) > 1 )
{
newJsonConfig [ " port " ] = addressparts [ 1 ] . toInt ( ) ;
}
else
{
newJsonConfig [ " port " ] = 19444 ;
}
2022-01-22 17:48:03 +01:00
newJsonConfig [ " name " ] = host ;
2021-11-17 21:30:43 +01:00
json . append ( newJsonConfig ) ;
migrated = true ;
}
}
}
if ( ! json . isEmpty ( ) )
{
2022-01-22 17:48:03 +01:00
newForwarderConfig [ " jsonapi " ] = json ;
2021-11-17 21:30:43 +01:00
}
2022-01-22 17:48:03 +01:00
newForwarderConfig . remove ( " json " ) ;
migrated = true ;
2021-11-17 21:30:43 +01:00
}
QJsonArray flatbuffer ;
if ( newForwarderConfig . contains ( " flat " ) )
{
2023-09-09 22:10:22 +02:00
const QJsonArray oldFlatbuffer = newForwarderConfig [ " flat " ] . toArray ( ) ;
2021-11-17 21:30:43 +01:00
QJsonObject newFlattbufferConfig ;
2023-09-09 22:10:22 +02:00
for ( const QJsonValue & value : oldFlatbuffer )
2021-11-17 21:30:43 +01:00
{
if ( value . isString ( ) )
{
QString oldHost = value . toString ( ) ;
// Resolve hostname and port
QStringList addressparts = QStringUtils : : split ( oldHost , " : " , QStringUtils : : SplitBehavior : : SkipEmptyParts ) ;
QString host = addressparts [ 0 ] ;
if ( host ! = " 127.0.0.1 " )
{
newFlattbufferConfig [ " host " ] = host ;
if ( addressparts . size ( ) > 1 )
{
newFlattbufferConfig [ " port " ] = addressparts [ 1 ] . toInt ( ) ;
}
else
{
newFlattbufferConfig [ " port " ] = 19400 ;
}
2022-01-22 17:48:03 +01:00
newFlattbufferConfig [ " name " ] = host ;
2021-11-17 21:30:43 +01:00
flatbuffer . append ( newFlattbufferConfig ) ;
migrated = true ;
}
}
if ( ! flatbuffer . isEmpty ( ) )
{
2022-01-22 17:48:03 +01:00
newForwarderConfig [ " flatbuffer " ] = flatbuffer ;
2021-11-17 21:30:43 +01:00
}
2022-01-22 17:48:03 +01:00
newForwarderConfig . remove ( " flat " ) ;
migrated = true ;
2021-11-17 21:30:43 +01:00
}
}
if ( json . isEmpty ( ) & & flatbuffer . isEmpty ( ) )
{
newForwarderConfig [ " enable " ] = false ;
}
if ( migrated )
{
config [ " forwarder " ] = newForwarderConfig ;
Debug ( _log , " Forwarder records migrated " ) ;
}
}
}
2022-09-30 17:02:40 +02:00
//Migration steps for versions <= 2.0.13
targetVersion . setVersion ( " 2.0.13 " ) ;
if ( _previousVersion < = targetVersion )
{
Info ( _log , " Instance [%u]: Migrate from version [%s] to version [%s] or later " , _instance , _previousVersion . getVersion ( ) . c_str ( ) , targetVersion . getVersion ( ) . c_str ( ) ) ;
// Have Hostname/IP-address separate from port for LED-Devices
if ( config . contains ( " device " ) )
{
QJsonObject newDeviceConfig = config [ " device " ] . toObject ( ) ;
if ( newDeviceConfig . contains ( " type " ) )
{
QString type = newDeviceConfig [ " type " ] . toString ( ) ;
const QStringList serialDevices { " adalight " , " dmx " , " atmo " , " sedu " , " tpm2 " , " karate " } ;
if ( serialDevices . contains ( type ) )
{
if ( ! newDeviceConfig . contains ( " rateList " ) )
{
newDeviceConfig [ " rateList " ] = " CUSTOM " ;
migrated = true ;
}
}
if ( type = = " adalight " )
{
if ( newDeviceConfig . contains ( " lightberry_apa102_mode " ) )
{
bool lightberry_apa102_mode = newDeviceConfig [ " lightberry_apa102_mode " ] . toBool ( ) ;
if ( lightberry_apa102_mode )
{
newDeviceConfig [ " streamProtocol " ] = " 1 " ;
}
else
{
newDeviceConfig [ " streamProtocol " ] = " 0 " ;
}
newDeviceConfig . remove ( " lightberry_apa102_mode " ) ;
migrated = true ;
}
}
}
if ( migrated )
{
config [ " device " ] = newDeviceConfig ;
Debug ( _log , " LED-Device records migrated " ) ;
}
}
}
2021-02-17 12:29:53 +01:00
}
}
2020-02-26 18:54:56 +01:00
return migrated ;
}