diff options
| author | Connor McLaughlin <stenzek@gmail.com> | 2019-06-30 21:13:19 +1000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-06-30 21:13:19 +1000 |
| commit | 0a7395bfba99719f71de5186a9916e66c1901f37 (patch) | |
| tree | 859bf25ac0e7d7a25ea89fc108c6ca1e24a61ee0 /Source/Core/VideoCommon/RenderBase.cpp | |
| parent | 0d2c3e6efc41c97fe3ea556985bd32c89d7009da (diff) | |
| parent | 1df655e376fe59291ee5c69755f2f2a70f82ee75 (diff) | |
Merge pull request #8128 from altimumdelta/FrameDumpUpgradePrep1
Code: Rename AVIDump to FrameDump
Diffstat (limited to 'Source/Core/VideoCommon/RenderBase.cpp')
| -rw-r--r-- | Source/Core/VideoCommon/RenderBase.cpp | 51 |
1 files changed, 26 insertions, 25 deletions
diff --git a/Source/Core/VideoCommon/RenderBase.cpp b/Source/Core/VideoCommon/RenderBase.cpp index 19e892a515..4f47ee64ce 100644 --- a/Source/Core/VideoCommon/RenderBase.cpp +++ b/Source/Core/VideoCommon/RenderBase.cpp @@ -48,7 +48,6 @@ #include "Core/Host.h" #include "Core/Movie.h" -#include "VideoCommon/AVIDump.h" #include "VideoCommon/AbstractFramebuffer.h" #include "VideoCommon/AbstractStagingTexture.h" #include "VideoCommon/AbstractTexture.h" @@ -57,6 +56,7 @@ #include "VideoCommon/CPMemory.h" #include "VideoCommon/CommandProcessor.h" #include "VideoCommon/FPSCounter.h" +#include "VideoCommon/FrameDump.h" #include "VideoCommon/FramebufferManager.h" #include "VideoCommon/ImageWrite.h" #include "VideoCommon/NetPlayChatUI.h" @@ -1390,7 +1390,7 @@ void Renderer::DumpCurrentFrame(const AbstractTexture* src_texture, copy_rect = src_texture->GetRect(); } - // Index 0 was just sent to AVI dump. Swap with the second texture. + // Index 0 was just sent to FFMPEG dump. Swap with the second texture. if (m_frame_dump_readback_textures[0]) std::swap(m_frame_dump_readback_textures[0], m_frame_dump_readback_textures[1]); @@ -1399,7 +1399,7 @@ void Renderer::DumpCurrentFrame(const AbstractTexture* src_texture, m_frame_dump_readback_textures[0]->CopyFromTexture(src_texture, copy_rect, 0, 0, m_frame_dump_readback_textures[0]->GetRect()); - m_last_frame_state = AVIDump::FetchState(ticks); + m_last_frame_state = FrameDump::FetchState(ticks); m_last_frame_exported = true; } @@ -1493,7 +1493,8 @@ void Renderer::ShutdownFrameDumping() tex.reset(); } -void Renderer::DumpFrameData(const u8* data, int w, int h, int stride, const AVIDump::Frame& state) +void Renderer::DumpFrameData(const u8* data, int w, int h, int stride, + const FrameDump::Frame& state) { m_frame_dump_config = FrameDumpConfig{data, w, h, stride, state}; @@ -1522,16 +1523,16 @@ void Renderer::FinishFrameData() void Renderer::RunFrameDumps() { Common::SetCurrentThreadName("FrameDumping"); - bool dump_to_avi = !g_ActiveConfig.bDumpFramesAsImages; + bool dump_to_ffmpeg = !g_ActiveConfig.bDumpFramesAsImages; bool frame_dump_started = false; -// If Dolphin was compiled without libav, we only support dumping to images. +// If Dolphin was compiled without ffmpeg, we only support dumping to images. #if !defined(HAVE_FFMPEG) - if (dump_to_avi) + if (dump_to_ffmpeg) { - WARN_LOG(VIDEO, "AVI frame dump requested, but Dolphin was compiled without libav. " - "Frame dump will be saved as images instead."); - dump_to_avi = false; + WARN_LOG(VIDEO, "FrameDump: Dolphin was not compiled with FFmpeg, using fallback option. " + "Frames will be saved as PNG images instead."); + dump_to_ffmpeg = false; } #endif @@ -1561,8 +1562,8 @@ void Renderer::RunFrameDumps() { if (!frame_dump_started) { - if (dump_to_avi) - frame_dump_started = StartFrameDumpToAVI(config); + if (dump_to_ffmpeg) + frame_dump_started = StartFrameDumpToFFMPEG(config); else frame_dump_started = StartFrameDumpToImage(config); @@ -1574,8 +1575,8 @@ void Renderer::RunFrameDumps() // If we failed to start frame dumping, don't write a frame. if (frame_dump_started) { - if (dump_to_avi) - DumpFrameToAVI(config); + if (dump_to_ffmpeg) + DumpFrameToFFMPEG(config); else DumpFrameToImage(config); } @@ -1587,40 +1588,40 @@ void Renderer::RunFrameDumps() if (frame_dump_started) { // No additional cleanup is needed when dumping to images. - if (dump_to_avi) - StopFrameDumpToAVI(); + if (dump_to_ffmpeg) + StopFrameDumpToFFMPEG(); } } #if defined(HAVE_FFMPEG) -bool Renderer::StartFrameDumpToAVI(const FrameDumpConfig& config) +bool Renderer::StartFrameDumpToFFMPEG(const FrameDumpConfig& config) { - return AVIDump::Start(config.width, config.height); + return FrameDump::Start(config.width, config.height); } -void Renderer::DumpFrameToAVI(const FrameDumpConfig& config) +void Renderer::DumpFrameToFFMPEG(const FrameDumpConfig& config) { - AVIDump::AddFrame(config.data, config.width, config.height, config.stride, config.state); + FrameDump::AddFrame(config.data, config.width, config.height, config.stride, config.state); } -void Renderer::StopFrameDumpToAVI() +void Renderer::StopFrameDumpToFFMPEG() { - AVIDump::Stop(); + FrameDump::Stop(); } #else -bool Renderer::StartFrameDumpToAVI(const FrameDumpConfig& config) +bool Renderer::StartFrameDumpToFFMPEG(const FrameDumpConfig& config) { return false; } -void Renderer::DumpFrameToAVI(const FrameDumpConfig& config) +void Renderer::DumpFrameToFFMPEG(const FrameDumpConfig& config) { } -void Renderer::StopFrameDumpToAVI() +void Renderer::StopFrameDumpToFFMPEG() { } |
