From d951d2e4c4540012fe43d637368e4c545a06c636 Mon Sep 17 00:00:00 2001 From: Michael Maltese Date: Mon, 22 May 2017 12:13:19 -0700 Subject: CMake: libav/ffmpeg cleanups Use @Orphis's FindFFmpeg module from ppsspp: https://github.com/hrydgard/ppsspp/commit/2149d3db7fb960d140bdee31a9f0f4837934127b From that commit: > This new module should be able to handle both libraries in the regular > paths and fallback to pkg-config. > It is also able to find dynamic libraries, not just static libraries. > It will generate imported targets with the name FFmpeg:: that you > can use in your scripts. --- Source/Core/VideoCommon/CMakeLists.txt | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'Source/Core/VideoCommon') diff --git a/Source/Core/VideoCommon/CMakeLists.txt b/Source/Core/VideoCommon/CMakeLists.txt index 7eef4f715d..a50cd2774a 100644 --- a/Source/Core/VideoCommon/CMakeLists.txt +++ b/Source/Core/VideoCommon/CMakeLists.txt @@ -62,12 +62,14 @@ else() set(SRCS ${SRCS} TextureDecoder_Generic.cpp) endif() -if(LIBAV_FOUND OR WIN32) - set(SRCS ${SRCS} AVIDump.cpp) -endif() - add_dolphin_library(videocommon "${SRCS}" "${LIBS}") -if(LIBAV_FOUND) - target_link_libraries(videocommon PRIVATE ${LIBS} ${LIBAV_LIBRARIES}) +if(FFmpeg_FOUND) + target_sources(videocommon PRIVATE AVIDump.cpp) + target_link_libraries(videocommon PRIVATE + FFmpeg::avcodec + FFmpeg::avformat + FFmpeg::avutil + FFmpeg::swscale + ) endif() -- cgit v1.2.3 From 53acd25de452c5efece3d3ee680b86e9acbeb514 Mon Sep 17 00:00:00 2001 From: Michael Maltese Date: Fri, 26 May 2017 00:32:35 -0700 Subject: Rename define HAVE_LIBAV->HAVE_FFMPEG --- Source/Core/VideoCommon/AVIDump.h | 2 +- Source/Core/VideoCommon/RenderBase.cpp | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'Source/Core/VideoCommon') diff --git a/Source/Core/VideoCommon/AVIDump.h b/Source/Core/VideoCommon/AVIDump.h index fcc3ddb2ce..521f0d792b 100644 --- a/Source/Core/VideoCommon/AVIDump.h +++ b/Source/Core/VideoCommon/AVIDump.h @@ -27,7 +27,7 @@ public: static void Stop(); static void DoState(); -#if defined(HAVE_LIBAV) || defined(_WIN32) +#if defined(HAVE_FFMPEG) || defined(_WIN32) static Frame FetchState(u64 ticks); #else static Frame FetchState(u64 ticks) { return {}; } diff --git a/Source/Core/VideoCommon/RenderBase.cpp b/Source/Core/VideoCommon/RenderBase.cpp index ff390a8c7d..baa8b73b37 100644 --- a/Source/Core/VideoCommon/RenderBase.cpp +++ b/Source/Core/VideoCommon/RenderBase.cpp @@ -774,7 +774,7 @@ bool Renderer::IsFrameDumping() if (m_screenshot_request.IsSet()) return true; -#if defined(HAVE_LIBAV) || defined(_WIN32) +#if defined(HAVE_FFMPEG) || defined(_WIN32) if (SConfig::GetInstance().m_DumpFrames) return true; #endif @@ -828,7 +828,7 @@ void Renderer::RunFrameDumps() bool frame_dump_started = false; // If Dolphin was compiled without libav, we only support dumping to images. -#if !defined(HAVE_LIBAV) && !defined(_WIN32) +#if !defined(HAVE_FFMPEG) && !defined(_WIN32) if (dump_to_avi) { WARN_LOG(VIDEO, "AVI frame dump requested, but Dolphin was compiled without libav. " @@ -900,7 +900,7 @@ void Renderer::RunFrameDumps() } } -#if defined(HAVE_LIBAV) || defined(_WIN32) +#if defined(HAVE_FFMPEG) || defined(_WIN32) bool Renderer::StartFrameDumpToAVI(const FrameDumpConfig& config) { @@ -932,7 +932,7 @@ void Renderer::StopFrameDumpToAVI() { } -#endif // defined(HAVE_LIBAV) || defined(WIN32) +#endif // defined(HAVE_FFMPEG) || defined(WIN32) std::string Renderer::GetFrameDumpNextImageFileName() const { -- cgit v1.2.3 From 3ca03373ae993e69088a33458e16afe1ee946eee Mon Sep 17 00:00:00 2001 From: Michael Maltese Date: Mon, 22 May 2017 12:27:10 -0700 Subject: MSVC: define HAVE_FFMPEG --- Source/Core/VideoCommon/AVIDump.h | 2 +- Source/Core/VideoCommon/RenderBase.cpp | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'Source/Core/VideoCommon') diff --git a/Source/Core/VideoCommon/AVIDump.h b/Source/Core/VideoCommon/AVIDump.h index 521f0d792b..065a5d63d0 100644 --- a/Source/Core/VideoCommon/AVIDump.h +++ b/Source/Core/VideoCommon/AVIDump.h @@ -27,7 +27,7 @@ public: static void Stop(); static void DoState(); -#if defined(HAVE_FFMPEG) || defined(_WIN32) +#if defined(HAVE_FFMPEG) static Frame FetchState(u64 ticks); #else static Frame FetchState(u64 ticks) { return {}; } diff --git a/Source/Core/VideoCommon/RenderBase.cpp b/Source/Core/VideoCommon/RenderBase.cpp index baa8b73b37..42f07ef403 100644 --- a/Source/Core/VideoCommon/RenderBase.cpp +++ b/Source/Core/VideoCommon/RenderBase.cpp @@ -774,7 +774,7 @@ bool Renderer::IsFrameDumping() if (m_screenshot_request.IsSet()) return true; -#if defined(HAVE_FFMPEG) || defined(_WIN32) +#if defined(HAVE_FFMPEG) if (SConfig::GetInstance().m_DumpFrames) return true; #endif @@ -828,7 +828,7 @@ void Renderer::RunFrameDumps() bool frame_dump_started = false; // If Dolphin was compiled without libav, we only support dumping to images. -#if !defined(HAVE_FFMPEG) && !defined(_WIN32) +#if !defined(HAVE_FFMPEG) if (dump_to_avi) { WARN_LOG(VIDEO, "AVI frame dump requested, but Dolphin was compiled without libav. " @@ -900,7 +900,7 @@ void Renderer::RunFrameDumps() } } -#if defined(HAVE_FFMPEG) || defined(_WIN32) +#if defined(HAVE_FFMPEG) bool Renderer::StartFrameDumpToAVI(const FrameDumpConfig& config) { @@ -932,7 +932,7 @@ void Renderer::StopFrameDumpToAVI() { } -#endif // defined(HAVE_FFMPEG) || defined(WIN32) +#endif // defined(HAVE_FFMPEG) std::string Renderer::GetFrameDumpNextImageFileName() const { -- cgit v1.2.3