Dynamically load cuda/nvenc

This commit is contained in:
Patrick Nicolas
2024-03-30 23:07:52 +01:00
parent 01f74270c8
commit b5202567bd
10 changed files with 2620 additions and 31 deletions
+1 -12
View File
@@ -31,7 +31,7 @@ option(WIVRN_BUILD_CLIENT "Build WiVRn client" OFF)
option(WIVRN_BUILD_SERVER "Build WiVRn server" ON)
option(WIVRN_BUILD_DISSECTOR "Build Wireshark dissector" OFF)
auto_option(WIVRN_USE_NVENC "Enable nvenc (Nvidia) hardware encoder" AUTO)
option(WIVRN_USE_NVENC "Enable nvenc (Nvidia) hardware encoder" ON)
auto_option(WIVRN_USE_VAAPI "Enable vaapi (AMD/Intel) hardware encoder" AUTO)
auto_option(WIVRN_USE_X264 "Enable x264 software encoder" AUTO)
@@ -72,17 +72,6 @@ if (WIVRN_BUILD_SERVER)
message(FATAL_ERROR "No encoder selected, use at least one of WIVRN_USE_NVENC, WIVRN_USE_VAAPI or WIVRN_USE_X264")
endif()
if (WIVRN_USE_NVENC STREQUAL "AUTO")
find_package(CUDAToolkit)
if (CUDAToolkit_FOUND)
set(WIVRN_USE_NVENC ON)
else()
set(WIVRN_USE_NVENC OFF)
endif()
elseif(WIVRN_USE_NVENC)
find_package(CUDAToolkit REQUIRED)
endif()
if (WIVRN_USE_VAAPI STREQUAL "AUTO")
pkg_check_modules(LIBAV IMPORTED_TARGET libavcodec libavutil libswscale libavfilter)
pkg_check_modules(LIBDRM IMPORTED_TARGET libdrm)