summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitmodules6
-rw-r--r--CMakeLists.txt213
-rw-r--r--externals/CMakeLists.txt5
m---------externals/ffmpeg0
-rw-r--r--externals/ffmpeg/CMakeLists.txt209
m---------externals/ffmpeg/ffmpeg0
6 files changed, 217 insertions, 216 deletions
diff --git a/.gitmodules b/.gitmodules
index dc6ed500f..a9cf9a24a 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -34,12 +34,12 @@
34[submodule "opus"] 34[submodule "opus"]
35 path = externals/opus/opus 35 path = externals/opus/opus
36 url = https://github.com/xiph/opus.git 36 url = https://github.com/xiph/opus.git
37[submodule "ffmpeg"]
38 path = externals/ffmpeg
39 url = https://git.ffmpeg.org/ffmpeg.git
40[submodule "SDL"] 37[submodule "SDL"]
41 path = externals/SDL 38 path = externals/SDL
42 url = https://github.com/libsdl-org/SDL.git 39 url = https://github.com/libsdl-org/SDL.git
43[submodule "externals/cpp-httplib"] 40[submodule "externals/cpp-httplib"]
44 path = externals/cpp-httplib 41 path = externals/cpp-httplib
45 url = https://github.com/yhirose/cpp-httplib.git 42 url = https://github.com/yhirose/cpp-httplib.git
43[submodule "externals/ffmpeg/ffmpeg"]
44 path = externals/ffmpeg/ffmpeg
45 url = https://git.ffmpeg.org/ffmpeg.git
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 34ba67993..18d553f4d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -532,219 +532,6 @@ if (NOT YUZU_USE_BUNDLED_FFMPEG)
532 endif() 532 endif()
533endif() 533endif()
534 534
535if (YUZU_USE_BUNDLED_FFMPEG)
536 if (NOT WIN32)
537 # TODO(lat9nq): Move this to externals/ffmpeg/CMakeLists.txt (and move externals/ffmpeg to
538 # externals/ffmpeg/ffmpeg)
539
540 # Build FFmpeg from externals
541 message(STATUS "Using FFmpeg from externals")
542
543 # FFmpeg has source that requires one of nasm or yasm to assemble it.
544 # REQUIRED throws an error if not found here during configuration rather than during compilation.
545 find_program(ASSEMBLER NAMES nasm yasm)
546 if ("${ASSEMBLER}" STREQUAL "ASSEMBLER-NOTFOUND")
547 message(FATAL_ERROR "One of either `nasm` or `yasm` not found but is required.")
548 endif()
549
550 find_program(AUTOCONF autoconf)
551 if ("${AUTOCONF}" STREQUAL "AUTOCONF-NOTFOUND")
552 message(FATAL_ERROR "Required program `autoconf` not found.")
553 endif()
554
555 set(FFmpeg_PREFIX ${PROJECT_SOURCE_DIR}/externals/ffmpeg)
556 set(FFmpeg_BUILD_DIR ${PROJECT_BINARY_DIR}/externals/ffmpeg)
557 set(FFmpeg_MAKEFILE ${FFmpeg_BUILD_DIR}/Makefile)
558 make_directory(${FFmpeg_BUILD_DIR})
559
560 # Read version string from external
561 file(READ ${FFmpeg_PREFIX}/RELEASE FFmpeg_VERSION)
562 set(FFmpeg_FOUND NO)
563 if (NOT FFmpeg_VERSION STREQUAL "")
564 set(FFmpeg_FOUND YES)
565 endif()
566
567 unset(FFmpeg_LIBRARIES CACHE)
568 foreach(COMPONENT ${FFmpeg_COMPONENTS})
569 set(FFmpeg_${COMPONENT}_PREFIX "${FFmpeg_BUILD_DIR}/lib${COMPONENT}")
570 set(FFmpeg_${COMPONENT}_LIB_NAME "lib${COMPONENT}.a")
571 set(FFmpeg_${COMPONENT}_LIBRARY "${FFmpeg_${COMPONENT}_PREFIX}/${FFmpeg_${COMPONENT}_LIB_NAME}")
572
573 set(FFmpeg_LIBRARIES
574 ${FFmpeg_LIBRARIES}
575 ${FFmpeg_${COMPONENT}_LIBRARY}
576 CACHE PATH "Paths to FFmpeg libraries" FORCE)
577 endforeach()
578
579 Include(FindPkgConfig REQUIRED)
580 pkg_check_modules(LIBVA libva)
581 pkg_check_modules(CUDA cuda)
582 pkg_check_modules(FFNVCODEC ffnvcodec)
583 pkg_check_modules(VDPAU vdpau)
584
585 set(FFmpeg_HWACCEL_LIBRARIES)
586 set(FFmpeg_HWACCEL_FLAGS)
587 set(FFmpeg_HWACCEL_INCLUDE_DIRS)
588 set(FFmpeg_HWACCEL_LDFLAGS)
589
590 if(LIBVA_FOUND)
591 pkg_check_modules(LIBDRM libdrm REQUIRED)
592 find_package(X11 REQUIRED)
593 pkg_check_modules(LIBVA-DRM libva-drm REQUIRED)
594 pkg_check_modules(LIBVA-X11 libva-x11 REQUIRED)
595 list(APPEND FFmpeg_HWACCEL_LIBRARIES
596 ${LIBDRM_LIBRARIES}
597 ${X11_LIBRARIES}
598 ${LIBVA-DRM_LIBRARIES}
599 ${LIBVA-X11_LIBRARIES}
600 ${LIBVA_LIBRARIES})
601 set(FFmpeg_HWACCEL_FLAGS
602 --enable-hwaccel=h264_vaapi
603 --enable-hwaccel=vp8_vaapi
604 --enable-hwaccel=vp9_vaapi
605 --enable-libdrm)
606 list(APPEND FFmpeg_HWACCEL_INCLUDE_DIRS
607 ${LIBDRM_INCLUDE_DIRS}
608 ${X11_INCLUDE_DIRS}
609 ${LIBVA-DRM_INCLUDE_DIRS}
610 ${LIBVA-X11_INCLUDE_DIRS}
611 ${LIBVA_INCLUDE_DIRS}
612 )
613 message(STATUS "VA-API found")
614 else()
615 set(FFmpeg_HWACCEL_FLAGS --disable-vaapi)
616 endif()
617
618 if (FFNVCODEC_FOUND)
619 list(APPEND FFmpeg_HWACCEL_FLAGS
620 --enable-cuvid
621 --enable-ffnvcodec
622 --enable-nvdec
623 --enable-hwaccel=h264_nvdec
624 --enable-hwaccel=vp8_nvdec
625 --enable-hwaccel=vp9_nvdec
626 )
627 list(APPEND FFmpeg_HWACCEL_LIBRARIES ${FFNVCODEC_LIBRARIES})
628 list(APPEND FFmpeg_HWACCEL_INCLUDE_DIRS ${FFNVCODEC_INCLUDE_DIRS})
629 list(APPEND FFmpeg_HWACCEL_LDFLAGS ${FFNVCODEC_LDFLAGS})
630 message(STATUS "ffnvcodec libraries version ${FFNVCODEC_VERSION} found")
631 # ffnvenc could load CUDA libraries at the runtime using dlopen/dlsym or LoadLibrary/GetProcAddress
632 # here we handle the hard-linking senario where CUDA is linked during compilation
633 if (CUDA_FOUND)
634 list(APPEND FFmpeg_HWACCEL_FLAGS --extra-cflags=-I${CUDA_INCLUDE_DIRS})
635 list(APPEND FFmpeg_HWACCEL_LIBRARIES ${CUDA_LIBRARIES})
636 list(APPEND FFmpeg_HWACCEL_INCLUDE_DIRS ${CUDA_INCLUDE_DIRS})
637 list(APPEND FFmpeg_HWACCEL_LDFLAGS ${CUDA_LDFLAGS})
638 message(STATUS "CUDA libraries found, hard-linking will be performed")
639 endif(CUDA_FOUND)
640 endif()
641
642 if (VDPAU_FOUND)
643 list(APPEND FFmpeg_HWACCEL_FLAGS
644 --enable-vdpau
645 --enable-hwaccel=h264_vdpau
646 --enable-hwaccel=vp9_vdpau
647 )
648 list(APPEND FFmpeg_HWACCEL_LIBRARIES ${VDPAU_LIBRARIES})
649 list(APPEND FFmpeg_HWACCEL_INCLUDE_DIRS ${VDPAU_INCLUDE_DIRS})
650 list(APPEND FFmpeg_HWACCEL_LDFLAGS ${VDPAU_LDFLAGS})
651 message(STATUS "vdpau libraries version ${VDPAU_VERSION} found")
652 else()
653 list(APPEND FFmpeg_HWACCEL_FLAGS --disable-vdpau)
654 endif()
655
656 # `configure` parameters builds only exactly what yuzu needs from FFmpeg
657 # `--disable-vdpau` is needed to avoid linking issues
658 add_custom_command(
659 OUTPUT
660 ${FFmpeg_MAKEFILE}
661 COMMAND
662 /bin/bash ${FFmpeg_PREFIX}/configure
663 --disable-avdevice
664 --disable-avfilter
665 --disable-avformat
666 --disable-doc
667 --disable-everything
668 --disable-ffmpeg
669 --disable-ffprobe
670 --disable-network
671 --disable-postproc
672 --disable-swresample
673 --enable-decoder=h264
674 --enable-decoder=vp8
675 --enable-decoder=vp9
676 --cc="${CMAKE_C_COMPILER}"
677 --cxx="${CMAKE_CXX_COMPILER}"
678 ${FFmpeg_HWACCEL_FLAGS}
679 WORKING_DIRECTORY
680 ${FFmpeg_BUILD_DIR}
681 )
682 unset(FFmpeg_HWACCEL_FLAGS)
683
684 # Workaround for Ubuntu 18.04's older version of make not being able to call make as a child
685 # with context of the jobserver. Also helps ninja users.
686 execute_process(
687 COMMAND
688 nproc
689 OUTPUT_VARIABLE
690 SYSTEM_THREADS)
691
692 set(FFmpeg_BUILD_LIBRARIES ${FFmpeg_LIBRARIES})
693 add_custom_command(
694 OUTPUT
695 ${FFmpeg_BUILD_LIBRARIES}
696 COMMAND
697 make -j${SYSTEM_THREADS}
698 WORKING_DIRECTORY
699 ${FFmpeg_BUILD_DIR}
700 )
701
702 set(FFmpeg_INCLUDE_DIR
703 "${FFmpeg_PREFIX};${FFmpeg_BUILD_DIR};${FFmpeg_HWACCEL_INCLUDE_DIRS}"
704 CACHE PATH "Path to FFmpeg headers" FORCE)
705
706 set(FFmpeg_LDFLAGS
707 "${FFmpeg_HWACCEL_LDFLAGS}"
708 CACHE STRING "FFmpeg linker flags" FORCE)
709
710 # ALL makes this custom target build every time
711 # but it won't actually build if the DEPENDS parameter is up to date
712 add_custom_target(ffmpeg-configure ALL DEPENDS ${FFmpeg_MAKEFILE})
713 add_custom_target(ffmpeg-build ALL DEPENDS ${FFmpeg_BUILD_LIBRARIES} ffmpeg-configure)
714 link_libraries(${FFmpeg_LIBVA_LIBRARIES})
715 set(FFmpeg_LIBRARIES ${FFmpeg_BUILD_LIBRARIES} ${FFmpeg_HWACCEL_LIBRARIES}
716 CACHE PATH "Paths to FFmpeg libraries" FORCE)
717 unset(FFmpeg_BUILD_LIBRARIES)
718 unset(FFmpeg_HWACCEL_FLAGS)
719 unset(FFmpeg_HWACCEL_INCLUDE_DIRS)
720 unset(FFmpeg_HWACCEL_LDFLAGS)
721 unset(FFmpeg_HWACCEL_LIBRARIES)
722
723 if (FFmpeg_FOUND)
724 message(STATUS "Found FFmpeg version ${FFmpeg_VERSION}")
725 else()
726 message(FATAL_ERROR "FFmpeg not found")
727 endif()
728 else() # WIN32
729 # Use yuzu FFmpeg binaries
730 set(FFmpeg_EXT_NAME "ffmpeg-4.4")
731 set(FFmpeg_PATH "${CMAKE_BINARY_DIR}/externals/${FFmpeg_EXT_NAME}")
732 download_bundled_external("ffmpeg/" ${FFmpeg_EXT_NAME} "")
733 set(FFmpeg_FOUND YES)
734 set(FFmpeg_INCLUDE_DIR "${FFmpeg_PATH}/include" CACHE PATH "Path to FFmpeg headers" FORCE)
735 set(FFmpeg_LIBRARY_DIR "${FFmpeg_PATH}/bin" CACHE PATH "Path to FFmpeg library directory" FORCE)
736 set(FFmpeg_LDFLAGS "" CACHE STRING "FFmpeg linker flags" FORCE)
737 set(FFmpeg_DLL_DIR "${FFmpeg_PATH}/bin" CACHE PATH "Path to FFmpeg dll's" FORCE)
738 set(FFmpeg_LIBRARIES
739 ${FFmpeg_LIBRARY_DIR}/swscale.lib
740 ${FFmpeg_LIBRARY_DIR}/avcodec.lib
741 ${FFmpeg_LIBRARY_DIR}/avutil.lib
742 CACHE PATH "Paths to FFmpeg libraries" FORCE)
743 endif()
744endif()
745
746unset(FFmpeg_COMPONENTS)
747
748# Prefer the -pthread flag on Linux. 535# Prefer the -pthread flag on Linux.
749set(THREADS_PREFER_PTHREAD_FLAG ON) 536set(THREADS_PREFER_PTHREAD_FLAG ON)
750find_package(Threads REQUIRED) 537find_package(Threads REQUIRED)
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)
121 message(STATUS "opus 1.3 or newer not found, falling back to externals") 121 message(STATUS "opus 1.3 or newer not found, falling back to externals")
122 add_subdirectory(opus EXCLUDE_FROM_ALL) 122 add_subdirectory(opus EXCLUDE_FROM_ALL)
123endif() 123endif()
124
125# FFMpeg
126if (YUZU_USE_BUNDLED_FFMPEG)
127 add_subdirectory(ffmpeg)
128endif()
diff --git a/externals/ffmpeg b/externals/ffmpeg
deleted file mode 160000
Subproject 79e8d17024e6c6328a40fcee191ffd70798a9c6
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 @@
1if (NOT WIN32)
2 # Build FFmpeg from externals
3 message(STATUS "Using FFmpeg from externals")
4
5 if (CMAKE_SYSTEM_PROCESSOR MATCHES "(x86_64|amd64)")
6 # FFmpeg has source that requires one of nasm or yasm to assemble it.
7 # REQUIRED throws an error if not found here during configuration rather than during compilation.
8 find_program(ASSEMBLER NAMES nasm yasm)
9 if ("${ASSEMBLER}" STREQUAL "ASSEMBLER-NOTFOUND")
10 message(FATAL_ERROR "One of either `nasm` or `yasm` not found but is required.")
11 endif()
12 endif()
13
14 find_program(AUTOCONF autoconf)
15 if ("${AUTOCONF}" STREQUAL "AUTOCONF-NOTFOUND")
16 message(FATAL_ERROR "Required program `autoconf` not found.")
17 endif()
18
19 set(FFmpeg_PREFIX ${PROJECT_SOURCE_DIR}/externals/ffmpeg/ffmpeg)
20 set(FFmpeg_BUILD_DIR ${PROJECT_BINARY_DIR}/externals/ffmpeg)
21 set(FFmpeg_MAKEFILE ${FFmpeg_BUILD_DIR}/Makefile)
22 make_directory(${FFmpeg_BUILD_DIR})
23
24 # Read version string from external
25 file(READ ${FFmpeg_PREFIX}/RELEASE FFmpeg_VERSION)
26 set(FFmpeg_FOUND NO)
27 if (NOT FFmpeg_VERSION STREQUAL "")
28 set(FFmpeg_FOUND YES)
29 endif()
30
31 unset(FFmpeg_LIBRARIES CACHE)
32 foreach(COMPONENT ${FFmpeg_COMPONENTS})
33 set(FFmpeg_${COMPONENT}_PREFIX "${FFmpeg_BUILD_DIR}/lib${COMPONENT}")
34 set(FFmpeg_${COMPONENT}_LIB_NAME "lib${COMPONENT}.a")
35 set(FFmpeg_${COMPONENT}_LIBRARY "${FFmpeg_${COMPONENT}_PREFIX}/${FFmpeg_${COMPONENT}_LIB_NAME}")
36
37 set(FFmpeg_LIBRARIES
38 ${FFmpeg_LIBRARIES}
39 ${FFmpeg_${COMPONENT}_LIBRARY}
40 CACHE PATH "Paths to FFmpeg libraries" FORCE)
41 endforeach()
42
43 Include(FindPkgConfig REQUIRED)
44 pkg_check_modules(LIBVA libva)
45 pkg_check_modules(CUDA cuda)
46 pkg_check_modules(FFNVCODEC ffnvcodec)
47 pkg_check_modules(VDPAU vdpau)
48
49 set(FFmpeg_HWACCEL_LIBRARIES)
50 set(FFmpeg_HWACCEL_FLAGS)
51 set(FFmpeg_HWACCEL_INCLUDE_DIRS)
52 set(FFmpeg_HWACCEL_LDFLAGS)
53
54 if(LIBVA_FOUND)
55 pkg_check_modules(LIBDRM libdrm REQUIRED)
56 find_package(X11 REQUIRED)
57 pkg_check_modules(LIBVA-DRM libva-drm REQUIRED)
58 pkg_check_modules(LIBVA-X11 libva-x11 REQUIRED)
59 list(APPEND FFmpeg_HWACCEL_LIBRARIES
60 ${LIBDRM_LIBRARIES}
61 ${X11_LIBRARIES}
62 ${LIBVA-DRM_LIBRARIES}
63 ${LIBVA-X11_LIBRARIES}
64 ${LIBVA_LIBRARIES})
65 set(FFmpeg_HWACCEL_FLAGS
66 --enable-hwaccel=h264_vaapi
67 --enable-hwaccel=vp8_vaapi
68 --enable-hwaccel=vp9_vaapi
69 --enable-libdrm)
70 list(APPEND FFmpeg_HWACCEL_INCLUDE_DIRS
71 ${LIBDRM_INCLUDE_DIRS}
72 ${X11_INCLUDE_DIRS}
73 ${LIBVA-DRM_INCLUDE_DIRS}
74 ${LIBVA-X11_INCLUDE_DIRS}
75 ${LIBVA_INCLUDE_DIRS}
76 )
77 message(STATUS "VA-API found")
78 else()
79 set(FFmpeg_HWACCEL_FLAGS --disable-vaapi)
80 endif()
81
82 if (FFNVCODEC_FOUND)
83 list(APPEND FFmpeg_HWACCEL_FLAGS
84 --enable-cuvid
85 --enable-ffnvcodec
86 --enable-nvdec
87 --enable-hwaccel=h264_nvdec
88 --enable-hwaccel=vp8_nvdec
89 --enable-hwaccel=vp9_nvdec
90 )
91 list(APPEND FFmpeg_HWACCEL_LIBRARIES ${FFNVCODEC_LIBRARIES})
92 list(APPEND FFmpeg_HWACCEL_INCLUDE_DIRS ${FFNVCODEC_INCLUDE_DIRS})
93 list(APPEND FFmpeg_HWACCEL_LDFLAGS ${FFNVCODEC_LDFLAGS})
94 message(STATUS "ffnvcodec libraries version ${FFNVCODEC_VERSION} found")
95 # ffnvenc could load CUDA libraries at the runtime using dlopen/dlsym or LoadLibrary/GetProcAddress
96 # here we handle the hard-linking senario where CUDA is linked during compilation
97 if (CUDA_FOUND)
98 list(APPEND FFmpeg_HWACCEL_FLAGS --extra-cflags=-I${CUDA_INCLUDE_DIRS})
99 list(APPEND FFmpeg_HWACCEL_LIBRARIES ${CUDA_LIBRARIES})
100 list(APPEND FFmpeg_HWACCEL_INCLUDE_DIRS ${CUDA_INCLUDE_DIRS})
101 list(APPEND FFmpeg_HWACCEL_LDFLAGS ${CUDA_LDFLAGS})
102 message(STATUS "CUDA libraries found, hard-linking will be performed")
103 endif(CUDA_FOUND)
104 endif()
105
106 if (VDPAU_FOUND)
107 list(APPEND FFmpeg_HWACCEL_FLAGS
108 --enable-vdpau
109 --enable-hwaccel=h264_vdpau
110 --enable-hwaccel=vp9_vdpau
111 )
112 list(APPEND FFmpeg_HWACCEL_LIBRARIES ${VDPAU_LIBRARIES})
113 list(APPEND FFmpeg_HWACCEL_INCLUDE_DIRS ${VDPAU_INCLUDE_DIRS})
114 list(APPEND FFmpeg_HWACCEL_LDFLAGS ${VDPAU_LDFLAGS})
115 message(STATUS "vdpau libraries version ${VDPAU_VERSION} found")
116 else()
117 list(APPEND FFmpeg_HWACCEL_FLAGS --disable-vdpau)
118 endif()
119
120 # `configure` parameters builds only exactly what yuzu needs from FFmpeg
121 # `--disable-vdpau` is needed to avoid linking issues
122 add_custom_command(
123 OUTPUT
124 ${FFmpeg_MAKEFILE}
125 COMMAND
126 /bin/bash ${FFmpeg_PREFIX}/configure
127 --disable-avdevice
128 --disable-avfilter
129 --disable-avformat
130 --disable-doc
131 --disable-everything
132 --disable-ffmpeg
133 --disable-ffprobe
134 --disable-network
135 --disable-postproc
136 --disable-swresample
137 --enable-decoder=h264
138 --enable-decoder=vp8
139 --enable-decoder=vp9
140 --cc="${CMAKE_C_COMPILER}"
141 --cxx="${CMAKE_CXX_COMPILER}"
142 ${FFmpeg_HWACCEL_FLAGS}
143 WORKING_DIRECTORY
144 ${FFmpeg_BUILD_DIR}
145 )
146 unset(FFmpeg_HWACCEL_FLAGS)
147
148 # Workaround for Ubuntu 18.04's older version of make not being able to call make as a child
149 # with context of the jobserver. Also helps ninja users.
150 execute_process(
151 COMMAND
152 nproc
153 OUTPUT_VARIABLE
154 SYSTEM_THREADS)
155
156 set(FFmpeg_BUILD_LIBRARIES ${FFmpeg_LIBRARIES})
157 add_custom_command(
158 OUTPUT
159 ${FFmpeg_BUILD_LIBRARIES}
160 COMMAND
161 make -j${SYSTEM_THREADS}
162 WORKING_DIRECTORY
163 ${FFmpeg_BUILD_DIR}
164 )
165
166 set(FFmpeg_INCLUDE_DIR
167 "${FFmpeg_PREFIX};${FFmpeg_BUILD_DIR};${FFmpeg_HWACCEL_INCLUDE_DIRS}"
168 CACHE PATH "Path to FFmpeg headers" FORCE)
169
170 set(FFmpeg_LDFLAGS
171 "${FFmpeg_HWACCEL_LDFLAGS}"
172 CACHE STRING "FFmpeg linker flags" FORCE)
173
174 # ALL makes this custom target build every time
175 # but it won't actually build if the DEPENDS parameter is up to date
176 add_custom_target(ffmpeg-configure ALL DEPENDS ${FFmpeg_MAKEFILE})
177 add_custom_target(ffmpeg-build ALL DEPENDS ${FFmpeg_BUILD_LIBRARIES} ffmpeg-configure)
178 link_libraries(${FFmpeg_LIBVA_LIBRARIES})
179 set(FFmpeg_LIBRARIES ${FFmpeg_BUILD_LIBRARIES} ${FFmpeg_HWACCEL_LIBRARIES}
180 CACHE PATH "Paths to FFmpeg libraries" FORCE)
181 unset(FFmpeg_BUILD_LIBRARIES)
182 unset(FFmpeg_HWACCEL_FLAGS)
183 unset(FFmpeg_HWACCEL_INCLUDE_DIRS)
184 unset(FFmpeg_HWACCEL_LDFLAGS)
185 unset(FFmpeg_HWACCEL_LIBRARIES)
186
187 if (FFmpeg_FOUND)
188 message(STATUS "Found FFmpeg version ${FFmpeg_VERSION}")
189 else()
190 message(FATAL_ERROR "FFmpeg not found")
191 endif()
192else(WIN32)
193 # Use yuzu FFmpeg binaries
194 set(FFmpeg_EXT_NAME "ffmpeg-4.4")
195 set(FFmpeg_PATH "${CMAKE_BINARY_DIR}/externals/${FFmpeg_EXT_NAME}")
196 download_bundled_external("ffmpeg/" ${FFmpeg_EXT_NAME} "")
197 set(FFmpeg_FOUND YES)
198 set(FFmpeg_INCLUDE_DIR "${FFmpeg_PATH}/include" CACHE PATH "Path to FFmpeg headers" FORCE)
199 set(FFmpeg_LIBRARY_DIR "${FFmpeg_PATH}/bin" CACHE PATH "Path to FFmpeg library directory" FORCE)
200 set(FFmpeg_LDFLAGS "" CACHE STRING "FFmpeg linker flags" FORCE)
201 set(FFmpeg_DLL_DIR "${FFmpeg_PATH}/bin" CACHE PATH "Path to FFmpeg dll's" FORCE)
202 set(FFmpeg_LIBRARIES
203 ${FFmpeg_LIBRARY_DIR}/swscale.lib
204 ${FFmpeg_LIBRARY_DIR}/avcodec.lib
205 ${FFmpeg_LIBRARY_DIR}/avutil.lib
206 CACHE PATH "Paths to FFmpeg libraries" FORCE)
207endif(WIN32)
208
209unset(FFmpeg_COMPONENTS)
diff --git a/externals/ffmpeg/ffmpeg b/externals/ffmpeg/ffmpeg
new file mode 160000
Subproject dc91b913b6260e85e1304c74ff7bb3c22a8c9fb