From b68d7a3054a45a608ddc188f455d0846452abc39 Mon Sep 17 00:00:00 2001 From: 21pages Date: Wed, 17 Jul 2024 22:37:05 +0800 Subject: [PATCH] fix linux armv7 ffmpeg arch, linux x64 sciter add hwcodec feature (#8744) Signed-off-by: 21pages --- .github/workflows/flutter-build.yml | 4 +++- libs/scrap/build.rs | 3 +-- res/vcpkg/ffmpeg/portfile.cmake | 11 ++++++++--- vcpkg.json | 4 ++-- 4 files changed, 14 insertions(+), 8 deletions(-) diff --git a/.github/workflows/flutter-build.yml b/.github/workflows/flutter-build.yml index d623f1332..75e21a6c0 100644 --- a/.github/workflows/flutter-build.yml +++ b/.github/workflows/flutter-build.yml @@ -1297,6 +1297,7 @@ jobs: deb_arch: amd64, sciter_arch: x64, vcpkg-triplet: x64-linux, + extra_features: ",hwcodec", } - { arch: armv7, @@ -1306,6 +1307,7 @@ jobs: deb_arch: armhf, sciter_arch: arm32, vcpkg-triplet: arm-linux, + extra_features: "", } steps: - name: Export GitHub Actions cache environment variables @@ -1436,7 +1438,7 @@ jobs: python3 ./res/inline-sciter.py export VCPKG_ROOT=/opt/artifacts/vcpkg export CARGO_INCREMENTAL=0 - cargo build --features inline --release --bins --jobs 1 + cargo build --features inline${{ matrix.job.extra_features }} --release --bins --jobs 1 # package mkdir -p ./Release mv ./target/release/rustdesk ./Release/rustdesk diff --git a/libs/scrap/build.rs b/libs/scrap/build.rs index 84b8631f3..ec5470546 100644 --- a/libs/scrap/build.rs +++ b/libs/scrap/build.rs @@ -192,6 +192,7 @@ fn gen_vcpkg_package(package: &str, ffi_header: &str, generated: &str, regex: &s fn ffmpeg() { // ffmpeg let target_os = std::env::var("CARGO_CFG_TARGET_OS").unwrap(); + let target_arch = std::env::var("CARGO_CFG_TARGET_ARCH").unwrap(); let static_libs = vec!["avcodec", "avutil", "avformat"]; static_libs.iter().for_each(|lib| { find_package(lib); @@ -201,8 +202,6 @@ fn ffmpeg() { } // os - let target_os = std::env::var("CARGO_CFG_TARGET_OS").unwrap(); - let target_arch = std::env::var("CARGO_CFG_TARGET_ARCH").unwrap(); let dyn_libs: Vec<&str> = if target_os == "windows" { ["User32", "bcrypt", "ole32", "advapi32"].to_vec() } else if target_os == "linux" { diff --git a/res/vcpkg/ffmpeg/portfile.cmake b/res/vcpkg/ffmpeg/portfile.cmake index d8ea95bd2..dc35752ff 100644 --- a/res/vcpkg/ffmpeg/portfile.cmake +++ b/res/vcpkg/ffmpeg/portfile.cmake @@ -102,6 +102,10 @@ if(VCPKG_TARGET_IS_LINUX) string(APPEND OPTIONS "\ --target-os=linux \ --enable-pthreads \ +") + if(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm") + else() + string(APPEND OPTIONS "\ --enable-cuda \ --enable-ffnvcodec \ --enable-encoder=h264_nvenc \ @@ -116,10 +120,11 @@ if(VCPKG_TARGET_IS_LINUX) --enable-encoder=h264_vaapi \ --enable-encoder=hevc_vaapi \ ") - if(VCPKG_TARGET_ARCHITECTURE STREQUAL "x64") - string(APPEND OPTIONS "\ ---enable-cuda_llvm \ + if(VCPKG_TARGET_ARCHITECTURE STREQUAL "x64") + string(APPEND OPTIONS "\ + --enable-cuda_llvm \ ") + endif() endif() elseif(VCPKG_TARGET_IS_WINDOWS) string(APPEND OPTIONS "\ diff --git a/vcpkg.json b/vcpkg.json index 6d4cbb7b2..f1d7036eb 100644 --- a/vcpkg.json +++ b/vcpkg.json @@ -69,12 +69,12 @@ "platform": "(windows & static)" } ], - "platform": "((windows | linux | osx) & static)" + "platform": "((windows | (linux & !arm32) | osx) & static)" }, { "name": "ffmpeg", "host": false, - "platform": "((android | ios) & static)" + "platform": "((android | ios | (linux & arm32)) & static)" } ], "vcpkg-configuration": {