diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d540d1e..c8a6a87 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -24,6 +24,9 @@ jobs: - name: Build vulkan run: ./scripts/build-vulkan + - name: Build libva + run: ./scripts/build-libva $PWD/3rdparty/libva -s $PWD/libva + - name: Install project dependencies run: | sudo apt-get install -y libboost-all-dev libspdlog-dev diff --git a/README.md b/README.md index f2c53f1..e55460f 100644 --- a/README.md +++ b/README.md @@ -421,6 +421,7 @@ more information. - [ ] Cross compile for raspberry pi - [ ] Segmentation fault when running --record without a camera being available. +- [ ] Fix release workflow such that it links libva correctly to static ffmpeg. - [ ] Fix issue with ffmpeg + hw acceleration on my arch machine: ``` diff --git a/cmake/Find.cmake b/cmake/Find.cmake index b1cd6d7..e032ce4 100644 --- a/cmake/Find.cmake +++ b/cmake/Find.cmake @@ -86,14 +86,25 @@ function(find_libva) set(libva_shorts va va-drm va-wayland va-x11) set(libva_longs LIBVA_LIBRARY LIBVA_DRM_LIBRARY LIBVA_WAYLAND_LIBRARY LIBVA_X11_LIBRARY) + if(LIBVA_DIR) + message(STATUS "LIBVA_DIR: ${LIBVA_DIR}") + set(find_args PATHS ${LIBVA_DIR} NO_DEFAULT_PATH) + endif() find_libdrm() - find_path(LIBVA_INCLUDE_DIR NAMES va/va.h) + find_path( + LIBVA_INCLUDE_DIR + NAMES va/va.h + PATH_SUFFIXES include ${find_args}) + message(STATUS "LIBVA_INCLUDE_DIR: ${LIBVA_INCLUDE_DIR}") foreach(libva_short ${libva_shorts}) _short2long(${libva_short}) # creates libva_long - find_library(${libva_long} NAMES ${libva_short}) + find_library( + ${libva_long} + NAMES ${libva_short} + PATH_SUFFIXES lib ${find_args}) add_library(Libva::${libva_short} UNKNOWN IMPORTED) set_target_properties( Libva::${libva_short} diff --git a/scripts/build-ffmpeg b/scripts/build-ffmpeg index fe05648..0a6b2eb 100755 --- a/scripts/build-ffmpeg +++ b/scripts/build-ffmpeg @@ -64,10 +64,12 @@ install_dependencies_apt() { install_dependencies_pacman() { echo "Installing build tools and dependencies" - sudo pacman -S --noconfirm --needed autoconf automake cmake git libass freetype2 sdl2 libtool libva libvdpau libvorbis libxcb meson ninja pkgconf texinfo wget yasm zlib gnutls libunistring aom dav1d tar + sudo pacman -S --noconfirm autoconf automake cmake git libass freetype2 sdl2 libtool libva libvdpau libvorbis libxcb meson ninja pkgconf texinfo wget yasm gnutls libunistring aom dav1d tar + sudo pacman -S --noconfirm zlib || true echo "Installing ffmpeg dependencies" - sudo pacman -S --noconfirm --needed nasm x264 x265 libvpx fdkaac opus numactl + sudo pacman -S --noconfirm nasm x264 x265 fdkaac opus numactl + sudo pacman -S --noconfirm libvpx || true } compile_libaom() { diff --git a/scripts/build-libva b/scripts/build-libva index e7b706a..43e1707 100755 --- a/scripts/build-libva +++ b/scripts/build-libva @@ -56,11 +56,11 @@ install_deps() { } install_deps_apt() { - sudo apt-get -y install git cmake pkg-config meson libdrm-dev automake libtool autogen + sudo apt-get -y install autogen automake cmake git libdrm-dev libtool libwayland-dev libx11-dev libx11-xcb-dev libx11-xcb-perl libx11-xcb1 libxcb-dri3-dev libxcb1-dev libxext-dev libxfixes-dev meson pkg-config xorg-dev } install_deps_pacman() { - sudo pacman -S --noconfirm git cmake pkg-config meson libdrm automake libtool autogen + sudo pacman -S --noconfirm git cmake pkg-config meson libdrm automake libtool autogen xorg wayland libx11-xcb libxext libxfixes } build_libva() { diff --git a/scripts/configure b/scripts/configure index f9a229d..2a5cd0e 100755 --- a/scripts/configure +++ b/scripts/configure @@ -30,6 +30,7 @@ root="$this_dir/.." patch=true qt_dir="$root/3rdparty/Qt" ffmpeg_dir="$root/3rdparty/ffmpeg" +libva_dir="$root/3rdparty/libva" build_type="Release" clean() { @@ -53,6 +54,7 @@ configure() { -DBUILD_TESTING=OFF \ -DCMAKE_BUILD_TYPE="$build_type" \ -DFFMPEG_DIR="$ffmpeg_dir" \ + -DLIBVA_DIR="$libva_dir" \ -DCMAKE_PREFIX_PATH="$qt_dir/lib/cmake" \ "$@" }