VideoCommon: Rename AVIDump to FrameDump

This commit is contained in:
altimumdelta
2019-03-18 05:50:53 +01:00
parent 4f6cdfe686
commit 1df655e376
8 changed files with 53 additions and 52 deletions

View File

@ -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"
@ -1339,7 +1339,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]);
@ -1348,7 +1348,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;
}
@ -1442,7 +1442,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};
@ -1471,16 +1472,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
@ -1510,8 +1511,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);
@ -1523,8 +1524,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);
}
@ -1536,40 +1537,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()
{
}