From f4587c596feb022fe2e681bb7f2b8283b4f72a37 Mon Sep 17 00:00:00 2001 From: Andrea Pappacoda Date: Mon, 6 Dec 2021 18:56:43 +0100 Subject: build: update cubeb and remove the result_of comment Cubeb doesn't use result_of anymore, it has been dropped in commit mozilla/cubeb@75d9d125ee655ef80f3bfcd97ae5a805931042b8 --- externals/cubeb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'externals') diff --git a/externals/cubeb b/externals/cubeb index 1d66483ad..75d9d125e 160000 --- a/externals/cubeb +++ b/externals/cubeb @@ -1 +1 @@ -Subproject commit 1d66483ad2b93f0e00e175f9480c771af90003a7 +Subproject commit 75d9d125ee655ef80f3bfcd97ae5a805931042b8 -- cgit v1.2.3 From 133504b74b73d5d1f29f59a6ca1bc0f2d2f2a037 Mon Sep 17 00:00:00 2001 From: Narr the Reg Date: Wed, 1 Dec 2021 14:45:00 -0600 Subject: input_common: Update SDL to 2.0.18 --- externals/SDL | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'externals') diff --git a/externals/SDL b/externals/SDL index 25f9ed87f..2e9821423 160000 --- a/externals/SDL +++ b/externals/SDL @@ -1 +1 @@ -Subproject commit 25f9ed87ff6947d9576fc9d79dee0784e638ac58 +Subproject commit 2e9821423a237a1206e3c09020778faacfe430be -- cgit v1.2.3 From eec9aace6091bb8441ad4420b8c7cd9d623fc792 Mon Sep 17 00:00:00 2001 From: Andrea Pappacoda Date: Fri, 10 Dec 2021 12:25:04 +0100 Subject: build: remove remaining bits of Unicorn Unicorn has been removed in fc6db97a09e2de5eff10131ddcab9cf8fb2f736c --- externals/CMakeLists.txt | 4 ---- externals/find-modules/FindUnicorn.cmake | 18 ------------------ 2 files changed, 22 deletions(-) delete mode 100644 externals/find-modules/FindUnicorn.cmake (limited to 'externals') diff --git a/externals/CMakeLists.txt b/externals/CMakeLists.txt index a76a3d800..64d1e6aec 100644 --- a/externals/CMakeLists.txt +++ b/externals/CMakeLists.txt @@ -44,10 +44,6 @@ target_include_directories(mbedtls PUBLIC ./mbedtls/include) add_library(microprofile INTERFACE) target_include_directories(microprofile INTERFACE ./microprofile) -# Unicorn -add_library(unicorn-headers INTERFACE) -target_include_directories(unicorn-headers INTERFACE ./unicorn/include) - # libusb if (NOT LIBUSB_FOUND OR YUZU_USE_BUNDLED_LIBUSB) add_subdirectory(libusb) diff --git a/externals/find-modules/FindUnicorn.cmake b/externals/find-modules/FindUnicorn.cmake deleted file mode 100644 index a0f2a71f6..000000000 --- a/externals/find-modules/FindUnicorn.cmake +++ /dev/null @@ -1,18 +0,0 @@ -# Exports: -# LIBUNICORN_FOUND -# LIBUNICORN_INCLUDE_DIR -# LIBUNICORN_LIBRARY - -find_path(LIBUNICORN_INCLUDE_DIR - unicorn/unicorn.h - HINTS $ENV{UNICORNDIR} - PATH_SUFFIXES include) - -find_library(LIBUNICORN_LIBRARY - NAMES unicorn - HINTS $ENV{UNICORNDIR}) - -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(unicorn DEFAULT_MSG - LIBUNICORN_LIBRARY LIBUNICORN_INCLUDE_DIR) -mark_as_advanced(LIBUNICORN_INCLUDE_DIR LIBUNICORN_LIBRARY) -- cgit v1.2.3 From f91b6fbbcb56870f912540550c9517800c152a46 Mon Sep 17 00:00:00 2001 From: liushuyu Date: Fri, 10 Dec 2021 21:26:43 -0700 Subject: ffmpeg: move the whole tree into externals/ffmpeg/ffmpeg ... * this resolves the todo items in the CMakeLists.txt * a version requirement check for ffmpeg is added to catch issues early * for future-proof reasons, nasm/yasm is now only required when build on x86/AMD64 systems --- externals/CMakeLists.txt | 5 + externals/ffmpeg | 1 - externals/ffmpeg/CMakeLists.txt | 209 ++++++++++++++++++++++++++++++++++++++++ externals/ffmpeg/ffmpeg | 1 + 4 files changed, 215 insertions(+), 1 deletion(-) delete mode 160000 externals/ffmpeg create mode 100644 externals/ffmpeg/CMakeLists.txt create mode 160000 externals/ffmpeg/ffmpeg (limited to 'externals') diff --git a/externals/CMakeLists.txt b/externals/CMakeLists.txt index 64d1e6aec..bbbe6667d 100644 --- a/externals/CMakeLists.txt +++ b/externals/CMakeLists.txt @@ -121,3 +121,8 @@ if (NOT opus_FOUND) message(STATUS "opus 1.3 or newer not found, falling back to externals") add_subdirectory(opus EXCLUDE_FROM_ALL) endif() + +# FFMpeg +if (YUZU_USE_BUNDLED_FFMPEG) + add_subdirectory(ffmpeg) +endif() diff --git a/externals/ffmpeg b/externals/ffmpeg deleted file mode 160000 index 79e8d1702..000000000 --- a/externals/ffmpeg +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 79e8d17024e6c6328a40fcee191ffd70798a9c6e diff --git a/externals/ffmpeg/CMakeLists.txt b/externals/ffmpeg/CMakeLists.txt new file mode 100644 index 000000000..63896edd5 --- /dev/null +++ b/externals/ffmpeg/CMakeLists.txt @@ -0,0 +1,209 @@ +if (NOT WIN32) + # Build FFmpeg from externals + message(STATUS "Using FFmpeg from externals") + + if (CMAKE_SYSTEM_PROCESSOR MATCHES "(x86_64|amd64)") + # FFmpeg has source that requires one of nasm or yasm to assemble it. + # REQUIRED throws an error if not found here during configuration rather than during compilation. + find_program(ASSEMBLER NAMES nasm yasm) + if ("${ASSEMBLER}" STREQUAL "ASSEMBLER-NOTFOUND") + message(FATAL_ERROR "One of either `nasm` or `yasm` not found but is required.") + endif() + endif() + + find_program(AUTOCONF autoconf) + if ("${AUTOCONF}" STREQUAL "AUTOCONF-NOTFOUND") + message(FATAL_ERROR "Required program `autoconf` not found.") + endif() + + set(FFmpeg_PREFIX ${PROJECT_SOURCE_DIR}/externals/ffmpeg/ffmpeg) + set(FFmpeg_BUILD_DIR ${PROJECT_BINARY_DIR}/externals/ffmpeg) + set(FFmpeg_MAKEFILE ${FFmpeg_BUILD_DIR}/Makefile) + make_directory(${FFmpeg_BUILD_DIR}) + + # Read version string from external + file(READ ${FFmpeg_PREFIX}/RELEASE FFmpeg_VERSION) + set(FFmpeg_FOUND NO) + if (NOT FFmpeg_VERSION STREQUAL "") + set(FFmpeg_FOUND YES) + endif() + + unset(FFmpeg_LIBRARIES CACHE) + foreach(COMPONENT ${FFmpeg_COMPONENTS}) + set(FFmpeg_${COMPONENT}_PREFIX "${FFmpeg_BUILD_DIR}/lib${COMPONENT}") + set(FFmpeg_${COMPONENT}_LIB_NAME "lib${COMPONENT}.a") + set(FFmpeg_${COMPONENT}_LIBRARY "${FFmpeg_${COMPONENT}_PREFIX}/${FFmpeg_${COMPONENT}_LIB_NAME}") + + set(FFmpeg_LIBRARIES + ${FFmpeg_LIBRARIES} + ${FFmpeg_${COMPONENT}_LIBRARY} + CACHE PATH "Paths to FFmpeg libraries" FORCE) + endforeach() + + Include(FindPkgConfig REQUIRED) + pkg_check_modules(LIBVA libva) + pkg_check_modules(CUDA cuda) + pkg_check_modules(FFNVCODEC ffnvcodec) + pkg_check_modules(VDPAU vdpau) + + set(FFmpeg_HWACCEL_LIBRARIES) + set(FFmpeg_HWACCEL_FLAGS) + set(FFmpeg_HWACCEL_INCLUDE_DIRS) + set(FFmpeg_HWACCEL_LDFLAGS) + + if(LIBVA_FOUND) + pkg_check_modules(LIBDRM libdrm REQUIRED) + find_package(X11 REQUIRED) + pkg_check_modules(LIBVA-DRM libva-drm REQUIRED) + pkg_check_modules(LIBVA-X11 libva-x11 REQUIRED) + list(APPEND FFmpeg_HWACCEL_LIBRARIES + ${LIBDRM_LIBRARIES} + ${X11_LIBRARIES} + ${LIBVA-DRM_LIBRARIES} + ${LIBVA-X11_LIBRARIES} + ${LIBVA_LIBRARIES}) + set(FFmpeg_HWACCEL_FLAGS + --enable-hwaccel=h264_vaapi + --enable-hwaccel=vp8_vaapi + --enable-hwaccel=vp9_vaapi + --enable-libdrm) + list(APPEND FFmpeg_HWACCEL_INCLUDE_DIRS + ${LIBDRM_INCLUDE_DIRS} + ${X11_INCLUDE_DIRS} + ${LIBVA-DRM_INCLUDE_DIRS} + ${LIBVA-X11_INCLUDE_DIRS} + ${LIBVA_INCLUDE_DIRS} + ) + message(STATUS "VA-API found") + else() + set(FFmpeg_HWACCEL_FLAGS --disable-vaapi) + endif() + + if (FFNVCODEC_FOUND) + list(APPEND FFmpeg_HWACCEL_FLAGS + --enable-cuvid + --enable-ffnvcodec + --enable-nvdec + --enable-hwaccel=h264_nvdec + --enable-hwaccel=vp8_nvdec + --enable-hwaccel=vp9_nvdec + ) + list(APPEND FFmpeg_HWACCEL_LIBRARIES ${FFNVCODEC_LIBRARIES}) + list(APPEND FFmpeg_HWACCEL_INCLUDE_DIRS ${FFNVCODEC_INCLUDE_DIRS}) + list(APPEND FFmpeg_HWACCEL_LDFLAGS ${FFNVCODEC_LDFLAGS}) + message(STATUS "ffnvcodec libraries version ${FFNVCODEC_VERSION} found") + # ffnvenc could load CUDA libraries at the runtime using dlopen/dlsym or LoadLibrary/GetProcAddress + # here we handle the hard-linking senario where CUDA is linked during compilation + if (CUDA_FOUND) + list(APPEND FFmpeg_HWACCEL_FLAGS --extra-cflags=-I${CUDA_INCLUDE_DIRS}) + list(APPEND FFmpeg_HWACCEL_LIBRARIES ${CUDA_LIBRARIES}) + list(APPEND FFmpeg_HWACCEL_INCLUDE_DIRS ${CUDA_INCLUDE_DIRS}) + list(APPEND FFmpeg_HWACCEL_LDFLAGS ${CUDA_LDFLAGS}) + message(STATUS "CUDA libraries found, hard-linking will be performed") + endif(CUDA_FOUND) + endif() + + if (VDPAU_FOUND) + list(APPEND FFmpeg_HWACCEL_FLAGS + --enable-vdpau + --enable-hwaccel=h264_vdpau + --enable-hwaccel=vp9_vdpau + ) + list(APPEND FFmpeg_HWACCEL_LIBRARIES ${VDPAU_LIBRARIES}) + list(APPEND FFmpeg_HWACCEL_INCLUDE_DIRS ${VDPAU_INCLUDE_DIRS}) + list(APPEND FFmpeg_HWACCEL_LDFLAGS ${VDPAU_LDFLAGS}) + message(STATUS "vdpau libraries version ${VDPAU_VERSION} found") + else() + list(APPEND FFmpeg_HWACCEL_FLAGS --disable-vdpau) + endif() + + # `configure` parameters builds only exactly what yuzu needs from FFmpeg + # `--disable-vdpau` is needed to avoid linking issues + add_custom_command( + OUTPUT + ${FFmpeg_MAKEFILE} + COMMAND + /bin/bash ${FFmpeg_PREFIX}/configure + --disable-avdevice + --disable-avfilter + --disable-avformat + --disable-doc + --disable-everything + --disable-ffmpeg + --disable-ffprobe + --disable-network + --disable-postproc + --disable-swresample + --enable-decoder=h264 + --enable-decoder=vp8 + --enable-decoder=vp9 + --cc="${CMAKE_C_COMPILER}" + --cxx="${CMAKE_CXX_COMPILER}" + ${FFmpeg_HWACCEL_FLAGS} + WORKING_DIRECTORY + ${FFmpeg_BUILD_DIR} + ) + unset(FFmpeg_HWACCEL_FLAGS) + + # Workaround for Ubuntu 18.04's older version of make not being able to call make as a child + # with context of the jobserver. Also helps ninja users. + execute_process( + COMMAND + nproc + OUTPUT_VARIABLE + SYSTEM_THREADS) + + set(FFmpeg_BUILD_LIBRARIES ${FFmpeg_LIBRARIES}) + add_custom_command( + OUTPUT + ${FFmpeg_BUILD_LIBRARIES} + COMMAND + make -j${SYSTEM_THREADS} + WORKING_DIRECTORY + ${FFmpeg_BUILD_DIR} + ) + + set(FFmpeg_INCLUDE_DIR + "${FFmpeg_PREFIX};${FFmpeg_BUILD_DIR};${FFmpeg_HWACCEL_INCLUDE_DIRS}" + CACHE PATH "Path to FFmpeg headers" FORCE) + + set(FFmpeg_LDFLAGS + "${FFmpeg_HWACCEL_LDFLAGS}" + CACHE STRING "FFmpeg linker flags" FORCE) + + # ALL makes this custom target build every time + # but it won't actually build if the DEPENDS parameter is up to date + add_custom_target(ffmpeg-configure ALL DEPENDS ${FFmpeg_MAKEFILE}) + add_custom_target(ffmpeg-build ALL DEPENDS ${FFmpeg_BUILD_LIBRARIES} ffmpeg-configure) + link_libraries(${FFmpeg_LIBVA_LIBRARIES}) + set(FFmpeg_LIBRARIES ${FFmpeg_BUILD_LIBRARIES} ${FFmpeg_HWACCEL_LIBRARIES} + CACHE PATH "Paths to FFmpeg libraries" FORCE) + unset(FFmpeg_BUILD_LIBRARIES) + unset(FFmpeg_HWACCEL_FLAGS) + unset(FFmpeg_HWACCEL_INCLUDE_DIRS) + unset(FFmpeg_HWACCEL_LDFLAGS) + unset(FFmpeg_HWACCEL_LIBRARIES) + + if (FFmpeg_FOUND) + message(STATUS "Found FFmpeg version ${FFmpeg_VERSION}") + else() + message(FATAL_ERROR "FFmpeg not found") + endif() +else(WIN32) + # Use yuzu FFmpeg binaries + set(FFmpeg_EXT_NAME "ffmpeg-4.4") + set(FFmpeg_PATH "${CMAKE_BINARY_DIR}/externals/${FFmpeg_EXT_NAME}") + download_bundled_external("ffmpeg/" ${FFmpeg_EXT_NAME} "") + set(FFmpeg_FOUND YES) + set(FFmpeg_INCLUDE_DIR "${FFmpeg_PATH}/include" CACHE PATH "Path to FFmpeg headers" FORCE) + set(FFmpeg_LIBRARY_DIR "${FFmpeg_PATH}/bin" CACHE PATH "Path to FFmpeg library directory" FORCE) + set(FFmpeg_LDFLAGS "" CACHE STRING "FFmpeg linker flags" FORCE) + set(FFmpeg_DLL_DIR "${FFmpeg_PATH}/bin" CACHE PATH "Path to FFmpeg dll's" FORCE) + set(FFmpeg_LIBRARIES + ${FFmpeg_LIBRARY_DIR}/swscale.lib + ${FFmpeg_LIBRARY_DIR}/avcodec.lib + ${FFmpeg_LIBRARY_DIR}/avutil.lib + CACHE PATH "Paths to FFmpeg libraries" FORCE) +endif(WIN32) + +unset(FFmpeg_COMPONENTS) diff --git a/externals/ffmpeg/ffmpeg b/externals/ffmpeg/ffmpeg new file mode 160000 index 000000000..dc91b913b --- /dev/null +++ b/externals/ffmpeg/ffmpeg @@ -0,0 +1 @@ +Subproject commit dc91b913b6260e85e1304c74ff7bb3c22a8c9fb1 -- cgit v1.2.3 From dd72e4dce4641498bd7e73f09afd7d90961c435d Mon Sep 17 00:00:00 2001 From: liushuyu Date: Sun, 12 Dec 2021 18:28:52 -0700 Subject: CI: fix CI on Linux --- externals/ffmpeg/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'externals') diff --git a/externals/ffmpeg/CMakeLists.txt b/externals/ffmpeg/CMakeLists.txt index 63896edd5..7da89d2c5 100644 --- a/externals/ffmpeg/CMakeLists.txt +++ b/externals/ffmpeg/CMakeLists.txt @@ -17,7 +17,7 @@ if (NOT WIN32) endif() set(FFmpeg_PREFIX ${PROJECT_SOURCE_DIR}/externals/ffmpeg/ffmpeg) - set(FFmpeg_BUILD_DIR ${PROJECT_BINARY_DIR}/externals/ffmpeg) + set(FFmpeg_BUILD_DIR ${PROJECT_BINARY_DIR}/externals/ffmpeg-build) set(FFmpeg_MAKEFILE ${FFmpeg_BUILD_DIR}/Makefile) make_directory(${FFmpeg_BUILD_DIR}) -- cgit v1.2.3 From 2f32133ad5e13503c56bc5c910407a27cc23908b Mon Sep 17 00:00:00 2001 From: bunnei Date: Wed, 15 Dec 2021 00:02:53 -0800 Subject: Revert "video_core/codecs: refactor ffmpeg searching and handling in cmake" --- externals/CMakeLists.txt | 5 - externals/ffmpeg | 1 + externals/ffmpeg/CMakeLists.txt | 209 ---------------------------------------- externals/ffmpeg/ffmpeg | 1 - 4 files changed, 1 insertion(+), 215 deletions(-) create mode 160000 externals/ffmpeg delete mode 100644 externals/ffmpeg/CMakeLists.txt delete mode 160000 externals/ffmpeg/ffmpeg (limited to 'externals') diff --git a/externals/CMakeLists.txt b/externals/CMakeLists.txt index bbbe6667d..64d1e6aec 100644 --- a/externals/CMakeLists.txt +++ b/externals/CMakeLists.txt @@ -121,8 +121,3 @@ if (NOT opus_FOUND) message(STATUS "opus 1.3 or newer not found, falling back to externals") add_subdirectory(opus EXCLUDE_FROM_ALL) endif() - -# FFMpeg -if (YUZU_USE_BUNDLED_FFMPEG) - add_subdirectory(ffmpeg) -endif() diff --git a/externals/ffmpeg b/externals/ffmpeg new file mode 160000 index 000000000..79e8d1702 --- /dev/null +++ b/externals/ffmpeg @@ -0,0 +1 @@ +Subproject commit 79e8d17024e6c6328a40fcee191ffd70798a9c6e diff --git a/externals/ffmpeg/CMakeLists.txt b/externals/ffmpeg/CMakeLists.txt deleted file mode 100644 index 7da89d2c5..000000000 --- a/externals/ffmpeg/CMakeLists.txt +++ /dev/null @@ -1,209 +0,0 @@ -if (NOT WIN32) - # Build FFmpeg from externals - message(STATUS "Using FFmpeg from externals") - - if (CMAKE_SYSTEM_PROCESSOR MATCHES "(x86_64|amd64)") - # FFmpeg has source that requires one of nasm or yasm to assemble it. - # REQUIRED throws an error if not found here during configuration rather than during compilation. - find_program(ASSEMBLER NAMES nasm yasm) - if ("${ASSEMBLER}" STREQUAL "ASSEMBLER-NOTFOUND") - message(FATAL_ERROR "One of either `nasm` or `yasm` not found but is required.") - endif() - endif() - - find_program(AUTOCONF autoconf) - if ("${AUTOCONF}" STREQUAL "AUTOCONF-NOTFOUND") - message(FATAL_ERROR "Required program `autoconf` not found.") - endif() - - set(FFmpeg_PREFIX ${PROJECT_SOURCE_DIR}/externals/ffmpeg/ffmpeg) - set(FFmpeg_BUILD_DIR ${PROJECT_BINARY_DIR}/externals/ffmpeg-build) - set(FFmpeg_MAKEFILE ${FFmpeg_BUILD_DIR}/Makefile) - make_directory(${FFmpeg_BUILD_DIR}) - - # Read version string from external - file(READ ${FFmpeg_PREFIX}/RELEASE FFmpeg_VERSION) - set(FFmpeg_FOUND NO) - if (NOT FFmpeg_VERSION STREQUAL "") - set(FFmpeg_FOUND YES) - endif() - - unset(FFmpeg_LIBRARIES CACHE) - foreach(COMPONENT ${FFmpeg_COMPONENTS}) - set(FFmpeg_${COMPONENT}_PREFIX "${FFmpeg_BUILD_DIR}/lib${COMPONENT}") - set(FFmpeg_${COMPONENT}_LIB_NAME "lib${COMPONENT}.a") - set(FFmpeg_${COMPONENT}_LIBRARY "${FFmpeg_${COMPONENT}_PREFIX}/${FFmpeg_${COMPONENT}_LIB_NAME}") - - set(FFmpeg_LIBRARIES - ${FFmpeg_LIBRARIES} - ${FFmpeg_${COMPONENT}_LIBRARY} - CACHE PATH "Paths to FFmpeg libraries" FORCE) - endforeach() - - Include(FindPkgConfig REQUIRED) - pkg_check_modules(LIBVA libva) - pkg_check_modules(CUDA cuda) - pkg_check_modules(FFNVCODEC ffnvcodec) - pkg_check_modules(VDPAU vdpau) - - set(FFmpeg_HWACCEL_LIBRARIES) - set(FFmpeg_HWACCEL_FLAGS) - set(FFmpeg_HWACCEL_INCLUDE_DIRS) - set(FFmpeg_HWACCEL_LDFLAGS) - - if(LIBVA_FOUND) - pkg_check_modules(LIBDRM libdrm REQUIRED) - find_package(X11 REQUIRED) - pkg_check_modules(LIBVA-DRM libva-drm REQUIRED) - pkg_check_modules(LIBVA-X11 libva-x11 REQUIRED) - list(APPEND FFmpeg_HWACCEL_LIBRARIES - ${LIBDRM_LIBRARIES} - ${X11_LIBRARIES} - ${LIBVA-DRM_LIBRARIES} - ${LIBVA-X11_LIBRARIES} - ${LIBVA_LIBRARIES}) - set(FFmpeg_HWACCEL_FLAGS - --enable-hwaccel=h264_vaapi - --enable-hwaccel=vp8_vaapi - --enable-hwaccel=vp9_vaapi - --enable-libdrm) - list(APPEND FFmpeg_HWACCEL_INCLUDE_DIRS - ${LIBDRM_INCLUDE_DIRS} - ${X11_INCLUDE_DIRS} - ${LIBVA-DRM_INCLUDE_DIRS} - ${LIBVA-X11_INCLUDE_DIRS} - ${LIBVA_INCLUDE_DIRS} - ) - message(STATUS "VA-API found") - else() - set(FFmpeg_HWACCEL_FLAGS --disable-vaapi) - endif() - - if (FFNVCODEC_FOUND) - list(APPEND FFmpeg_HWACCEL_FLAGS - --enable-cuvid - --enable-ffnvcodec - --enable-nvdec - --enable-hwaccel=h264_nvdec - --enable-hwaccel=vp8_nvdec - --enable-hwaccel=vp9_nvdec - ) - list(APPEND FFmpeg_HWACCEL_LIBRARIES ${FFNVCODEC_LIBRARIES}) - list(APPEND FFmpeg_HWACCEL_INCLUDE_DIRS ${FFNVCODEC_INCLUDE_DIRS}) - list(APPEND FFmpeg_HWACCEL_LDFLAGS ${FFNVCODEC_LDFLAGS}) - message(STATUS "ffnvcodec libraries version ${FFNVCODEC_VERSION} found") - # ffnvenc could load CUDA libraries at the runtime using dlopen/dlsym or LoadLibrary/GetProcAddress - # here we handle the hard-linking senario where CUDA is linked during compilation - if (CUDA_FOUND) - list(APPEND FFmpeg_HWACCEL_FLAGS --extra-cflags=-I${CUDA_INCLUDE_DIRS}) - list(APPEND FFmpeg_HWACCEL_LIBRARIES ${CUDA_LIBRARIES}) - list(APPEND FFmpeg_HWACCEL_INCLUDE_DIRS ${CUDA_INCLUDE_DIRS}) - list(APPEND FFmpeg_HWACCEL_LDFLAGS ${CUDA_LDFLAGS}) - message(STATUS "CUDA libraries found, hard-linking will be performed") - endif(CUDA_FOUND) - endif() - - if (VDPAU_FOUND) - list(APPEND FFmpeg_HWACCEL_FLAGS - --enable-vdpau - --enable-hwaccel=h264_vdpau - --enable-hwaccel=vp9_vdpau - ) - list(APPEND FFmpeg_HWACCEL_LIBRARIES ${VDPAU_LIBRARIES}) - list(APPEND FFmpeg_HWACCEL_INCLUDE_DIRS ${VDPAU_INCLUDE_DIRS}) - list(APPEND FFmpeg_HWACCEL_LDFLAGS ${VDPAU_LDFLAGS}) - message(STATUS "vdpau libraries version ${VDPAU_VERSION} found") - else() - list(APPEND FFmpeg_HWACCEL_FLAGS --disable-vdpau) - endif() - - # `configure` parameters builds only exactly what yuzu needs from FFmpeg - # `--disable-vdpau` is needed to avoid linking issues - add_custom_command( - OUTPUT - ${FFmpeg_MAKEFILE} - COMMAND - /bin/bash ${FFmpeg_PREFIX}/configure - --disable-avdevice - --disable-avfilter - --disable-avformat - --disable-doc - --disable-everything - --disable-ffmpeg - --disable-ffprobe - --disable-network - --disable-postproc - --disable-swresample - --enable-decoder=h264 - --enable-decoder=vp8 - --enable-decoder=vp9 - --cc="${CMAKE_C_COMPILER}" - --cxx="${CMAKE_CXX_COMPILER}" - ${FFmpeg_HWACCEL_FLAGS} - WORKING_DIRECTORY - ${FFmpeg_BUILD_DIR} - ) - unset(FFmpeg_HWACCEL_FLAGS) - - # Workaround for Ubuntu 18.04's older version of make not being able to call make as a child - # with context of the jobserver. Also helps ninja users. - execute_process( - COMMAND - nproc - OUTPUT_VARIABLE - SYSTEM_THREADS) - - set(FFmpeg_BUILD_LIBRARIES ${FFmpeg_LIBRARIES}) - add_custom_command( - OUTPUT - ${FFmpeg_BUILD_LIBRARIES} - COMMAND - make -j${SYSTEM_THREADS} - WORKING_DIRECTORY - ${FFmpeg_BUILD_DIR} - ) - - set(FFmpeg_INCLUDE_DIR - "${FFmpeg_PREFIX};${FFmpeg_BUILD_DIR};${FFmpeg_HWACCEL_INCLUDE_DIRS}" - CACHE PATH "Path to FFmpeg headers" FORCE) - - set(FFmpeg_LDFLAGS - "${FFmpeg_HWACCEL_LDFLAGS}" - CACHE STRING "FFmpeg linker flags" FORCE) - - # ALL makes this custom target build every time - # but it won't actually build if the DEPENDS parameter is up to date - add_custom_target(ffmpeg-configure ALL DEPENDS ${FFmpeg_MAKEFILE}) - add_custom_target(ffmpeg-build ALL DEPENDS ${FFmpeg_BUILD_LIBRARIES} ffmpeg-configure) - link_libraries(${FFmpeg_LIBVA_LIBRARIES}) - set(FFmpeg_LIBRARIES ${FFmpeg_BUILD_LIBRARIES} ${FFmpeg_HWACCEL_LIBRARIES} - CACHE PATH "Paths to FFmpeg libraries" FORCE) - unset(FFmpeg_BUILD_LIBRARIES) - unset(FFmpeg_HWACCEL_FLAGS) - unset(FFmpeg_HWACCEL_INCLUDE_DIRS) - unset(FFmpeg_HWACCEL_LDFLAGS) - unset(FFmpeg_HWACCEL_LIBRARIES) - - if (FFmpeg_FOUND) - message(STATUS "Found FFmpeg version ${FFmpeg_VERSION}") - else() - message(FATAL_ERROR "FFmpeg not found") - endif() -else(WIN32) - # Use yuzu FFmpeg binaries - set(FFmpeg_EXT_NAME "ffmpeg-4.4") - set(FFmpeg_PATH "${CMAKE_BINARY_DIR}/externals/${FFmpeg_EXT_NAME}") - download_bundled_external("ffmpeg/" ${FFmpeg_EXT_NAME} "") - set(FFmpeg_FOUND YES) - set(FFmpeg_INCLUDE_DIR "${FFmpeg_PATH}/include" CACHE PATH "Path to FFmpeg headers" FORCE) - set(FFmpeg_LIBRARY_DIR "${FFmpeg_PATH}/bin" CACHE PATH "Path to FFmpeg library directory" FORCE) - set(FFmpeg_LDFLAGS "" CACHE STRING "FFmpeg linker flags" FORCE) - set(FFmpeg_DLL_DIR "${FFmpeg_PATH}/bin" CACHE PATH "Path to FFmpeg dll's" FORCE) - set(FFmpeg_LIBRARIES - ${FFmpeg_LIBRARY_DIR}/swscale.lib - ${FFmpeg_LIBRARY_DIR}/avcodec.lib - ${FFmpeg_LIBRARY_DIR}/avutil.lib - CACHE PATH "Paths to FFmpeg libraries" FORCE) -endif(WIN32) - -unset(FFmpeg_COMPONENTS) diff --git a/externals/ffmpeg/ffmpeg b/externals/ffmpeg/ffmpeg deleted file mode 160000 index dc91b913b..000000000 --- a/externals/ffmpeg/ffmpeg +++ /dev/null @@ -1 +0,0 @@ -Subproject commit dc91b913b6260e85e1304c74ff7bb3c22a8c9fb1 -- cgit v1.2.3