Workflow merge (#79)

merge workflow_test into apt
This commit is contained in:
Paulchen-Panther 2023-11-13 19:53:56 +01:00 committed by GitHub
parent 1de37ceeff
commit 0359368451
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
138 changed files with 1664 additions and 2871 deletions

View File

@ -33,23 +33,24 @@ elif [[ $RUNNER_OS == "Windows" ]]; then
exit 1 || { echo "---> Hyperion compilation failed! Abort"; exit 5; }
elif [[ "$RUNNER_OS" == 'Linux' ]]; then
echo "Docker arguments used: DOCKER_IMAGE=${DOCKER_IMAGE}, DOCKER_TAG=${DOCKER_TAG}, TARGET_ARCH=${TARGET_ARCH}"
# verification bypass of external dependencies
git config --global --add safe.directory "${GITHUB_WORKSPACE}/dependencies/external/*"
# set GitHub Container Registry url
REGISTRY_URL="ghcr.io/hyperion-project/${DOCKER_IMAGE}"
REGISTRY_URL="ghcr.io/paulchen-panther/${DOCKER_IMAGE}"
# take ownership of deploy dir
mkdir ${GITHUB_WORKSPACE}/deploy
# run docker
docker run --rm --platform=${TARGET_ARCH} \
-v "${GITHUB_WORKSPACE}/deploy:/deploy" \
-v "${GITHUB_WORKSPACE}:/source:ro" \
-v "${GITHUB_WORKSPACE}:/source:rw" \
$REGISTRY_URL:$DOCKER_TAG \
/bin/bash -c "mkdir hyperion && cp -r source/. /hyperion &&
cd /hyperion && mkdir build && cd build &&
/bin/bash -c "mkdir -p /source/build && cd /source/build &&
cmake -DPLATFORM=${PLATFORM} -DCMAKE_BUILD_TYPE=${BUILD_TYPE} ../ || exit 2 &&
make -j $(nproc) package || exit 3 &&
cp /hyperion/build/bin/h* /deploy/ 2>/dev/null || : &&
cp /hyperion/build/Hyperion-* /deploy/ 2>/dev/null || : &&
cd /hyperion && source /hyperion/test/testrunner.sh || exit 4 &&
cmake --build /source/build --target package -- -j $(nproc) || exit 3 &&
cp /source/build/bin/h* /deploy/ 2>/dev/null || : &&
cp /source/build/Hyperion-* /deploy/ 2>/dev/null || : &&
cd /source && source /source/test/testrunner.sh || exit 5 &&
exit 0;
exit 1 " || { echo "---> Hyperion compilation failed! Abort"; exit 5; }

View File

@ -1,207 +0,0 @@
name: Hyperion APT Build
on:
# Reusable from nightly and push
workflow_call:
inputs:
head_sha:
type: string
description: The branch, tag or SHA to checkout
default: "master"
required: false
nightly:
type: boolean
description: Nightly build
default: false
required: false
publish:
type: boolean
description: Publish packages
default: false
required: false
# For running the workflow manually via GitHub Actions tab
workflow_dispatch:
inputs:
head_sha:
type: string
description: The branch, tag or SHA to checkout
default: "master"
required: false
nightly:
type: boolean
description: Nightly build
default: false
required: false
publish:
type: boolean
description: Publish packages
default: false
required: false
env:
ghcr: hyperion-project
jobs:
build:
name: 🐧 ${{ matrix.os.description }} (${{ matrix.architecture[0] }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
os: [
{ distribution: ubuntu, codename: focal, description: Ubuntu 20.04 (Focal Fossa) },
{ distribution: ubuntu, codename: jammy, description: Ubuntu 22.04 (Jammy Jellyfish) },
{ distribution: ubuntu, codename: lunar, description: Ubuntu 23.04 (Lunar Lobster) },
{ distribution: ubuntu, codename: mantic, description: Ubuntu 23.10 (Mantic Minotaur) },
{ distribution: debian, codename: buster, description: Debian 10.x (Buster) },
{ distribution: debian, codename: bullseye, description: Debian 11.x (Bullseye) },
{ distribution: debian, codename: bookworm, description: Debian 12.x (Bookworm) },
{ distribution: debian, codename: trixie, description: Debian 13.x (Trixie) }
]
architecture: [
[ amd64, linux/amd64 ],
[ arm64, linux/arm64 ],
[ armhf, linux/arm/v7 ]
]
include:
- os: { distribution: debian, codename: bullseye, description: Debian 11.x (Bullseye) }
architecture: [ armel, linux/arm/v6 ]
- os: { distribution: debian, codename: bookworm, description: Debian 12.x (Bookworm) }
architecture: [ armel, linux/arm/v6 ]
- os: { distribution: debian, codename: trixie, description: Debian 13.x (Trixie) }
architecture: [ armel, linux/arm/v6 ]
steps:
- name: ⬇ Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.head_sha || github.event.client_payload.head_sha }}
submodules: recursive
- name: 🔧 Prepare
run: |
echo '::group::Checking the version number'
if [[ "${{ inputs.nightly }}" = true ]]; then
echo "$(tr -d '\n' < .version)+nightly$(date '+%Y%m%d')$(git rev-parse --short HEAD)" > .version
else
tr -d '\n' < .version > temp && mv temp .version
fi
echo '::endgroup::'
echo '::group::Generate environment variables'
VERSION=$(cat .version)
echo VERSION=${VERSION} >> $GITHUB_ENV
if [[ $VERSION == *"-"* ]]; then
echo STANDARDS_VERSION=$(echo ${VERSION%-*}) >> $GITHUB_ENV
echo DEBIAN_FORMAT='3.0 (quilt)' >> $GITHUB_ENV
else
echo STANDARDS_VERSION=$(echo ${VERSION%+*}) >> $GITHUB_ENV
echo DEBIAN_FORMAT='3.0 (native)' >> $GITHUB_ENV
fi
echo '::endgroup::'
- name: 🛠️ Setup QEMU
uses: docker/setup-qemu-action@v3
- name: 👷 Build
shell: bash
run: |
mkdir -p "${GITHUB_WORKSPACE}/deploy"
docker run --rm --platform=${{ matrix.architecture[1] }} \
-v "${GITHUB_WORKSPACE}/deploy:/deploy" \
-v "${GITHUB_WORKSPACE}:/source:rw" \
ghcr.io/${{ env.ghcr }}/${{ matrix.os.distribution }}:${{ matrix.os.codename }} \
/bin/bash -c "cd /source && \
mkdir -p debian/source && echo '${{ env.DEBIAN_FORMAT }}' > debian/source/format && echo 10 > debian/compat && \
dch --create --distribution ${{ matrix.os.codename }} --package 'hyperion' -v '${{ env.VERSION }}~${{ matrix.os.codename }}' '${{ github.event.commits[0].message }}' && \
cp -fr LICENSE debian/copyright && \
sed 's/@ARCHITECTURE@/${{ matrix.architecture[0] }}/g; s/@STANDARDS_VERSION@/${{ env.STANDARDS_VERSION }}/g' debian/control.in > debian/control && \
debuild -b -uc -us && \
cp ../hyperion_*.deb /deploy"
- name: 📦 Upload
if: ${{ inputs.publish }}
uses: actions/upload-artifact@v3
with:
path: deploy
retention-days: 1
publish:
name: 🚀 Publish DEB packages
if: ${{ github.repository == 'hyperion-project' && inputs.publish }}
needs: [build]
runs-on: ubuntu-latest
steps:
- name: ⬇ Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.head_sha || github.event.client_payload.head_sha }}
- name: 🔑 GPG Import
if: ${{ env.SECRET_GPG_KEY != null }}
uses: crazy-max/ghaction-import-gpg@v5
with:
gpg_private_key: ${{ secrets.GPG_KEY }}
env:
SECRET_GPG_KEY: ${{ secrets.GPG_KEY }}
- name: 💾 Artifact download
uses: actions/download-artifact@v3
- name: 🔧 Prepare
if: ${{ env.SECRET_APT_REPO_NIGHTLY != null && env.SECRET_APT_REPO != null }}
run: |
echo '::group::Install reprepro'
sudo apt -y install reprepro
echo '::endgroup::'
echo '::group::Create initial structure'
mkdir -p deb/{conf,dists,db}
cp debian/distributions deb/conf/distributions
if [[ "${{ inputs.nightly }}" = true ]]; then
touch "deb/$(git rev-parse --short HEAD)"
fi
reprepro -Vb deb createsymlinks
reprepro -Vb deb export
echo '::endgroup::'
echo '::group::Include artifacts into the package source'
for file in artifact/hyperion_*.deb; do
if [ -f "$file" ]; then
dist=${file#*~}
dist=${dist%_*}
reprepro -Vb deb/ includedeb "$dist" "$file"
fi
done
echo '::endgroup::'
echo '::group::Set server directory'
if [[ "${{ inputs.nightly }}" = true ]]; then
echo "SERVER_DIR=${{ secrets.APT_REPO_NIGHTLY }}" >> $GITHUB_ENV
else
echo "SERVER_DIR=${{ secrets.APT_REPO }}" >> $GITHUB_ENV
fi
echo '::endgroup::'
env:
SECRET_APT_REPO_NIGHTLY: ${{ secrets.APT_REPO_NIGHTLY }}
SECRET_APT_REPO: ${{ secrets.APT_REPO }}
- name: 📦 Upload
if: ${{ env.SECRET_REPO_USER != null && env.SECRET_REPO_PASSWORD != null && env.SERVER_DIR != null }}
uses: SamKirkland/FTP-Deploy-Action@v4.3.4
with:
server: releases.hyperion-project.org
username: ${{ secrets.REPO_USER }}
password: ${{ secrets.REPO_PASSWORD }}
server-dir: ${{ env.SERVER_DIR }}
local-dir: "./deb/"
dangerous-clean-slate: true
env:
SECRET_REPO_USER: ${{ secrets.REPO_USER }}
SECRET_REPO_PASSWORD: ${{ secrets.REPO_PASSWORD }}
- name: 🧹 Cleanup
uses: geekyeggo/delete-artifact@v2
with:
name: artifact
failOnError: false

View File

@ -1,4 +1,4 @@
name: 🧹 Clean artifacts
name: 🧹 Cleanup old artifacts
# Run cleanup workflow at the end of every day
on:

View File

@ -1,4 +1,8 @@
name: 📊 CodeQL
run-name: |
${{ github.event_name == 'schedule' && '⏰ Scheduled CodeQL run' || '' }}
${{ github.event_name == 'push' && format('📊 Pushed CodeQL run - {0}', github.event.head_commit.message) || '' }}
${{ github.event_name == 'pull_request' && format('📊 CodeQL run for PR {0} - {1}', github.event.pull_request.number, github.event.pull_request.title) || github.event.head_commit.message }}
on:
push:

View File

@ -1,196 +0,0 @@
name: Hyperion DNF Build
on:
# Reusable from nightly and push
workflow_call:
inputs:
head_sha:
type: string
description: The branch, tag or SHA to checkout
default: "master"
required: false
nightly:
type: boolean
description: Nightly build
default: false
required: false
publish:
type: boolean
description: Publish packages
default: false
required: false
# For running the workflow manually via GitHub Actions tab
workflow_dispatch:
inputs:
head_sha:
type: string
description: The branch, tag or SHA to checkout
default: "master"
required: false
nightly:
type: boolean
description: Nightly build
default: false
required: false
publish:
type: boolean
description: Publish packages
default: false
required: false
env:
ghcr: hyperion-project
jobs:
build:
name: 🐧 ${{ matrix.os.distribution }} ${{ matrix.os.version }} (${{ matrix.architecture[0] }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
os: [
{ distribution: Fedora, version: 37 },
{ distribution: Fedora, version: 38 },
{ distribution: Fedora, version: 39 },
{ distribution: Fedora, version: 40 }
]
architecture: [
[ amd64, linux/amd64 ]
]
steps:
- name: ⬇ Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.head_sha || github.event.client_payload.head_sha }}
submodules: recursive
- name: 🔧 Prepare
run: |
echo '::group::Checking the version number'
if [[ "${{ inputs.nightly }}" = true ]]; then
echo VERSION=$(tr -d '\n' < .version)+nightly$(date '+%Y%m%d')$(git rev-parse --short HEAD | sed s/-/_/g) >> $GITHUB_ENV
else
echo VERSION=$(tr -d '\n' < .version | sed s/-/_/g) >> $GITHUB_ENV
fi
echo '::endgroup::'
- name: 🛠️ Setup QEMU
uses: docker/setup-qemu-action@v3
- name: 👷 Build
shell: bash
run: |
echo '::group::Set distribution name to lower case'
DISTRIBUTION=$(echo '${{ matrix.os.distribution }}' | tr '[:upper:]' '[:lower:]')
echo '::endgroup::'
echo '::group::Building Hyperion'
mkdir -p "${GITHUB_WORKSPACE}/deploy"
docker run --rm --platform=${{ matrix.architecture[1] }} \
-w "/root" \
-v "${GITHUB_WORKSPACE}/deploy:/deploy" \
-v "${GITHUB_WORKSPACE}:/root/hyperion.ng:rw" \
ghcr.io/${{ env.ghcr }}/${DISTRIBUTION}:${{ matrix.os.version }} \
/bin/bash -c "tar -czf rpmbuild/SOURCES/hyperion.ng.tar.gz hyperion.ng/ && \
cp -f hyperion.ng/rpmbuild/hyperion.spec.in rpmbuild/SPECS/hyperion.spec && \
rpmbuild -ba --define '_version ${{ env.VERSION }}' rpmbuild/SPECS/hyperion.spec --clean && \
cp -fv rpmbuild/RPMS/$(uname -m)/hyperion* /deploy"
echo '::endgroup::'
env:
ACTOR: "Hyperion Project <admin@hyperion-project.org>"
COMMIT_MESSAGE: ${{ github.event.commits[0].message }}
- name: 📦 Upload
if: ${{ inputs.publish }}
uses: actions/upload-artifact@v3
with:
path: deploy
retention-days: 1
publish:
name: 🚀 Publish RPM packages
if: ${{ github.repository == 'hyperion-project' && inputs.publish }}
needs: [build]
runs-on: ubuntu-latest
container:
image: fedora
steps:
- name: ⬇ Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.head_sha || github.event.client_payload.head_sha }}
- name: 🔑 GPG Import
id: import_gpg
if: ${{ env.SECRET_GPG_KEY != null }}
uses: crazy-max/ghaction-import-gpg@v5
with:
gpg_private_key: ${{ secrets.GPG_KEY }}
env:
SECRET_GPG_KEY: ${{ secrets.GPG_KEY }}
- name: 💾 Artifact download
uses: actions/download-artifact@v3
- name: 🔧 Prepare
if: ${{ env.SECRET_DNF_REPO_NIGHTLY != null && env.SECRET_DNF_REPO != null }}
run: |
echo '::group::Install createrepo & rpm-sign'
dnf install createrepo rpm-sign -y
echo '::endgroup::'
echo '::group::Make folders, sign/copy packages and create metadata/manifest files'
mkdir rpm/
gpg --armor --output hyperion.pub.key --export 'admin@hyperion-project.org'
rpm --import hyperion.pub.key
channel=$([ "${{ inputs.nightly }}" = true ] && echo "Nightly" || echo "Stable")
declare -A distArray=([fc]=fedora [el]=rhel)
for file in artifact/hyperion-*.rpm; do
if [ -f "$file" ]; then
dist_ver_arch=$(basename -- "$file")
dist_ver_arch=${dist_ver_arch%.*}
dist_ver=${dist_ver_arch%.*}
dist_ver=${dist_ver##*.}
[ -z "${dist_ver:0:2}" ] && continue
rpm=rpm/${distArray[${dist_ver:0:2}]}/${dist_ver:2}/${dist_ver_arch##*.}
mkdir -p $rpm/ && cp $file $rpm/
rpm --define "_gpg_name ${{ steps.import_gpg.outputs.keyid }}" --addsign $rpm/*.rpm
rpm --checksig $rpm/*.rpm
createrepo $rpm/
gpg --yes --detach-sign --armor $rpm/repodata/repomd.xml
sed -r "s/@CHANNEL@/${channel}/g; s/@DIST@/${distArray[${dist_ver:0:2}]}/g; s/@ARCH@/${dist_ver_arch##*.}/g" ${GITHUB_WORKSPACE}/rpmbuild/hyperion.repo.in > rpm/${distArray[${dist_ver:0:2}]}/hyperion.repo
fi
done
echo '::endgroup::'
echo '::group::Set server directory'
if [[ "${{ inputs.nightly }}" = true ]]; then
echo "SERVER_DIR=${{ secrets.DNF_REPO_NIGHTLY }}" >> $GITHUB_ENV
else
echo "SERVER_DIR=${{ secrets.DNF_REPO }}" >> $GITHUB_ENV
fi
echo '::endgroup::'
env:
SECRET_DNF_REPO_NIGHTLY: ${{ secrets.DNF_REPO_NIGHTLY }}
SECRET_DNF_REPO: ${{ secrets.DNF_REPO }}
- name: 📦 Upload
if: ${{ env.SECRET_REPO_USER != null && env.SECRET_REPO_PASSWORD != null && env.SERVER_DIR != null }}
uses: SamKirkland/FTP-Deploy-Action@v4.3.4
with:
server: releases.hyperion-project.org
username: ${{ secrets.REPO_USER }}
password: ${{ secrets.REPO_PASSWORD }}
server-dir: ${{ env.SERVER_DIR }}
local-dir: "./rpm/"
dangerous-clean-slate: true
env:
SECRET_REPO_USER: ${{ secrets.REPO_USER }}
SECRET_REPO_PASSWORD: ${{ secrets.REPO_PASSWORD }}
- name: 🧹 Cleanup
uses: geekyeggo/delete-artifact@v2
with:
name: artifact
failOnError: false

View File

@ -1,111 +0,0 @@
name: 🌑️ Nightly builds
# Create nightly builds at the end of every day
on:
schedule:
- cron: '0 0 * * *'
jobs:
###############################################
###### rpi_ws281x submodule update check ######
###############################################
update_submodule:
name: 🔁 Update Submodule rpi_ws281x (Nightly build only)
if: ${{ !startsWith(github.repository, 'hyperion-project') }}
runs-on: ubuntu-latest
steps:
- name: ⬇ Checkout
uses: actions/checkout@v4
with:
persist-credentials: false
fetch-depth: 0
submodules: recursive
- name: 🔁 Update Submodule rpi_ws281x
id: update
run: git submodule update --remote --recursive dependencies/external/rpi_ws281x
- name: ✅ Check git status
id: status
run: echo "status=$(git status -s)" >> $GITHUB_OUTPUT
- name: ✏️ Add/Commit changes
if: ${{ steps.status.outputs.status }}
run: |
git config --local user.email "20935312+Hyperion-Bot@users.noreply.github.com"
git config --local user.name "Hyperion-Bot"
git config --local diff.ignoreSubmodules dirty
git commit -am "Update submodule rpi_ws281x"
- name: 📦 Push changes
if: ${{ env.SECRET_BOT_TOKEN != null && steps.status.outputs.status }}
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.HYPERION_BOT_TOKEN }}
branch: ${{ github.ref }}
env:
SECRET_BOT_TOKEN: ${{ secrets.HYPERION_BOT_TOKEN }}
##################################
###### APT/DNF commit check ######
##################################
check:
name: 🔀 Compare local <-> nightly (Nightly build only)
needs: [update_submodule]
if: ${{ !startsWith(github.repository, 'hyperion-project') }}
runs-on: ubuntu-latest
steps:
- name: ⬇ Checkout
uses: actions/checkout@v3
- name: ✅ Check if commit has changed (APT)
id: apt-build-necessary
run: |
if wget --spider "https://nightly.apt.releases.hyperion-project.org//$(git rev-parse --short HEAD)" 2>/dev/null; then
echo "commit-has-changed=false" >> $GITHUB_OUTPUT
else
echo "commit-has-changed=true" >> $GITHUB_OUTPUT
fi
- name: ✅ Check if commit has changed (DNF)
id: dnf-build-necessary
run: |
if wget --spider "https://nightly.dnf.releases.hyperion-project.org/$(git rev-parse --short HEAD)" 2>/dev/null; then
echo "commit-has-changed=false" >> $GITHUB_OUTPUT
else
echo "commit-has-changed=true" >> $GITHUB_OUTPUT
fi
outputs:
build-apt-nightly: ${{ steps.apt-build-necessary.outputs.commit-has-changed }}
build-dnf-nightly: ${{ steps.dnf-build-necessary.outputs.commit-has-changed }}
###################################
###### APT reusable workflow ######
###################################
apt_build:
name: 👷 APT Build
needs: [check]
if: ${{ needs.check.outputs.build-apt-nightly == 'true' }}
uses: ./.github/workflows/apt.yml
secrets: inherit
with:
nightly: true
publish: true
###################################
###### DNF reusable workflow ######
###################################
dnf_build:
name: 👷 DNF Build
needs: [check]
if: ${{ needs.check.outputs.build-dnf-nightly == 'true' }}
uses: ./.github/workflows/dnf.yml
secrets: inherit
with:
nightly: true
publish: true

View File

@ -1,10 +1,7 @@
name: Hyperion CI/PR Builds
run-name: |
${{ github.event_name == 'pull_request' && '📦 Generate artifacts for PR' || '' }}
${{ github.event_name == 'pull_request' && github.event.pull_request.number || '' }}
${{ github.event_name == 'pull_request' && '-' || '' }}
${{ github.event_name == 'push' && '🌱 Push Build -' || '' }}
${{ github.event_name == 'pull_request' && github.event.pull_request.title || github.event.head_commit.message }}
${{ github.event_name == 'push' && '🌱 Push build -' || '' }}
${{ github.event_name == 'pull_request' && format('📦 Artifacts build for PR {0} - {1}', github.event.pull_request.number, github.event.pull_request.title) || github.event.head_commit.message }}
on:
push:
@ -16,242 +13,37 @@ on:
branches:
- 'master'
# Cancel running actions when a new action on the same PR is started
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
######################
###### Linux #########
######################
Linux:
name: 🐧 ${{ matrix.os.description }}
runs-on: ubuntu-latest
# GitHub Push/Pull Request (Release only on tagged commits)
github_build:
name: Qt ${{ matrix.qt_version }} Build ${{ matrix.qt_version == '6' && '(Testing))' || '' }}
strategy:
fail-fast: false
matrix:
os: [
{ description: Debian Buster (x86_64), platform: x11, architecture: [ amd64, linux/amd64 ] },
{ description: Debian Buster (Raspberry Pi v1 & ZERO), platform: rpi, architecture: [ armv6, linux/arm/v5 ] },
{ description: Debian Buster (Raspberry Pi 2/3/4), platform: rpi, architecture: [ armv7, linux/arm/v7 ] },
{ description: Debian Buster (Generic AARCH64), platform: amlogic, architecture: [ aarch64, linux/arm64 ] }
]
include:
- distribution: debian
- codename: buster
qt_version: ['5', '6']
uses: ./.github/workflows/qt5_6.yml
secrets: inherit
with:
qt_version: ${{ matrix.qt_version }}
event_name: ${{ github.event_name }}
pull_request_number: ${{ github.event.pull_request.number }}
publish: ${{ startsWith(github.event.ref, 'refs/tags') }}
steps:
- name: ⬇ Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: 🔧 Prepare PR
if: ${{ github.event_name == 'pull_request' }}
shell: bash
run: |
echo '::group::Append PR number to version'
tr -d '\n' < .version > temp && mv temp .version
echo -n "+PR${{ github.event.pull_request.number }}" >> .version
echo '::endgroup::'
- name: 🛠️ Setup QEMU
if: ${{ matrix.os.architecture[0] != 'amd64' }}
uses: docker/setup-qemu-action@v3
- name: 👷 Build
shell: bash
run: |
echo '::group::Build Hyperion'
./.github/scripts/build.sh
echo '::endgroup::'
env:
DOCKER_IMAGE: ${{ matrix.distribution }}
DOCKER_TAG: ${{ matrix.codename }}
PLATFORM: ${{ matrix.os.platform }}
TARGET_ARCH: ${{ matrix.os.architecture[1] }}
- name: 📦 Upload
if: ${{ startsWith(github.event.ref, 'refs/tags') || github.event_name == 'pull_request' }}
uses: actions/upload-artifact@v3
with:
name: ${{ github.event_name == 'pull_request' && matrix.os.architecture[0] || 'artifact' }}
path: ${{ github.event_name == 'pull_request' && 'deploy/*.tar.gz' || 'deploy/Hyperion-*' }}
######################
###### macOS #########
######################
macOS:
name: 🍏 macOS
runs-on: macos-latest
steps:
- name: ⬇ Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: 🔧 Prepare PR
if: ${{ github.event_name == 'pull_request' }}
shell: bash
run: |
echo '::group::Append PR number to version'
tr -d '\n' < .version > temp && mv temp .version
echo -n "+PR${{ github.event.pull_request.number }}" >> .version
echo '::endgroup::'
- name: 👷 Build
shell: bash
run: |
echo '::group::Update/Install dependencies'
brew update || true
brew install --overwrite qt5 libusb
brew link --overwrite --force qt5
echo '::endgroup::'
echo '::group::Build packages'
./.github/scripts/build.sh
echo '::endgroup::'
env:
PLATFORM: osx
- name: 📦 Upload
if: ${{ startsWith(github.event.ref, 'refs/tags') || github.event_name == 'pull_request' }}
uses: actions/upload-artifact@v3
with:
name: ${{ github.event_name == 'pull_request' && 'macOS' || 'artifact' }}
path: 'build/Hyperion-*'
######################
###### Windows #######
######################
windows:
name: 🪟 Windows
runs-on: windows-2022
env:
VCINSTALLDIR: 'C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC'
QT_VERSION: 5.15.2
steps:
- name: ⬇ Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: 🔧 Prepare PR
if: ${{ github.event_name == 'pull_request' }}
shell: bash
run: |
echo '::group::Append PR number to version'
tr -d '\n' < .version > temp && mv temp .version
echo -n "+PR${{ github.event.pull_request.number }}" >> .version
echo '::endgroup::'
- name: 💾 Cache/Restore
uses: actions/cache@v3
with:
path: C:\Users\runneradmin\AppData\Local\Temp\chocolatey
key: ${{ runner.os }}-chocolatey
- name: 📥 Install OpenSSL, DirectX SDK, libjpeg-turbo
shell: powershell
run: |
choco install --no-progress openssl --version=1.1.1.2100 -y
choco install --no-progress directx-sdk -y
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
.\libjpeg-turbo /S
- name: 📥 Install Qt
uses: jurplel/install-qt-action@v3
with:
version: ${{env.QT_VERSION}}
target: 'desktop'
arch: 'win64_msvc2019_64'
cache: 'true'
cache-key-prefix: 'cache-qt-windows'
- name: 🛠️ Setup MSVC
shell: cmd
run: call "${{env.VCINSTALLDIR}}\Auxiliary\Build\vcvars64.bat"
- name: 👷 Build
shell: bash
run: |
echo '::group::Build packages'
./.github/scripts/build.sh
echo '::endgroup::'
env:
PLATFORM: windows
- name: 📦 Upload
if: ${{ startsWith(github.event.ref, 'refs/tags') || github.event_name == 'pull_request' }}
uses: actions/upload-artifact@v3
with:
name: ${{ github.event_name == 'pull_request' && 'windows' || 'artifact' }}
path: ${{ github.event_name == 'pull_request' && 'build/*.exe' || 'build/Hyperion-*' }}
#####################################
###### Publish GitHub Releases ######
#####################################
github_publish:
name: 🚀 Publish GitHub Releases
# Build DEB/RPM Packages for APT/DNF Repository (runs only on tagged commits)
repo_build:
name: 🚀 Let Hyperion build its own repository (APT/DNF)
if: startsWith(github.event.ref, 'refs/tags')
needs: [Linux, macOS, windows]
needs: [ github_build ]
runs-on: ubuntu-latest
steps:
- name: ⬇ Checkout
uses: actions/checkout@v4
- name: 🔧 Prepare
run: |
echo '::group::Generate environment variables from .version and tag'
echo "TAG=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV
echo "VERSION=$(tr -d '\n' < .version)" >> $GITHUB_ENV
echo '::endgroup::'
- name: 💾 Artifact download
uses: actions/download-artifact@v3.0.2
- name: 📲 Dispatch APT/DNF build
if: ${{ env.SECRET_HYPERION_BOT_TOKEN != null }}
uses: peter-evans/repository-dispatch@v2.1.2
with:
path: artifacts
- name: 📦 Upload
uses: softprops/action-gh-release@v1
with:
name: Hyperion ${{ env.VERSION }}
tag_name: ${{ env.TAG }}
files: "artifacts/**"
draft: true
repository: hyperion-project/hyperion.releases-ci
token: ${{ secrets.HYPERION_BOT_TOKEN }}
event-type: releases_repo_build
client-payload: '{ "head_sha": "${{ github.sha }}" }'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
###################################
###### APT reusable workflow ######
###################################
apt_build:
name: APT Build
if: startsWith(github.event.ref, 'refs/tags')
needs: [Linux, macOS, windows]
uses: ./.github/workflows/apt.yml
secrets: inherit
with:
nightly: false
publish: true
###################################
###### DNF reusable workflow ######
###################################
dnf_build:
name: DNF Build
if: startsWith(github.event.ref, 'refs/tags')
needs: [Linux, macOS, windows]
uses: ./.github/workflows/dnf.yml
secrets: inherit
with:
nightly: false
publish: true
SECRET_HYPERION_BOT_TOKEN: ${{ secrets.HYPERION_BOT_TOKEN }}

250
.github/workflows/qt5_6.yml vendored Normal file
View File

@ -0,0 +1,250 @@
name: GitHub Qt5/6 Builds
on:
# Reusable from push_pull.yml
workflow_call:
inputs:
qt_version:
type: string
description: Build with this Qt version
default: '5'
required: false
event_name:
type: string
description: The event name
default: ''
required: false
pull_request_number:
type: string
description: The corresponding PR number
default: ''
required: false
publish:
type: boolean
description: Package publishing
default: false
required: false
env:
ghcr: hyperion-project
jobs:
######################
###### Linux #########
######################
Linux:
name: 🐧 ${{ matrix.os.description }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
os: [
{ distribution: debian, codename: buster, description: Debian Buster (x86_64), architecture: [ amd64, linux/amd64 ] },
{ distribution: debian, codename: bullseye, description: Debian Bullseye (x86_64), architecture: [ amd64, linux/amd64 ] },
{ distribution: debian, codename: buster, description: Debian Buster (Raspberry Pi 1/ZERO), architecture: [ armv6, linux/arm/v5 ] },
{ distribution: debian, codename: buster, description: Debian Buster (Raspberry Pi 2/3/4), architecture: [ armv7, linux/arm/v7 ] },
{ distribution: debian, codename: bullseye, description: Debian Bullseye (Raspberry Pi 2/3/4), architecture: [ armv7, linux/arm/v7 ] },
{ distribution: debian, codename: buster, description: Debian Buster (Generic AARCH64), architecture: [ aarch64, linux/arm64 ] },
{ distribution: debian, codename: bullseye, description: Debian Bullseye (Generic AARCH64), architecture: [ aarch64, linux/arm64 ] }
]
isQt5:
- ${{ inputs.qt_version == '5' }}
include:
- os.architecture[0]: amd64
platform: x11
- os.architecture[0]: armv6
platform: rpi
- os.architecture[0]: armv7
platform: rpi
- os.architecture[0]: aarch64
platform: amlogic
exclude:
- isQt5: true
os: { distribution: debian, codename: bullseye }
- isQt5: false
os: { distribution: debian, codename: buster }
steps:
- name: ⬇ Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: 🔧 Prepare
shell: bash
run: |
echo '::group::Append PR number to version (PR only)'
if [[ "${{ inputs.event_name }}" = "pull_request" ]]; then
tr -d '\n' < .version > temp && mv temp .version
echo -n "+PR${{ inputs.pull_request_number }}" >> .version
fi
echo '::endgroup::'
- name: 👷 Build
shell: bash
run: ./.github/scripts/build.sh
env:
DOCKER_IMAGE: ${{ matrix.os.distribution }}
DOCKER_TAG: ${{ matrix.os.codename }}${{ inputs.qt_version == '6' && '-qt6' || '' }}
PLATFORM: ${{ matrix.platform }}
TARGET_ARCH: ${{ matrix.os.architecture[1] }}
- name: 📦 Upload
if: ${{ inputs.publish || inputs.event_name == 'pull_request' }}
uses: actions/upload-artifact@v3
with:
name: ${{ inputs.event_name == 'pull_request' && env.NAME || 'artifact' }}
path: ${{ inputs.event_name == 'pull_request' && 'deploy/*.tar.gz' || 'deploy/Hyperion-*' }}
env:
NAME: format('{0}_{1}_{2}{3}', matrix.os.distribution, matrix.os.codename, matrix.os.architecture[0], inputs.qt_version == '6' && '_qt6' || '')
######################
###### macOS #########
######################
macOS:
name: 🍏 macOS x64
runs-on: macos-latest
steps:
- name: ⬇ Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: 🔧 Prepare
shell: bash
run: |
echo '::group::Append PR number to version (PR only)'
if [[ "${{ inputs.event_name }}" = "pull_request" ]]; then
tr -d '\n' < .version > temp && mv temp .version
echo -n "+PR${{ inputs.pull_request_number }}" >> .version
fi
echo '::endgroup::'
echo '::group::Update/Install dependencies'
brew update || true
brew install --overwrite qt${{ inputs.qt_version }} libusb
brew link --overwrite --force qt${{ inputs.qt_version }}
echo '::endgroup::'
- name: 👷 Build
shell: bash
run: ./.github/scripts/build.sh
env:
PLATFORM: osx
- name: 📦 Upload
if: ${{ inputs.publish || inputs.event_name == 'pull_request' }}
uses: actions/upload-artifact@v3
with:
name: ${{ inputs.event_name == 'pull_request' && env.NAME || 'artifact' }}
path: 'build/Hyperion-*'
env:
NAME: ${{ inputs.qt_version == '6' && 'macOS_x64_qt6' || 'macOS_x64' }}
######################
###### Windows #######
######################
windows:
name: 🪟 Windows x64
runs-on: windows-2022
env:
VCINSTALLDIR: 'C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC'
steps:
- name: ⬇ Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: 🔧 Prepare PR
if: ${{ inputs.event_name == 'pull_request' }}
shell: bash
run: |
echo '::group::Append PR number to version'
tr -d '\n' < .version > temp && mv temp .version
echo -n "+PR${{ inputs.pull_request_number }}" >> .version
echo '::endgroup::'
- name: 💾 Cache/Restore
uses: actions/cache@v3
with:
path: C:\Users\runneradmin\AppData\Local\Temp\chocolatey
key: ${{ runner.os }}${{ inputs.qt_version == '6' && '-chocolatey-qt6' || '-chocolatey' }}
- name: 📥 Install DirectX SDK, OpenSSL, libjpeg-turbo ${{ inputs.qt_version == '6' && 'and Vulkan-SDK' || '' }}
shell: powershell
run: |
choco install --no-progress directx-sdk ${{env.VULKAN_SDK}} -y
choco install --no-progress ${{env.OPENSSL}} -y
Invoke-WebRequest https://netcologne.dl.sourceforge.net/project/libjpeg-turbo/3.0.1/libjpeg-turbo-3.0.1-vc64.exe -OutFile libjpeg-turbo.exe -UserAgent NativeHost
.\libjpeg-turbo /S
env:
VULKAN_SDK: ${{ inputs.qt_version == '6' && 'vulkan-sdk' || '' }}
OPENSSL: ${{ inputs.qt_version == '6' && 'openssl' || 'openssl --version=1.1.1.2100' }}
- name: 📥 Install Qt
uses: jurplel/install-qt-action@v3
with:
version: ${{ inputs.qt_version == '6' && '6.5.2' || '5.15.2' }}
target: 'desktop'
modules: ${{ inputs.qt_version == '6' && 'qtserialport' || '' }}
arch: 'win64_msvc2019_64'
cache: 'true'
cache-key-prefix: 'cache-qt-windows'
- name: 🛠️ Setup MSVC
shell: cmd
run: call "${{env.VCINSTALLDIR}}\Auxiliary\Build\vcvars64.bat"
- name: 👷 Build
shell: bash
run: ./.github/scripts/build.sh
env:
PLATFORM: windows
- name: 📦 Upload
if: ${{ inputs.publish || inputs.event_name == 'pull_request' }}
uses: actions/upload-artifact@v3
with:
name: ${{ inputs.event_name == 'pull_request' && env.NAME || 'artifact' }}
path: ${{ inputs.event_name == 'pull_request' && 'build/*.exe' || 'build/Hyperion-*' }}
env:
NAME: ${{ inputs.qt_version == '6' && 'windows_x64_qt6' || 'windows_x64' }}
#####################################
###### Publish GitHub Releases ######
#####################################
github_publish:
name: 🚀 Publish GitHub Releases
if: ${{ inputs.qt_version == '5' && inputs.publish }}
needs: [Linux, macOS, windows]
runs-on: ubuntu-latest
steps:
- name: ⬇ Checkout
uses: actions/checkout@v4
- name: 🔧 Prepare
run: |
echo '::group::Generate environment variables from .version and tag'
echo "TAG=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV
echo "VERSION=$(tr -d '\n' < .version)" >> $GITHUB_ENV
echo '::endgroup::'
- name: 💾 Artifact download
uses: actions/download-artifact@v3.0.2
with:
path: artifacts
- name: 📦 Upload
uses: softprops/action-gh-release@v1
with:
name: Hyperion ${{ env.VERSION }}
tag_name: ${{ env.TAG }}
files: "artifacts/**"
draft: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

7
.gitmodules vendored
View File

@ -1,7 +1,7 @@
[submodule "dependencies/external/rpi_ws281x"]
path = dependencies/external/rpi_ws281x
url = https://github.com/jgarff/rpi_ws281x
branch = master
url = https://github.com/hyperion-project/rpi_ws281x
branch = main
[submodule "dependencies/external/flatbuffers"]
path = dependencies/external/flatbuffers
url = https://github.com/google/flatbuffers
@ -15,3 +15,6 @@
[submodule "dependencies/external/mbedtls"]
path = dependencies/external/mbedtls
url = ../../Mbed-TLS/mbedtls.git
[submodule "dependencies/external/rpi_ws281x"]
path = dependencies/external/rpi_ws281x
url = https://github.com/Paulchen-Panther/rpi_ws281x

View File

@ -70,6 +70,7 @@ Note: The wizard will configure an APIv2 capable bridge always with Entertainmen
- Changed default build from Stretch to Buster
- Support Qt 6.7, Update to Protobuf 23.4.0, Update mbedTLS to v3.4.0, Update flatbuffers to v23.5.26
- Use C++17 standard as default
- Added Pull Request (PR) installation script, allowing users to test development builds savely on Linux
- Fixed missing include limits in QJsonSchemaChecker - Thanks @Portisch
- Fixed dependencies for deb packages in Debian Bookworm (#1579) - Thanks @hg42, @Psirus
- Fixed git version identification when run in docker and local code

View File

@ -1,17 +1,17 @@
cmake_minimum_required(VERSION 3.5.0)
message( STATUS "CMake Version: ${CMAKE_VERSION}" )
message(STATUS "CMake Version: ${CMAKE_VERSION}")
macro(addIndent text)
if(${CMAKE_VERSION} VERSION_GREATER "3.16.0")
list(APPEND CMAKE_MESSAGE_INDENT ${text})
endif()
if(${CMAKE_VERSION} VERSION_GREATER "3.16.0")
list(APPEND CMAKE_MESSAGE_INDENT ${text})
endif()
endmacro()
macro(removeIndent)
if(${CMAKE_VERSION} VERSION_GREATER "3.16.0")
list(POP_BACK CMAKE_MESSAGE_INDENT)
endif()
if(${CMAKE_VERSION} VERSION_GREATER "3.16.0")
list(POP_BACK CMAKE_MESSAGE_INDENT)
endif()
endmacro()
PROJECT(hyperion)
@ -31,9 +31,16 @@ set(CMAKE_AUTOMOC ON)
# auto prepare .qrc files
set(CMAKE_AUTORCC ON)
# Configure CCache if available
# multicore compiling
include(ProcessorCount)
ProcessorCount(NCORES)
if(NOT NCORES EQUAL 0)
set(CMAKE_BUILD_PARALLEL_LEVEL NCORES)
endif()
# Configure CCache ifavailable
find_program(CCACHE_FOUND ccache)
if ( CCACHE_FOUND )
if(CCACHE_FOUND)
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache)
set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache)
endif(CCACHE_FOUND)
@ -58,163 +65,163 @@ set(CMAKE_CXX_EXTENSIONS OFF)
# Set build variables
# Grabber
SET ( DEFAULT_AMLOGIC OFF )
SET ( DEFAULT_DISPMANX OFF )
SET ( DEFAULT_DX OFF )
SET ( DEFAULT_MF OFF )
SET ( DEFAULT_OSX OFF )
SET ( DEFAULT_QT ON )
SET ( DEFAULT_V4L2 OFF )
SET ( DEFAULT_AUDIO ON )
SET ( DEFAULT_X11 OFF )
SET ( DEFAULT_XCB OFF )
set(DEFAULT_AMLOGIC OFF)
set(DEFAULT_DISPMANX OFF)
set(DEFAULT_DX OFF)
set(DEFAULT_MF OFF)
set(DEFAULT_OSX OFF)
set(DEFAULT_QT ON )
set(DEFAULT_V4L2 OFF)
set(DEFAULT_AUDIO ON )
set(DEFAULT_X11 OFF)
set(DEFAULT_XCB OFF)
# Input
SET ( DEFAULT_BOBLIGHT_SERVER ON )
SET ( DEFAULT_CEC OFF )
SET ( DEFAULT_FLATBUF_SERVER ON )
SET ( DEFAULT_PROTOBUF_SERVER ON )
set(DEFAULT_BOBLIGHT_SERVER ON )
set(DEFAULT_CEC OFF)
set(DEFAULT_FLATBUF_SERVER ON )
set(DEFAULT_PROTOBUF_SERVER ON )
# Output
SET ( DEFAULT_FORWARDER ON )
SET ( DEFAULT_FLATBUF_CONNECT ON )
set(DEFAULT_FORWARDER ON )
set(DEFAULT_FLATBUF_CONNECT ON )
# LED-Devices
SET ( DEFAULT_DEV_NETWORK ON )
SET ( DEFAULT_DEV_SERIAL ON )
SET ( DEFAULT_DEV_SPI OFF )
SET ( DEFAULT_DEV_TINKERFORGE OFF )
SET ( DEFAULT_DEV_USB_HID OFF )
SET ( DEFAULT_DEV_WS281XPWM OFF )
set(DEFAULT_DEV_NETWORK ON )
set(DEFAULT_DEV_SERIAL ON )
set(DEFAULT_DEV_SPI OFF)
set(DEFAULT_DEV_TINKERFORGE OFF)
set(DEFAULT_DEV_USB_HID OFF)
set(DEFAULT_DEV_WS281XPWM OFF)
# Services
SET ( DEFAULT_EFFECTENGINE ON )
SET ( DEFAULT_EXPERIMENTAL OFF )
SET ( DEFAULT_MDNS ON )
SET ( DEFAULT_REMOTE_CTL ON )
set(DEFAULT_EFFECTENGINE ON )
set(DEFAULT_EXPERIMENTAL OFF)
set(DEFAULT_MDNS ON )
set(DEFAULT_REMOTE_CTL ON )
# Build
SET ( DEFAULT_JSONCHECKS ON )
SET ( DEFAULT_DEPLOY_DEPENDENCIES ON )
SET ( DEFAULT_USE_SYSTEM_FLATBUFFERS_LIBS OFF )
SET ( DEFAULT_USE_SYSTEM_PROTO_LIBS OFF )
SET ( DEFAULT_USE_SYSTEM_MBEDTLS_LIBS OFF )
SET ( DEFAULT_USE_SYSTEM_QMDNS_LIBS OFF )
SET ( DEFAULT_TESTS OFF )
set(DEFAULT_JSONCHECKS ON )
set(DEFAULT_DEPLOY_DEPENDENCIES ON )
set(DEFAULT_USE_SYSTEM_FLATBUFFERS_LIBS OFF)
set(DEFAULT_USE_SYSTEM_PROTO_LIBS OFF)
set(DEFAULT_USE_SYSTEM_MBEDTLS_LIBS OFF)
set(DEFAULT_USE_SYSTEM_QMDNS_LIBS OFF)
set(DEFAULT_TESTS OFF)
# Build Hyperion with a reduced set of functionality, overwrites other default values
SET ( DEFAULT_HYPERION_LIGHT OFF )
set(DEFAULT_HYPERION_LIGHT OFF)
IF ( ${CMAKE_SYSTEM} MATCHES "Linux" )
SET ( DEFAULT_FB ON )
SET ( DEFAULT_V4L2 ON )
SET ( DEFAULT_DEV_SPI ON )
SET ( DEFAULT_DEV_TINKERFORGE ON )
SET ( DEFAULT_DEV_USB_HID ON )
SET ( DEFAULT_CEC ON )
ELSEIF ( WIN32 )
SET ( DEFAULT_DX ON )
SET ( DEFAULT_MF ON )
ELSE()
SET ( DEFAULT_FB OFF )
SET ( DEFAULT_V4L2 OFF )
SET ( DEFAULT_DEV_SPI OFF )
SET ( DEFAULT_DEV_TINKERFORGE OFF )
SET ( DEFAULT_DEV_USB_HID OFF )
SET ( DEFAULT_CEC OFF )
ENDIF()
if(${CMAKE_SYSTEM} MATCHES "Linux")
set(DEFAULT_FB ON)
set(DEFAULT_V4L2 ON)
set(DEFAULT_DEV_SPI ON)
set(DEFAULT_DEV_TINKERFORGE ON)
set(DEFAULT_DEV_USB_HID ON)
set(DEFAULT_CEC ON)
elseif (WIN32)
set(DEFAULT_DX ON)
set(DEFAULT_MF ON)
else()
set(DEFAULT_FB OFF)
set(DEFAULT_V4L2 OFF)
set(DEFAULT_DEV_SPI OFF)
set(DEFAULT_DEV_TINKERFORGE OFF)
set(DEFAULT_DEV_USB_HID OFF)
set(DEFAULT_CEC OFF)
endif()
if ( NOT DEFINED PLATFORM )
if ( APPLE )
SET( PLATFORM "osx")
elseif ( WIN32 )
SET( PLATFORM "windows")
elseif ( "${CMAKE_SYSTEM_PROCESSOR}" MATCHES "x86" )
SET( PLATFORM "x11")
elseif ( "${CMAKE_SYSTEM_PROCESSOR}" MATCHES "arm" OR "${CMAKE_SYSTEM_PROCESSOR}" MATCHES "aarch64")
SET( PLATFORM "rpi")
FILE( READ /proc/cpuinfo SYSTEM_CPUINFO )
STRING ( TOLOWER "${SYSTEM_CPUINFO}" SYSTEM_CPUINFO )
if ( "${SYSTEM_CPUINFO}" MATCHES "amlogic" AND ${CMAKE_SIZEOF_VOID_P} EQUAL 4 )
SET( PLATFORM "amlogic" )
elseif ( ("${SYSTEM_CPUINFO}" MATCHES "amlogic" OR "${SYSTEM_CPUINFO}" MATCHES "odroid-c2" OR "${SYSTEM_CPUINFO}" MATCHES "vero4k") AND ${CMAKE_SIZEOF_VOID_P} EQUAL 8 )
SET( PLATFORM "amlogic64" )
if(NOT DEFINED PLATFORM)
if(APPLE)
set(PLATFORM "osx")
elseif (WIN32)
set(PLATFORM "windows")
elseif ("${CMAKE_SYSTEM_PROCESSOR}" MATCHES "x86")
set(PLATFORM "x11")
elseif ("${CMAKE_SYSTEM_PROCESSOR}" MATCHES "arm" OR "${CMAKE_SYSTEM_PROCESSOR}" MATCHES "aarch64")
set(PLATFORM "rpi")
file(READ /proc/cpuinfo SYSTEM_CPUINFO)
STRING (TOLOWER "${SYSTEM_CPUINFO}" SYSTEM_CPUINFO)
if("${SYSTEM_CPUINFO}" MATCHES "amlogic" AND ${CMAKE_SIZEOF_VOID_P} EQUAL 4)
set(PLATFORM "amlogic")
elseif (("${SYSTEM_CPUINFO}" MATCHES "amlogic" OR "${SYSTEM_CPUINFO}" MATCHES "odroid-c2" OR "${SYSTEM_CPUINFO}" MATCHES "vero4k") AND ${CMAKE_SIZEOF_VOID_P} EQUAL 8)
set(PLATFORM "amlogic64")
endif()
endif()
if ( PLATFORM )
message( STATUS "PLATFORM is not defined, evaluated platform: ${PLATFORM}")
if(PLATFORM)
message(STATUS "PLATFORM is not defined, evaluated platform: ${PLATFORM}")
else()
message( FATAL_ERROR "PLATFORM is not defined and could not be evaluated. Set -DPLATFORM=<rpi|amlogic|amlogic64|x11|x11-dev|osx|osx-dev>")
message(FATAL_ERROR "PLATFORM is not defined and could not be evaluated. Set -DPLATFORM=<rpi|amlogic|amlogic64|x11|x11-dev|osx|osx-dev>")
endif()
endif()
message( STATUS "PLATFORM: ${PLATFORM}")
message(STATUS "PLATFORM: ${PLATFORM}")
# Macro to get path of first sub dir of a dir, used for MAC OSX lib/header searching
MACRO(FIRSTSUBDIR result curdir)
FILE(GLOB children RELATIVE ${curdir} ${curdir}/*)
SET(dirlist "")
FOREACH(child ${children})
IF(IS_DIRECTORY ${curdir}/${child})
LIST(APPEND dirlist "${curdir}/${child}")
BREAK()
ENDIF()
ENDFOREACH()
SET(${result} ${dirlist})
ENDMACRO()
macro(FIRSTSUBDIR result curdir)
file(GLOB children RELATIVE ${curdir} ${curdir}/*)
set(dirlist "")
foreach(child ${children})
if(IS_DIRECTORY ${curdir}/${child})
list(APPEND dirlist "${curdir}/${child}")
break()
endif()
endforeach()
set(${result} ${dirlist})
endmacro()
if ( "${PLATFORM}" MATCHES "osx" )
if("${PLATFORM}" MATCHES "osx")
# specify the min version of the target platform (only GitHub Actions)
if( DEFINED ENV{GITHUB_ACTIONS} AND DEFINED ENV{GITHUB_WORKSPACE} )
SET ( CMAKE_OSX_DEPLOYMENT_TARGET "10.15" )
if(DEFINED ENV{GITHUB_WORKSPACE})
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.15")
endif()
# add specific prefix paths
FIRSTSUBDIR(SUBDIRPY "/usr/local/opt/python3/Frameworks/Python.framework/Versions")
SET ( CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} ${SUBDIRPY} )
set(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} ${SUBDIRPY})
include_directories("/opt/X11/include/")
SET ( DEFAULT_OSX ON )
SET ( DEFAULT_AUDIO OFF )
SET ( DEFAULT_DEV_USB_HID ON )
set(DEFAULT_OSX ON )
set(DEFAULT_AUDIO OFF)
set(DEFAULT_DEV_USB_HID ON )
elseif ( "${PLATFORM}" MATCHES "rpi" )
SET ( DEFAULT_DISPMANX ON )
SET ( DEFAULT_DEV_WS281XPWM ON )
elseif ( "${PLATFORM}" MATCHES "^amlogic" )
SET ( DEFAULT_AMLOGIC ON )
if ( "${PLATFORM}" MATCHES "-dev$" )
SET ( DEFAULT_AMLOGIC ON )
SET ( DEFAULT_DISPMANX OFF )
SET ( DEFAULT_QT OFF )
SET ( DEFAULT_CEC OFF )
elseif ("${PLATFORM}" MATCHES "rpi")
set(DEFAULT_DISPMANX ON)
set(DEFAULT_DEV_WS281XPWM ON)
elseif ("${PLATFORM}" MATCHES "^amlogic")
set(DEFAULT_AMLOGIC ON)
if("${PLATFORM}" MATCHES "-dev$")
set(DEFAULT_AMLOGIC ON)
set(DEFAULT_DISPMANX OFF)
set(DEFAULT_QT OFF)
set(DEFAULT_CEC OFF)
endif()
elseif ( "${PLATFORM}" MATCHES "^x11" )
SET ( DEFAULT_X11 ON )
SET ( DEFAULT_XCB ON )
if ( "${PLATFORM}" MATCHES "-dev$" )
SET ( DEFAULT_AMLOGIC ON)
SET ( DEFAULT_DEV_WS281XPWM ON )
elseif ("${PLATFORM}" MATCHES "^x11")
set(DEFAULT_X11 ON)
set(DEFAULT_XCB ON)
if("${PLATFORM}" MATCHES "-dev$")
set(DEFAULT_AMLOGIC ON)
set(DEFAULT_DEV_WS281XPWM ON)
endif()
elseif ( "${PLATFORM}" STREQUAL "imx6" )
SET ( DEFAULT_FB ON )
elseif ("${PLATFORM}" STREQUAL "imx6")
set(DEFAULT_FB ON)
endif()
# enable tests for -dev builds
if ( "${PLATFORM}" MATCHES "-dev$" )
SET ( DEFAULT_TESTS ON )
if("${PLATFORM}" MATCHES "-dev$")
set(DEFAULT_TESTS ON)
endif()
STRING( TOUPPER "-DPLATFORM_${PLATFORM}" PLATFORM_DEFINE)
STRING( REPLACE "-DEV" "" PLATFORM_DEFINE "${PLATFORM_DEFINE}" )
ADD_DEFINITIONS( ${PLATFORM_DEFINE} )
string(TOUPPER "-DPLATFORM_${PLATFORM}" PLATFORM_DEFINE)
string(REPLACE "-DEV" "" PLATFORM_DEFINE "${PLATFORM_DEFINE}")
ADD_DEFINITIONS(${PLATFORM_DEFINE})
# set the build options
option(HYPERION_LIGHT "Build Hyperion with a reduced set of functionality" ${DEFAULT_HYPERION_LIGHT} )
option(HYPERION_LIGHT "Build Hyperion with a reduced set of functionality" ${DEFAULT_HYPERION_LIGHT})
message(STATUS "HYPERION_LIGHT = ${HYPERION_LIGHT}")
if (HYPERION_LIGHT)
if(HYPERION_LIGHT)
message(STATUS "HYPERION_LIGHT: Hyperion is build with a reduced set of functionality.")
# Disable Grabbers
SET ( DEFAULT_AMLOGIC OFF )
@ -225,48 +232,49 @@ if (HYPERION_LIGHT)
SET ( DEFAULT_OSX OFF )
SET ( DEFAULT_QT OFF )
SET ( DEFAULT_V4L2 OFF )
SET ( DEFAULT_AUDIO OFF )
SET ( DEFAULT_X11 OFF )
SET ( DEFAULT_XCB OFF )
SET ( DEFAULT_AUDIO OFF )
# Disable Input Servers
SET ( DEFAULT_BOBLIGHT_SERVER OFF )
SET ( DEFAULT_CEC OFF )
SET ( DEFAULT_FLATBUF_SERVER OFF )
SET ( DEFAULT_PROTOBUF_SERVER OFF )
set(DEFAULT_BOBLIGHT_SERVER OFF)
set(DEFAULT_CEC OFF)
set(DEFAULT_FLATBUF_SERVER OFF)
set(DEFAULT_PROTOBUF_SERVER OFF)
# Disable Output Connectors
SET ( DEFAULT_FORWARDER OFF )
SET ( DEFAULT_FLATBUF_CONNECT OFF )
set(DEFAULT_FORWARDER OFF)
set(DEFAULT_FLATBUF_CONNECT OFF)
# Disable Services
SET ( DEFAULT_EFFECTENGINE OFF )
set(DEFAULT_EFFECTENGINE OFF)
endif()
message(STATUS "Grabber options:")
addIndent(" - ")
option(ENABLE_AMLOGIC "Enable the AMLOGIC video grabber" ${DEFAULT_AMLOGIC} )
option(ENABLE_AMLOGIC "Enable the AMLOGIC video grabber" ${DEFAULT_AMLOGIC})
message(STATUS "ENABLE_AMLOGIC = ${ENABLE_AMLOGIC}")
option(ENABLE_DISPMANX "Enable the RPi dispmanx grabber" ${DEFAULT_DISPMANX} )
option(ENABLE_DISPMANX "Enable the RPi dispmanx grabber" ${DEFAULT_DISPMANX})
message(STATUS "ENABLE_DISPMANX = ${ENABLE_DISPMANX}")
option(ENABLE_DX "Enable the DirectX grabber" ${DEFAULT_DX})
message(STATUS "ENABLE_DX = ${ENABLE_DX}")
if (ENABLE_AMLOGIC)
SET(ENABLE_FB ON)
if(ENABLE_AMLOGIC)
set(ENABLE_FB ON)
else()
option(ENABLE_FB " Enable the framebuffer grabber" ${DEFAULT_FB} )
option(ENABLE_FB " Enable the framebuffer grabber" ${DEFAULT_FB})
endif()
message(STATUS "ENABLE_FB = ${ENABLE_FB}")
option(ENABLE_MF "Enable the Media Foundation grabber" ${DEFAULT_MF})
message(STATUS "ENABLE_MF = ${ENABLE_MF}")
option(ENABLE_OSX "Enable the OSX grabber" ${DEFAULT_OSX} )
option(ENABLE_OSX "Enable the OSX grabber" ${DEFAULT_OSX})
message(STATUS "ENABLE_OSX = ${ENABLE_OSX}")
option(ENABLE_QT "Enable the Qt grabber" ${DEFAULT_QT})
@ -277,30 +285,28 @@ message(STATUS "ENABLE_V4L2 = ${ENABLE_V4L2}")
option(ENABLE_X11 "Enable the X11 grabber" ${DEFAULT_X11})
message(STATUS "ENABLE_X11 = ${ENABLE_X11}")
option(ENABLE_AUDIO "Enable the AUDIO grabber" ${DEFAULT_AUDIO})
message(STATUS "ENABLE_AUDIO = ${ENABLE_AUDIO}")
option(ENABLE_WS281XPWM "Enable the WS281x-PWM device" ${DEFAULT_WS281XPWM} )
message(STATUS "ENABLE_WS281XPWM = ${ENABLE_WS281XPWM}")
option(ENABLE_XCB "Enable the XCB grabber" ${DEFAULT_XCB})
message(STATUS "ENABLE_XCB = ${ENABLE_XCB}")
option(ENABLE_AUDIO "Enable the AUDIO grabber" ${DEFAULT_AUDIO})
message(STATUS "ENABLE_AUDIO = ${ENABLE_AUDIO}")
removeIndent()
message(STATUS "Input options:")
addIndent(" - ")
option(ENABLE_BOBLIGHT_SERVER "Enable BOBLIGHT server" ${DEFAULT_BOBLIGHT_SERVER} )
option(ENABLE_BOBLIGHT_SERVER "Enable BOBLIGHT server" ${DEFAULT_BOBLIGHT_SERVER})
message(STATUS "ENABLE_BOBLIGHT_SERVER = ${ENABLE_BOBLIGHT_SERVER}")
option(ENABLE_CEC "Enable the libcec and CEC control" ${DEFAULT_CEC} )
option(ENABLE_CEC "Enable the libcec and CEC control" ${DEFAULT_CEC})
message(STATUS "ENABLE_CEC = ${ENABLE_CEC}")
option(ENABLE_FLATBUF_SERVER "Enable Flatbuffers server" ${DEFAULT_FLATBUF_SERVER} )
option(ENABLE_FLATBUF_SERVER "Enable Flatbuffers server" ${DEFAULT_FLATBUF_SERVER})
message(STATUS "ENABLE_FLATBUF_SERVER = ${ENABLE_FLATBUF_SERVER}")
option(ENABLE_PROTOBUF_SERVER "Enable Protocol Buffers server" ${DEFAULT_PROTOBUF_SERVER} )
option(ENABLE_PROTOBUF_SERVER "Enable Protocol Buffers server" ${DEFAULT_PROTOBUF_SERVER})
message(STATUS "ENABLE_PROTOBUF_SERVER = ${ENABLE_PROTOBUF_SERVER}")
removeIndent()
@ -308,13 +314,13 @@ removeIndent()
message(STATUS "Output options:")
addIndent(" - ")
option(ENABLE_FORWARDER "Enable Hyperion forwarding" ${DEFAULT_FORWARDER} )
option(ENABLE_FORWARDER "Enable Hyperion forwarding" ${DEFAULT_FORWARDER})
message(STATUS "ENABLE_FORWARDER = ${ENABLE_FORWARDER}")
if (ENABLE_FORWARDER)
SET(ENABLE_FLATBUF_CONNECT ON)
if(ENABLE_FORWARDER)
set(ENABLE_FLATBUF_CONNECT ON)
else()
option(ENABLE_FLATBUF_CONNECT "Enable Flatbuffers connecting remotely" ${DEFAULT_FLATBUF_CONNECT} )
option(ENABLE_FLATBUF_CONNECT "Enable Flatbuffers connecting remotely" ${DEFAULT_FLATBUF_CONNECT})
endif()
message(STATUS "ENABLE_FLATBUF_CONNECT = ${ENABLE_FLATBUF_CONNECT}")
@ -323,22 +329,22 @@ removeIndent()
message(STATUS "LED-Device options:")
addIndent(" - ")
option(ENABLE_DEV_NETWORK "Enable the Network devices" ${DEFAULT_DEV_NETWORK} )
option(ENABLE_DEV_NETWORK "Enable the Network devices" ${DEFAULT_DEV_NETWORK})
message(STATUS "ENABLE_DEV_NETWORK = ${ENABLE_DEV_NETWORK}")
option(ENABLE_DEV_SERIAL "Enable the Serial devices" ${DEFAULT_DEV_SERIAL} )
option(ENABLE_DEV_SERIAL "Enable the Serial devices" ${DEFAULT_DEV_SERIAL})
message(STATUS "ENABLE_DEV_SERIAL = ${ENABLE_DEV_SERIAL}")
option(ENABLE_DEV_SPI "Enable the SPI device" ${DEFAULT_DEV_SPI} )
option(ENABLE_DEV_SPI "Enable the SPI device" ${DEFAULT_DEV_SPI})
message(STATUS "ENABLE_DEV_SPI = ${ENABLE_DEV_SPI}")
option(ENABLE_DEV_TINKERFORGE "Enable the TINKERFORGE device" ${DEFAULT_DEV_TINKERFORGE})
message(STATUS "ENABLE_DEV_TINKERFORGE = ${ENABLE_DEV_TINKERFORGE}")
option(ENABLE_DEV_USB_HID "Enable the libusb and hid devices" ${DEFAULT_DEV_USB_HID} )
option(ENABLE_DEV_USB_HID "Enable the libusb and hid devices" ${DEFAULT_DEV_USB_HID})
message(STATUS "ENABLE_DEV_USB_HID = ${ENABLE_DEV_USB_HID}")
option(ENABLE_DEV_WS281XPWM "Enable the WS281x-PWM device" ${DEFAULT_DEV_WS281XPWM} )
option(ENABLE_DEV_WS281XPWM "Enable the WS281x-PWM device" ${DEFAULT_DEV_WS281XPWM})
message(STATUS "ENABLE_DEV_WS281XPWM = ${ENABLE_DEV_WS281XPWM}")
removeIndent()
@ -379,7 +385,7 @@ endif()
message(STATUS "DEFAULT_USE_SYSTEM_MBEDTLS_LIBS = ${DEFAULT_USE_SYSTEM_MBEDTLS_LIBS}")
if (ENABLE_MDNS)
if(ENABLE_MDNS)
message(STATUS "DEFAULT_USE_SYSTEM_QMDNS_LIBS = ${DEFAULT_USE_SYSTEM_QMDNS_LIBS}")
endif()
@ -392,14 +398,14 @@ message(STATUS "ENABLE_TESTS = ${ENABLE_TESTS}")
removeIndent()
SET ( FLATBUFFERS_INSTALL_BIN_DIR ${CMAKE_BINARY_DIR}/flatbuf )
SET ( FLATBUFFERS_INSTALL_LIB_DIR ${CMAKE_BINARY_DIR}/flatbuf )
set(FLATBUFFERS_INSTALL_BIN_DIR ${CMAKE_BINARY_DIR}/flatbuf)
set(FLATBUFFERS_INSTALL_LIB_DIR ${CMAKE_BINARY_DIR}/flatbuf)
SET ( PROTOBUF_INSTALL_BIN_DIR ${CMAKE_BINARY_DIR}/proto )
SET ( PROTOBUF_INSTALL_LIB_DIR ${CMAKE_BINARY_DIR}/proto )
set(PROTOBUF_INSTALL_BIN_DIR ${CMAKE_BINARY_DIR}/proto)
set(PROTOBUF_INSTALL_LIB_DIR ${CMAKE_BINARY_DIR}/proto)
if(ENABLE_JSONCHECKS OR ENABLE_EFFECTENGINE)
if ("${CMAKE_VERSION}" VERSION_LESS "3.12.0")
if("${CMAKE_VERSION}" VERSION_LESS "3.12.0")
set(Python_ADDITIONAL_VERSIONS 3.5)
find_package(PythonInterp 3.5 REQUIRED)
else()
@ -412,38 +418,38 @@ endif()
if(ENABLE_JSONCHECKS)
# check all json files
FILE ( GLOB_RECURSE HYPERION_SCHEMAS RELATIVE ${CMAKE_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/libsrc/*schema*.json )
SET( JSON_FILES ${CMAKE_BINARY_DIR}/config/hyperion.config.json.default ${HYPERION_SCHEMAS})
file (GLOB_RECURSE HYPERION_SCHEMAS RELATIVE ${CMAKE_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/libsrc/*schema*.json)
set(JSON_FILES ${CMAKE_BINARY_DIR}/config/hyperion.config.json.default ${HYPERION_SCHEMAS})
EXECUTE_PROCESS (
execute_process (
COMMAND ${PYTHON_EXECUTABLE} test/jsonchecks/checkjson.py ${JSON_FILES}
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
RESULT_VARIABLE CHECK_JSON_FAILED
)
IF ( ${CHECK_JSON_FAILED} )
MESSAGE (FATAL_ERROR "check of json files failed" )
ENDIF ()
if(${CHECK_JSON_FAILED})
message (FATAL_ERROR "check of json files failed")
endif()
if(ENABLE_EFFECTENGINE)
EXECUTE_PROCESS (
execute_process (
COMMAND ${PYTHON_EXECUTABLE} test/jsonchecks/checkeffects.py effects effects/schema
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
RESULT_VARIABLE CHECK_EFFECTS_FAILED
)
IF ( ${CHECK_EFFECTS_FAILED} )
MESSAGE (FATAL_ERROR "check of json effect files failed" )
ENDIF ()
if(${CHECK_EFFECTS_FAILED})
message (FATAL_ERROR "check of json effect files failed")
endif()
endif()
EXECUTE_PROCESS (
execute_process (
COMMAND ${PYTHON_EXECUTABLE} test/jsonchecks/checkschema.py ${CMAKE_BINARY_DIR}/config/hyperion.config.json.default libsrc/hyperion/hyperion.schema.json
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
RESULT_VARIABLE CHECK_CONFIG_FAILED
)
IF ( ${CHECK_CONFIG_FAILED} )
MESSAGE (FATAL_ERROR "check of json default config failed" )
ENDIF ()
if(${CHECK_CONFIG_FAILED})
message (FATAL_ERROR "check of json default config failed")
endif()
endif(ENABLE_JSONCHECKS)
# Add project specific cmake modules (find, etc)
@ -457,8 +463,8 @@ configure_file("${PROJECT_SOURCE_DIR}/HyperionConfig.h.in" "${PROJECT_BINARY_DIR
include_directories("${PROJECT_BINARY_DIR}")
# Define the global output path of binaries
SET(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/lib)
SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
set(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/lib)
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
file(MAKE_DIRECTORY ${LIBRARY_OUTPUT_PATH})
file(MAKE_DIRECTORY ${EXECUTABLE_OUTPUT_PATH})
@ -471,27 +477,21 @@ include_directories(${CMAKE_SOURCE_DIR}/include)
#set(CMAKE_FIND_LIBRARY_SUFFIXES ".a;.so")
# MSVC options
if (CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
if(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
# Search for Windows SDK
find_package(WindowsSDK REQUIRED)
message(STATUS "WINDOWS SDK: ${WINDOWSSDK_LATEST_DIR} ${WINDOWSSDK_LATEST_NAME}")
message(STATUS "MSVC VERSION: ${MSVC_VERSION}")
# Search for DirectX9
if (ENABLE_DX)
find_package(DirectX9 REQUIRED)
endif()
endif()
# Don't create new dynamic tags (RUNPATH) and setup -rpath to search for shared libs in BINARY/../lib folder (only for Unix)
if (ENABLE_DEPLOY_DEPENDENCIES AND UNIX AND NOT APPLE)
if(ENABLE_DEPLOY_DEPENDENCIES AND UNIX AND NOT APPLE)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--disable-new-dtags")
SET(CMAKE_SKIP_BUILD_RPATH FALSE)
SET(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
SET(CMAKE_INSTALL_RPATH "$ORIGIN/../lib")
SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
endif ()
set(CMAKE_SKIP_BUILD_RPATH FALSE)
set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
set(CMAKE_INSTALL_RPATH "$ORIGIN/../lib")
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
endif()
if(APPLE)
set(CMAKE_EXE_LINKER_FLAGS "-framework CoreGraphics")
@ -502,18 +502,18 @@ find_package(Threads REQUIRED)
# Allow to overwrite QT base directory
# Either supply QTDIR as -DQTDIR=<path> to cmake or set and environment variable QTDIR pointing to the Qt installation
# For Windows and OSX, the default Qt installation path are tried to resolved automatically
if (NOT DEFINED QTDIR)
if (DEFINED ENV{QTDIR})
if(NOT DEFINED QTDIR)
if(DEFINED ENV{QTDIR})
set(QTDIR $ENV{QTDIR})
else()
if (CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
if(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
FIRSTSUBDIR(SUBDIRQT "C:/Qt")
if (NOT ${SUBDIRQT} STREQUAL "")
if(NOT ${SUBDIRQT} STREQUAL "")
set(QTDIR "${SUBDIRQT}/msvc2019_64")
endif()
elseif ( "${PLATFORM}" MATCHES "osx" )
elseif ("${PLATFORM}" MATCHES "osx")
# QT6 x86_64 location
if (EXISTS /usr/local/opt/qt6)
if(EXISTS /usr/local/opt/qt6)
set(QTDIR "/usr/local/opt/qt6")
# QT6 arm64 location
elseif (EXISTS /opt/homebrew/opt/qt@6)
@ -529,34 +529,34 @@ if (NOT DEFINED QTDIR)
endif()
endif()
if (DEFINED QTDIR)
if(DEFINED QTDIR)
message(STATUS "Add QTDIR: ${QTDIR} to CMAKE_PREFIX_PATH")
list(PREPEND CMAKE_PREFIX_PATH ${QTDIR} "${QTDIR}/lib")
endif()
if (CMAKE_PREFIX_PATH)
message( STATUS "CMAKE_PREFIX_PATH used: ${CMAKE_PREFIX_PATH}" )
if(CMAKE_PREFIX_PATH)
message(STATUS "CMAKE_PREFIX_PATH used: ${CMAKE_PREFIX_PATH}")
endif()
# find QT libs
find_package(QT NAMES Qt6 Qt5 COMPONENTS Core Gui Network Sql Widgets REQUIRED)
message( STATUS "Found Qt Version: ${QT_VERSION}" )
message(STATUS "Found Qt Version: ${QT_VERSION}")
if (${QT_VERSION_MAJOR} GREATER_EQUAL 6 )
SET(QT_MIN_VERSION "6.2.2")
if(${QT_VERSION_MAJOR} GREATER_EQUAL 6)
set(QT_MIN_VERSION "6.2.2")
else()
SET(QT_MIN_VERSION "5.5.0")
set(QT_MIN_VERSION "5.5.0")
endif()
if ( "${QT_VERSION}" VERSION_LESS "${QT_MIN_VERSION}" )
message( FATAL_ERROR "Your Qt version is to old! Minimum required ${QT_MIN_VERSION}" )
if("${QT_VERSION}" VERSION_LESS "${QT_MIN_VERSION}")
message(FATAL_ERROR "Your Qt version is to old! Minimum required ${QT_MIN_VERSION}")
endif()
find_package(Qt${QT_VERSION_MAJOR} ${QT_VERSION} COMPONENTS Core Gui Network Sql Widgets REQUIRED)
message( STATUS "Qt version used: ${QT_VERSION}" )
message(STATUS "Qt version used: ${QT_VERSION}")
if (APPLE AND (${QT_VERSION_MAJOR} GREATER_EQUAL 6) )
if(APPLE AND (${QT_VERSION_MAJOR} GREATER_EQUAL 6))
set(OPENSSL_ROOT_DIR /usr/local/opt/openssl)
endif()
@ -568,29 +568,29 @@ add_definitions(${QT_DEFINITIONS})
add_subdirectory(dependencies)
add_subdirectory(libsrc)
add_subdirectory(src)
if (ENABLE_TESTS)
if(ENABLE_TESTS)
add_subdirectory(test)
endif ()
endif()
# Add resources directory
add_subdirectory(resources)
# remove generated files on make cleaan too
LIST( APPEND GENERATED_QRC
list(APPEND GENERATED_QRC
${CMAKE_BINARY_DIR}/WebConfig.qrc
${CMAKE_BINARY_DIR}/HyperionConfig.h
)
if(ENABLE_EFFECTENGINE)
LIST( APPEND GENERATED_QRC
list(APPEND GENERATED_QRC
${CMAKE_BINARY_DIR}/EffectEngine.qrc
)
endif ()
endif()
set_directory_properties(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "${GENERATED_QRC}" )
set_directory_properties(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "${GENERATED_QRC}")
# uninstall target
configure_file( "${CMAKE_CURRENT_SOURCE_DIR}/cmake/cmake_uninstall.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake" IMMEDIATE @ONLY)
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/cmake/cmake_uninstall.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake" IMMEDIATE @ONLY)
add_custom_target(uninstall COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake)
# enable make package - no code after this line !

View File

@ -16,6 +16,8 @@ BUILD_PACKAGES=true
PACKAGES=""
# platform string inserted to cmake cmd
BUILD_PLATFORM=""
#Run build with Qt6 or Qt5
BUILD_WITH_QT5=false
#Run build using GitHub code files
BUILD_LOCAL=false
#Build from scratch
@ -70,9 +72,10 @@ echo "########################################################
# docker-compile.sh -a, --architecture # The output architecture, e.g., amd64, arm64, arm/v7
# docker-compile.sh -b, --type # Release or Debug build
# docker-compile.sh -p, --packages # If true, build packages with CPack
# docker-compile.sh --qt5 # Build with Qt5, otherwise build with Qt6
# docker-compile.sh -f, --platform # cmake PLATFORM parameter, e.g. x11, amlogic-dev
# docker-compile.sh -l, --local # Run build using local code files
# docker-compile.sh -c, --incremental # Run incremental build, i.e. do not delete files created during previous build
# docker-compile.sh -f, --platform # cmake PLATFORM parameter, e.g. x11, amlogic-dev
# docker-compile.sh -v, --verbose # Run the script in verbose mode
# docker-compile.sh -- args # Additonal cmake arguments, e.g., -DHYPERION_LIGHT=ON
# More informations to docker containers available at: https://github.com/Hyperion-Project/hyperion.docker-ci"
@ -85,10 +88,10 @@ function log () {
}
function check_distribution () {
url=${REGISTRY_URL}/$1:${CODENAME}
url=${REGISTRY_URL}/$1:${CODENAME}
log "Check for distribution at: $url"
if $($DOCKER buildx imagetools inspect "$url" 2>&1 | grep -q $2) ; then
if $($DOCKER buildx imagetools inspect "$url" 2>&1 | grep -q $2) ; then
rc=0
else
rc=1
@ -97,47 +100,50 @@ function check_distribution () {
}
echo "Compile Hyperion using a Docker container"
options=$(getopt -l "architecture:,name:,type:,packages:,platform:,local,incremental,verbose,help" -o "a:n:b:p:f:lcvh" -a -- "$@")
options=$(getopt -l "architecture:,name:,type:,packages:,platform:,qt5,local,incremental,verbose,help" -o "a:n:b:p:f:lcvh" -a -- "$@")
eval set -- "$options"
while true
do
case $1 in
-a|--architecture)
-a|--architecture)
shift
ARCHITECTURE=`echo $1 | tr '[:upper:]' '[:lower:]'`
ARCHITECTURE=`echo $1 | tr '[:upper:]' '[:lower:]'`
;;
-n|--name)
-n|--name)
shift
CODENAME=`echo $1 | tr '[:upper:]' '[:lower:]'`
CODENAME=`echo $1 | tr '[:upper:]' '[:lower:]'`
;;
-b|--type)
-b|--type)
shift
BUILD_TYPE=$1
;;
-p|--packages)
-p|--packages)
shift
BUILD_PACKAGES=$1
;;
-f|--platform)
-f|--platform)
shift
BUILD_PLATFORM=$1
;;
-l|--local)
--qt5)
BUILD_WITH_QT5=true
;;
-l|--local)
BUILD_LOCAL=true
;;
-i|--incremental)
-i|--incremental)
BUILD_INCREMENTAL=true
;;
-v|--verbose)
-v|--verbose)
_VERBOSE=1
;;
-h|--help)
-h|--help)
printHelp
exit 0
;;
--)
shift
shift
break;;
esac
shift
@ -157,20 +163,26 @@ fi
PLATFORM_ARCHITECTURE="linux/"${ARCHITECTURE}
QTVERSION="5"
if [ ${BUILD_WITH_QT5} == false ]; then
QTVERSION="6"
CODENAME="${CODENAME}-qt6"
fi
echo "---> Evaluate distribution for codename:${CODENAME} on platform architecture ${PLATFORM_ARCHITECTURE}"
DISTRIBUTION="debian"
if ! check_distribution ${DISTRIBUTION} ${PLATFORM_ARCHITECTURE} ; then
if ! check_distribution ${DISTRIBUTION} ${PLATFORM_ARCHITECTURE} ; then
DISTRIBUTION="ubuntu"
if ! check_distribution ${DISTRIBUTION} ${PLATFORM_ARCHITECTURE} ; then
DISTRIBUTION="fedora"
if ! check_distribution ${DISTRIBUTION} ${PLATFORM_ARCHITECTURE} ; then
echo "No docker image found for a distribution with codename: ${CODENAME} on platform architecture ${PLATFORM_ARCHITECTURE}"
if ! check_distribution ${DISTRIBUTION} ${PLATFORM_ARCHITECTURE} ; then
echo "No docker image found for a distribution with codename: ${CODENAME} to be build on platform architecture ${PLATFORM_ARCHITECTURE}"
exit 1
fi
fi
fi
echo "---> Build with -> Distribution: ${DISTRIBUTION}, Codename: ${CODENAME}, Architecture: ${ARCHITECTURE}, Type: ${BUILD_TYPE}, Platform: ${BUILD_PLATFORM}, Build Packages: ${BUILD_PACKAGES}, Build local: ${BUILD_LOCAL}, Build incremental: ${BUILD_INCREMENTAL}"
echo "---> Build with -> Distribution: ${DISTRIBUTION}, Codename: ${CODENAME}, Architecture: ${ARCHITECTURE}, Type: ${BUILD_TYPE}, Platform: ${BUILD_PLATFORM}, QT Version: ${QTVERSION}, Build Packages: ${BUILD_PACKAGES}, Build local: ${BUILD_LOCAL}, Build incremental: ${BUILD_INCREMENTAL}"
# Determine the current architecture
CURRENT_ARCHITECTURE=`uname -m`
@ -182,33 +194,32 @@ if [ ${CURRENT_ARCHITECTURE} == "aarch64" ]; then
IS_V7L=`cat /proc/$$/maps |grep -m1 -c v7l`
if [ $IS_V7L -ne 0 ]; then
USER_ARCHITECTURE="arm/v7"
else
else
IS_V6L=`cat /proc/$$/maps |grep -m1 -c v6l`
if [ $IS_V6L -ne 0 ]; then
USER_ARCHITECTURE="arm/v6"
fi
fi
if [ $ARCHITECTURE != $USER_ARCHITECTURE ]; then
if [ $ARCHITECTURE != $USER_ARCHITECTURE ]; then
log "Identified user space current architecture: $USER_ARCHITECTURE"
CURRENT_ARCHITECTURE=$USER_ARCHITECTURE
fi
else
CURRENT_ARCHITECTURE=${CURRENT_ARCHITECTURE//x86_/amd}
CURRENT_ARCHITECTURE=${CURRENT_ARCHITECTURE//x86_/amd}
fi
log "Identified kernel current architecture: $CURRENT_ARCHITECTURE"
if [ $ARCHITECTURE != $CURRENT_ARCHITECTURE ]; then
echo "---> Build is not for the same architecturem, install emulation environment for ${PLATFORM_ARCHITECTURE}"
$DOCKER run --privileged --rm tonistiigi/binfmt --install "${PLATFORM_ARCHITECTURE}"
DOCKERRC=${?}
if [ ${DOCKERRC} == 0 ]; then
echo "---> Emulation environment installed sucessfully"
echo "---> You can uninstall it via following command: "docker run --privileged --rm tonistiigi/binfmt --uninstall ${PLATFORM_ARCHITECTURE}""
else
echo "---> Failed to install emulation environment"
echo "---> Build is not for the same architecturem, enable emulation for ${PLATFORM_ARCHITECTURE}"
ENTRYPOINT_OPTION=
if [ $CURRENT_ARCHITECTURE != "amd64" ]; then
echo "---> Emulation builds can only be executed on linux/amd64, linux/x86_64 platforms, current architecture is ${CURRENT_ARCHITECTURE}"
exit 1
fi
else
log "Build natively for platform architecture: ${PLATFORM_ARCHITECTURE}"
ENTRYPOINT_OPTION="--entrypoint="""
fi
log "---> BASE_PATH = ${BASE_PATH}"
@ -257,7 +268,8 @@ echo "---> Compiling Hyperion from source code at ${CODE_PATH}"
# execute inside container all commands on bash
echo "---> Startup docker..."
$DOCKER run --rm --platform=${PLATFORM_ARCHITECTURE}\
$DOCKER run --rm --platform=${PLATFORM_ARCHITECTURE} \
${ENTRYPOINT_OPTION} \
-v "${DEPLOY_PATH}:/deploy" \
-v "${CODE_PATH}/:/source:rw" \
${REGISTRY_URL}/${DISTRIBUTION}:${CODENAME} \

View File

@ -73,13 +73,13 @@ if [ ${ARCHITECTURE} == "aarch64" ]; then
IS_V7L=`cat /proc/$$/maps |grep -m1 -c v7l`
if [ $IS_V7L -ne 0 ]; then
USER_ARCHITECTURE="armv7l"
else
else
IS_V6L=`cat /proc/$$/maps |grep -m1 -c v6l`
if [ $IS_V6L -ne 0 ]; then
USER_ARCHITECTURE="armv6l"
fi
fi
if [ $ARCHITECTURE != $USER_ARCHITECTURE ]; then
if [ $ARCHITECTURE != $USER_ARCHITECTURE ]; then
echo "---> Identified kernel target architecture: $ARCHITECTURE"
echo "---> Identified user space target architecture: $USER_ARCHITECTURE"
ARCHITECTURE=$USER_ARCHITECTURE
@ -134,11 +134,11 @@ if [ -z "$run_id" ]; then
# Determine run_id from head_sha
runs=$(request_call "$api_url/actions/runs?head_sha=$head_sha")
run_id=$(echo "$runs" | tr '\r\n' ' ' | ${pythonCmd} -c """
import json,sys
import json,sys,os
data = json.load(sys.stdin)
for i in data['workflow_runs']:
if i['name'] == 'Hyperion PR Build':
if os.path.basename(i['path']) == 'push_pull.yml':
print(i['id'])
break
""" 2>/dev/null)
@ -198,11 +198,11 @@ if [[ ! -z ${CURRENT_SERVICE} ]]; then
echo "---> Stop current service: ${CURRENT_SERVICE}"
STOPCMD="systemctl stop --quiet ${CURRENT_SERVICE} --now"
USERNAME=${SUDO_USER:-$(whoami)}
USERNAME=${SUDO_USER:-$(whoami)}
if [ ${USERNAME} != "root" ]; then
STOPCMD="sudo ${STOPCMD}"
fi
${STOPCMD} >/dev/null 2>&1
if [ $? -ne 0 ]; then
echo "---> Critical Error: Failed to stop service: ${CURRENT_SERVICE}, Hyperion may not be started. Stop Hyperion manually."

View File

@ -14,7 +14,7 @@ macro(DeployMacOS TARGET)
install(CODE "set(PLUGIN_DIR \"${QT_PLUGIN_DIR}\")" COMPONENT "Hyperion")
install(CODE "set(BUILD_DIR \"${CMAKE_BINARY_DIR}\")" COMPONENT "Hyperion")
install(CODE "set(ENABLE_EFFECTENGINE \"${ENABLE_EFFECTENGINE}\")" COMPONENT "Hyperion")
install(CODE [[
file(GET_RUNTIME_DEPENDENCIES
@ -36,6 +36,7 @@ macro(DeployMacOS TARGET)
FILES "${dependency}"
DESTINATION "${CMAKE_INSTALL_PREFIX}/${TARGET_BUNDLE_NAME}/Contents/lib"
TYPE SHARED_LIBRARY
FOLLOW_SYMLINK_CHAIN
)
endif()
endforeach()
@ -48,7 +49,6 @@ macro(DeployMacOS TARGET)
foreach(PLUGIN "platforms" "sqldrivers" "imageformats")
if(EXISTS ${PLUGIN_DIR}/${PLUGIN})
file(GLOB files "${PLUGIN_DIR}/${PLUGIN}/*")
list(FILTER files EXCLUDE REGEX ".*libqwebp\\.dylib$")
foreach(file ${files})
file(GET_RUNTIME_DEPENDENCIES
EXECUTABLES ${file}
@ -61,6 +61,7 @@ macro(DeployMacOS TARGET)
DESTINATION "${CMAKE_INSTALL_PREFIX}/${TARGET_BUNDLE_NAME}/Contents/lib"
TYPE SHARED_LIBRARY
FILES ${DEPENDENCY}
FOLLOW_SYMLINK_CHAIN
)
endforeach()
@ -76,25 +77,27 @@ macro(DeployMacOS TARGET)
endif()
endforeach()
include(BundleUtilities)
include(BundleUtilities)
fixup_bundle("${CMAKE_INSTALL_PREFIX}/${TARGET_BUNDLE_NAME}" "${QT_PLUGINS}" "${CMAKE_INSTALL_PREFIX}/${TARGET_BUNDLE_NAME}/Contents/lib" IGNORE_ITEM "python;python3;Python;Python3;.Python;.Python3")
if(ENABLE_EFFECTENGINE)
# Detect the Python version and modules directory
find_package(Python3 3.5 REQUIRED)
execute_process(
COMMAND ${Python3_EXECUTABLE} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(standard_lib=True))"
OUTPUT_VARIABLE PYTHON_MODULES_DIR
OUTPUT_STRIP_TRAILING_WHITESPACE
)
if(NOT CMAKE_VERSION VERSION_LESS "3.12")
find_package(Python3 COMPONENTS Interpreter Development REQUIRED)
set(PYTHON_VERSION_MAJOR_MINOR "${Python3_VERSION_MAJOR}.${Python3_VERSION_MINOR}")
set(PYTHON_MODULES_DIR ${Python3_STDLIB})
else()
find_package (PythonLibs ${PYTHON_VERSION_STRING} EXACT)
set(PYTHON_VERSION_MAJOR_MINOR "${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}")
set(PYTHON_MODULES_DIR ${Python_STDLIB})
endif()
MESSAGE("Add Python ${Python3_VERSION_MAJOR}.${Python3_VERSION_MINOR} to bundle")
MESSAGE("PYTHON_MODULES_DIR: ${PYTHON_MODULES_DIR}")
# Copy Python modules to '/../Frameworks/Python.framework/Versions/Current/lib/PythonMAJOR.MINOR' and ignore the unnecessary stuff listed below
if (PYTHON_MODULES_DIR)
set(PYTHON_VERSION_MAJOR_MINOR "${Python3_VERSION_MAJOR}.${Python3_VERSION_MINOR}")
file(
COPY ${PYTHON_MODULES_DIR}/
DESTINATION "${CMAKE_INSTALL_PREFIX}/${TARGET_BUNDLE_NAME}/Contents/Frameworks/Python.framework/Versions/Current/lib/python${PYTHON_VERSION_MAJOR_MINOR}"
@ -167,9 +170,9 @@ macro(DeployLinux TARGET)
# Extract dependencies ignoring the system ones
get_prerequisites(${TARGET_FILE} DEPENDENCIES 0 1 "" "")
message(STATUS "Dependencies for target file: ${DEPENDENCIES}")
# Append symlink and non-symlink dependencies to the list
set(PREREQUISITE_LIBS "")
foreach(DEPENDENCY ${DEPENDENCIES})
@ -276,15 +279,13 @@ macro(DeployLinux TARGET)
if(ENABLE_EFFECTENGINE)
# Detect the Python version and modules directory
if (NOT CMAKE_VERSION VERSION_LESS "3.12")
find_package(Python3 COMPONENTS Interpreter Development REQUIRED)
set(PYTHON_VERSION_MAJOR_MINOR "${Python3_VERSION_MAJOR}.${Python3_VERSION_MINOR}")
set(PYTHON_MODULES_DIR "${Python3_STDLIB}")
set(PYTHON_MODULES_DIR ${Python3_STDLIB})
else()
find_package (PythonLibs ${PYTHON_VERSION_STRING} EXACT)
set(PYTHON_VERSION_MAJOR_MINOR "${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}")
execute_process(
COMMAND ${PYTHON_EXECUTABLE} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(standard_lib=True))"
OUTPUT_VARIABLE PYTHON_MODULES_DIR
OUTPUT_STRIP_TRAILING_WHITESPACE
)
set(PYTHON_MODULES_DIR ${Python_STDLIB})
endif()
# Copy Python modules to 'share/hyperion/lib/pythonMAJOR.MINOR' and ignore the unnecessary stuff listed below
@ -381,19 +382,25 @@ macro(DeployWindows TARGET)
list(GET openssl_versions 0 openssl_version_major)
list(GET openssl_versions 1 openssl_version_minor)
set(library_suffix "-${openssl_version_major}_${openssl_version_minor}")
set(open_ssl_version_suffix)
if (openssl_version_major VERSION_EQUAL 1 AND openssl_version_minor VERSION_EQUAL 1)
set(open_ssl_version_suffix "-1_1")
else()
set(open_ssl_version_suffix "-3")
endif()
if (CMAKE_SIZEOF_VOID_P EQUAL 8)
string(APPEND library_suffix "-x64")
string(APPEND open_ssl_version_suffix "-x64")
endif()
find_file(OPENSSL_SSL
NAMES "libssl${library_suffix}.dll"
NAMES "libssl${open_ssl_version_suffix}.dll"
PATHS ${OPENSSL_INCLUDE_DIR}/.. ${OPENSSL_INCLUDE_DIR}/../bin
NO_DEFAULT_PATH
)
find_file(OPENSSL_CRYPTO
NAMES "libcrypto${library_suffix}.dll"
NAMES "libcrypto${open_ssl_version_suffix}.dll"
PATHS ${OPENSSL_INCLUDE_DIR}/.. ${OPENSSL_INCLUDE_DIR}/../bin
NO_DEFAULT_PATH
)

View File

@ -19,4 +19,10 @@ find_package_handle_standard_args(qmdnsengine
REQUIRED_VARS QMDNS_INCLUDE_DIR QMDNS_LIBRARIES
)
mark_as_advanced(QMDNS_INCLUDE_DIR QMDNS_LIBRARIES)
if(QMDNSENGINE_FOUND)
add_library(qmdnsengine STATIC IMPORTED GLOBAL)
set_target_properties(qmdnsengine PROPERTIES
IMPORTED_LOCATION ${QMDNS_LIBRARIES}
INTERFACE_INCLUDE_DIRECTORIES ${QMDNS_INCLUDE_DIR}
)
endif()

View File

@ -1,15 +0,0 @@
# process a .rc file for windows
# Provides (BINARY_NAME)_WIN_RC_PATH with path to generated file
function(generate_win_rc_file BINARY_NAME)
# target path to store generated files
set(TARGET_PATH ${CMAKE_BINARY_DIR}/win_rc_file/${BINARY_NAME})
# assets
string(REPLACE "/" "\\\\" WIN_RC_ICON_PATH ${CMAKE_SOURCE_DIR}/cmake/nsis/installer.ico)
# configure the rc file
configure_file(
${CMAKE_SOURCE_DIR}/cmake/win/win.rc.in
${TARGET_PATH}/win.rc
)
# provide var for parent scope
set(${BINARY_NAME}_WIN_RC_PATH ${TARGET_PATH}/win.rc PARENT_SCOPE)
endfunction()

11
debian/control.in vendored
View File

@ -1,11 +0,0 @@
Source: hyperion
Section: devel
Priority: optional
Standards-Version: @STANDARDS_VERSION@
Maintainer: Hyperion Project <admin@hyperion-project.org>
Homepage: https://hyperion-project.org/
Package: hyperion
Architecture: @ARCHITECTURE@
Depends: ${dist:Depends}
Description: Hyperion is an opensource Bias or Ambient Lighting implementation which you might know from TV manufactures. It supports many LED devices and video grabbers.

67
debian/distributions vendored
View File

@ -1,67 +0,0 @@
Origin: Hyperion-Project
Label: apt.hyperion-project.org
Codename: focal
Architectures: amd64 armhf arm64
Components: main
Description: Official APT Repository by Hyperion Project
SignWith: yes
Origin: Hyperion-Project
Label: apt.hyperion-project.org
Codename: jammy
Architectures: amd64 armhf arm64
Components: main
Description: Official APT Repository by Hyperion Project
SignWith: yes
Origin: Hyperion-Project
Label: apt.hyperion-project.org
Codename: lunar
Architectures: amd64 armhf arm64
Components: main
Description: Official APT Repository by Hyperion Project
SignWith: yes
Origin: Hyperion-Project
Label: apt.hyperion-project.org
Codename: mantic
Architectures: amd64 armhf arm64
Components: main
Description: Official APT Repository by Hyperion Project
SignWith: yes
Origin: Hyperion-Project
Label: apt.hyperion-project.org
Suite: oldstable
Codename: buster
Architectures: amd64 armhf arm64
Components: main
Description: Official APT Repository by Hyperion Project
SignWith: yes
Origin: Hyperion-Project
Label: apt.hyperion-project.org
Suite: stable
Codename: bullseye
Architectures: amd64 armhf arm64
Components: main
Description: Official APT Repository by Hyperion Project
SignWith: yes
Origin: Hyperion-Project
Label: apt.hyperion-project.org
Suite: unstable
Codename: bookworm
Architectures: amd64 armhf arm64
Components: main
Description: Official APT Repository by Hyperion Project
SignWith: yes
Origin: Hyperion-Project
Label: apt.hyperion-project.org
Suite: testing
Codename: trixie
Architectures: amd64 armhf arm64
Components: main
Description: Official APT Repository by Hyperion Project
SignWith: yes

58
debian/rules vendored
View File

@ -1,58 +0,0 @@
#!/usr/bin/make -f
SHELL := /bin/bash
BUILDDIR := build
TARGET := debian/tmp
# libcec currently not linked in hyperion therefore not recognizable but hardcoded in FIND_DEPENDS
REQUIRED_DEPS := libusb libasound libmbedtls libturbojpeg libcec
QT5_DEPS := libqt5widgets5,libqt5x11extras5,libqt5sql5,libqt5serialport5,libqt5sql5-sqlite,
FIND_DEPENDS = $(shell \
PACKAGES=(); \
PACKAGES+=("$$(dpkg -S "libcec.so" 2>/dev/null | cut -d : -f 1 | sed '/-dev/d' | head -1)"); \
for SHARED_LIB in $$(objdump -p $(BUILDDIR)/bin/hyperiond | awk '/NEEDED/{ print $$2 }'); do \
PACKAGES+=("$$(dpkg -S $$(basename "$$SHARED_LIB") 2>/dev/null | cut -d : -f 1 | sed '/-dev/d' | head -1)"); \
done; \
RESULT=(); \
for LIB in $(REQUIRED_DEPS); do \
for i in "$${PACKAGES[@]}"; do \
if [[ $$i = *"$$LIB"* ]]; then \
RESULT+=("$$i"); \
break; \
fi; \
done; \
done; \
printf '%s,' "$${RESULT[@]}" \
)
CMAKE_ENVIRONMENT := -DUSE_SYSTEM_MBEDTLS_LIBS=ON -DENABLE_DEPLOY_DEPENDENCIES=OFF -DCMAKE_BUILD_TYPE=Release
ifeq ($(shell dpkg-vendor --query Vendor),Ubuntu)
ifeq ($(shell dpkg-architecture -qDEB_HOST_ARCH),arm64)
CMAKE_ENVIRONMENT+= -DENABLE_DISPMANX=OFF -DENABLE_X11=ON -DENABLE_XCB=ON
else ifeq ($(shell dpkg-architecture -qDEB_HOST_ARCH),armhf)
CMAKE_ENVIRONMENT+= -DENABLE_DISPMANX=OFF -DENABLE_X11=ON -DENABLE_XCB=ON
endif
endif
build:
[ -d $(BUILDDIR) ] || mkdir -p $(BUILDDIR)
cd $(BUILDDIR); cmake $(CMAKE_ENVIRONMENT) -DCMAKE_INSTALL_PREFIX=../$(TARGET)/usr ..
make -j$(shell nproc) -C $(BUILDDIR)
binary:
$(eval DETERMINED_DEPS=$(FIND_DEPENDS))
cd $(BUILDDIR); cmake -P cmake_install.cmake
rm -rf $(TARGET)/usr/include $(TARGET)/usr/lib $(TARGET)/usr/bin/flatc
[ -d $(TARGET)/DEBIAN ] || mkdir -p $(TARGET)/DEBIAN
cp -rf cmake/package-scripts/* $(TARGET)/DEBIAN/
chmod 0775 $(TARGET)/DEBIAN/*
dpkg-gencontrol -phyperion "-Vdist:Depends=$(QT5_DEPS)$(DETERMINED_DEPS)"
dpkg-deb --build $(TARGET) ..
clean:
rm -rf $(TARGET) $(BUILDDIR)
.PHONY: build binary clean

View File

@ -1,26 +0,0 @@
cmake_minimum_required(VERSION 3.5)
project(qmdnsengine)
set(WORK_DIR "@QMDNS_WORK_DIR@")
set(SOURCE_DIR "@QMDNS_SOURCE_DIR@")
set(INSTALL_DIR "@QMDNS_INSTALL_DIR@")
set(CMAKE_ARGS "@QMDNS_CMAKE_ARGS@")
set(QMDNS_LOGGING "@QMDNS_LOGGING@")
include(ExternalProject)
ExternalProject_Add(qmdnsengine
PREFIX ${WORK_DIR}
BUILD_ALWAYS OFF
DOWNLOAD_COMMAND ""
SOURCE_DIR ${SOURCE_DIR}
INSTALL_DIR ${INSTALL_DIR}
CMAKE_ARGS ${CMAKE_ARGS}
LOG_DOWNLOAD ${QMDNS_LOGGING}
LOG_UPDATE ${QMDNS_LOGGING}
LOG_CONFIGURE ${QMDNS_LOGGING}
LOG_BUILD ${QMDNS_LOGGING}
LOG_INSTALL ${QMDNS_LOGGING}
LOG_TEST ${QMDNS_LOGGING}
)

View File

@ -24,46 +24,46 @@ if (ENABLE_MDNS)
if (USE_SYSTEM_QMDNS_LIBS)
find_package(qmdnsengine REQUIRED)
else ()
if (NOT DEFINED BUILD_QMDNS_ONCE)
set(BUILD_QMDNS_ONCE CACHE INTERNAL "Done")
set(QMDNS_WORK_DIR "${CMAKE_BINARY_DIR}/dependencies/external/qmdnsengine")
set(QMDNS_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/external/qmdnsengine")
set(QMDNS_INSTALL_DIR ${CMAKE_BINARY_DIR})
set(QMDNS_CMAKE_ARGS
-DBUILD_SHARED_LIBS:BOOL=OFF
-DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_BINARY_DIR}
-DBIN_INSTALL_DIR:STRING=lib
-DLIB_INSTALL_DIR:STRING=lib
-DINCLUDE_INSTALL_DIR:STRING=include
-DCMAKE_PREFIX_PATH:PATH=${CMAKE_PREFIX_PATH}
-Wno-dev
)
if(${CMAKE_BUILD_TYPE} AND ${CMAKE_BUILD_TYPE} EQUAL "Debug")
set(QMDNS_LOGGING 1)
else ()
set(QMDNS_LOGGING 0)
endif ()
configure_file(${CMAKE_SOURCE_DIR}/dependencies/CMakeLists-qmdnsengine.txt.in ${QMDNS_WORK_DIR}/CMakeLists.txt @ONLY)
execute_process(COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" . WORKING_DIRECTORY ${QMDNS_WORK_DIR})
execute_process(COMMAND ${CMAKE_COMMAND} --build . --config "${CMAKE_BUILD_TYPE}" WORKING_DIRECTORY ${QMDNS_WORK_DIR})
endif()
set(QMDNS_INCLUDE_DIR "${CMAKE_BINARY_DIR}/include")
if(WIN32)
set(QMDNS_LIBRARIES ${CMAKE_BINARY_DIR}/lib/qmdnsengine${CMAKE_STATIC_LIBRARY_SUFFIX})
else()
set(QMDNS_LIBRARIES ${CMAKE_BINARY_DIR}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}qmdnsengine${CMAKE_STATIC_LIBRARY_SUFFIX})
endif()
mark_as_advanced (QMDNS_INCLUDE_DIR QMDNS_LIBRARIES)
endif ()
get_property(isMultiConfig GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
set(QMDNS_CMAKE_ARGS
-DBUILD_SHARED_LIBS:BOOL=OFF
-DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_BINARY_DIR}
-DBIN_INSTALL_DIR:STRING=lib
-DLIB_INSTALL_DIR:STRING=lib
-DINCLUDE_INSTALL_DIR:STRING=include
-DCMAKE_PREFIX_PATH:PATH=${CMAKE_PREFIX_PATH}
$<$<NOT:$<BOOL:${isMultiConfig}>>:-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}>
-Wno-dev
)
set(QMDNS_INCLUDE_DIR ${QMDNS_INCLUDE_DIR} PARENT_SCOPE)
set(QMDNS_LIBRARIES ${QMDNS_LIBRARIES} PARENT_SCOPE)
include_directories(${QMDNS_INCLUDE_DIR})
include(ExternalProject)
ExternalProject_Add(qmdns
PREFIX ${CMAKE_BINARY_DIR}/dependencies/external/qmdnsengine
BUILD_ALWAYS OFF
DOWNLOAD_COMMAND ""
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/external/qmdnsengine
BINARY_DIR ${CMAKE_BINARY_DIR}/dependencies/external/qmdnsengine/build
CMAKE_ARGS ${QMDNS_CMAKE_ARGS}
CONFIGURE_COMMAND ${CMAKE_COMMAND} -S <SOURCE_DIR> -B <BINARY_DIR> ${QMDNS_CMAKE_ARGS} -G ${CMAKE_GENERATOR}
BUILD_COMMAND ${CMAKE_COMMAND} --build <BINARY_DIR> --config $<CONFIG>
INSTALL_DIR ${CMAKE_BINARY_DIR}
BUILD_BYPRODUCTS ${QMDNS_LIBRARIES}
)
add_library(qmdnsengine STATIC IMPORTED GLOBAL)
set_target_properties(qmdnsengine PROPERTIES
IMPORTED_LOCATION ${QMDNS_LIBRARIES}
INTERFACE_INCLUDE_DIRECTORIES ${CMAKE_BINARY_DIR}/include
)
add_dependencies(qmdnsengine qmdns)
endif ()
endif()
#=============================================================================
@ -143,9 +143,9 @@ endif()
if(ENABLE_PROTOBUF_SERVER)
set(USE_SYSTEM_PROTO_LIBS ${DEFAULT_USE_SYSTEM_PROTO_LIBS} CACHE BOOL "use protobuf library from system")
# defines for 3rd party sub-modules
set(ABSL_PROPAGATE_CXX_STD ON CACHE BOOL "Build abseil-cpp with C++ version requirements propagated")
set(ABSL_PROPAGATE_CXX_STD ON CACHE BOOL "Build abseil-cpp with C++ version requirements propagated")
if (USE_SYSTEM_PROTO_LIBS)
find_package(Protobuf REQUIRED)
@ -173,7 +173,7 @@ if(ENABLE_PROTOBUF_SERVER)
# define the protobuf library
set(PROTOBUF_LIBRARIES protobuf::libprotobuf)
endif()
# redefine at parent scope

@ -1 +1 @@
Subproject commit 1873d3bfc2da771672bd8e7e8f41f57e0af77f33
Subproject commit edb8fec9882084344a314368ac7fd957a187519c

@ -1 +1 @@
Subproject commit 1f47b59ed603223d1376d36c788c89af67ae2fdc
Subproject commit 49086d3913367d2fb014a615f9d958a47867bc39

View File

@ -1,93 +0,0 @@
#pragma once
#ifndef __APPLE__
/*
* this is a mock up for compiling and testing osx wrapper on no osx platform.
* this will show a test image and rotate the colors.
*
* see https://github.com/phracker/MacOSX-SDKs/blob/master/MacOSX10.8.sdk/System/Library/Frameworks/CoreGraphics.framework/Versions/A/Headers
*
*/
#include <utils/Image.h>
#include <utils/ColorRgb.h>
enum _CGError {
kCGErrorSuccess = 0,
kCGErrorFailure = 1000,
kCGErrorIllegalArgument = 1001,
kCGErrorInvalidConnection = 1002,
kCGErrorInvalidContext = 1003,
kCGErrorCannotComplete = 1004,
kCGErrorNotImplemented = 1006,
kCGErrorRangeCheck = 1007,
kCGErrorTypeCheck = 1008,
kCGErrorInvalidOperation = 1010,
kCGErrorNoneAvailable = 1011,
/* Obsolete errors. */
kCGErrorNameTooLong = 1005,
kCGErrorNoCurrentPoint = 1009,
kCGErrorApplicationRequiresNewerSystem = 1015,
kCGErrorApplicationNotPermittedToExecute = 1016,
kCGErrorApplicationIncorrectExecutableFormatFound = 1023,
kCGErrorApplicationIsLaunching = 1024,
kCGErrorApplicationAlreadyRunning = 1025,
kCGErrorApplicationCanOnlyBeRunInOneSessionAtATime = 1026,
kCGErrorClassicApplicationsMustBeLaunchedByClassic = 1027,
kCGErrorForkFailed = 1028,
kCGErrorRetryRegistration = 1029,
kCGErrorFirst = 1000,
kCGErrorLast = 1029
};
typedef int32_t CGError;
typedef double CGFloat;
struct CGSize {
CGFloat width;
CGFloat height;
};
typedef struct CGSize CGSize;
struct CGPoint {
float x;
float y;
};
typedef struct CGPoint CGPoint;
struct CGRect {
CGPoint origin;
CGSize size;
};
typedef struct CGRect CGRect;
typedef CGError CGDisplayErr;
typedef uint32_t CGDirectDisplayID;
typedef uint32_t CGDisplayCount;;
typedef struct CGDisplayMode *CGDisplayModeRef;
typedef Image<ColorRgb> CGImage;
typedef CGImage* CGImageRef;
typedef unsigned char CFData;
typedef CFData* CFDataRef;
const int kCGDirectMainDisplay = 0;
CGError CGGetActiveDisplayList(uint32_t maxDisplays, CGDirectDisplayID *activeDisplays, uint32_t *displayCount);
CGDisplayModeRef CGDisplayCopyDisplayMode(CGDirectDisplayID display);
CGRect CGDisplayBounds(CGDirectDisplayID display);
void CGDisplayModeRelease(CGDisplayModeRef mode);
CGImageRef CGDisplayCreateImage(CGDirectDisplayID display);
void CGImageRelease(CGImageRef image);
CGImageRef CGImageGetDataProvider(CGImageRef image);
CFDataRef CGDataProviderCopyData(CGImageRef image);
unsigned char* CFDataGetBytePtr(CFDataRef imgData);
unsigned CGImageGetWidth(CGImageRef image);
unsigned CGImageGetHeight(CGImageRef image);
unsigned CGImageGetBitsPerPixel(CGImageRef image);
unsigned CGImageGetBytesPerRow(CGImageRef image);
void CFRelease(CFDataRef imgData);
#endif

View File

@ -4,7 +4,7 @@
#include <utils/ColorBgr.h>
#include <utils/ColorRgba.h>
#include <hyperion/Grabber.h>
#include <grabber/FramebufferFrameGrabber.h>
#include <grabber/framebuffer/FramebufferFrameGrabber.h>
///
///

View File

@ -1,7 +1,7 @@
#pragma once
#include <hyperion/GrabberWrapper.h>
#include <grabber/AmlogicGrabber.h>
#include <grabber/amlogic/AmlogicGrabber.h>
///
/// The Amlogic uses an instance of the AmlogicGrabber to obtain ImageRgb's from the

View File

@ -6,7 +6,7 @@
#include <alsa/asoundlib.h>
// Hyperion-utils includes
#include <grabber/AudioGrabber.h>
#include <grabber/audio/AudioGrabber.h>
///
/// @brief The Linux Audio capture implementation

View File

@ -2,7 +2,7 @@
#define AUDIOGRABBERWINDOWS_H
// Hyperion-utils includes
#include <grabber/AudioGrabber.h>
#include <grabber/audio/AudioGrabber.h>
#include <DSound.h>
///
@ -14,7 +14,7 @@ class AudioGrabberWindows : public AudioGrabber
AudioGrabberWindows();
~AudioGrabberWindows() override;
public slots:
bool start() override;
void stop() override;

View File

@ -3,14 +3,14 @@
#include <hyperion/GrabberWrapper.h>
#ifdef WIN32
#include <grabber/AudioGrabberWindows.h>
#include <grabber/audio/AudioGrabberWindows.h>
#endif
#ifdef __linux__
#include <grabber/AudioGrabberLinux.h>
#include <grabber/audio/AudioGrabberLinux.h>
#endif
///
///
/// Audio Grabber wrapper
///
class AudioWrapper : public GrabberWrapper
@ -32,7 +32,7 @@ class AudioWrapper : public GrabberWrapper
///
~AudioWrapper() override;
///
///
/// Settings update handler
///
void handleSettingsUpdate(settings::type type, const QJsonDocument& config) override;
@ -43,13 +43,13 @@ class AudioWrapper : public GrabberWrapper
///
void action() override;
///
///
/// Start audio capturing session
///
/// @returns true if successful
bool start() override;
///
///
/// Stop audio capturing session
///
void stop() override;

View File

@ -1,7 +1,7 @@
#pragma once
#include <hyperion/GrabberWrapper.h>
#include <grabber/DirectXGrabber.h>
#include <grabber/directx/DirectXGrabber.h>
class DirectXWrapper: public GrabberWrapper
{

View File

@ -3,7 +3,7 @@
// Utils includes
#include <utils/ColorRgba.h>
#include <hyperion/GrabberWrapper.h>
#include <grabber/DispmanxFrameGrabber.h>
#include <grabber/dispmanx/DispmanxFrameGrabber.h>
///
/// The DispmanxWrapper uses an instance of the DispmanxFrameGrabber to obtain ImageRgb's from the

View File

@ -1,7 +1,7 @@
#pragma once
#include <hyperion/GrabberWrapper.h>
#include <grabber/FramebufferFrameGrabber.h>
#include <grabber/framebuffer/FramebufferFrameGrabber.h>
///
/// The FramebufferWrapper uses an instance of the FramebufferFrameGrabber to obtain ImageRgb's from the

View File

@ -1,11 +1,7 @@
#pragma once
// OSX includes
#ifdef __APPLE__
#include <CoreGraphics/CoreGraphics.h>
#else
#include <grabber/OsxFrameGrabberMock.h>
#endif
// Utils includes
#include <utils/ColorRgb.h>

View File

@ -1,7 +1,7 @@
#pragma once
#include <hyperion/GrabberWrapper.h>
#include <grabber/OsxFrameGrabber.h>
#include <grabber/osx/OsxFrameGrabber.h>
///
/// The OsxWrapper uses an instance of the OsxFrameGrabber to obtain ImageRgb's from the displayed content.

View File

@ -1,7 +1,7 @@
#pragma once
#include <hyperion/GrabberWrapper.h>
#include <grabber/QtGrabber.h>
#include <grabber/qt/QtGrabber.h>
///
/// The QtWrapper uses QtFramework API's to get a picture from system

View File

@ -4,9 +4,9 @@
#include <hyperion/GrabberWrapper.h>
#if defined(ENABLE_MF)
#include <grabber/MFGrabber.h>
#include <grabber/video/mediafoundation/MFGrabber.h>
#elif defined(ENABLE_V4L2)
#include <grabber/V4L2Grabber.h>
#include <grabber/video/v4l2/V4L2Grabber.h>
#endif
#if defined(ENABLE_CEC)

View File

@ -21,7 +21,7 @@
#include <hyperion/Grabber.h>
// decoder thread includes
#include <grabber/EncoderThread.h>
#include <grabber/video/EncoderThread.h>
/// Forward class declaration
class SourceReaderCB;

View File

@ -19,7 +19,7 @@
#include <utils/Components.h>
// decoder thread includes
#include <grabber/EncoderThread.h>
#include <grabber/video/EncoderThread.h>
// Determine the cmake options
#include <HyperionConfig.h>

View File

@ -1,7 +1,7 @@
#pragma once
#include <hyperion/GrabberWrapper.h>
#include <grabber/X11Grabber.h>
#include <grabber/x11/X11Grabber.h>
// some include of xorg defines "None" this is also used by QT and has to be undefined to avoid collisions
#ifdef None
#undef None

View File

@ -1,7 +1,7 @@
#pragma once
#include <hyperion/GrabberWrapper.h>
#include <grabber/XcbGrabber.h>
#include <grabber/xcb/XcbGrabber.h>
// some include of xorg defines "None" this is also used by QT and has to be undefined to avoid collisions
#ifdef None

View File

@ -3,9 +3,8 @@
#include <QString>
#include <QByteArray>
namespace Process {
void restartHyperion(int exitCode = 0);
QByteArray command_exec(const QString& cmd, const QByteArray& data = {});
namespace Process
{
void restartHyperion(int exitCode = 0);
QByteArray command_exec(const QString& cmd, const QByteArray& data = {});
}

View File

@ -1,7 +1,7 @@
# Define the current source locations
SET(CURRENT_HEADER_DIR ${CMAKE_SOURCE_DIR}/include)
SET(CURRENT_SOURCE_DIR ${CMAKE_SOURCE_DIR}/libsrc)
set(CURRENT_HEADER_DIR ${CMAKE_SOURCE_DIR}/include)
set(CURRENT_SOURCE_DIR ${CMAKE_SOURCE_DIR}/libsrc)
add_subdirectory(hyperion)
add_subdirectory(commandline)
@ -34,7 +34,7 @@ add_subdirectory(ssdp)
if(ENABLE_MDNS)
add_subdirectory(mdns)
endif()
endif()
if(ENABLE_EFFECTENGINE)
add_subdirectory(effectengine)

View File

@ -1,26 +1,20 @@
# Define the current source locations
SET(CURRENT_HEADER_DIR ${CMAKE_SOURCE_DIR}/include/api)
SET(CURRENT_SOURCE_DIR ${CMAKE_SOURCE_DIR}/libsrc/api)
FILE ( GLOB_RECURSE Api_SOURCES "${CURRENT_HEADER_DIR}/*.h" "${CURRENT_SOURCE_DIR}/*.h" "${CURRENT_SOURCE_DIR}/*.cpp" )
set(Api_RESOURCES ${CURRENT_SOURCE_DIR}/JSONRPC_schemas.qrc )
add_library(hyperion-api
${Api_SOURCES}
${Api_RESOURCES}
${CMAKE_SOURCE_DIR}/include/api/apiStructs.h
${CMAKE_SOURCE_DIR}/include/api/API.h
${CMAKE_SOURCE_DIR}/include/api/JsonAPI.h
${CMAKE_SOURCE_DIR}/include/api/JsonCB.h
${CMAKE_SOURCE_DIR}/libsrc/api/JsonAPI.cpp
${CMAKE_SOURCE_DIR}/libsrc/api/API.cpp
${CMAKE_SOURCE_DIR}/libsrc/api/JsonCB.cpp
${CMAKE_SOURCE_DIR}/libsrc/api/JSONRPC_schemas.qrc
)
if(ENABLE_DX)
include_directories(${DIRECTX9_INCLUDE_DIRS})
target_link_libraries(hyperion-api ${DIRECTX9_LIBRARIES})
endif(ENABLE_DX)
target_link_libraries(hyperion-api
hyperion
hyperion-utils
Qt${QT_VERSION_MAJOR}::Core
Qt${QT_VERSION_MAJOR}::Gui
Qt${QT_VERSION_MAJOR}::Network
${DIRECTX9_LIBRARIES}
)
target_include_directories(hyperion-api PRIVATE
${DIRECTX9_INCLUDE_DIRS}
)

View File

@ -19,54 +19,54 @@
#include <HyperionConfig.h> // Required to determine the cmake options
#include <hyperion/GrabberWrapper.h>
#include <grabber/QtGrabber.h>
#include <grabber/qt/QtGrabber.h>
#include <utils/WeakConnect.h>
#if defined(ENABLE_MF)
#include <grabber/MFGrabber.h>
#include <grabber/video/mediafoundation/MFGrabber.h>
#elif defined(ENABLE_V4L2)
#include <grabber/V4L2Grabber.h>
#include <grabber/video/v4l2/V4L2Grabber.h>
#endif
#if defined(ENABLE_AUDIO)
#include <grabber/AudioGrabber.h>
#include <grabber/audio/AudioGrabber.h>
#ifdef WIN32
#include <grabber/AudioGrabberWindows.h>
#include <grabber/audio/AudioGrabberWindows.h>
#endif
#ifdef __linux__
#include <grabber/AudioGrabberLinux.h>
#include <grabber/audio/AudioGrabberLinux.h>
#endif
#endif
#if defined(ENABLE_X11)
#include <grabber/X11Grabber.h>
#include <grabber/x11/X11Grabber.h>
#endif
#if defined(ENABLE_XCB)
#include <grabber/XcbGrabber.h>
#include <grabber/xcb/XcbGrabber.h>
#endif
#if defined(ENABLE_DX)
#include <grabber/DirectXGrabber.h>
#include <grabber/directx/DirectXGrabber.h>
#endif
#if defined(ENABLE_FB)
#include <grabber/FramebufferFrameGrabber.h>
#include <grabber/framebuffer/FramebufferFrameGrabber.h>
#endif
#if defined(ENABLE_DISPMANX)
#include <grabber/DispmanxFrameGrabber.h>
#include <grabber/dispmanx/DispmanxFrameGrabber.h>
#endif
#if defined(ENABLE_AMLOGIC)
#include <grabber/AmlogicGrabber.h>
#include <grabber/amlogic/AmlogicGrabber.h>
#endif
#if defined(ENABLE_OSX)
#include <grabber/OsxFrameGrabber.h>
#include <grabber/osx/OsxFrameGrabber.h>
#endif
#include <utils/jsonschema/QJsonFactory.h>

View File

@ -1,11 +1,9 @@
# Define the current source locations
SET(CURRENT_HEADER_DIR ${CMAKE_SOURCE_DIR}/include/blackborder)
SET(CURRENT_SOURCE_DIR ${CMAKE_SOURCE_DIR}/libsrc/blackborder)
FILE ( GLOB Blackborder_SOURCES "${CURRENT_HEADER_DIR}/*.h" "${CURRENT_SOURCE_DIR}/*.h" "${CURRENT_SOURCE_DIR}/*.cpp" )
add_library(blackborder ${Blackborder_SOURCES} )
add_library(blackborder
${CMAKE_SOURCE_DIR}/include/blackborder/BlackBorderDetector.h
${CMAKE_SOURCE_DIR}/include/blackborder/BlackBorderProcessor.h
${CMAKE_SOURCE_DIR}/libsrc/blackborder/BlackBorderDetector.cpp
${CMAKE_SOURCE_DIR}/libsrc/blackborder/BlackBorderProcessor.cpp
)
target_link_libraries(blackborder
hyperion-utils

View File

@ -1,14 +1,11 @@
# Define the current source locations
set(CURRENT_HEADER_DIR ${CMAKE_SOURCE_DIR}/include/boblightserver)
set(CURRENT_SOURCE_DIR ${CMAKE_SOURCE_DIR}/libsrc/boblightserver)
FILE ( GLOB BoblightServer_SOURCES "${CURRENT_HEADER_DIR}/*.h" "${CURRENT_SOURCE_DIR}/*.h" "${CURRENT_SOURCE_DIR}/*.cpp" )
add_library(boblightserver ${BoblightServer_SOURCES} )
add_library(boblightserver
${CMAKE_SOURCE_DIR}/include/boblightserver/BoblightServer.h
${CMAKE_SOURCE_DIR}/libsrc/boblightserver/BoblightServer.cpp
${CMAKE_SOURCE_DIR}/libsrc/boblightserver/BoblightClientConnection.h
${CMAKE_SOURCE_DIR}/libsrc/boblightserver/BoblightClientConnection.cpp
)
target_link_libraries(boblightserver
hyperion
hyperion-utils
${QT_LIBRARIES}
)

View File

@ -1,19 +1,18 @@
# Define the current source locations
find_package(CEC REQUIRED)
if(CEC_FOUND)
list(GET CEC_LIBRARIES 0 CEC_LIBRARIES)
add_definitions(-DCEC_LIBRARY="${CEC_LIBRARIES}")
else()
message(FATAL_ERROR "libCEC not found")
endif()
SET(CURRENT_HEADER_DIR ${CMAKE_SOURCE_DIR}/include/cec)
SET(CURRENT_SOURCE_DIR ${CMAKE_SOURCE_DIR}/libsrc/cec)
FILE (GLOB CEC_SOURCES "${CURRENT_HEADER_DIR}/*.h" "${CURRENT_SOURCE_DIR}/*.h" "${CURRENT_SOURCE_DIR}/*.cpp")
add_library(cechandler ${CEC_SOURCES})
list(GET CEC_LIBRARIES 0 CEC_LIBRARIES)
add_definitions(-DCEC_LIBRARY="${CEC_LIBRARIES}")
include_directories(${CEC_INCLUDE_DIRS})
add_library(cechandler
${CMAKE_SOURCE_DIR}/include/cec/CECEvent.h
${CMAKE_SOURCE_DIR}/include/cec/CECHandler.h
${CMAKE_SOURCE_DIR}/libsrc/cec/CECHandler.cpp
)
target_link_libraries(cechandler
Qt${QT_VERSION_MAJOR}::Core
${CMAKE_DL_LIBS}
)

View File

@ -1,10 +1,27 @@
# Define the current source locations
set(CURRENT_HEADER_DIR ${CMAKE_SOURCE_DIR}/include/commandline)
set(CURRENT_SOURCE_DIR ${CMAKE_SOURCE_DIR}/libsrc/commandline)
FILE ( GLOB Parser_SOURCES "${CURRENT_HEADER_DIR}/*.h" "${CURRENT_SOURCE_DIR}/*.h" "${CURRENT_SOURCE_DIR}/*.cpp" )
add_library(commandline ${Parser_SOURCES} )
add_library(commandline
${CMAKE_SOURCE_DIR}/include/commandline/BooleanOption.h
${CMAKE_SOURCE_DIR}/include/commandline/ColorOption.h
${CMAKE_SOURCE_DIR}/include/commandline/ColorsOption.h
${CMAKE_SOURCE_DIR}/include/commandline/DoubleOption.h
${CMAKE_SOURCE_DIR}/include/commandline/ImageOption.h
${CMAKE_SOURCE_DIR}/include/commandline/IntOption.h
${CMAKE_SOURCE_DIR}/include/commandline/Option.h
${CMAKE_SOURCE_DIR}/include/commandline/Parser.h
${CMAKE_SOURCE_DIR}/include/commandline/RegularExpressionOption.h
${CMAKE_SOURCE_DIR}/include/commandline/SwitchOption.h
${CMAKE_SOURCE_DIR}/include/commandline/ValidatorOption.h
${CMAKE_SOURCE_DIR}/libsrc/commandline/BooleanOption.cpp
${CMAKE_SOURCE_DIR}/libsrc/commandline/ColorOption.cpp
${CMAKE_SOURCE_DIR}/libsrc/commandline/ColorsOption.cpp
${CMAKE_SOURCE_DIR}/libsrc/commandline/DoubleOption.cpp
${CMAKE_SOURCE_DIR}/libsrc/commandline/ImageOption.cpp
${CMAKE_SOURCE_DIR}/libsrc/commandline/IntOption.cpp
${CMAKE_SOURCE_DIR}/libsrc/commandline/Option.cpp
${CMAKE_SOURCE_DIR}/libsrc/commandline/Parser.cpp
${CMAKE_SOURCE_DIR}/libsrc/commandline/RegularExpressionOption.cpp
${CMAKE_SOURCE_DIR}/libsrc/commandline/SwitchOption.cpp
${CMAKE_SOURCE_DIR}/libsrc/commandline/ValidatorOption.cpp
)
target_link_libraries(commandline
hyperion

View File

@ -14,19 +14,22 @@ bool Parser::parse(const QStringList &arguments)
return false;
}
for(Option * option : _options)
for(Option * option : std::as_const(_options))
{
QString value = this->value(*option);
if (!option->validate(*this, value)) {
const QString error = option->getError();
if (!error.isEmpty()) {
_errorText = tr("\"%1\" is not a valid option for %2, %3").arg(value, option->name(), error);
if (!option->valueName().isEmpty())
{
QString value = this->value(*option);
if (!option->validate(*this, value)) {
const QString error = option->getError();
if (!error.isEmpty()) {
_errorText = tr("\"%1\" is not a valid option for %2, %3").arg(value, option->name(), error);
}
else
{
_errorText = tr("\"%1\" is not a valid option for %2").arg(value, option->name());
}
return false;
}
else
{
_errorText = tr("\"%1\" is not a valid option for %2").arg(value, option->name());
}
return false;
}
}
return true;

View File

@ -1,16 +1,14 @@
# Define the current source locations
SET(CURRENT_HEADER_DIR ${CMAKE_SOURCE_DIR}/include/db)
SET(CURRENT_SOURCE_DIR ${CMAKE_SOURCE_DIR}/libsrc/db)
FILE ( GLOB DB_SOURCES "${CURRENT_HEADER_DIR}/*.h" "${CURRENT_SOURCE_DIR}/*.h" "${CURRENT_SOURCE_DIR}/*.cpp" )
add_library(database
${DB_SOURCES}
${CMAKE_SOURCE_DIR}/include/db/AuthTable.h
${CMAKE_SOURCE_DIR}/include/db/DBManager.h
${CMAKE_SOURCE_DIR}/include/db/InstanceTable.h
${CMAKE_SOURCE_DIR}/include/db/MetaTable.h
${CMAKE_SOURCE_DIR}/include/db/SettingsTable.h
${CMAKE_SOURCE_DIR}/libsrc/db/DBManager.cpp
)
target_link_libraries(database
hyperion
hyperion-utils
Qt${QT_VERSION_MAJOR}::Core
Qt${QT_VERSION_MAJOR}::Sql
)

View File

@ -1,47 +1,30 @@
if (NOT CMAKE_VERSION VERSION_LESS "3.12")
find_package(Python3 COMPONENTS Interpreter Development REQUIRED)
else()
find_package (PythonLibs ${PYTHON_VERSION_STRING} EXACT) # Maps PythonLibs to the PythonInterp version of the main cmake
endif()
file(GLOB effectFiles RELATIVE ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR}/effects/*)
set(HYPERION_EFFECTS_RES "")
foreach(f ${effectFiles})
get_filename_component(fname ${f} NAME)
set(HYPERION_EFFECTS_RES "${HYPERION_EFFECTS_RES}\n\t\t<file alias=\"/effects/${fname}\">${f}</file>")
endforeach()
# Include the python directory. Also include the parent (which is for example /usr/include)
# which may be required when it is not includes by the (cross-) compiler by default.
if (NOT CMAKE_VERSION VERSION_LESS "3.12")
include_directories(${Python3_INCLUDE_DIRS} ${Python3_INCLUDE_DIRS}/..)
else()
include_directories(${PYTHON_INCLUDE_DIRS} ${PYTHON_INCLUDE_DIRS}/..)
endif()
# Define the current source locations
SET(CURRENT_HEADER_DIR ${CMAKE_SOURCE_DIR}/include/effectengine)
SET(CURRENT_SOURCE_DIR ${CMAKE_SOURCE_DIR}/libsrc/effectengine)
FILE ( GLOB EffectEngineSOURCES "${CURRENT_HEADER_DIR}/*.h" "${CURRENT_SOURCE_DIR}/*.h" "${CURRENT_SOURCE_DIR}/*.cpp" )
FILE ( GLOB effectFiles RELATIVE ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR}/effects/* )
SET ( HYPERION_EFFECTS_RES "")
FOREACH( f ${effectFiles} )
GET_FILENAME_COMPONENT(fname ${f} NAME)
SET(HYPERION_EFFECTS_RES "${HYPERION_EFFECTS_RES}\n\t\t<file alias=\"/effects/${fname}\">${f}</file>")
ENDFOREACH()
CONFIGURE_FILE(${CURRENT_SOURCE_DIR}/EffectEngine.qrc.in ${CMAKE_BINARY_DIR}/EffectEngine.qrc )
SET(EffectEngine_RESOURCES ${CMAKE_BINARY_DIR}/EffectEngine.qrc)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/EffectEngine.qrc.in ${CMAKE_BINARY_DIR}/EffectEngine.qrc)
add_library(effectengine
${EffectEngine_RESOURCES}
${EffectEngineSOURCES}
${CMAKE_BINARY_DIR}/EffectEngine.qrc
${CMAKE_SOURCE_DIR}/include/effectengine/ActiveEffectDefinition.h
${CMAKE_SOURCE_DIR}/include/effectengine/Effect.h
${CMAKE_SOURCE_DIR}/include/effectengine/EffectDefinition.h
${CMAKE_SOURCE_DIR}/include/effectengine/EffectEngine.h
${CMAKE_SOURCE_DIR}/include/effectengine/EffectFileHandler.h
${CMAKE_SOURCE_DIR}/include/effectengine/EffectModule.h
${CMAKE_SOURCE_DIR}/include/effectengine/EffectSchema.h
${CMAKE_SOURCE_DIR}/libsrc/effectengine/Effect.cpp
${CMAKE_SOURCE_DIR}/libsrc/effectengine/EffectEngine.cpp
${CMAKE_SOURCE_DIR}/libsrc/effectengine/EffectFileHandler.cpp
${CMAKE_SOURCE_DIR}/libsrc/effectengine/EffectModule.cpp
)
target_link_libraries(effectengine
hyperion
python
hyperion
Qt${QT_VERSION_MAJOR}::Core
Qt${QT_VERSION_MAJOR}::Gui
)
if (NOT CMAKE_VERSION VERSION_LESS "3.12")
target_link_libraries( effectengine ${Python3_LIBRARIES} )
else()
target_link_libraries( effectengine ${PYTHON_LIBRARIES} )
endif()

View File

@ -1,6 +1,6 @@
<RCC>
<qresource prefix="/">
<file alias="effect-schema">${CURRENT_SOURCE_DIR}/EffectDefinition.schema.json</file>
<file alias="effect-schema">${CMAKE_CURRENT_SOURCE_DIR}/EffectDefinition.schema.json</file>
${HYPERION_EFFECTS_RES}
</qresource>
</RCC>

View File

@ -1,69 +1,54 @@
# set (compiled) Flatbuffer schema names
set(FBS_Request "hyperion_request")
set(FBS_Reply "hyperion_reply")
# Define the current source locations
set(CURRENT_HEADER_DIR ${CMAKE_SOURCE_DIR}/include/flatbufserver)
set(CURRENT_SOURCE_DIR ${CMAKE_SOURCE_DIR}/libsrc/flatbufserver)
include_directories(
${CMAKE_CURRENT_BINARY_DIR}
${FLATBUFFERS_INCLUDE_DIRS}
)
set(Flatbuffer_GENERATED_FBS
hyperion_reply_generated.h
hyperion_request_generated.h
)
set(Flatbuffer_FBS
${CURRENT_SOURCE_DIR}/hyperion_reply.fbs
${CURRENT_SOURCE_DIR}/hyperion_request.fbs
)
FOREACH(FBS_FILE ${Flatbuffer_FBS})
compile_flattbuffer_schema(${FBS_FILE} ${CMAKE_CURRENT_SOURCE_DIR})
ENDFOREACH(FBS_FILE)
# define and compile flatbuffer schemas
list(APPEND Compiled_FBS ${FBS_Request}_generated.h)
list(APPEND Compiled_FBS ${FBS_Reply}_generated.h)
compile_flattbuffer_schema(${CMAKE_CURRENT_SOURCE_DIR}/${FBS_Request}.fbs ${CMAKE_CURRENT_SOURCE_DIR})
compile_flattbuffer_schema(${CMAKE_CURRENT_SOURCE_DIR}/${FBS_Reply}.fbs ${CMAKE_CURRENT_SOURCE_DIR})
# let cmake know about new generated source files
set_source_files_properties(
${Flatbuffer_GENERATED_FBS} PROPERTIES GENERATED TRUE
)
### Split flatbufconnect from flatbufserver as flatbufserver relates to HyperionDaemon
set_source_files_properties(${Compiled_FBS} PROPERTIES GENERATED TRUE)
# split flatbufconnect from flatbufserver as flatbufserver relates to HyperionDaemon
if(ENABLE_FLATBUF_CONNECT)
add_library(flatbufconnect
${CURRENT_HEADER_DIR}/FlatBufferConnection.h
${CURRENT_SOURCE_DIR}/FlatBufferConnection.cpp
${FLATBUFSERVER_SOURCES}
${Flatbuffer_GENERATED_FBS}
add_library(flatbufconnect
${CMAKE_SOURCE_DIR}/include/flatbufserver/FlatBufferConnection.h
${CMAKE_SOURCE_DIR}/libsrc/flatbufserver/FlatBufferConnection.cpp
${Compiled_FBS}
)
)
target_link_libraries(flatbufconnect
hyperion-utils
flatbuffers
Qt${QT_VERSION_MAJOR}::Network
Qt${QT_VERSION_MAJOR}::Core
)
target_link_libraries(flatbufconnect
hyperion-utils
flatbuffers
)
target_include_directories(flatbufconnect PUBLIC
${FLATBUFFERS_INCLUDE_DIRS}
)
endif()
if(ENABLE_FLATBUF_SERVER)
add_library(flatbufserver
${CURRENT_HEADER_DIR}/FlatBufferServer.h
${CURRENT_SOURCE_DIR}/FlatBufferServer.cpp
${CURRENT_SOURCE_DIR}/FlatBufferClient.h
${CURRENT_SOURCE_DIR}/FlatBufferClient.cpp
${FLATBUFSERVER_SOURCES}
${Flatbuffer_GENERATED_FBS}
)
add_library(flatbufserver
${CMAKE_SOURCE_DIR}/include/flatbufserver/FlatBufferServer.h
${CMAKE_SOURCE_DIR}/libsrc/flatbufserver/FlatBufferServer.cpp
${CMAKE_SOURCE_DIR}/libsrc/flatbufserver/FlatBufferClient.h
${CMAKE_SOURCE_DIR}/libsrc/flatbufserver/FlatBufferClient.cpp
${Compiled_FBS}
)
target_link_libraries(flatbufserver
hyperion-utils
flatbuffers
Qt${QT_VERSION_MAJOR}::Network
Qt${QT_VERSION_MAJOR}::Core
)
if(ENABLE_MDNS)
target_link_libraries(flatbufserver mdns)
endif()
target_link_libraries(flatbufserver
hyperion-utils
flatbuffers
)
target_include_directories(flatbufserver PUBLIC
${FLATBUFFERS_INCLUDE_DIRS}
)
if(ENABLE_MDNS)
target_link_libraries(flatbufserver mdns)
endif()
endif()

View File

@ -1,22 +1,11 @@
# Define the current source locations
SET(CURRENT_HEADER_DIR ${CMAKE_SOURCE_DIR}/include/forwarder)
SET(CURRENT_SOURCE_DIR ${CMAKE_SOURCE_DIR}/libsrc/forwarder)
if(ENABLE_FLATBUF_CONNECT)
include_directories(
${CMAKE_CURRENT_BINARY_DIR}/../../libsrc/flatbufserver
add_library(forwarder
${CMAKE_SOURCE_DIR}/include/forwarder/MessageForwarder.h
${CMAKE_SOURCE_DIR}/libsrc/forwarder/MessageForwarder.cpp
)
endif()
FILE ( GLOB Forwarder_SOURCES "${CURRENT_HEADER_DIR}/*.h" "${CURRENT_SOURCE_DIR}/*.h" "${CURRENT_SOURCE_DIR}/*.cpp" )
add_library(forwarder ${Forwarder_SOURCES} )
target_link_libraries(forwarder
hyperion
hyperion-utils
${QT_LIBRARIES}
)
if(ENABLE_FLATBUF_CONNECT)

View File

@ -1,39 +1,39 @@
if (ENABLE_AMLOGIC)
if(ENABLE_AMLOGIC)
add_subdirectory(amlogic)
endif (ENABLE_AMLOGIC)
if (ENABLE_DISPMANX)
if(ENABLE_DISPMANX)
add_subdirectory(dispmanx)
endif (ENABLE_DISPMANX)
if (ENABLE_FB)
if(ENABLE_FB)
add_subdirectory(framebuffer)
endif (ENABLE_FB)
if (ENABLE_OSX)
if(ENABLE_OSX)
add_subdirectory(osx)
endif(ENABLE_OSX)
if (ENABLE_V4L2 OR ENABLE_MF)
if(ENABLE_V4L2 OR ENABLE_MF)
add_subdirectory(video)
endif ()
endif()
if (ENABLE_X11)
if(ENABLE_X11)
add_subdirectory(x11)
endif(ENABLE_X11)
if (ENABLE_XCB)
if(ENABLE_XCB)
add_subdirectory(xcb)
endif(ENABLE_XCB)
if (ENABLE_QT)
if(ENABLE_QT)
add_subdirectory(qt)
endif(ENABLE_QT)
if (ENABLE_DX)
if(ENABLE_DX)
add_subdirectory(directx)
endif(ENABLE_DX)
if (ENABLE_AUDIO)
if(ENABLE_AUDIO)
add_subdirectory(audio)
endif()

View File

@ -20,7 +20,7 @@
// Local includes
#include <utils/Logger.h>
#include <grabber/AmlogicGrabber.h>
#include <grabber/amlogic/AmlogicGrabber.h>
#include "Amvideocap.h"
// Constants

View File

@ -1,4 +1,4 @@
#include <grabber/AmlogicWrapper.h>
#include <grabber/amlogic/AmlogicWrapper.h>
AmlogicWrapper::AmlogicWrapper(int pixelDecimation, int updateRate_Hz)
: GrabberWrapper("Amlogic", &_grabber, updateRate_Hz)

View File

@ -1,13 +1,15 @@
INCLUDE (CheckIncludeFiles)
# Define the current source locations
SET(CURRENT_HEADER_DIR ${CMAKE_SOURCE_DIR}/include/grabber)
SET(CURRENT_SOURCE_DIR ${CMAKE_SOURCE_DIR}/libsrc/grabber/amlogic)
FILE ( GLOB AmlogicSOURCES "${CURRENT_HEADER_DIR}/Amlogic*.h" "${CURRENT_SOURCE_DIR}/*.h" "${CURRENT_SOURCE_DIR}/*.cpp" )
add_library(amlogic-grabber ${AmlogicSOURCES} )
add_library(amlogic-grabber
${CMAKE_SOURCE_DIR}/include/grabber/amlogic/AmlogicGrabber.h
${CMAKE_SOURCE_DIR}/include/grabber/amlogic/AmlogicWrapper.h
${CMAKE_SOURCE_DIR}/libsrc/grabber/amlogic/AmlogicGrabber.cpp
${CMAKE_SOURCE_DIR}/libsrc/grabber/amlogic/AmlogicWrapper.cpp
${CMAKE_SOURCE_DIR}/libsrc/grabber/amlogic/Amvideocap.h
${CMAKE_SOURCE_DIR}/libsrc/grabber/amlogic/ion.h
${CMAKE_SOURCE_DIR}/libsrc/grabber/amlogic/meson_ion.h
${CMAKE_SOURCE_DIR}/libsrc/grabber/amlogic/IonBuffer.h
${CMAKE_SOURCE_DIR}/libsrc/grabber/amlogic/IonBuffer.cpp
)
target_link_libraries(amlogic-grabber
hyperion
${QT_LIBRARIES})
)

View File

@ -1,4 +1,4 @@
#include <grabber/AudioGrabber.h>
#include <grabber/audio/AudioGrabber.h>
#include <math.h>
#include <QImage>
#include <QObject>

View File

@ -1,4 +1,4 @@
#include <grabber/AudioGrabberLinux.h>
#include <grabber/audio/AudioGrabberLinux.h>
#include <alsa/asoundlib.h>

View File

@ -1,4 +1,4 @@
#include <grabber/AudioGrabberWindows.h>
#include <grabber/audio/AudioGrabberWindows.h>
#include <climits>
@ -71,7 +71,7 @@ bool AudioGrabberWindows::configureCaptureInterface()
notificationSize -= notificationSize % audioFormat.nBlockAlign;
bufferCaptureSize = notificationSize * AUDIO_NOTIFICATION_COUNT;
DSCBUFFERDESC bufferDesc;
bufferDesc.dwSize = sizeof(DSCBUFFERDESC);
bufferDesc.dwFlags = 0;
@ -80,7 +80,7 @@ bool AudioGrabberWindows::configureCaptureInterface()
bufferDesc.lpwfxFormat = &audioFormat;
bufferDesc.dwFXCount = 0;
bufferDesc.lpDSCFXDesc = NULL;
// Create Capture Device's Buffer
LPDIRECTSOUNDCAPTUREBUFFER preBuffer;
if (FAILED(recordingDevice->CreateCaptureBuffer(&bufferDesc, &preBuffer, NULL)))
@ -101,7 +101,7 @@ bool AudioGrabberWindows::configureCaptureInterface()
}
preBuffer->Release();
// Create Notifications
LPDIRECTSOUNDNOTIFY8 notify;
@ -112,7 +112,7 @@ bool AudioGrabberWindows::configureCaptureInterface()
recordingBuffer->Release();
return false;
}
// Create Events
notificationEvent = CreateEvent(NULL, TRUE, FALSE, NULL);
@ -133,11 +133,11 @@ bool AudioGrabberWindows::configureCaptureInterface()
positionNotify[i].dwOffset = (notificationSize * i) + notificationSize - 1;
positionNotify[i].hEventNotify = notificationEvent;
}
// Set Notifications
notify->SetNotificationPositions(AUDIO_NOTIFICATION_COUNT, positionNotify);
notify->Release();
return true;
}
@ -162,12 +162,12 @@ bool AudioGrabberWindows::start()
}
Info(_log, "Capture audio from %s", QSTRING_CSTR(getDeviceName(_device)));
if (!this->configureCaptureInterface())
{
return false;
}
if (FAILED(recordingBuffer->Start(DSCBSTART_LOOPING)))
{
Error(_log, "Failed starting audio capture from '%s'", QSTRING_CSTR(getDeviceName(_device)));
@ -214,7 +214,7 @@ void AudioGrabberWindows::stop()
{
Error(_log, "Audio capture failed to stop: '%s'", QSTRING_CSTR(getDeviceName(_device)));
}
if (FAILED(recordingBuffer->Release()))
{
Error(_log, "Failed to release recording buffer: '%s'", QSTRING_CSTR(getDeviceName(_device)));
@ -306,7 +306,7 @@ void AudioGrabberWindows::processAudioBuffer()
// Buffer wrapped around, read second position
if (capturedAudio2 != NULL)
{
{
bufferCapturePosition += capturedAudio2Length;
bufferCapturePosition %= bufferCaptureSize; // Circular Buffer
}
@ -318,13 +318,13 @@ void AudioGrabberWindows::processAudioBuffer()
{
CopyMemory(readBuffer + capturedAudioLength, capturedAudio2, capturedAudio2Length);
}
// Release Buffer Lock
recordingBuffer->Unlock(capturedAudio, capturedAudioLength, capturedAudio2, capturedAudio2Length);
// Process Audio Frame
this->processAudioFrame(readBuffer, frameSize);
delete[] readBuffer;
}

View File

@ -1,4 +1,4 @@
#include <grabber/AudioWrapper.h>
#include <grabber/audio/AudioWrapper.h>
#include <hyperion/GrabberWrapper.h>
#include <QObject>
#include <QMetaType>

View File

@ -1,35 +1,38 @@
# Define the current source locations
SET( CURRENT_HEADER_DIR ${CMAKE_SOURCE_DIR}/include/grabber )
SET( CURRENT_SOURCE_DIR ${CMAKE_SOURCE_DIR}/libsrc/grabber/audio )
if (WIN32)
add_definitions(-DUNICODE -D_UNICODE)
FILE ( GLOB AUDIO_GRABBER_SOURCES "${CURRENT_HEADER_DIR}/Audio*Windows.h" "${CURRENT_HEADER_DIR}/AudioGrabber.h" "${CURRENT_HEADER_DIR}/AudioWrapper.h" "${CURRENT_SOURCE_DIR}/*.h" "${CURRENT_SOURCE_DIR}/*Windows.cpp" "${CURRENT_SOURCE_DIR}/AudioGrabber.cpp" "${CURRENT_SOURCE_DIR}/AudioWrapper.cpp")
elseif(${CMAKE_SYSTEM} MATCHES "Linux")
FILE ( GLOB AUDIO_GRABBER_SOURCES "${CURRENT_HEADER_DIR}/Audio*Linux.h" "${CURRENT_HEADER_DIR}/AudioGrabber.h" "${CURRENT_HEADER_DIR}/AudioWrapper.h" "${CURRENT_SOURCE_DIR}/*.h" "${CURRENT_SOURCE_DIR}/*Linux.cpp" "${CURRENT_SOURCE_DIR}/AudioGrabber.cpp" "${CURRENT_SOURCE_DIR}/AudioWrapper.cpp")
elseif (APPLE)
#TODO
#FILE ( GLOB AUDIO_GRABBER_SOURCES "${CURRENT_HEADER_DIR}/Audio*Apple.h" "${CURRENT_HEADER_DIR}/AudioGrabber.h" "${CURRENT_HEADER_DIR}/AudioWrapper.h" "${CURRENT_SOURCE_DIR}/*.h" "${CURRENT_SOURCE_DIR}/*Apple.cpp" "${CURRENT_SOURCE_DIR}/AudioGrabber.cpp" "${CURRENT_SOURCE_DIR}/AudioWrapper.cpp")
if(WIN32)
add_definitions(-DUNICODE -D_UNICODE)
set(AUDIO_GRABBER_SOURCES
${CMAKE_SOURCE_DIR}/include/grabber/audio/AudioGrabberWindows.h
${CMAKE_SOURCE_DIR}/libsrc/grabber/audio/AudioGrabberWindows.cpp
)
elseif(CMAKE_HOST_UNIX AND NOT APPLE)
set(AUDIO_GRABBER_SOURCES
${CMAKE_SOURCE_DIR}/include/grabber/audio/AudioGrabberLinux.h
${CMAKE_SOURCE_DIR}/libsrc/grabber/audio/AudioGrabberLinux.cpp
)
endif()
add_library( audio-grabber ${AUDIO_GRABBER_SOURCES} )
add_library(audio-grabber
${CMAKE_SOURCE_DIR}/include/grabber/audio/AudioGrabber.h
${CMAKE_SOURCE_DIR}/include/grabber/audio/AudioWrapper.h
${CMAKE_SOURCE_DIR}/libsrc/grabber/audio/AudioGrabber.cpp
${CMAKE_SOURCE_DIR}/libsrc/grabber/audio/AudioWrapper.cpp
${AUDIO_GRABBER_SOURCES}
)
set(AUDIO_LIBS hyperion)
if (WIN32)
set(AUDIO_LIBS ${AUDIO_LIBS} DSound)
elseif(${CMAKE_SYSTEM} MATCHES "Linux")
find_package(ALSA REQUIRED)
if (ALSA_FOUND)
include_directories(${ALSA_INCLUDE_DIRS})
set(AUDIO_LIBS ${AUDIO_LIBS} ${ALSA_LIBRARIES})
endif(ALSA_FOUND)
set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads REQUIRED)
set(AUDIO_LIBS ${AUDIO_LIBS} Threads::Threads) # PRIVATE
if(WIN32)
set(AUDIO_LIBS DSound)
elseif(CMAKE_HOST_UNIX AND NOT APPLE)
set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(ALSA REQUIRED)
find_package(Threads REQUIRED)
set(AUDIO_LIBS ${ALSA_LIBRARIES} Threads::Threads)
endif()
target_link_libraries(audio-grabber
hyperion
${AUDIO_LIBS}
)
target_link_libraries(audio-grabber ${AUDIO_LIBS} ${QT_LIBRARIES})
if(CMAKE_HOST_UNIX AND NOT APPLE)
target_include_directories(audio-grabber PUBLIC ${ALSA_INCLUDE_DIRS})
endif()

View File

@ -1,14 +1,17 @@
# Define the current source locations
SET( CURRENT_HEADER_DIR ${CMAKE_SOURCE_DIR}/include/grabber )
SET( CURRENT_SOURCE_DIR ${CMAKE_SOURCE_DIR}/libsrc/grabber/directx )
find_package(DirectX9 REQUIRED)
include_directories(${DIRECTX9_INCLUDE_DIRS})
FILE ( GLOB DIRECTX_GRAB_SOURCES "${CURRENT_HEADER_DIR}/DirectX*.h" "${CURRENT_SOURCE_DIR}/*.h" "${CURRENT_SOURCE_DIR}/*.cpp" )
add_library( directx-grabber ${DIRECTX_GRAB_SOURCES} )
add_library(directx-grabber
${CMAKE_SOURCE_DIR}/include/grabber/directx/DirectXGrabber.h
${CMAKE_SOURCE_DIR}/include/grabber/directx/DirectXWrapper.h
${CMAKE_SOURCE_DIR}/libsrc/grabber/directx/DirectXGrabber.cpp
${CMAKE_SOURCE_DIR}/libsrc/grabber/directx/DirectXWrapper.cpp
)
target_link_libraries(directx-grabber
hyperion
${DIRECTX9_LIBRARIES}
hyperion
${DIRECTX9_LIBRARIES}
)
target_include_directories(directx-grabber PUBLIC
${DIRECTX9_INCLUDE_DIRS}
)

View File

@ -1,5 +1,5 @@
#include <windows.h>
#include <grabber/DirectXGrabber.h>
#include <grabber/directx/DirectXGrabber.h>
#pragma comment(lib, "d3d9.lib")
#pragma comment(lib,"d3dx9.lib")

View File

@ -1,4 +1,4 @@
#include <grabber/DirectXWrapper.h>
#include <grabber/directx/DirectXWrapper.h>
DirectXWrapper::DirectXWrapper( int updateRate_Hz,
int display,

View File

@ -1,5 +1,5 @@
# Find the BCM-package (VC control)
if( "${PLATFORM}" MATCHES rpi)
if("${PLATFORM}" MATCHES rpi)
find_package(BCM)
if(BCM_FOUND)
add_definitions(-DBCM_FOUND)
@ -9,21 +9,20 @@ else()
set(BCM_LIBRARY "")
endif()
# Define the current source locations
set(CURRENT_HEADER_DIR ${CMAKE_SOURCE_DIR}/include/grabber)
set(CURRENT_SOURCE_DIR ${CMAKE_SOURCE_DIR}/libsrc/grabber/dispmanx)
add_library(dispmanx-grabber
${CMAKE_SOURCE_DIR}/include/grabber/dispmanx/DispmanxFrameGrabber.h
${CMAKE_SOURCE_DIR}/include/grabber/dispmanx/DispmanxWrapper.h
${CMAKE_SOURCE_DIR}/libsrc/grabber/dispmanx/DispmanxFrameGrabber.cpp
${CMAKE_SOURCE_DIR}/libsrc/grabber/dispmanx/DispmanxWrapper.cpp
)
FILE ( GLOB DispmanxGrabberSOURCES "${CURRENT_HEADER_DIR}/Dispmanx*.h" "${CURRENT_SOURCE_DIR}/*.h" "${CURRENT_SOURCE_DIR}/*.cpp" )
add_library(dispmanx-grabber ${DispmanxGrabberSOURCES})
add_definitions(-DBCM_LIBRARY="${BCM_LIBRARY}")
target_link_libraries(dispmanx-grabber
hyperion
${CMAKE_DL_LIBS}
)
target_include_directories(dispmanx-grabber PUBLIC
${BCM_INCLUDE_DIR}
)
target_link_libraries(dispmanx-grabber
hyperion
${QT_LIBRARIES}
${CMAKE_DL_LIBS}
)

View File

@ -16,7 +16,7 @@ namespace {
} //End of constants
// Local includes
#include "grabber/DispmanxFrameGrabber.h"
#include "grabber/dispmanx/DispmanxFrameGrabber.h"
DispmanxFrameGrabber::DispmanxFrameGrabber()
: Grabber("DISPMANXGRABBER")

View File

@ -1,4 +1,4 @@
#include <grabber/DispmanxWrapper.h>
#include <grabber/dispmanx/DispmanxWrapper.h>
DispmanxWrapper::DispmanxWrapper( int updateRate_Hz,
int pixelDecimation

View File

@ -1,11 +1,10 @@
# Define the current source locations
SET(CURRENT_HEADER_DIR ${CMAKE_SOURCE_DIR}/include/grabber)
SET(CURRENT_SOURCE_DIR ${CMAKE_SOURCE_DIR}/libsrc/grabber/framebuffer)
FILE ( GLOB FramebufferGrabberSOURCES "${CURRENT_HEADER_DIR}/Framebuffer*.h" "${CURRENT_SOURCE_DIR}/*.h" "${CURRENT_SOURCE_DIR}/*.cpp" )
add_library(framebuffer-grabber ${FramebufferGrabberSOURCES} )
add_library(framebuffer-grabber
${CMAKE_SOURCE_DIR}/include/grabber/framebuffer/FramebufferFrameGrabber.h
${CMAKE_SOURCE_DIR}/include/grabber/framebuffer/FramebufferWrapper.h
${CMAKE_SOURCE_DIR}/libsrc/grabber/framebuffer/FramebufferFrameGrabber.cpp
${CMAKE_SOURCE_DIR}/libsrc/grabber/framebuffer/FramebufferWrapper.cpp
)
target_link_libraries(framebuffer-grabber
hyperion
${QT_LIBRARIES})
)

View File

@ -28,7 +28,7 @@ const char DISCOVERY_FILEPATTERN[] = "fb?";
} //End of constants
// Local includes
#include <grabber/FramebufferFrameGrabber.h>
#include <grabber/framebuffer/FramebufferFrameGrabber.h>
FramebufferFrameGrabber::FramebufferFrameGrabber(const QString & device)
: Grabber("FRAMEBUFFERGRABBER")

View File

@ -1,4 +1,4 @@
#include <grabber/FramebufferWrapper.h>
#include <grabber/framebuffer/FramebufferWrapper.h>
FramebufferWrapper::FramebufferWrapper( int updateRate_Hz,
const QString & device,

View File

@ -1,11 +1,10 @@
# Define the current source locations
SET(CURRENT_HEADER_DIR ${CMAKE_SOURCE_DIR}/include/grabber)
SET(CURRENT_SOURCE_DIR ${CMAKE_SOURCE_DIR}/libsrc/grabber/osx)
FILE ( GLOB OsxGrabberSOURCES "${CURRENT_HEADER_DIR}/Osx*.h" "${CURRENT_SOURCE_DIR}/*.h" "${CURRENT_SOURCE_DIR}/*.cpp" )
add_library(osx-grabber ${OsxGrabberSOURCES} )
add_library(osx-grabber
${CMAKE_SOURCE_DIR}/include/grabber/osx/OsxFrameGrabber.h
${CMAKE_SOURCE_DIR}/include/grabber/osx/OsxWrapper.h
${CMAKE_SOURCE_DIR}/libsrc/grabber/osx/OsxFrameGrabber.cpp
${CMAKE_SOURCE_DIR}/libsrc/grabber/osx/OsxWrapper.cpp
)
target_link_libraries(osx-grabber
hyperion
${QT_LIBRARIES})
)

View File

@ -3,7 +3,7 @@
#include <iostream>
// Local includes
#include <grabber/OsxFrameGrabber.h>
#include <grabber/osx/OsxFrameGrabber.h>
//Qt
#include <QJsonObject>

View File

@ -1,159 +0,0 @@
#ifndef __APPLE__
#include <grabber/OsxFrameGrabberMock.h>
unsigned __osx_frame_counter = 0;
const int __screenWidth = 800;
const int __screenHeight = 600;
CGError CGGetActiveDisplayList(uint32_t maxDisplays, CGDirectDisplayID *activeDisplays, uint32_t *displayCount)
{
if (maxDisplays == 0 || activeDisplays == nullptr)
{
*displayCount = 2;
}
else
{
displayCount = &maxDisplays;
if (activeDisplays != nullptr)
{
for (CGDirectDisplayID i = 0; i < maxDisplays; ++i)
{
activeDisplays[i] = i;
}
}
else
{
return kCGErrorFailure;
}
}
return kCGErrorSuccess;
}
CGImageRef CGDisplayCreateImage(CGDirectDisplayID display)
{
CGImageRef image = new CGImage(__screenWidth / (display+1), __screenHeight / (display+1));
return image;
}
void CGImageRelease(CGImageRef image)
{
delete image;
}
CGImageRef CGImageGetDataProvider(CGImageRef image)
{
__osx_frame_counter++;
if (__osx_frame_counter > 100)
{
__osx_frame_counter = 0;
}
ColorRgb color[4] = {ColorRgb::RED, ColorRgb::BLUE, ColorRgb::GREEN, ColorRgb::WHITE};
if (__osx_frame_counter < 25)
{
color[0] = ColorRgb::WHITE;
color[1] = ColorRgb::RED;
color[2] = ColorRgb::BLUE;
color[3] = ColorRgb::GREEN;
}
else if(__osx_frame_counter < 50)
{
color[1] = ColorRgb::WHITE;
color[2] = ColorRgb::RED;
color[3] = ColorRgb::BLUE;
color[0] = ColorRgb::GREEN;
}
else if(__osx_frame_counter < 75)
{
color[2] = ColorRgb::WHITE;
color[3] = ColorRgb::RED;
color[0] = ColorRgb::BLUE;
color[1] = ColorRgb::GREEN;
}
unsigned w = image->width();
unsigned h = image->height();
for (unsigned y=0; y<h; y++)
{
for (unsigned x=0; x<w; x++)
{
unsigned id = 0;
if (x < w/2 && y < h/2) id = 1;
if (x < w/2 && y >= h/2) id = 2;
if (x >= w/2 && y < h/2) id = 3;
image->memptr()[y*w + x] = color[id];
}
}
return image;
}
CFDataRef CGDataProviderCopyData(CGImageRef image)
{
const unsigned indexMax = image->width() * image->height() * CGImageGetBitsPerPixel(image);
CFDataRef data = new CFData[indexMax];
int lineLength = CGImageGetBytesPerRow(image);
for (unsigned y=0; y<image->height(); y++)
{
for (unsigned x=0; x<image->width(); x++)
{
int index = lineLength * y + x * CGImageGetBitsPerPixel(image);
data[index ] = (*image)(x,y).blue;
data[index+1] = (*image)(x,y).green;
data[index+2] = (*image)(x,y).red;
data[index+3] = 0;
}
}
return data;
}
unsigned char* CFDataGetBytePtr(CFDataRef imgData)
{
return imgData;
}
unsigned CGImageGetWidth(CGImageRef image)
{
return image->width();
}
unsigned CGImageGetHeight(CGImageRef image)
{
return image->height();
}
unsigned CGImageGetBytesPerRow(CGImageRef image)
{
return image->width()*CGImageGetBitsPerPixel(image);
}
unsigned CGImageGetBitsPerPixel(CGImageRef)
{
return 4;
}
void CFRelease(CFDataRef imgData)
{
delete imgData;
}
CGDisplayModeRef CGDisplayCopyDisplayMode(CGDirectDisplayID display)
{
return nullptr;
}
CGRect CGDisplayBounds(CGDirectDisplayID display)
{
CGRect rect;
rect.size.width = __screenWidth / (display+1);
rect.size.height = __screenHeight / (display+1);
return rect;
}
void CGDisplayModeRelease(CGDisplayModeRef mode)
{
}
#endif

View File

@ -1,4 +1,4 @@
#include <grabber/OsxWrapper.h>
#include <grabber/osx/OsxWrapper.h>
OsxWrapper::OsxWrapper( int updateRate_Hz,
int display,

View File

@ -1,13 +1,10 @@
# Define the current source locations
SET(CURRENT_HEADER_DIR ${CMAKE_SOURCE_DIR}/include/grabber)
SET(CURRENT_SOURCE_DIR ${CMAKE_SOURCE_DIR}/libsrc/grabber/qt)
FILE ( GLOB QT_GRAB_SOURCES "${CURRENT_HEADER_DIR}/Qt*.h" "${CURRENT_SOURCE_DIR}/*.h" "${CURRENT_SOURCE_DIR}/*.cpp" )
add_library(qt-grabber ${QT_GRAB_SOURCES} )
add_library(qt-grabber
${CMAKE_SOURCE_DIR}/include/grabber/qt/QtGrabber.h
${CMAKE_SOURCE_DIR}/include/grabber/qt/QtWrapper.h
${CMAKE_SOURCE_DIR}/libsrc/grabber/qt/QtGrabber.cpp
${CMAKE_SOURCE_DIR}/libsrc/grabber/qt/QtWrapper.cpp
)
target_link_libraries(qt-grabber
hyperion
${QT_LIBRARIES}
)

View File

@ -1,5 +1,5 @@
// proj
#include <grabber/QtGrabber.h>
#include <grabber/qt/QtGrabber.h>
// qt
#include <QPixmap>
@ -226,7 +226,7 @@ int QtGrabber::grabFrame(Image<ColorRgb>& image)
QPixmap originalPixmap = grabWindow(0, _src_x, _src_y, _src_x_max, _src_y_max);
#else
QPixmap originalPixmap = _screen->grabWindow(0, _src_x, _src_y, _src_x_max, _src_y_max);
#endif
#endif
if (originalPixmap.isNull())
{
rc = -1;

View File

@ -1,4 +1,4 @@
#include <grabber/QtWrapper.h>
#include <grabber/qt/QtWrapper.h>
QtWrapper::QtWrapper( int updateRate_Hz,
int display,

View File

@ -1,33 +1,38 @@
# Common cmake definition for external video grabber
# Add Turbo JPEG library
if (ENABLE_V4L2 OR ENABLE_MF)
find_package(TurboJPEG)
if (TURBOJPEG_FOUND)
add_definitions(-DHAVE_TURBO_JPEG)
message( STATUS "Using Turbo JPEG library: ${TurboJPEG_LIBRARY}")
include_directories(${TurboJPEG_INCLUDE_DIRS})
else ()
message( STATUS "Turbo JPEG library not found, MJPEG camera format won't work.")
endif ()
endif()
set(MF-grabber mediafoundation)
set(V4L2-grabber v4l2)
# Define the wrapper/header/source locations and collect them
SET(WRAPPER_DIR ${CMAKE_SOURCE_DIR}/libsrc/grabber/video)
SET(HEADER_DIR ${CMAKE_SOURCE_DIR}/include/grabber)
if (ENABLE_MF)
if(ENABLE_MF)
project(mf-grabber)
SET(CURRENT_SOURCE_DIR ${CMAKE_SOURCE_DIR}/libsrc/grabber/video/mediafoundation)
FILE (GLOB SOURCES "${WRAPPER_DIR}/*.cpp" "${HEADER_DIR}/Video*.h" "${HEADER_DIR}/MF*.h" "${HEADER_DIR}/Encoder*.h" "${CURRENT_SOURCE_DIR}/*.h" "${CURRENT_SOURCE_DIR}/*.cpp")
set(grabber_project MF)
set(MediaFoundationSourceReaderCallBack ${CMAKE_SOURCE_DIR}/libsrc/grabber/video/mediafoundation/MFSourceReaderCB.h)
elseif(ENABLE_V4L2)
project(v4l2-grabber)
SET(CURRENT_SOURCE_DIR ${CMAKE_SOURCE_DIR}/libsrc/grabber/video/v4l2)
FILE (GLOB SOURCES "${WRAPPER_DIR}/*.cpp" "${HEADER_DIR}/Video*.h" "${HEADER_DIR}/V4L2*.h" "${HEADER_DIR}/Encoder*.h" "${CURRENT_SOURCE_DIR}/*.cpp")
set(grabber_project V4L2)
endif()
add_library(${PROJECT_NAME} ${SOURCES})
target_link_libraries(${PROJECT_NAME} hyperion ${QT_LIBRARIES})
add_library(${PROJECT_NAME}
${CMAKE_SOURCE_DIR}/include/grabber/video/EncoderThread.h
${CMAKE_SOURCE_DIR}/include/grabber/video/VideoWrapper.h
${CMAKE_SOURCE_DIR}/libsrc/grabber/video/EncoderThread.cpp
${CMAKE_SOURCE_DIR}/libsrc/grabber/video/VideoWrapper.cpp
${CMAKE_SOURCE_DIR}/include/grabber/video/${${grabber_project}-grabber}/${grabber_project}Grabber.h
${CMAKE_SOURCE_DIR}/libsrc/grabber/video/${${grabber_project}-grabber}/${grabber_project}Grabber.cpp
${MediaFoundationSourceReaderCallBack}
)
if(TURBOJPEG_FOUND)
target_link_libraries(${PROJECT_NAME} ${TurboJPEG_LIBRARY})
target_link_libraries(${PROJECT_NAME} hyperion)
# Add Turbo JPEG library
if(ENABLE_V4L2 OR ENABLE_MF)
find_package(TurboJPEG)
if(TURBOJPEG_FOUND)
add_definitions(-DHAVE_TURBO_JPEG)
message(STATUS "Using Turbo JPEG library: ${TurboJPEG_LIBRARY}")
target_link_libraries(${PROJECT_NAME} ${TurboJPEG_LIBRARY})
target_include_directories(${PROJECT_NAME} PUBLIC ${TurboJPEG_INCLUDE_DIRS})
else ()
message(STATUS "Turbo JPEG library not found, MJPEG camera format won't work.")
endif()
endif()

View File

@ -1,4 +1,4 @@
#include "grabber/EncoderThread.h"
#include "grabber/video/EncoderThread.h"
#include <QDebug>

View File

@ -1,6 +1,6 @@
#include <QMetaType>
#include <grabber/VideoWrapper.h>
#include <grabber/video/VideoWrapper.h>
// qt includes
#include <QTimer>

View File

@ -1,5 +1,5 @@
#include "MFSourceReaderCB.h"
#include "grabber/MFGrabber.h"
#include "grabber/video/mediafoundation/MFGrabber.h"
// Constants
namespace { const bool verbose = false; }
@ -537,7 +537,7 @@ void MFGrabber::process_image(const void *frameImageBuffer, int size)
Error(_log, "Frame too small: %d != %d", size, _frameByteSize);
else if (_threadManager != nullptr)
{
for (unsigned long i = 0; i < _threadManager->_threadCount; i++)
for (int i = 0; i < _threadManager->_threadCount; i++)
{
if (!_threadManager->_threads[i]->isBusy())
{

View File

@ -19,7 +19,7 @@
#pragma comment (lib, "strmiids.lib")
#pragma comment (lib, "wmcodecdspuuid.lib")
#include <grabber/MFGrabber.h>
#include <grabber/video/mediafoundation/MFGrabber.h>
#define SAFE_RELEASE(x) if(x) { x->Release(); x = nullptr; }

View File

@ -23,7 +23,7 @@
#include <QFileInfo>
#include <QSet>
#include "grabber/V4L2Grabber.h"
#include "grabber/video/v4l2/V4L2Grabber.h"
#define CLEAR(x) memset(&(x), 0, sizeof(x))

View File

@ -1,24 +1,23 @@
# Define the current source locations
SET(CURRENT_HEADER_DIR ${CMAKE_SOURCE_DIR}/include/grabber)
SET(CURRENT_SOURCE_DIR ${CMAKE_SOURCE_DIR}/libsrc/grabber/x11)
# Find X11
find_package(X11 REQUIRED)
include_directories( ${X11_INCLUDES} )
if(APPLE)
include_directories("/opt/X11/include")
endif(APPLE)
FILE ( GLOB X11_SOURCES "${CURRENT_HEADER_DIR}/X11*.h" "${CURRENT_SOURCE_DIR}/*.h" "${CURRENT_SOURCE_DIR}/*.cpp" )
add_library(x11-grabber ${X11_SOURCES} )
add_library(x11-grabber
${CMAKE_SOURCE_DIR}/include/grabber/x11/X11Grabber.h
${CMAKE_SOURCE_DIR}/include/grabber/x11/X11Wrapper.h
${CMAKE_SOURCE_DIR}/libsrc/grabber/x11/X11Grabber.cpp
${CMAKE_SOURCE_DIR}/libsrc/grabber/x11/X11Wrapper.cpp
)
target_link_libraries(x11-grabber
hyperion
${X11_LIBRARIES}
${X11_Xrandr_LIB}
${X11_Xrender_LIB}
${QT_LIBRARIES}
)
if(APPLE)
list(APPEND X11_INCLUDES "/opt/X11/include")
endif()
target_include_directories(x11-grabber PUBLIC
${X11_INCLUDES}
)

View File

@ -1,5 +1,5 @@
#include <utils/Logger.h>
#include <grabber/X11Grabber.h>
#include <grabber/x11/X11Grabber.h>
#include <xcb/randr.h>
#include <xcb/xcb_event.h>

View File

@ -1,4 +1,4 @@
#include <grabber/X11Wrapper.h>
#include <grabber/x11/X11Wrapper.h>
X11Wrapper::X11Wrapper( int updateRate_Hz,
int pixelDecimation,

View File

@ -1,23 +1,19 @@
# Define the current source locations
SET(CURRENT_HEADER_DIR ${CMAKE_SOURCE_DIR}/include/grabber)
SET(CURRENT_SOURCE_DIR ${CMAKE_SOURCE_DIR}/libsrc/grabber/xcb)
find_package(XCB COMPONENTS SHM IMAGE RENDER RANDR REQUIRED)
include_directories(${XCB_INCLUDE_DIRS})
FILE (GLOB XCB_SOURCES "${CURRENT_HEADER_DIR}/Xcb*.h" "${CURRENT_SOURCE_DIR}/*.h" "${CURRENT_SOURCE_DIR}/*.cpp" )
add_library(xcb-grabber ${XCB_SOURCES})
add_library(xcb-grabber
${CMAKE_SOURCE_DIR}/include/grabber/xcb/XcbGrabber.h
${CMAKE_SOURCE_DIR}/include/grabber/xcb/XcbWrapper.h
${CMAKE_SOURCE_DIR}/libsrc/grabber/xcb/XcbCommandExecutor.h
${CMAKE_SOURCE_DIR}/libsrc/grabber/xcb/XcbCommands.h
${CMAKE_SOURCE_DIR}/libsrc/grabber/xcb/XcbGrabber.cpp
${CMAKE_SOURCE_DIR}/libsrc/grabber/xcb/XcbWrapper.cpp
)
target_link_libraries(xcb-grabber
hyperion
${XCB_LIBRARIES}
${QT_LIBRARIES}
)
if (NOT APPLE)
target_link_libraries(
xcb-grabber
)
endif()
target_include_directories(xcb-grabber PUBLIC
${XCB_INCLUDE_DIRS}
)

View File

@ -1,5 +1,5 @@
#include <utils/Logger.h>
#include <grabber/XcbGrabber.h>
#include <grabber/xcb/XcbGrabber.h>
#include "XcbCommands.h"
#include "XcbCommandExecutor.h"

View File

@ -1,4 +1,4 @@
#include <grabber/XcbWrapper.h>
#include <grabber/xcb/XcbWrapper.h>
XcbWrapper::XcbWrapper( int updateRate_Hz,
int pixelDecimation,

View File

@ -1,21 +1,50 @@
# Define the current source locations
SET(CURRENT_HEADER_DIR ${CMAKE_SOURCE_DIR}/include/hyperion)
SET(CURRENT_SOURCE_DIR ${CMAKE_SOURCE_DIR}/libsrc/hyperion)
if(ENABLE_FLATBUF_SERVER)
include_directories(
${CMAKE_CURRENT_BINARY_DIR}/../../libsrc/flatbufserver
)
endif()
FILE ( GLOB Hyperion_SOURCES "${CURRENT_HEADER_DIR}/*.h" "${CURRENT_SOURCE_DIR}/*.h" "${CURRENT_SOURCE_DIR}/*.cpp" )
SET(Hyperion_RESOURCES ${CURRENT_SOURCE_DIR}/resource.qrc)
add_library(hyperion
${Hyperion_SOURCES}
${Hyperion_RESOURCES}
# Authorization Manager
${CMAKE_SOURCE_DIR}/include/hyperion/AuthManager.h
${CMAKE_SOURCE_DIR}/libsrc/hyperion/AuthManager.cpp
# Background Effect Handler
${CMAKE_SOURCE_DIR}/include/hyperion/BGEffectHandler.h
# Capture Control class
${CMAKE_SOURCE_DIR}/include/hyperion/CaptureCont.h
${CMAKE_SOURCE_DIR}/libsrc/hyperion/CaptureCont.cpp
# Color Adjustment
${CMAKE_SOURCE_DIR}/include/hyperion/ColorAdjustment.h
# Component Register
${CMAKE_SOURCE_DIR}/include/hyperion/ComponentRegister.h
${CMAKE_SOURCE_DIR}/libsrc/hyperion/ComponentRegister.cpp
# Grabber/Wrapper classes
${CMAKE_SOURCE_DIR}/include/hyperion/Grabber.h
${CMAKE_SOURCE_DIR}/libsrc/hyperion/Grabber.cpp
${CMAKE_SOURCE_DIR}/include/hyperion/GrabberWrapper.h
${CMAKE_SOURCE_DIR}/libsrc/hyperion/GrabberWrapper.cpp
# Hyperion + Resources
${CMAKE_SOURCE_DIR}/include/hyperion/Hyperion.h
${CMAKE_SOURCE_DIR}/libsrc/hyperion/Hyperion.cpp
${CMAKE_SOURCE_DIR}/libsrc/hyperion/resource.qrc
# Instance Manager
${CMAKE_SOURCE_DIR}/include/hyperion/HyperionIManager.h
${CMAKE_SOURCE_DIR}/libsrc/hyperion/HyperionIManager.cpp
# Image Processor
${CMAKE_SOURCE_DIR}/include/hyperion/ImageProcessor.h
${CMAKE_SOURCE_DIR}/libsrc/hyperion/ImageProcessor.cpp
# ImageToLedsMap class
${CMAKE_SOURCE_DIR}/include/hyperion/ImageToLedsMap.h
${CMAKE_SOURCE_DIR}/libsrc/hyperion/ImageToLedsMap.cpp
# Led String
${CMAKE_SOURCE_DIR}/include/hyperion/LedString.h
${CMAKE_SOURCE_DIR}/libsrc/hyperion/LedString.cpp
# Linear Color Smoothing
${CMAKE_SOURCE_DIR}/include/hyperion/LinearColorSmoothing.h
${CMAKE_SOURCE_DIR}/libsrc/hyperion/LinearColorSmoothing.cpp
# Led Color Transform
${CMAKE_SOURCE_DIR}/include/hyperion/MultiColorAdjustment.h
${CMAKE_SOURCE_DIR}/libsrc/hyperion/MultiColorAdjustment.cpp
# Priority Muxer
${CMAKE_SOURCE_DIR}/include/hyperion/PriorityMuxer.h
${CMAKE_SOURCE_DIR}/libsrc/hyperion/PriorityMuxer.cpp
# Settings Manager
${CMAKE_SOURCE_DIR}/include/hyperion/SettingsManager.h
${CMAKE_SOURCE_DIR}/libsrc/hyperion/SettingsManager.cpp
)
target_link_libraries(hyperion
@ -23,7 +52,6 @@ target_link_libraries(hyperion
hyperion-utils
leddevice
database
${QT_LIBRARIES}
)
if(ENABLE_BOBLIGHT_SERVER)

Some files were not shown because too many files have changed in this diff Show More