refactor: Several random fixes + Experimental playground (#917)

This commit is contained in:
Murat Seker 2020-08-02 22:37:52 +02:00 committed by GitHub
parent d183c630c8
commit b7a9a10223
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
13 changed files with 130 additions and 96 deletions

View File

@ -140,7 +140,7 @@ If you used a `.deb` package please uninstall it before you upgrade
- Resolve enable state for v4l and screen capture (#728)
- Enable/Disable loops for components
- Runs now on x86_64 LibreElec (missing libs) (#736)
- Brightness componsation is now visible for configuration (#746)
- Brightness compensation is now visible for configuration (#746)
- Prevent malformed image size for effects with specific led layouts (#746)
### Changed:
@ -170,7 +170,7 @@ If you used a `.deb` package please uninstall it before you upgrade
- Smoothing comp state on startup (#685)
- Azure GitHub release title (#686)
- SSL/Avahi problems in previous release (#689)
- WebUI Version Check to SemVer. Also addes "Alpha" Channel (#692)
- WebUI Version Check to SemVer. Also adds "Alpha" Channel (#692)
### Removed
- Travis CI tests (#684)

View File

@ -36,18 +36,19 @@ else()
endif()
# Set build variables
SET ( DEFAULT_AMLOGIC OFF )
SET ( DEFAULT_DISPMANX OFF )
SET ( DEFAULT_OSX OFF )
SET ( DEFAULT_X11 OFF )
SET ( DEFAULT_QT ON )
SET ( DEFAULT_WS281XPWM OFF )
SET ( DEFAULT_AVAHI ON )
SET ( DEFAULT_USE_SHARED_AVAHI_LIBS ON )
SET ( DEFAULT_AMLOGIC OFF )
SET ( DEFAULT_DISPMANX OFF )
SET ( DEFAULT_OSX OFF )
SET ( DEFAULT_X11 OFF )
SET ( DEFAULT_QT ON )
SET ( DEFAULT_WS281XPWM OFF )
SET ( DEFAULT_AVAHI ON )
SET ( DEFAULT_USE_SHARED_AVAHI_LIBS ON )
SET ( DEFAULT_USE_SYSTEM_FLATBUFFERS_LIBS OFF )
SET ( DEFAULT_USE_SYSTEM_PROTO_LIBS OFF )
SET ( DEFAULT_USE_SYSTEM_MBEDTLS_LIBS OFF )
SET ( DEFAULT_TESTS OFF )
SET ( DEFAULT_USE_SYSTEM_PROTO_LIBS OFF )
SET ( DEFAULT_USE_SYSTEM_MBEDTLS_LIBS OFF )
SET ( DEFAULT_TESTS OFF )
SET ( DEFAULT_EXPERIMENTAL OFF )
IF ( ${CMAKE_SYSTEM} MATCHES "Linux" )
SET ( DEFAULT_V4L2 ON )
@ -190,6 +191,9 @@ message(STATUS "ENABLE_TESTS = ${ENABLE_TESTS}")
option(ENABLE_PROFILER "enable profiler capabilities - not for release code" OFF)
message(STATUS "ENABLE_PROFILER = ${ENABLE_PROFILER}")
option(ENABLE_EXPERIMENTAL "Compile experimental features" ${DEFAULT_EXPERIMENTAL})
message(STATUS "ENABLE_EXPERIMENTAL = ${ENABLE_EXPERIMENTAL}")
SET ( FLATBUFFERS_INSTALL_BIN_DIR ${CMAKE_BINARY_DIR}/flatbuf )
SET ( FLATBUFFERS_INSTALL_LIB_DIR ${CMAKE_BINARY_DIR}/flatbuf )

View File

@ -94,13 +94,13 @@ Error( log_main, "oh to crazy, aborting");
// quick logging, when only one message exists and want no typing overhead - or usage in static functions
Info( Logger::getInstance("LedDevice"), "Leddevice %s started", "PublicStreetLighting");
// a bit mor complex - with printf like format
// a bit more complex - with printf like format
Info( log_main, "hello %s, you have %d messages", "Dax", 25);
// conditional messages
WarningIf( (value>threshold), log_main, "Alert, your value is greater then %d", threshold );
```
The amount of "%" mus match with following arguments
The amount of "%" must match with following arguments
#### The Placeholders
- %s for strings (this are cstrings, when having std::string use myStdString.c_str() to convert)
@ -110,7 +110,7 @@ The amount of "%" mus match with following arguments
#### Log Level
* Debug - used when message is more or less for the developer or for trouble shooting
* Info - used for not absolutly developer stuff messages for what's going on
* Info - used for not absolutely developer stuff messages for what's going on
* Warning - warn if something is not as it should be, but didn't harm
* Error - used when an error occurs
@ -120,7 +120,7 @@ The amount of "%" mus match with following arguments
> TODO
## Visual Studio Code
**We assume that you sucessfully compiled Hyperion with the [Compile HowTo](CompileHowto.md) WITHOUT Docker** \
**We assume that you successfully compiled Hyperion with the [Compile HowTo](CompileHowto.md) WITHOUT Docker** \
If you want to use VSCode for development follow the steps.
- Install [VSCode](https://code.visualstudio.com/). On Ubuntu 16.04+ you can also use the [Snapcraft VSCode](https://snapcraft.io/code) package.

View File

@ -42,6 +42,9 @@
// Define to enable profiler for development purpose
#cmakedefine ENABLE_PROFILER
// Define to enable experimental features
#cmakedefine ENABLE_EXPERIMENTAL
// the hyperion build id string
#define HYPERION_BUILD_ID "${HYPERION_BUILD_ID}"
#define HYPERION_GIT_REMOTE "${HYPERION_GIT_REMOTE}"

View File

@ -1,24 +1,46 @@
#!/bin/sh
# exit on error
set -e
TARGET=${1:-hyperion}
CFG="${2:-Release}"
INST="$( [ "${3:-}" = "install" ] && echo true || echo false )"
sudo apt-get update
sudo apt-get install git cmake build-essential qtbase5-dev libqt5serialport5-dev libusb-1.0-0-dev libturbojpeg0-dev python3-dev libcec-dev libxcb-util0-dev libxcb-randr0-dev libxrandr-dev libxrender-dev libavahi-core-dev libavahi-compat-libdnssd-dev libssl-dev libjpeg-dev libqt5sql5-sqlite zlib1g-dev || exit 1
sudo apt-get install \
git \
cmake \
build-essential \
qtbase5-dev \
libqt5serialport5-dev \
libusb-1.0-0-dev \
libturbojpeg0-dev \
python3-dev \
libcec-dev \
libxcb-util0-dev \
libxcb-randr0-dev \
libxrandr-dev \
libxrender-dev \
libavahi-core-dev \
libavahi-compat-libdnssd-dev \
libssl-dev \
libjpeg-dev \
libqt5sql5-sqlite \
zlib1g-dev \
if [ -e /dev/vc-cma -a -e /dev/vc-mem ]
then
sudo apt-get install libraspberrypi-dev || exit 1
sudo apt-get install libraspberrypi-dev
fi
git clone --recursive https://github.com/hyperion-project/hyperion.ng.git ${TARGET} || exit 1
git clone --recursive https://github.com/hyperion-project/hyperion.ng.git ${TARGET}
rm -rf $TARGET/build
mkdir -p $TARGET/build || exit 1
cd $TARGET/build || exit 1
cmake -DCMAKE_BUILD_TYPE=$CFG .. || exit 1
make -j $(nproc) || exit 1
rm -rf $TARGET/build
mkdir -p $TARGET/build
cd $TARGET/build
cmake -DCMAKE_BUILD_TYPE=$CFG ..
make -j $(nproc)
# optional: install into your system
$INST && sudo make install/strip

View File

@ -97,9 +97,9 @@ if [ $OS_OPENELEC -eq 1 ]; then
echo '---> Remove the OpenELEC Hyperion binaries and hyperion.config.json'
rm -rv /storage/hyperion 2>/dev/null
rm -v /storage/.config/hyperion.config.json 2>/dev/null
else
else
#Remove binaries on all distributions/systems (not OpenELEC)
echo "---> Remove links to the binaries"
echo "---> Remove links to the binaries"
rm -v /usr/bin/hyperiond 2>/dev/null
rm -v /usr/bin/hyperion-remote 2>/dev/null
rm -v /usr/bin/hyperion-v4l2 2>/dev/null
@ -112,8 +112,8 @@ else
rm -rv /etc/hyperion 2>/dev/null
rm -rv /usr/share/hyperion 2>/dev/null
fi
echo '*******************************************************************************'
echo '*******************************************************************************'
echo 'Hyperion successful removed!'
echo '*******************************************************************************'
echo '*******************************************************************************'
exit 0

View File

@ -10,7 +10,7 @@ set(CoreFoundation_FOUND false)
set(CoreFoundation_INCLUDE_DIR)
set(CoreFoundation_LIBRARY)
if(APPLE)
if(APPLE)
# The only platform it makes sense to check for CoreFoundation
find_library(CoreFoundation CoreFoundation)
if(CoreFoundation)

View File

@ -10,7 +10,7 @@ set(IOKit_FOUND false)
set(IOKit_INCLUDE_DIR)
set(IOKit_LIBRARY)
if(APPLE)
if(APPLE)
# The only platform it makes sense to check for IOKit
find_library(IOKit IOKit)
if(IOKit)

View File

@ -1,5 +1,5 @@
SET(CMAKE_SYSTEM_NAME Linux)
SET(CMAKE_SYSTEM_VERSION 1)
SET(CMAKE_SYSTEM_NAME Linux)
SET(CMAKE_SYSTEM_VERSION 1)
SET(CROSSROOT $ENV{HOME}/crosscompile)
SET(DEVROOT ${CROSSROOT}/hummingboard)
@ -8,20 +8,20 @@ SET(CUBIXCROSS_DIR ${DEVROOT}/tools)
SET(TOOLROOT ${CUBIXCROSS_DIR}/gcc-linaro-arm-linux-gnueabihf-4.8-2013.10_linux/ )
# specify the cross compiler
# specify the cross compiler
SET(CMAKE_C_COMPILER ${TOOLROOT}/bin/arm-linux-gnueabihf-gcc)
SET(CMAKE_CXX_COMPILER ${TOOLROOT}/bin/arm-linux-gnueabihf-g++)
SET(CUBIX_FLAGS "-march=armv7-a -mcpu=cortex-a9 -mtune=cortex-a9 -mfpu=vfpv3 -mfloat-abi=hard")
SET(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "armhf" )
SET(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "armhf" )
SET(CMAKE_SYSROOT ${CUBIXROOT})
SET(CMAKE_FIND_ROOT_PATH ${CUBIXROOT})
# search for programs in the build host directories
# search for programs in the build host directories
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
# for libraries and headers in the target directories
SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
# for libraries and headers in the target directories
SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
#SET(CMAKE_FIND_ROOT_PATH_MODE_PACKAGES ONLY)

View File

@ -1,5 +1,5 @@
SET(CMAKE_SYSTEM_NAME Linux)
SET(CMAKE_SYSTEM_VERSION 1)
SET(CMAKE_SYSTEM_NAME Linux)
SET(CMAKE_SYSTEM_VERSION 1)
SET(CROSSROOT $ENV{HOME}/crosscompile)
SET(DEVROOT ${CROSSROOT}/raspberrypi)
@ -9,19 +9,19 @@ SET(PITOOLCHAIN ${DEVROOT}/tools)
SET(TOOLROOT ${PITOOLCHAIN}/gcc-linaro-7.4.1-2019.02-x86_64_arm-linux-gnueabihf )
SET(QT_BIN_PATH ${CROSSROOT}/Qt5/5.7/gcc_64/bin)
# specify the cross compiler
# specify the cross compiler
SET(CMAKE_C_COMPILER ${TOOLROOT}/bin/arm-linux-gnueabihf-gcc)
SET(CMAKE_CXX_COMPILER ${TOOLROOT}/bin/arm-linux-gnueabihf-g++)
SET(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "armhf" )
SET(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "armhf" )
SET(CMAKE_SYSROOT ${PIROOT})
SET(CMAKE_FIND_ROOT_PATH ${PIROOT})
# search for programs in the build host directories
# search for programs in the build host directories
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
# for libraries and headers in the target directories
SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
# for libraries and headers in the target directories
SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
#SET(CMAKE_FIND_ROOT_PATH_MODE_PACKAGES ONLY)

View File

@ -109,36 +109,36 @@
/// * cropRight : Cropping from the right [default=0]
/// * cropTop : Cropping from the top [default=0]
/// * cropBottom : Cropping from the bottom [default=0]
/// * signalDetection : enable/disable signal detection [default=true]
/// * cecDetection : enable/disable cec detection [default=true]
/// * signalDetection : enable/disable signal detection [default=false]
/// * cecDetection : enable/disable cec detection [default=false]
/// * redSignalThreshold : Signal threshold for the red channel between 0 and 100 [default=5]
/// * greenSignalThreshold : Signal threshold for the green channel between 0 and 100 [default=5]
/// * blueSignalThreshold : Signal threshold for the blue channel between 0 and 100 [default=5]
/// * sDHOffsetMin : area for signal detection - horizontal minimum offset value. Values between 0.0 and 1.0
/// * sDVOffsetMin : area for signal detection - vertical minimum offset value. Values between 0.0 and 1.0
/// * sDHOffsetMax : area for signal detection - horizontal maximum offset value. Values between 0.0 and 1.0
/// * sDVOffsetMax : area for signal detection - vertical maximum offset value. Values between 0.0 and 1.0
/// * sDHOffsetMin : area for signal detection - horizontal minimum offset value. Values between 0.0 and 1.0
/// * sDVOffsetMin : area for signal detection - vertical minimum offset value. Values between 0.0 and 1.0
/// * sDHOffsetMax : area for signal detection - horizontal maximum offset value. Values between 0.0 and 1.0
/// * sDVOffsetMax : area for signal detection - vertical maximum offset value. Values between 0.0 and 1.0
"grabberV4L2" :
{
"device" : "auto",
"width" : 0,
"height" : 0,
"standard" : "NO_CHANGE",
"sizeDecimation" : 8,
"priority" : 240,
"cropLeft" : 0,
"cropRight" : 0,
"cropTop" : 0,
"cropBottom" : 0,
"device" : "auto",
"width" : 0,
"height" : 0,
"standard" : "NO_CHANGE",
"sizeDecimation" : 8,
"priority" : 240,
"cropLeft" : 0,
"cropRight" : 0,
"cropTop" : 0,
"cropBottom" : 0,
"redSignalThreshold" : 5,
"greenSignalThreshold" : 5,
"blueSignalThreshold" : 5,
"signalDetection" : false,
"cecDetection" : false,
"sDVOffsetMin" : 0.25,
"sDHOffsetMin" : 0.25,
"sDVOffsetMax" : 0.75,
"sDHOffsetMax" : 0.75
"sDVOffsetMin" : 0.25,
"sDHOffsetMin" : 0.25,
"sDVOffsetMax" : 0.75,
"sDHOffsetMax" : 0.75
},
/// The configuration for the frame-grabber, contains the following items:

View File

@ -58,40 +58,40 @@
"grabberV4L2" :
{
"device" : "auto",
"input" : 0,
"width" : 0,
"height" : 0,
"fps" : 15,
"standard" : "NO_CHANGE",
"sizeDecimation" : 8,
"cropLeft" : 0,
"cropRight" : 0,
"cropTop" : 0,
"cropBottom" : 0,
"redSignalThreshold" : 5,
"greenSignalThreshold" : 5,
"blueSignalThreshold" : 5,
"signalDetection" : false,
"cecDetection" : false,
"sDVOffsetMin" : 0.25,
"sDHOffsetMin" : 0.25,
"sDVOffsetMax" : 0.75,
"sDHOffsetMax" : 0.75
"device" : "auto",
"input" : 0,
"width" : 0,
"height" : 0,
"fps" : 15,
"standard" : "NO_CHANGE",
"sizeDecimation" : 8,
"cropLeft" : 0,
"cropRight" : 0,
"cropTop" : 0,
"cropBottom" : 0,
"redSignalThreshold" : 5,
"greenSignalThreshold" : 5,
"blueSignalThreshold" : 5,
"signalDetection" : false,
"cecDetection" : false,
"sDVOffsetMin" : 0.25,
"sDHOffsetMin" : 0.25,
"sDVOffsetMax" : 0.75,
"sDHOffsetMax" : 0.75
},
"framegrabber" :
{
"type" : "auto",
"width" : 80,
"height" : 45,
"frequency_Hz" : 10,
"pixelDecimation" : 8,
"cropLeft" : 0,
"cropRight" : 0,
"cropTop" : 0,
"cropBottom" : 0,
"device" : "/dev/fb0"
"type" : "auto",
"width" : 80,
"height" : 45,
"frequency_Hz" : 10,
"pixelDecimation" : 8,
"cropLeft" : 0,
"cropRight" : 0,
"cropTop" : 0,
"cropBottom" : 0,
"device" : "/dev/fb0"
},
"blackborderdetector" :

View File

@ -27,3 +27,8 @@ endif()
if(ENABLE_AVAHI)
add_subdirectory(bonjour)
endif()
if(ENABLE_EXPERIMENTAL)
add_subdirectory(experimental)
endif()