Skip to content

Commit

Permalink
Merge branch 'CESNET:master' into wip-cmpto-j2k-cpu
Browse files Browse the repository at this point in the history
  • Loading branch information
ATrivialAtomic authored Jun 11, 2024
2 parents 4517975 + 818fcc0 commit 525a0f4
Show file tree
Hide file tree
Showing 143 changed files with 3,860 additions and 1,609 deletions.
1 change: 1 addition & 0 deletions .github/scripts/Linux/arm/bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ apt -y install libasound2-dev portaudio19-dev libjack-dev
apt -y install libglew-dev libglfw3-dev libglm-dev
apt -y install libcaca-dev libmagickwand-dev libnatpmp-dev libopencv-core-dev libopencv-imgproc-dev libv4l-dev
apt -y install libavcodec-dev libavformat-dev libswscale-dev libraspberrypi-dev
apt -y install libdrm-dev

/.github/scripts/install-common-deps.sh
/.github/scripts/Linux/install_others.sh ndi pipewire ximea
Expand Down
1 change: 1 addition & 0 deletions .github/scripts/Linux/arm/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ set -- "$@" --enable-decklink --enable-file --enable-ndi --enable-rtsp \
set -- "$@" --enable-caca --enable-gl-display --enable-panogl_disp --enable-sdl # display
set -- "$@" --enable-libavcodec --enable-rtdxt --enable-libswscale --enable-uyvy # compression
set -- "$@" --enable-blank --enable-holepunch --enable-natpmp --enable-pcp --enable-resize --enable-scale --enable-sdp-http --enable-testcard-extras --enable-text --enable-video-mixer --enable-zfec # extras (pp. etc)
set -- "$@" --enable-drm
if [ "$ARCH" = arm64 ]; then
set -- "$@" --enable-vulkan
fi
Expand Down
20 changes: 1 addition & 19 deletions .github/scripts/Linux/install_others.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,6 @@ install_ximea() {
sudo ./install -noudev
}

# Install AJA
install_aja() {(
git clone --depth 1 https://github.com/aja-video/ntv2
cd ntv2/ajalibraries/ajantv2/build
make -j "$(nproc)"
)}


install_gpujpeg() {(
cd "$GITHUB_WORKSPACE"
./ext-deps/bootstrap_gpujpeg.sh -d
Expand All @@ -38,16 +30,6 @@ install_gpujpeg() {(
sudo ldconfig
)}

# Install live555
install_live555() {(
git clone https://github.com/xanview/live555/
cd live555
git checkout 35c375
./genMakefiles linux-64bit
make -j "$(nproc)" CPLUSPLUS_COMPILER="c++ -DXLOCALE_NOT_USED"
sudo make install
)}

# Install NDI
install_ndi() {(
if [ ! -f "Install_NDI_SDK_Linux.tar.gz" ]; then # it should be already cached in a CI step
Expand Down Expand Up @@ -115,7 +97,7 @@ if [ $# -eq 1 ] && { [ "$1" = -h ] || [ "$1" = --help ] || [ "$1" = help ]; }; t
fi

if [ $# -eq 0 ] || [ $show_help ]; then
set -- aja gpujpeg live555 ndi pipewire rav1e vulkan ximea
set -- gpujpeg ndi pipewire rav1e vulkan ximea
fi

if [ $show_help ]; then
Expand Down
2 changes: 1 addition & 1 deletion .github/scripts/Linux/prepare.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash -eux

export PKG_CONFIG_PATH=/usr/local/qt/lib/pkgconfig:/usr/local/lib/pkgconfig
printf "%b" "AJA_DIRECTORY=/var/tmp/ntv2\n\
printf "%b" "\
CPATH=/usr/local/qt/include\n\
LIBRARY_PATH=/usr/local/qt/lib\n\
PKG_CONFIG_PATH=$PKG_CONFIG_PATH\n" >> "$GITHUB_ENV"
Expand Down
19 changes: 0 additions & 19 deletions .github/scripts/Windows/build_live555.sh

This file was deleted.

31 changes: 10 additions & 21 deletions .github/scripts/Windows/prepare_msys.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ export CPATH=/usr/local/include:/usr/include
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/usr/local/share/pkgconfig:/usr/lib/pkgconfig:$MSYSTEM_PREFIX/lib/pkgconfig
export LIBRARY_PATH=/usr/local/lib
export INCLUDE='C:\msys64\clang64\include' # for MSVC (CUDA)
export CUDA_FLAGS='--generate-code arch=compute_35,code=sm_35'
export CUDA_FLAGS="--generate-code arch=compute_35,code=sm_35\
-allow-unsupported-compiler"
CUDA_D=$(ls -d /c/Program\ Files/NVIDIA\ GPU\ Computing\ Toolkit/CUDA/*)
if test -d "$CUDA_D"; then
Expand Down Expand Up @@ -40,8 +41,6 @@ EOF
# shellcheck source=/dev/null
. .github/scripts/json-common.sh

github_workspace_cp=$(cygpath "$GITHUB_WORKSPACE")

PACMAN_INSTALL='pacman -Sy --needed --noconfirm --disable-download-timeout'
# Install MSYS2 packages
MINGW_PACKAGE_PREFIX=mingw-w64-clang-x86_64
Expand All @@ -65,18 +64,7 @@ $PACMAN_INSTALL $m-imagemagick $m-opencv
$PACMAN_INSTALL libtool # PCP
pacman -Scc --noconfirm

# Build AJA wrapper if we have SDK
install_aja() {(
git clone --depth 1 https://github.com/aja-video/ntv2 AJA
cd AJA
"$github_workspace_cp/.github/scripts/download-gh-asset.sh" \
aja-video/ntv2 libs_windows_ aja_build.zip
rm README.md # would be overriden from zip below
unzip aja_build.zip
mkdir -p lib
cp Release/*.lib lib/
cp Release/*.dll /usr/local/bin/
cd ..
build_aja_wrapper() {(
data/scripts/build_aja_lib_win64.sh
)}

Expand All @@ -86,13 +74,14 @@ install_deltacast() {(
fi
mkdir VideoMaster
cd VideoMaster
if curl -f -S "$SDK_URL/VideoMaster_SDK_Windows.zip" -O; then
filename=videomaster-win.x64-dev.zip
if curl -f -S "$SDK_URL/$filename" -O; then
FEATURES="$FEATURES --enable-deltacast"
echo "FEATURES=$FEATURES" >> "$GITHUB_ENV"
unzip VideoMaster_SDK_Windows.zip
cp Binaries/Resources/Lib64/*dll /usr/local/bin/
cp -r Include/* /usr/local/include/
cp Library/x64/* /usr/local/lib/
unzip "$filename"
cp resources/lib/*dll /usr/local/bin/
cp resources/lib/*lib /usr/local/lib/
cp -r resources/include/* /usr/local/include/
fi
cd ..
rm -rf VideoMaster
Expand All @@ -114,7 +103,7 @@ install_soundfont() {
# Install cross-platform deps
"$GITHUB_WORKSPACE/.github/scripts/install-common-deps.sh"

install_aja
build_aja_wrapper
install_deltacast
install_gpujpeg
install_soundfont
Expand Down
2 changes: 1 addition & 1 deletion .github/scripts/environment.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ fi

# include platform on mac in version string
if [ "$(uname -s)" = Darwin ]; then
VERSION="$(uname -m)-$VERSION"
VERSION="$VERSION-$(uname -m)"
fi

if [ -z "${CHANNEL-}" ]; then
Expand Down
53 changes: 53 additions & 0 deletions .github/scripts/install-common-deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,28 @@ download_install_cineform() {(
sudo cmake --install .
)}

download_build_aja() {
git clone --depth 1 https://github.com/aja-video/libajantv2.git
export MACOSX_DEPLOYMENT_TARGET=10.13 # needed for arm64 mac
cmake -DAJANTV2_DISABLE_DEMOS=ON -DAJANTV2_DISABLE_DRIVER=ON \
-DAJANTV2_DISABLE_TOOLS=ON -DAJANTV2_DISABLE_TESTS=ON \
-DAJANTV2_DISABLE_PLUGINS=ON -DAJANTV2_BUILD_SHARED=ON \
-DCMAKE_BUILD_TYPE=Release -Blibajantv2/build -Slibajantv2
cmake --build libajantv2/build --config Release -j "$(nproc)"
}

install_aja() {(
if [ ! -d libajantv2 ]; then
download_build_aja
fi
if is_win; then
cp libajantv2/build/ajantv2/Release/ajantv2.dll /usr/local/bin/
cp libajantv2/build/ajantv2/Release/ajantv2.lib /usr/local/lib/
else
sudo cmake --install libajantv2/build
fi
)}

install_ews() {
sudo mkdir -p /usr/local/include
sudo curl -LS https://raw.githubusercontent.com/hellerf/\
Expand All @@ -53,6 +75,35 @@ install_juice() {
)
}

download_build_live555() {
if is_win; then
target=mingw
PATH=/usr/bin:$PATH
# ensure binutils ld is used (not lld)
pacman -Sy --noconfirm binutils
elif [ "$(uname -s)" = Linux ]; then
target=linux-64bit
else
target=macosx
fi

git clone https://github.com/xanview/live555/
cd live555
git checkout 35c375
./genMakefiles "$target"

make -j "$(nproc)" CPLUSPLUS_COMPILER="c++ -DXLOCALE_NOT_USED"
is_win && pacman -Rs --noconfirm binutils
cd ..
}

install_live555() {(
if [ ! -d live555 ]; then
download_build_live555
fi
sudo make -C live555 install
)}

install_pcp() {
git clone https://github.com/libpcp/pcp.git
(
Expand All @@ -74,8 +125,10 @@ install_zfec() {(
if ! is_arm && ! is_win; then
download_install_cineform
fi
install_aja
install_ews
install_juice
install_live555
install_pcp
install_zfec

31 changes: 6 additions & 25 deletions .github/scripts/macOS/install_others.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,24 +30,13 @@ install_ximea() {(
umount /Volumes/XIMEA
)}

install_aja() {(
AJA_DIRECTORY=/private/var/tmp/ntv2sdk
git clone --depth 1 https://github.com/aja-video/ntv2 $AJA_DIRECTORY
cd $AJA_DIRECTORY
echo "AJA_DIRECTORY=$AJA_DIRECTORY" >>"$GITHUB_ENV"
"$srcroot/.github/scripts/download-gh-asset.sh" aja-video/ntv2 \
libs_mac_ aja_build.tar.gz
tar xzf aja_build.tar.gz
arch_subd=$(uname -m | sed 's/x86_64/x64/')
sudo cp Release/"$arch_subd"/* /usr/local/lib/
)}

install_deltacast() {
if [ ! -f "$SDK_NONFREE_PATH/VideoMaster_SDK_MacOSX.zip" ]; then
filename=videomaster-macos-dev.zip
if [ ! -f "$SDK_NONFREE_PATH/$filename" ]; then
return
fi
unzip "$SDK_NONFREE_PATH/VideoMaster_SDK_MacOSX.zip"
sudo installer -pkg VideoMaster_SDK.pkg -target / || true
unzip "$SDK_NONFREE_PATH/$filename"
sudo cp -a Frameworks/VideoMasterHD* /Library/Frameworks/
export FEATURES="${FEATURES+$FEATURES }--enable-deltacast"
echo "FEATURES=$FEATURES" >> "$GITHUB_ENV"
export COMMON_OSX_FLAGS="${COMMON_OSX_FLAGS+$COMMON_OSX_FLAGS }\
Expand Down Expand Up @@ -88,16 +77,8 @@ LIBRARY_PATH=$LIBRARY_PATH\nMY_DYLD_LIBRARY_PATH=$MY_DYLD_LIBRARY_PATH\n" >> \
"$GITHUB_ENV"
}

install_live555() {(
git clone https://github.com/xanview/live555/
cd live555
git checkout 35c375
./genMakefiles macosx
sudo make -j "$(sysctl -n hw.ncpu)" install
)}

install_soundfont() {(
sf_dir="$srcroot/data/MacOS-bundle-template/Contents/share/soundfonts"
sf_dir="$srcroot/data/template/macOS-bundle/Contents/share/soundfonts"
mkdir -p "$sf_dir"
cp "$GITHUB_WORKSPACE/data/default.sf3" "$sf_dir"
)}
Expand All @@ -123,7 +104,7 @@ if [ $# -eq 1 ] && { [ "$1" = -h ] || [ "$1" = --help ] || [ "$1" = help ]; }; t
fi

if [ $# -eq 0 ] || [ $show_help ]; then
set -- aja deltacast glfw live555 ndi soundfont syphon ximea
set -- deltacast glfw ndi soundfont syphon ximea
fi

if [ $show_help ]; then
Expand Down
44 changes: 35 additions & 9 deletions .github/scripts/macOS/prepare.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,42 @@ echo "PKG_CONFIG_PATH=/usr/local/lib/pkgconfig" >> "$GITHUB_ENV"
echo "/usr/local/opt/qt/bin" >> "$GITHUB_PATH"
echo "DYLIBBUNDLER_FLAGS=$DYLIBBUNDLER_FLAGS" >> "$GITHUB_ENV"

brew install autoconf automake libtool pkg-config \
asciidoctor
brew install libsoxr speexdsp
brew install ffmpeg portaudio sdl2 sdl2_mixer sdl2_ttf
brew install molten-vk vulkan-headers
brew install imagemagick libcaca libnatpmp jack opencv wolfssl
brew install ossp-uuid # for cineform
brew install qt
brew install glm
set -- \
asciidoctor \
autoconf \
automake \
ffmpeg \
glm \
imagemagick \
jack \
libcaca \
libnatpmp \
libsoxr \
libtool \
molten-vk \
opencv \
ossp-uuid `#for cineform` \
pkg-config \
portaudio \
qt \
sdl2 \
sdl2_mixer \
sdl2_ttf \
speexdsp \
vulkan-headers \
wolfssl \

# shellcheck disable=SC2034
for n in $(seq $#); do
# if not installed, add on the back of positional parameters
if ! brew list "$1" >/dev/null; then
set -- "$@" "$1"
fi
shift # remove from the front
done

brew install "$@"

mkdir $TEMP_INST
cd $TEMP_INST

Expand Down
27 changes: 15 additions & 12 deletions .github/workflows/ccpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ jobs:
id: upload-release
if: (github.repository == 'CESNET/UltraGrid' && github.ref == 'refs/heads/master') || startsWith(github.ref, 'refs/tags/')
run: |
brew install jq
brew list jq >/dev/null || brew install jq
.github/scripts/replace-asset.sh $TAG UltraGrid-$VERSION.dmg application/x-apple-diskimage macOS%20$(uname -m)%20build
- name: Upload Build
if: steps.upload-release.conclusion == 'skipped'
Expand Down Expand Up @@ -266,6 +266,20 @@ jobs:
- name: Download XIMEA
if: steps.cache-macos-ximea.outputs.cache-hit != 'true'
run: curl 'https://www.ximea.com/support/attachments/download/37/XIMEA_API_Installer.exe' -o 'C:\XIMEA_API_Installer.exe'

- name: Cache libajantv2 build
id: cache-aja
uses: actions/cache@main
with:
path: 'libajantv2'
key: cache-aja-${{ runner.os }}-${{ hashFiles('.github/scripts/install-common-deps.sh') }}
- name: Cache live555
id: cache-live555
uses: actions/cache@main
with:
path: 'live555'
key: cache-live555-${{ runner.os }}-${{ hashFiles('.github/scripts/install-common-deps.sh') }}

- name: bootsrap
run: .github/scripts/Windows/prepare.ps1
shell: pwsh -command ". '{0}'"
Expand All @@ -281,17 +295,6 @@ jobs:
shell: pwsh -command ". '{0}'"
- name: bootsrap MSYS2
run: $GITHUB_WORKSPACE/.github/scripts/Windows/prepare_msys.sh
- name: Cache live555
id: cache-live555
uses: actions/cache@main
with:
path: 'C:\live555'
key: cache-live555-${{ runner.os }}-${{ hashFiles('.github/scripts/Windows/build_live555.sh') }}
- name: Build live555
if: steps.cache-live555.outputs.cache-hit != 'true'
run: $GITHUB_WORKSPACE/.github/scripts/Windows/build_live555.sh
- name: Install live555
run: make -C /c/live555 install

- name: Cache Spout build
id: cache-spout
Expand Down
Loading

0 comments on commit 525a0f4

Please sign in to comment.