Skip to content

Commit

Permalink
Merge pull request #2 from ATrivialAtomic/wip-cmpto-j2k-cpu-conflict-…
Browse files Browse the repository at this point in the history
…resolution

Merge temp branch used to resolve remaining sync conflicts. See commit c307088 for details.
  • Loading branch information
ATrivialAtomic authored Sep 10, 2024
2 parents a7eba41 + c307088 commit 392b3b4
Show file tree
Hide file tree
Showing 166 changed files with 5,542 additions and 2,153 deletions.
4 changes: 3 additions & 1 deletion .github/scripts/Linux/arm/bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@ 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
apt -y install libdrm-dev\
libsdl2-mixer-dev libsdl2-ttf-dev\
libva-dev\

/.github/scripts/install-common-deps.sh
/.github/scripts/Linux/install_others.sh ndi pipewire ximea
Expand Down
16 changes: 5 additions & 11 deletions .github/scripts/Linux/arm/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,11 @@ export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:${PKG_CONFIG_PATH:+":$PKG_CONFIG
ARCH=$(dpkg --print-architecture)
APPNAME=UltraGrid-latest-${ARCH}.AppImage

set -- --enable-plugins --enable-openssl --enable-soxr --enable-speexdsp # general
set -- "$@" --enable-alsa --enable-jack --enable-jack-transport --enable-pipewire # audio
# vidcap (+ duplex video)
set -- "$@" --enable-decklink --enable-file --enable-ndi --enable-rtsp \
--enable-screen --enable-swmix --enable-v4l2 --enable-ximea
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
# shellcheck disable=SC2086 # intentional
set -- $FEATURES
set -- "$@" --enable-drm_disp
if [ "$ARCH" != arm64 ]; then
set -- "$@" --disable-vulkan
fi

./autogen.sh "$@"
Expand Down
4 changes: 4 additions & 0 deletions .github/scripts/Linux/download_build_ffmpeg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ install_svt() {
( git clone --depth 1 https://github.com/OpenVisualCloud/SVT-VP9.git && cd SVT-VP9/Build && cmake .. -DCMAKE_BUILD_TYPE=Release && cmake --build . --parallel && sudo cmake --install . || exit 1 )
# if patch apply fails, try increasing $FFMPEG_GIT_DEPTH
git am -3 SVT-HEVC/ffmpeg_plugin/master-*.patch
patch SVT-VP9/ffmpeg_plugin/master-*.patch < "$GITHUB_WORKSPACE/\
.github/scripts/Linux/tmp/\
master-0001-Add-ability-for-ffmpeg-to-run-svt-vp9.patch.patch"
git am -3 SVT-VP9/ffmpeg_plugin/master-*.patch
}

Expand Down Expand Up @@ -64,6 +67,7 @@ find "$GITHUB_WORKSPACE/.github/scripts/Linux/ffmpeg-patches" -name '*.patch' -p
./configure --disable-static --enable-shared --enable-gpl --enable-libx264 --enable-libx265 --enable-libopus --enable-nonfree --enable-nvenc --enable-libaom --enable-libvpx --enable-libspeex --enable-libmp3lame \
--enable-libdav1d \
--enable-libde265 \
--enable-libopenh264 \
--enable-librav1e \
--enable-libsvtav1 \
--enable-libsvthevc \
Expand Down
33 changes: 5 additions & 28 deletions .github/scripts/Linux/install_others.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,27 +20,20 @@ install_ximea() {
}

install_gpujpeg() {(
cd "$GITHUB_WORKSPACE"
./ext-deps/bootstrap_gpujpeg.sh -d
mkdir ext-deps/gpujpeg/build
cd ext-deps/gpujpeg/build
cmake -DBUILD_OPENGL=OFF ..
cmake --build . --parallel "$(nproc)"
sudo cmake --install .
curl -LO https://github.com/CESNET/GPUJPEG/releases/download/\
continuous/GPUJPEG-Linux.tar.xz
tar xaf GPUJPEG-Linux.tar.xz
sudo cp -r GPUJPEG/* /usr/local/
sudo ldconfig
)}

# Install NDI
install_ndi() {(
if [ ! -f "Install_NDI_SDK_Linux.tar.gz" ]; then # it should be already cached in a CI step
curl -L https://downloads.ndi.tv/SDK/NDI_SDK_Linux/Install_NDI_SDK_v5_Linux.tar.gz -o /var/tmp/Install_NDI_SDK_Linux.tar.gz
fi
tar -xzf Install_NDI_SDK_Linux.tar.gz
# shellcheck disable=SC2125
installer=./Install*NDI*sh
yes | PAGER="cat" $installer
sudo cp -r NDI\ SDK\ for\ Linux/include/* /usr/local/include/
sed 's/\(.*\)/\#define NDI_VERSION \"\1\"/' < 'NDI SDK for Linux/Version.txt' | sudo tee /usr/local/include/ndi_version.h
)}

# TODO: needed only for U20.04, remove after upgrading to U22.04
Expand Down Expand Up @@ -75,29 +68,13 @@ install_rav1e() {(
/usr/local/lib/pkgconfig/rav1e.pc
)}

# FFmpeg master needs at least v1.3.238 as for 23th Aug '23
install_vulkan() {(
git clone --depth 1 https://github.com/KhronosGroup/Vulkan-Headers
mkdir Vulkan-Headers/build
cd Vulkan-Headers/build
cmake ..
sudo make install
cd ../..
git clone --depth 1 https://github.com/KhronosGroup/Vulkan-Loader
mkdir Vulkan-Loader/build
cd Vulkan-Loader/build
cmake ..
cmake --build . --parallel "$(nproc)"
sudo make install
)}

show_help=
if [ $# -eq 1 ] && { [ "$1" = -h ] || [ "$1" = --help ] || [ "$1" = help ]; }; then
show_help=1
fi

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

if [ $show_help ]; then
Expand Down
12 changes: 7 additions & 5 deletions .github/scripts/Linux/prepare.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ sudo apt install libssl-dev
sudo apt install libasound-dev libcaca-dev libjack-jackd2-dev libnatpmp-dev libv4l-dev portaudio19-dev
sudo apt install libopencv-core-dev libopencv-imgproc-dev
sudo apt install libcurl4-nss-dev
sudo apt install i965-va-driver-shaders # instead of i965-va-driver
sudo apt install i965-va-driver-shaders libva-dev # instead of i965-va-driver
sudo apt-mark hold libva2
sudo apt install uuid-dev # Cineform

(
Expand All @@ -38,7 +39,7 @@ sudo apt install uuid-dev # Cineform
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-10 10
)

get_build_deps_excl() { # $2 - pattern to exclude
get_build_deps_excl() { # $2 - pattern to exclude; separate packates with '\|' (BRE alternation)
apt-cache showsrc "$1" | sed -n '/^Build-Depends:/{s/Build-Depends://;p;q}' | tr ',' '\n' | cut -f 2 -d\ | grep -v "$2"
}
sudo apt build-dep libsdl2
Expand All @@ -48,11 +49,12 @@ sdl2_ttf_build_dep=$(get_build_deps_excl libsdl2-ttf libsdl2-dev)
sudo apt install $sdl2_mix_build_dep $sdl2_ttf_build_dep

# FFmpeg deps
sudo add-apt-repository ppa:savoury1/vlc3 # new x265
sudo add-apt-repository ppa:savoury1/ffmpeg4 # openh264, new x265
# for FFmpeg - libzmq3-dev needs to be ignored (cannot be installed, see run #380)
ffmpeg_build_dep=$(get_build_deps_excl ffmpeg 'libzmq3-dev\|libsdl2-dev')
ffmpeg_build_dep=$(get_build_deps_excl ffmpeg 'libva-dev')
# shellcheck disable=SC2086 # intentional
sudo apt install $ffmpeg_build_dep libdav1d-dev libde265-dev
sudo apt install $ffmpeg_build_dep libdav1d-dev libde265-dev \
libopenh264-dev libvulkan-dev
sudo apt-get -y remove 'libavcodec*' 'libavutil*' 'libswscale*' libvpx-dev nginx

sudo apt install qtbase5-dev
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
1c1
< From bcecbfb0188680c2f4e355ad843639f6198b36da Mon Sep 17 00:00:00 2001
---
> From e8e7fe02ad0a7c1f8d125594a52d6163d489855b Mon Sep 17 00:00:00 2001
20c20
< index 71386c3920..3d3e7ba5a5 100755
---
> index 55676f742a..eb0254d5c6 100755
23c23
< @@ -292,6 +292,7 @@ External library support:
---
> @@ -293,6 +293,7 @@ External library support:
27a28
> --enable-libvvenc enable H.266/VVC encoding via vvenc [no]
30,31c31
< --enable-libx265 enable HEVC encoding via x265 [no]
< @@ -1948,6 +1949,7 @@ EXTERNAL_LIBRARY_LIST="
---
> @@ -1951,6 +1952,7 @@ EXTERNAL_LIBRARY_LIST="
39c39
< @@ -3537,6 +3539,7 @@ libvpx_vp8_decoder_deps="libvpx"
---
> @@ -3556,6 +3558,7 @@ libvpx_vp8_decoder_deps="libvpx"
43a44
> libvvenc_encoder_deps="libvvenc"
46,47c47
< libx262_encoder_deps="libx262"
< @@ -6995,6 +6998,7 @@ enabled libvpx && {
---
> @@ -6997,6 +7000,7 @@ enabled libvpx && {
51a52
> enabled libvvenc && require_pkg_config libvvenc "libvvenc >= 1.6.1" "vvenc/vvenc.h" vvenc_get_version
54d54
< enabled libwebp_anim_encoder && check_pkg_config libwebp_anim_encoder "libwebpmux >= 0.4.0" webp/mux.h WebPAnimEncoderOptionsInit; }
56c56
< index 8c8c2ce659..2a00269821 100644
---
> index ffab0a8e11..7a23165264 100644
59c59
< @@ -1149,6 +1149,7 @@ OBJS-$(CONFIG_LIBVPX_VP8_DECODER) += libvpxdec.o
---
> @@ -1150,6 +1150,7 @@ OBJS-$(CONFIG_LIBVPX_VP8_DECODER) += libvpxdec.o
63a64
> OBJS-$(CONFIG_LIBVVENC_ENCODER) += libvvenc.o
66d66
< OBJS-$(CONFIG_LIBX262_ENCODER) += libx264.o
68c68
< index 2386b450a6..58b17d4c34 100644
---
> index 59d36dbd56..89456aeec1 100644
71c71
< @@ -799,6 +799,7 @@ extern const FFCodec ff_libvpx_vp8_encoder;
---
> @@ -800,6 +800,7 @@ extern const FFCodec ff_libvpx_vp8_encoder;
75a76
> extern const FFCodec ff_libvvenc_encoder;
78d78
< extern const FFCodec ff_libwebp_encoder;
787c787
< 2.44.0
---
> 2.45.2
6 changes: 6 additions & 0 deletions .github/scripts/Windows/prepare.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,10 @@ while ($attempts -eq 10) {
echo "C:\Program Files\NDI\$sdk\Bin\x64" >> ${env:GITHUB_PATH}
#Remove-Item C:\ndi.exe

#Install vc redist 2010
$url="https://download.microsoft.com/download/1/6/5/165255E7-1014-4D0A-B094-B6A430A6BFFC/vcredist_x64.exe"
Invoke-WebRequest $url -OutFile vcredist_x64.exe
Start-Process -FilePath "vcredist_x64.exe" -ArgumentList "/install /quiet /norestart" -Wait -NoNewWindow
Remove-Item vcredist_x64.exe

# vim: set sw=2:
5 changes: 3 additions & 2 deletions .github/scripts/Windows/prepare_msys.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/usr/local/share/pkgconfig:/usr/
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\
-allow-unsupported-compiler"
-D_ALLOW_COMPILER_AND_STL_VERSION_MISMATCH -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 @@ -46,7 +46,8 @@ PACMAN_INSTALL='pacman -Sy --needed --noconfirm --disable-download-timeout'
MINGW_PACKAGE_PREFIX=mingw-w64-clang-x86_64
m=$MINGW_PACKAGE_PREFIX
$PACMAN_INSTALL automake autoconf git make pkgconf \
$m-gcc-compat $m-toolchain \
$m-clang $m-winpthreads-git \
$m-gcc-compat \
unzip zip
$PACMAN_INSTALL $m-asciidoc \
$m-ffmpeg \
Expand Down
19 changes: 15 additions & 4 deletions .github/scripts/environment.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@ export CHANNEL TAG VERSION

printf '%b' "CHANNEL=$CHANNEL\nTAG=$TAG\nVERSION=$VERSION\n" >> "$GITHUB_ENV"

## @note `uname -m` is x86_64 for Linux ARM builds, because this script is
## not called from the build chroot, so utilize GITHUB_WORKFLOW
is_arm() {
[ "$(uname -m)" = arm64 ] || [ "$GITHUB_WORKFLOW" = 'ARM builds' ]
}

export FEATURES="\
--enable-option-checking=fatal\
--with-live555=/usr/local\
Expand Down Expand Up @@ -74,9 +80,14 @@ export FEATURES="\
CUDA_FEATURES="--enable-cuda_dxt --enable-gpujpeg --enable-ldgm-gpu --enable-uyvy"
case "$RUNNER_OS" in
Linux)
FEATURES="$FEATURES $CUDA_FEATURES --enable-plugins\
--enable-alsa --enable-lavc-hw-accel-vaapi --enable-lavc-hw-accel-vdpau\
--enable-pipewire-audio --enable-v4l2"
FEATURES="$FEATURES --enable-plugins --enable-alsa \
--enable-pipewire-audio --enable-v4l2 --enable-lavc-hw-accel-vaapi"
if is_arm; then
FEATURES="$FEATURES --disable-qt"
else
FEATURES="$FEATURES $CUDA_FEATURES \
--enable-lavc-hw-accel-vdpau"
fi
;;
macOS)
FEATURES="$FEATURES --enable-avfoundation --enable-coreaudio --enable-syphon"
Expand All @@ -90,7 +101,7 @@ case "$RUNNER_OS" in
;;
esac

if [ "$(uname -s)" != Darwin ] || [ "$(uname -m)" != arm64 ]; then
if ! is_arm; then
FEATURES="$FEATURES --enable-cineform"
fi

Expand Down
33 changes: 16 additions & 17 deletions .github/scripts/install-common-deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ download_build_aja() {
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 \
-DAJANTV2_DISABLE_PLUGIN_LOAD=ON -DAJANTV2_BUILD_SHARED=ON \
-DCMAKE_BUILD_TYPE=Release -Blibajantv2/build -Slibajantv2
cmake --build libajantv2/build --config Release -j "$(nproc)"
}
Expand All @@ -50,8 +50,9 @@ install_aja() {(
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/
cd libajantv2/build/ajantv2/Release
cp ajantv2*.dll /usr/local/bin/
cp ajantv2*.lib /usr/local/lib/
else
sudo cmake --install libajantv2/build
fi
Expand All @@ -75,27 +76,25 @@ install_juice() {
)
}

download_build_live555() {
download_build_live555() {(
git clone --depth 1 https://github.com/xanview/live555/
cd live555

if is_win; then
target=mingw
./genMakefiles mingw
PATH=/usr/bin:$PATH
# ensure binutils ld is used (not lld)
pacman -Sy --noconfirm binutils
make -j "$(nproc)" CXX="c++ -DNO_GETIFADDRS -DNO_OPENSSL"
pacman -Rs --noconfirm binutils
elif [ "$(uname -s)" = Linux ]; then
target=linux-64bit
./genMakefiles linux-with-shared-libraries
make -j "$(nproc)"
else
target=macosx
./genMakefiles macosx-no-openssl
make -j "$(nproc)" CPLUSPLUS_COMPILER="c++ -std=c++11"
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
Expand Down
17 changes: 2 additions & 15 deletions .github/scripts/macOS/install_others.sh
Original file line number Diff line number Diff line change
Expand Up @@ -55,26 +55,13 @@ install_glfw() {(

# Install NDI
install_ndi() {(
# installer downloaed by cache step
installer=/private/var/tmp/Install_NDI_SDK_Apple.pkg
if [ ! -f $installer ]; then
curl -L https://downloads.ndi.tv/SDK/NDI_SDK_Mac/Install_NDI_\
SDK_v5_Apple.pkg -o /private/var/tmp/Install_NDI_SDK_Apple.pkg
fi
sudo installer -pkg $installer -target /
sudo mv /Library/NDI\ SDK\ for\ * /Library/NDI
sed 's/\(.*\)/\#define NDI_VERSION \"\1\"/' < /Library/NDI/Version.txt |
sudo tee /usr/local/include/ndi_version.h
)
NDI_LIB=/Library/NDI/lib/macOS
export CPATH=${CPATH:+"$CPATH:"}/Library/NDI/include
export DYLIBBUNDLER_FLAGS="${DYLIBBUNDLER_FLAGS:+$DYLIBBUNDLER_FLAGS }\
-s $NDI_LIB"
export LIBRARY_PATH=${LIBRARY_PATH:+"$LIBRARY_PATH:"}$NDI_LIB
export MY_DYLD_LIBRARY_PATH="${MY_DYLD_LIBRARY_PATH:+\
$MY_DYLD_LIBRARY_PATH:}$NDI_LIB"
printf '%b' "CPATH=$CPATH\nDYLIBBUNDLER_FLAGS=$DYLIBBUNDLER_FLAGS\n\
LIBRARY_PATH=$LIBRARY_PATH\nMY_DYLD_LIBRARY_PATH=$MY_DYLD_LIBRARY_PATH\n" >> \
"$GITHUB_ENV"
printf '%b' "CPATH=$CPATH\n" >> "$GITHUB_ENV"
}

install_soundfont() {(
Expand Down
2 changes: 1 addition & 1 deletion .github/scripts/macOS/prepare.sh
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ set -- \
# 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
if ! brew list "$1" 2>/dev/null; then
set -- "$@" "$1"
fi
shift # remove from the front
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ Further subsection briefly describe individual assets and how to obtain them. A
are unmodified files downloaded from vendor website. However, rename may be required.

### macOS
- **VideoMaster\_SDK\_MacOSX.zip** - VideoMaster SDK for Mac from
- **videomaster-macos-dev.zip** - VideoMaster SDK for Mac from
[DELTACAST](https://www.deltacast.tv/support/download-center)

### Windows
- **VideoMaster\_SDK\_Windows.zip** - VideoMaster SDK from DELTACAST for Windows
- **videomaster-win.x64-dev.zip** - VideoMaster SDK from DELTACAST for Windows

### Linux
**Note:** _VideoMaster SDK_ is not used because DELTACAST doesn't provide redistributable
Expand Down
Loading

0 comments on commit 392b3b4

Please sign in to comment.