Skip to content

Commit c135d91

Browse files
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 5b0ce3c. * 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>
1 parent b0e1510 commit c135d91

File tree

163 files changed

+10832
-6029
lines changed

Some content is hidden

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

163 files changed

+10832
-6029
lines changed

.ci/ci_build.sh

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,8 @@
11
#!/bin/bash
22

33
# detect CI
4-
if [ "$SYSTEM_COLLECTIONID" != "" ]; then
5-
# Azure Pipelines
6-
echo "Azure detected"
7-
CI_NAME="$(echo "$AGENT_OS" | tr '[:upper:]' '[:lower:]')"
8-
CI_BUILD_DIR="$BUILD_SOURCESDIRECTORY"
9-
elif [ "$HOME" != "" ]; then
4+
if [ "$HOME" != "" ]; then
105
# GitHub Actions
11-
echo "Github Actions detected"
126
CI_NAME="$(uname -s | tr '[:upper:]' '[:lower:]')"
137
CI_BUILD_DIR="$GITHUB_WORKSPACE"
148
else

.ci/ci_install.sh

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11
#!/bin/bash
22

33
# detect CI
4-
if [ "$SYSTEM_COLLECTIONID" != "" ]; then
5-
# Azure Pipelines
6-
CI_NAME="$(echo "$AGENT_OS" | tr '[:upper:]' '[:lower:]')"
7-
CI_BUILD_DIR="$BUILD_SOURCESDIRECTORY"
8-
elif [ "$HOME" != "" ]; then
4+
if [ "$HOME" != "" ]; then
95
# GitHub Actions
106
CI_NAME="$(uname -s | tr '[:upper:]' '[:lower:]')"
117
CI_BUILD_DIR="$GITHUB_WORKSPACE"

.github/workflows/pull-request.yml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,10 +159,21 @@ jobs:
159159
path: C:\Users\runneradmin\AppData\Local\Temp\chocolatey
160160
key: ${{ runner.os }}-chocolatey
161161

162-
- name: Install Python, NSIS, OpenSSL
162+
- name: "Remove Redistributable"
163+
shell: cmd
164+
run: |
165+
MsiExec.exe /passive /X{F0C3E5D1-1ADE-321E-8167-68EF0DE699A5}
166+
MsiExec.exe /passive /X{1D8E6291-B0D5-35EC-8441-6616F567A0F7}
167+
168+
- name: Install Python, NSIS, OpenSSL, DirectX SDK
163169
shell: powershell
164170
run: |
165-
choco install --no-progress python nsis openssl -y
171+
choco install --no-progress python nsis openssl directx-sdk -y
172+
173+
- name: Install libjpeg-turbo
174+
run: |
175+
Invoke-WebRequest https://netcologne.dl.sourceforge.net/project/libjpeg-turbo/2.0.6/libjpeg-turbo-2.0.6-vc64.exe -OutFile libjpeg-turbo.exe -UserAgent NativeHost
176+
.\libjpeg-turbo /S
166177
167178
- name: Set up x64 build architecture environment
168179
shell: cmd

.github/workflows/push-master.yml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,10 +122,21 @@ jobs:
122122
path: C:\Users\runneradmin\AppData\Local\Temp\chocolatey
123123
key: ${{ runner.os }}-chocolatey
124124

125-
- name: Install Python, NSIS, OpenSSL
125+
- name: "Remove Redistributable"
126+
shell: cmd
127+
run: |
128+
MsiExec.exe /passive /X{F0C3E5D1-1ADE-321E-8167-68EF0DE699A5}
129+
MsiExec.exe /passive /X{1D8E6291-B0D5-35EC-8441-6616F567A0F7}
130+
131+
- name: Install Python, NSIS, OpenSSL, DirectX SDK
126132
shell: powershell
127133
run: |
128-
choco install --no-progress python nsis openssl -y
134+
choco install --no-progress python nsis openssl directx-sdk -y
135+
136+
- name: Install libjpeg-turbo
137+
run: |
138+
Invoke-WebRequest https://netcologne.dl.sourceforge.net/project/libjpeg-turbo/2.0.6/libjpeg-turbo-2.0.6-vc64.exe -OutFile libjpeg-turbo.exe -UserAgent NativeHost
139+
.\libjpeg-turbo /S
129140
130141
- name: Set up x64 build architecture environment
131142
shell: cmd

.gitignore

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,11 @@ libsrc/flatbufserver/hyperion_request_generated.h
2727
*.kdev*
2828

2929
# Visual Studio 2015/2017/2019 cache/options directory
30-
.vs/
30+
# Ignore
31+
.vs/*
3132
CMakeSettings.json
33+
# Allow
34+
!.vs/launch.vs.json
35+
36+
# LedDevice 'File' output
37+
NULL

.vs/launch.vs.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"version": "0.2.1",
3+
"defaults": {},
4+
"configurations": [
5+
{
6+
"type": "default",
7+
"project": "CMakeLists.txt",
8+
"projectTarget": "hyperiond.exe (bin\\hyperiond.exe)",
9+
"name": "Run hyperion with debug option and external console",
10+
"args": [
11+
"-d",
12+
"-c"
13+
],
14+
"externalConsole": true
15+
}
16+
]
17+
}

.vscode/launch.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,12 @@
2727
"name": "(Windows) hyperiond",
2828
"type": "cppvsdbg",
2929
"request": "launch",
30-
"program": "${workspaceFolder}/build/bin/Debug/hyperiond.exe",
30+
"program": "${command:cmake.launchTargetDirectory}/hyperiond",
3131
"args": ["-d"],
3232
"stopAtEntry": false,
3333
"cwd": "${workspaceFolder}",
3434
"environment": [],
35-
"externalConsole": false
35+
"console": "internalConsole"
3636
}
3737
]
3838
}

CMakeLists.txt

Lines changed: 27 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,15 @@ message( STATUS "CMake Version: ${CMAKE_VERSION}" )
44

55
PROJECT(hyperion)
66

7-
# Parse semantic version of version file
7+
# Parse semantic version of version file and write version to config
88
include (${CMAKE_CURRENT_SOURCE_DIR}/cmake/version.cmake)
99
file (STRINGS "version" HYPERION_VERSION)
1010
SetVersionNumber(HYPERION ${HYPERION_VERSION})
11+
set(DEFAULT_JSON_CONFIG_FILE ${CMAKE_CURRENT_SOURCE_DIR}/config/hyperion.config.json.default)
12+
file(READ ${DEFAULT_JSON_CONFIG_FILE} DEFAULT_JSON_CONFIG_VAR)
13+
string(REPLACE "configVersionValue" ${HYPERION_VERSION} DEFAULT_JSON_CONFIG_VAR "${DEFAULT_JSON_CONFIG_VAR}")
14+
string(REPLACE "previousVersionValue" ${HYPERION_VERSION} DEFAULT_JSON_CONFIG_VAR "${DEFAULT_JSON_CONFIG_VAR}")
15+
file(WRITE ${CMAKE_BINARY_DIR}/config/hyperion.config.json.default "${DEFAULT_JSON_CONFIG_VAR}")
1116

1217
# Instruct CMake to run moc automatically when needed.
1318
set(CMAKE_AUTOMOC ON)
@@ -50,6 +55,7 @@ SET ( DEFAULT_USE_SYSTEM_PROTO_LIBS OFF )
5055
SET ( DEFAULT_USE_SYSTEM_MBEDTLS_LIBS OFF )
5156
SET ( DEFAULT_TESTS OFF )
5257
SET ( DEFAULT_EXPERIMENTAL OFF )
58+
SET ( DEFAULT_MF OFF )
5359
SET ( DEFAULT_DEPLOY_DEPENDENCIES ON )
5460

5561
IF ( ${CMAKE_SYSTEM} MATCHES "Linux" )
@@ -60,7 +66,8 @@ IF ( ${CMAKE_SYSTEM} MATCHES "Linux" )
6066
SET ( DEFAULT_USB_HID ON )
6167
SET ( DEFAULT_CEC ON )
6268
ELSEIF ( WIN32 )
63-
SET ( DEFAULT_DX OFF )
69+
SET ( DEFAULT_DX ON )
70+
SET ( DEFAULT_MF ON )
6471
ELSE()
6572
SET ( DEFAULT_V4L2 OFF )
6673
SET ( DEFAULT_FB OFF )
@@ -121,9 +128,14 @@ elseif ( "${PLATFORM}" MATCHES "rpi" )
121128
SET ( DEFAULT_DISPMANX ON )
122129
SET ( DEFAULT_WS281XPWM ON )
123130
elseif ( "${PLATFORM}" STREQUAL "amlogic" )
124-
SET ( DEFAULT_AMLOGIC ON )
131+
SET ( DEFAULT_AMLOGIC ON )
132+
elseif ( "${PLATFORM}" STREQUAL "amlogic-dev" )
133+
SET ( DEFAULT_AMLOGIC ON )
134+
SET ( DEFAULT_DISPMANX OFF )
135+
SET ( DEFAULT_QT OFF )
136+
SET ( DEFAULT_CEC OFF )
125137
elseif ( "${PLATFORM}" STREQUAL "amlogic64" )
126-
SET ( DEFAULT_AMLOGIC ON )
138+
SET ( DEFAULT_AMLOGIC ON )
127139
elseif ( "${PLATFORM}" MATCHES "x11" )
128140
SET ( DEFAULT_X11 ON )
129141
SET ( DEFAULT_XCB ON )
@@ -150,17 +162,18 @@ ADD_DEFINITIONS( ${PLATFORM_DEFINE} )
150162
option(ENABLE_AMLOGIC "Enable the AMLOGIC video grabber" ${DEFAULT_AMLOGIC} )
151163
message(STATUS "ENABLE_AMLOGIC = ${ENABLE_AMLOGIC}")
152164

153-
option(ENABLE_DISPMANX "Enable the RPi dispmanx grabber" ${DEFAULT_DISPMANX} )
154-
message(STATUS "ENABLE_DISPMANX = ${ENABLE_DISPMANX}")
155-
156165
if (ENABLE_AMLOGIC)
157166
SET(ENABLE_FB ON)
158167
else()
159168
option(ENABLE_FB "Enable the framebuffer grabber" ${DEFAULT_FB} )
160169
endif()
170+
161171
message(STATUS "ENABLE_FB = ${ENABLE_FB}")
162172

163-
option(ENABLE_OSX "Enable the osx grabber" ${DEFAULT_OSX} )
173+
option(ENABLE_DISPMANX "Enable the RPi dispmanx grabber" ${DEFAULT_DISPMANX} )
174+
message(STATUS "ENABLE_DISPMANX = ${ENABLE_DISPMANX}")
175+
176+
option(ENABLE_OSX "Enable the OSX grabber" ${DEFAULT_OSX} )
164177
message(STATUS "ENABLE_OSX = ${ENABLE_OSX}")
165178

166179
option(ENABLE_SPIDEV "Enable the SPIDEV device" ${DEFAULT_SPIDEV} )
@@ -172,6 +185,9 @@ message(STATUS "ENABLE_TINKERFORGE = ${ENABLE_TINKERFORGE}")
172185
option(ENABLE_V4L2 "Enable the V4L2 grabber" ${DEFAULT_V4L2})
173186
message(STATUS "ENABLE_V4L2 = ${ENABLE_V4L2}")
174187

188+
option(ENABLE_MF "Enable the Media Foundation grabber" ${DEFAULT_MF})
189+
message(STATUS "ENABLE_MF = ${ENABLE_MF}")
190+
175191
option(ENABLE_WS281XPWM "Enable the WS281x-PWM device" ${DEFAULT_WS281XPWM} )
176192
message(STATUS "ENABLE_WS281XPWM = ${ENABLE_WS281XPWM}")
177193

@@ -190,7 +206,7 @@ message(STATUS "ENABLE_X11 = ${ENABLE_X11}")
190206
option(ENABLE_XCB "Enable the XCB grabber" ${DEFAULT_XCB})
191207
message(STATUS "ENABLE_XCB = ${ENABLE_XCB}")
192208

193-
option(ENABLE_QT "Enable the qt grabber" ${DEFAULT_QT})
209+
option(ENABLE_QT "Enable the Qt grabber" ${DEFAULT_QT})
194210
message(STATUS "ENABLE_QT = ${ENABLE_QT}")
195211

196212
option(ENABLE_DX "Enable the DirectX grabber" ${DEFAULT_DX})
@@ -216,10 +232,7 @@ SET ( PROTOBUF_INSTALL_LIB_DIR ${CMAKE_BINARY_DIR}/proto )
216232

217233
# check all json files
218234
FILE ( GLOB_RECURSE HYPERION_SCHEMAS RELATIVE ${CMAKE_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/libsrc/*schema*.json )
219-
SET( JSON_FILES
220-
config/hyperion.config.json.default
221-
${HYPERION_SCHEMAS}
222-
)
235+
SET( JSON_FILES ${CMAKE_BINARY_DIR}/config/hyperion.config.json.default ${HYPERION_SCHEMAS})
223236

224237
EXECUTE_PROCESS (
225238
COMMAND ${PYTHON_EXECUTABLE} test/jsonchecks/checkjson.py ${JSON_FILES}
@@ -243,7 +256,7 @@ ENDIF ()
243256
# TODO on windows it can't resolve the path inside the file (Das System kann den angegebenen Pfad nicht finden: '\\schema\\schema-general.json')
244257
IF (NOT WIN32)
245258
EXECUTE_PROCESS (
246-
COMMAND python test/jsonchecks/checkschema.py config/hyperion.config.json.default libsrc/hyperion/hyperion.schema.json
259+
COMMAND python test/jsonchecks/checkschema.py ${CMAKE_BINARY_DIR}/config/hyperion.config.json.default libsrc/hyperion/hyperion.schema.json
247260
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
248261
RESULT_VARIABLE CHECK_CONFIG_FAILED
249262
)
@@ -399,31 +412,6 @@ find_package(libusb-1.0 REQUIRED)
399412
find_package(Threads REQUIRED)
400413
add_definitions(${QT_DEFINITIONS})
401414

402-
# Add JPEG library
403-
if (ENABLE_V4L2)
404-
# Turbo JPEG
405-
find_package(TurboJPEG)
406-
if (TURBOJPEG_FOUND)
407-
add_definitions(-DHAVE_TURBO_JPEG)
408-
message( STATUS "Using Turbo JPEG library: ${TurboJPEG_LIBRARY}")
409-
include_directories(${TurboJPEG_INCLUDE_DIRS})
410-
else()
411-
# System JPEG
412-
find_package(JPEG)
413-
if (JPEG_FOUND)
414-
add_definitions(-DHAVE_JPEG)
415-
message( STATUS "Using system JPEG library: ${JPEG_LIBRARIES}")
416-
include_directories(${JPEG_INCLUDE_DIR})
417-
else()
418-
message( STATUS "JPEG library not found, MJPEG camera format won't work in V4L2 grabber.")
419-
endif()
420-
endif (TURBOJPEG_FOUND)
421-
422-
if (TURBOJPEG_FOUND OR JPEG_FOUND)
423-
add_definitions(-DHAVE_JPEG_DECODER)
424-
endif()
425-
endif()
426-
427415
if(APPLE)
428416
set(CMAKE_EXE_LINKER_FLAGS "-framework CoreGraphics")
429417
endif()

HyperionConfig.h.in

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,51 @@
11
// Generated config file
22

3-
// Define to enable the dispmanx grabber
3+
// Define to enable the DispmanX grabber
44
#cmakedefine ENABLE_DISPMANX
55

6-
// Define to enable the v4l2 grabber
6+
// Define to enable the V4L2 grabber
77
#cmakedefine ENABLE_V4L2
88

9-
// Define to enable the framebuffer grabber
9+
// Define to enable the Media Foundation grabber
10+
#cmakedefine ENABLE_MF
11+
12+
// Define to enable the Framebuffer grabber
1013
#cmakedefine ENABLE_FB
1114

12-
// Define to enable the amlogic grabber
15+
// Define to enable the AMLogic grabber
1316
#cmakedefine ENABLE_AMLOGIC
1417

15-
// Define to enable the osx grabber
18+
// Define to enable the OSX grabber
1619
#cmakedefine ENABLE_OSX
1720

18-
// Define to enable the x11 grabber
21+
// Define to enable the X11 grabber
1922
#cmakedefine ENABLE_X11
2023

21-
// Define to enable the xcb grabber
24+
// Define to enable the XCB grabber
2225
#cmakedefine ENABLE_XCB
2326

24-
// Define to enable the qt grabber
27+
// Define to enable the Qt grabber
2528
#cmakedefine ENABLE_QT
2629

2730
// Define to enable the DirectX grabber
2831
#cmakedefine ENABLE_DX
2932

30-
// Define to enable the spi-device
33+
// Define to enable the SPI-Device
3134
#cmakedefine ENABLE_SPIDEV
3235

33-
// Define to enable the ws281x-pwm-via-dma-device using jgarff's library
36+
// Define to enable the WS281x-PWM-via-DMA-device using jgarff's library
3437
#cmakedefine ENABLE_WS281XPWM
3538

36-
// Define to enable the tinkerforge device
39+
// Define to enable the Tinkerforge device
3740
#cmakedefine ENABLE_TINKERFORGE
3841

39-
// Define to enable avahi
42+
// Define to enable AVAHI
4043
#cmakedefine ENABLE_AVAHI
4144

42-
// Define to enable cec
45+
// Define to enable CEC
4346
#cmakedefine ENABLE_CEC
4447

45-
// Define to enable the usb / hid devices
48+
// Define to enable the USB / HID devices
4649
#cmakedefine ENABLE_USB_HID
4750

4851
// Define to enable profiler for development purpose

assets/webconfig/content/conf_grabber.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<div class="container-fluid">
33
<div class="row">
44
<div class="col-lg-12">
5-
<h3 class="page-header"><i class="fa fa-camera fa-fw"></i><span data-i18n="main_menu_grabber_conf_token">Capturing Hardware</span></h3>
5+
<h3 class="page-header"><i class="fa fa-camera fa-fw"></i><span data-i18n="main_menu_grabber_conf_token">Capturing Hardware</span></h3>
66
<div id="conf_cont"></div>
77
</div>
88
</div>

0 commit comments

Comments
 (0)