Skip to content

Commit f068727

Browse files
committed
More HyperHDR libs
1 parent 5e83d6f commit f068727

File tree

145 files changed

+693
-1393
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

145 files changed

+693
-1393
lines changed

Diff for: .ci/ci_build.sh

+25-7
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ if [[ "$CI_NAME" == 'osx' || "$CI_NAME" == 'darwin' ]]; then
4747
CCACHE_PATH=$PWD
4848
cd ..
4949
cachecommand="-DCMAKE_C_COMPILER_LAUNCHER=ccache ${IS_ARCHIVE_SKIPPED}"
50-
export CCACHE_DIR=${CCACHE_PATH} && export CCACHE_COMPRESS=true && export CCACHE_COMPRESSLEVEL=1 && export CCACHE_MAXSIZE=400M
50+
export CCACHE_SLOPPINESS=pch_defines,time_macros && export CCACHE_DIR=${CCACHE_PATH} && export CCACHE_COMPRESS=true && export CCACHE_COMPRESSLEVEL=1 && export CCACHE_MAXSIZE=400M
5151
echo "CCache parameters: ${cachecommand}"
5252
ls -a .ccache
5353

@@ -70,15 +70,33 @@ if [[ "$CI_NAME" == 'osx' || "$CI_NAME" == 'darwin' ]]; then
7070
exit 1 || { echo "---> HyperHDR compilation failed! Abort"; exit 5; }
7171
fi
7272
elif [[ $CI_NAME == *"mingw64_nt"* || "$CI_NAME" == 'windows_nt' ]]; then
73-
echo "Start: windows"
74-
75-
echo "Number of Cores $NUMBER_OF_PROCESSORS"
76-
mkdir build || exit 1
73+
echo "Start: windows"
74+
echo "Number of cores: $NUMBER_OF_PROCESSORS"
75+
76+
if [[ "$USE_CCACHE" == '1' ]]; then
77+
echo "Using ccache"
78+
79+
mkdir -p .ccache
80+
81+
if [[ "$RESET_CACHE" == '1' ]]; then
82+
echo "Clearing ccache"
83+
pushd .
84+
cd .ccache && rm -rf ..?* .[!.]* *
85+
popd
86+
fi
87+
export CCACHE_SLOPPINESS=pch_defines,time_macros && export CCACHE_DIR=$PWD/.ccache && export CCACHE_NOCOMPRESS=true && export CCACHE_MAXSIZE=600M
88+
fi
89+
90+
mkdir -p build || exit 1
7791
cd build
7892
cmake -G "Visual Studio 17 2022" -A x64 -DPLATFORM=${PLATFORM} -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DCMAKE_GITHUB_ACTION=1 ${IS_ARCHIVE_SKIPPED} ../ || exit 2
7993
cmake --build . --target package --config Release -- -nologo -v:m -maxcpucount || exit 3
94+
95+
if [[ "$USE_CCACHE" == '1' ]]; then
96+
./ccache.exe -s
97+
fi
8098
exit 0;
81-
exit 1 || { echo "---> Hyperhdr compilation failed! Abort"; exit 5; }
99+
82100
elif [[ "$CI_NAME" == 'linux' ]]; then
83101
echo "Compile Hyperhdr with DOCKER_IMAGE = ${DOCKER_IMAGE}, DOCKER_TAG = ${DOCKER_TAG} and friendly name DOCKER_NAME = ${DOCKER_NAME}"
84102

@@ -98,7 +116,7 @@ elif [[ "$CI_NAME" == 'linux' ]]; then
98116
fi
99117

100118
if [[ "$USE_CCACHE" == '1' ]]; then
101-
echo "Using cache"
119+
echo "Using ccache"
102120

103121
mkdir -p .ccache
104122

Diff for: .github/workflows/push-master.yml

+30-2
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ jobs:
8181
file(APPEND "$ENV{GITHUB_OUTPUT}" "timestamp=${current_date}")
8282
8383
# download cache
84-
- name: ccache cache files
84+
- name: Download ccache files
8585
if: ( env.USE_CACHE == '1' )
8686
uses: actions/cache@v4
8787
with:
@@ -159,7 +159,7 @@ jobs:
159159
file(APPEND "$ENV{GITHUB_OUTPUT}" "timestamp=${current_date}")
160160
161161
# Download cache
162-
- name: ccache cache files
162+
- name: Download ccache files
163163
if: ( env.USE_CACHE == '1' )
164164
uses: actions/cache@v4
165165
with:
@@ -234,12 +234,40 @@ jobs:
234234
pip install aqtinstall
235235
aqt install-qt -O ${{ runner.workspace }}/Qt windows desktop ${{ env.QT_VERSION }} win64_msvc2019_64 -m qtserialport
236236
237+
# Generate cache id
238+
- name: Prepare ccache timestamp
239+
if: env.USE_CACHE == '1'
240+
id: ccache_cache_timestamp
241+
shell: cmake -P {0}
242+
run: |
243+
string(TIMESTAMP current_date "%Y-%m-%d-%H-%M-%S" UTC)
244+
file(APPEND "$ENV{GITHUB_OUTPUT}" "timestamp=${current_date}")
245+
246+
# Download cache
247+
- name: Download ccache files
248+
if: ( env.USE_CACHE == '1' )
249+
uses: actions/cache@v4
250+
with:
251+
path: .ccache
252+
key: ${{ runner.os }}-ccache-${{ steps.ccache_cache_timestamp.outputs.timestamp }}
253+
restore-keys: ${{ runner.os }}-ccache
254+
237255
- name: Install TurboJPEG
238256
shell: powershell
239257
run: |
240258
Invoke-WebRequest -Method Get -Uri https://github.com/libjpeg-turbo/libjpeg-turbo/releases/download/3.0.3/libjpeg-turbo-3.0.3-vc64.exe -OutFile turbojpeg.exe -UseBasicParsing
241259
Start-Process -Wait turbojpeg.exe -ArgumentList "/S"
242260
261+
- name: Download CCache
262+
shell: powershell
263+
run: |
264+
Invoke-WebRequest -Method Get -Uri https://github.com/ccache/ccache/releases/download/v4.10/ccache-4.10-windows-x86_64.zip -OutFile ccache.zip -UseBasicParsing
265+
266+
- name: Install CCache
267+
shell: cmd
268+
run: |
269+
7z e ccache.zip -o.\build *.exe -r
270+
243271
- name: Set up x64 build architecture environment
244272
shell: cmd
245273
run: call "${{env.VCINSTALLDIR}}\Auxiliary\Build\vcvars64.bat"

Diff for: CMakeLists.txt

+24-11
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ set_property(GLOBAL PROPERTY USE_FOLDERS ON)
2727

2828
# Set build variables
2929
SET ( DEFAULT_PROTOBUF ON )
30-
SET ( DEFAULT_BOBLIGHT OFF )
3130
SET ( DEFAULT_WS281XPWM OFF )
3231
SET ( DEFAULT_USE_SYSTEM_FLATBUFFERS_LIBS OFF )
3332
SET ( DEFAULT_USE_SYSTEM_MQTT_LIBS OFF )
@@ -53,12 +52,30 @@ SET ( DEFAULT_SYSTRAY ON )
5352
SET ( DEFAULT_SHARED_LIBS ON )
5453

5554
# Configure CCache if available
56-
find_program(CCACHE_FOUND ccache)
55+
find_program(CCACHE_FOUND ccache HINTS "${CMAKE_CURRENT_SOURCE_DIR}/build")
5756
if ( CCACHE_FOUND )
5857
if (DEFINED ENV{CCACHE_DIR})
59-
message ( STATUS "Found CCache and its env settings: $ENV{CCACHE_DIR}. Will try to use it." )
60-
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache)
61-
set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache)
58+
set( CCACHE_ENABLED ON )
59+
message ( STATUS "Found CCache (${CCACHE_FOUND}) and its env settings ($ENV{CCACHE_DIR}). Will try to use it." )
60+
if (WIN32)
61+
file(COPY_FILE
62+
${CCACHE_FOUND} ${CMAKE_BINARY_DIR}/cl.exe
63+
ONLY_IF_DIFFERENT
64+
)
65+
66+
message(STATUS "Setting MSVC debug information format to 'Embedded'")
67+
set(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT "$<$<CONFIG:Debug,RelWithDebInfo>:Embedded>")
68+
69+
set(CMAKE_VS_GLOBALS
70+
"CLToolExe=cl.exe"
71+
"CLToolPath=${CMAKE_BINARY_DIR}"
72+
"TrackFileAccess=false"
73+
"UseMultiToolTask=true"
74+
"DebugInformationFormat=OldStyle"
75+
)
76+
else()
77+
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE "${CCACHE_FOUND}")
78+
endif()
6279
else()
6380
message ( WARNING "Found CCache but env settings: CCACHE_DIR is not set. Skipping." )
6481
endif()
@@ -163,7 +180,6 @@ if ( "${PLATFORM}" MATCHES "osx" )
163180

164181
SET ( DEFAULT_AVF ON )
165182
SET ( DEFAULT_MAC_SYSTEM ON )
166-
SET ( DEFAULT_PRECOMPILED_HEADERS OFF )
167183
elseif ( "${PLATFORM}" MATCHES "rpi" )
168184
SET ( DEFAULT_WS281XPWM ON )
169185
SET ( DEFAULT_CEC ON )
@@ -417,9 +433,6 @@ colorMe("ENABLE_SOUNDCAPWINDOWS = " ${ENABLE_SOUNDCAPWINDOWS})
417433

418434
message( STATUS "\n${CyanColor}SERVICE SUPPORT${ColorReset}")
419435

420-
option(ENABLE_BOBLIGHT "Enable BOBLIGHT component" ${DEFAULT_BOBLIGHT} )
421-
colorMe("ENABLE_BOBLIGHT = " ${ENABLE_BOBLIGHT})
422-
423436
option(ENABLE_BONJOUR "Enable the network discovery service" ${DEFAULT_BONJOUR} )
424437
colorMe("ENABLE_BONJOUR = " ${ENABLE_BONJOUR})
425438

@@ -647,8 +660,8 @@ add_custom_target(uninstall COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_D
647660
include (${CMAKE_CURRENT_SOURCE_DIR}/cmake/packages.cmake)
648661

649662
# external targets
650-
if (WIN32 AND TARGET flatbuffers AND TARGET protobuf-nanopb AND TARGET lunasvg AND TARGET flatc AND TARGET qmqtt AND TARGET liblzma AND TARGET sqlite3)
651-
set_target_properties(qmqtt flatbuffers protobuf-nanopb lunasvg flatc resources uninstall liblzma sqlite3 PROPERTIES FOLDER ExternalLibsTargets)
663+
if (WIN32 AND TARGET stb AND TARGET flatbuffers AND TARGET protobuf-nanopb AND TARGET lunasvg AND TARGET flatc AND TARGET qmqtt AND TARGET liblzma AND TARGET sqlite3)
664+
set_target_properties(stb qmqtt flatbuffers protobuf-nanopb lunasvg flatc resources uninstall liblzma sqlite3 PROPERTIES FOLDER ExternalLibsTargets)
652665
else()
653666
set_target_properties(resources uninstall PROPERTIES FOLDER ExternalLibsTargets)
654667
endif()

Diff for: HyperhdrConfig.h.in

-3
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,6 @@
2727
// PipeWire EGL extension
2828
#cmakedefine ENABLE_PIPEWIRE_EGL
2929

30-
// Define to enable boblight server
31-
#cmakedefine ENABLE_BOBLIGHT
32-
3330
// Define to enable sound linux
3431
#cmakedefine ENABLE_SOUNDCAPLINUX
3532

Diff for: cmake/installers.cmake

+10-1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,11 @@ macro(DeployApple TARGET)
3434
install(CODE [[ file(INSTALL FILES $<TARGET_FILE:utils-xz> DESTINATION "${CMAKE_INSTALL_PREFIX}/hyperhdr.app/Contents/lib" TYPE SHARED_LIBRARY) ]] COMPONENT "HyperHDR")
3535
endif()
3636

37+
# Copy utils-image
38+
if (USE_SHARED_LIBS AND TARGET utils-image)
39+
install(CODE [[ file(INSTALL FILES $<TARGET_FILE:utils-image> DESTINATION "${CMAKE_INSTALL_PREFIX}/hyperhdr.app/Contents/lib" TYPE SHARED_LIBRARY) ]] COMPONENT "HyperHDR")
40+
endif()
41+
3742
if ( Qt5Core_FOUND )
3843
get_target_property(MYQT_QMAKE_EXECUTABLE ${Qt5Core_QMAKE_EXECUTABLE} IMPORTED_LOCATION)
3944
else()
@@ -344,7 +349,6 @@ macro(DeployUnix TARGET)
344349
"librt"
345350
"libstdc++"
346351
"libudev"
347-
"libutil"
348352
"libz"
349353
"libxrender1"
350354
"libxi6"
@@ -566,6 +570,11 @@ macro(DeployWindows TARGET)
566570
install(CODE [[ file(INSTALL FILES $<TARGET_FILE:utils-xz> DESTINATION "${CMAKE_INSTALL_PREFIX}/bin" TYPE SHARED_LIBRARY) ]] COMPONENT "HyperHDR")
567571
endif()
568572

573+
# Copy utils-image
574+
if (USE_SHARED_LIBS AND TARGET utils-image)
575+
install(CODE [[ file(INSTALL FILES $<TARGET_FILE:utils-image> DESTINATION "${CMAKE_INSTALL_PREFIX}/bin" TYPE SHARED_LIBRARY) ]] COMPONENT "HyperHDR")
576+
endif()
577+
569578
# Create a qt.conf file in 'bin' to override hard-coded search paths in Qt plugins
570579
file(WRITE "${CMAKE_BINARY_DIR}/qt.conf" "[Paths]\nPlugins=../lib/\n")
571580
install(

Diff for: external/CMakeLists.txt

+20
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ endif()
8686
set(no_dev_warnings_backup "$CACHE{CMAKE_WARN_DEPRECATED}")
8787
set(CMAKE_WARN_DEPRECATED OFF CACHE INTERNAL "" FORCE)
8888
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/lunasvg)
89+
set_target_properties(lunasvg PROPERTIES POSITION_INDEPENDENT_CODE ON)
8990
set(CMAKE_WARN_DEPRECATED ${no_dev_warnings_backup} CACHE INTERNAL "" FORCE)
9091

9192
#=============================================================================
@@ -245,3 +246,22 @@ if (UNIX AND NOT APPLE AND (ENABLE_POWER_MANAGEMENT OR ENABLE_PIPEWIRE))
245246
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/sdbus-cpp)
246247
set_target_properties(sdbus-c++-objlib PROPERTIES POSITION_INDEPENDENT_CODE ON)
247248
endif()
249+
250+
#=============================================================================
251+
# STB
252+
#=============================================================================
253+
254+
add_library(stb ${CMAKE_CURRENT_SOURCE_DIR}/stb/stb_image.h ${CMAKE_CURRENT_SOURCE_DIR}/lunasvg/3rdparty/stb/stb_image_write.h )
255+
256+
install(
257+
TARGETS stb
258+
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
259+
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
260+
)
261+
262+
target_include_directories(stb PUBLIC ${CMAKE_SOURCE_DIR}/external/lunasvg/3rdparty/stb ${CMAKE_SOURCE_DIR}/external/stb)
263+
264+
target_compile_definitions(stb PUBLIC
265+
STB_IMAGE_WRITE_IMPLEMENTATION
266+
STB_IMAGE_IMPLEMENTATION
267+
)
File renamed without changes.

Diff for: include/api/CallbackAPI.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
#include <utils/Components.h>
1010
#include <api/BaseAPI.h>
1111
#include <base/AccessManager.h>
12-
#include <utils/LutCalibrator.h>
12+
#include <lut-calibrator/LutCalibrator.h>
1313

1414
#ifdef ENABLE_BONJOUR
1515
#include <bonjour/DiscoveryWrapper.h>

Diff for: include/base/DetectionAutomatic.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
#include <vector>
1111
#endif
1212

13-
#include <utils/Image.h>
14-
#include <utils/ColorRgb.h>
13+
#include <image/Image.h>
14+
#include <image/ColorRgb.h>
1515
#include <utils/Logger.h>
1616
#include <utils/Components.h>
1717

Diff for: include/base/DetectionManual.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
#include <cstdint>
99
#endif
1010

11-
#include <utils/ColorRgb.h>
12-
#include <utils/Image.h>
11+
#include <image/ColorRgb.h>
12+
#include <image/Image.h>
1313
#include <utils/Logger.h>
1414
#include <utils/Components.h>
1515

Diff for: include/base/Grabber.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@
1111
#include <atomic>
1212
#endif
1313

14-
#include <utils/ColorRgb.h>
15-
#include <utils/Image.h>
14+
#include <image/ColorRgb.h>
15+
#include <image/Image.h>
1616
#include <utils/Logger.h>
1717
#include <utils/Components.h>
1818
#include <utils/MemoryBuffer.h>
1919
#include <utils/FrameDecoder.h>
2020
#include <base/DetectionManual.h>
2121
#include <base/DetectionAutomatic.h>
22-
#include <utils/PerformanceCounters.h>
22+
#include <performance-counters/PerformanceCounters.h>
2323

2424
#if defined(_WIN32) || defined(WIN32)
2525
// Windows

Diff for: include/base/GrabberWrapper.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
#include <QMultiMap>
1010
#endif
1111

12-
#include <utils/ColorRgb.h>
13-
#include <utils/Image.h>
12+
#include <image/ColorRgb.h>
13+
#include <image/Image.h>
1414
#include <utils/Logger.h>
1515
#include <utils/settings.h>
1616
#include <utils/Components.h>

Diff for: include/base/HyperHdrInstance.h

+2-4
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
#include <atomic>
1717
#endif
1818

19-
#include <utils/ColorRgb.h>
20-
#include <utils/Image.h>
19+
#include <image/ColorRgb.h>
20+
#include <image/Image.h>
2121
#include <utils/settings.h>
2222
#include <utils/Components.h>
2323
#include <base/LedString.h>
@@ -36,7 +36,6 @@ class ColorAdjustment;
3636
class InstanceConfig;
3737
class VideoControl;
3838
class SystemControl;
39-
class BoblightServer;
4039
class RawUdpServer;
4140
class LedDeviceWrapper;
4241
class Logger;
@@ -142,7 +141,6 @@ private slots:
142141
std::unique_ptr<EffectEngine> _effectEngine;
143142
std::unique_ptr<VideoControl> _videoControl;
144143
std::unique_ptr<SystemControl> _systemControl;
145-
std::unique_ptr<BoblightServer> _boblightServer;
146144
std::unique_ptr<RawUdpServer> _rawUdpServer;
147145

148146
Logger* _log;

Diff for: include/base/HyperHdrManager.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#include <QStringList>
66
#endif
77

8-
#include <utils/ColorRgb.h>
8+
#include <image/ColorRgb.h>
99
#include <utils/Logger.h>
1010
#include <utils/settings.h>
1111
#include <utils/Components.h>

Diff for: include/base/ImageColorAveraging.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#include <algorithm>
88
#endif
99

10-
#include <utils/Image.h>
10+
#include <image/Image.h>
1111
#include <utils/Logger.h>
1212
#include <base/LedString.h>
1313

Diff for: include/base/ImageToLedManager.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#include <vector>
88
#endif
99

10-
#include <utils/Image.h>
10+
#include <image/Image.h>
1111
#include <utils/Logger.h>
1212
#include <base/LedString.h>
1313
#include <base/ImageColorAveraging.h>

Diff for: include/base/LedCalibration.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
#include <vector>
3636
#endif
3737

38-
#include <utils/ColorRgb.h>
38+
#include <image/ColorRgb.h>
3939
#include <base/ColorCalibration.h>
4040

4141
class LedCalibration

Diff for: include/base/LedString.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
#include <vector>
1111
#endif
1212

13-
#include <utils/ColorRgb.h>
13+
#include <image/ColorRgb.h>
1414

1515
namespace Json { class Value; }
1616

0 commit comments

Comments
 (0)