From ebc617882b3375883d6c214381d44b9114f23d9e Mon Sep 17 00:00:00 2001 From: degasus Date: Fri, 7 Oct 2016 22:59:39 +0200 Subject: VideoCommon: Drop RepeatFrameDumpFrame helper. This was needed with fixed framerate dumping. As we now synchronize the frames, the last one will just get padded. --- Source/Core/VideoCommon/RenderBase.cpp | 11 ----------- 1 file changed, 11 deletions(-) (limited to 'Source/Core/VideoCommon/RenderBase.cpp') diff --git a/Source/Core/VideoCommon/RenderBase.cpp b/Source/Core/VideoCommon/RenderBase.cpp index 1dd07c905b..0d7d44622b 100644 --- a/Source/Core/VideoCommon/RenderBase.cpp +++ b/Source/Core/VideoCommon/RenderBase.cpp @@ -578,7 +578,6 @@ void Renderer::DumpFrameData(const u8* data, int w, int h, AVIDump::DumpFormat f m_last_framedump_format = format; // TODO: Refactor this. Right now it's needed for the implace flipping of the image. - // It's also used to repeat the last frame. m_frame_data.assign(data, data + image_size); if (!m_last_frame_dumped) @@ -606,16 +605,6 @@ void Renderer::DumpFrameData(const u8* data, int w, int h, AVIDump::DumpFormat f #endif } -void Renderer::RepeatFrameDumpFrame() -{ -#if defined(HAVE_LIBAV) || defined(_WIN32) - if (SConfig::GetInstance().m_DumpFrames && m_AVI_dumping && !m_frame_data.empty()) - { - AVIDump::AddFrame(m_frame_data.data(), m_last_framedump_width, m_last_framedump_height); - } -#endif -} - void Renderer::FlipImageData(u8* data, int w, int h, int pixel_width) { for (int y = 0; y < h / 2; ++y) -- cgit v1.2.3 From b5a91e1dfaf62924e05421de48987c105546f8ca Mon Sep 17 00:00:00 2001 From: degasus Date: Sat, 8 Oct 2016 00:04:25 +0200 Subject: Framedumps: Add finish() function to limit memory lifetime. --- Source/Core/VideoCommon/RenderBase.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'Source/Core/VideoCommon/RenderBase.cpp') diff --git a/Source/Core/VideoCommon/RenderBase.cpp b/Source/Core/VideoCommon/RenderBase.cpp index 0d7d44622b..6f1a581b6e 100644 --- a/Source/Core/VideoCommon/RenderBase.cpp +++ b/Source/Core/VideoCommon/RenderBase.cpp @@ -605,6 +605,10 @@ void Renderer::DumpFrameData(const u8* data, int w, int h, AVIDump::DumpFormat f #endif } +void Renderer::FinishFrameData() +{ +} + void Renderer::FlipImageData(u8* data, int w, int h, int pixel_width) { for (int y = 0; y < h / 2; ++y) -- cgit v1.2.3 From 0864ef435219dbbded3b07a8159a85731e605087 Mon Sep 17 00:00:00 2001 From: degasus Date: Sat, 8 Oct 2016 15:28:12 +0200 Subject: VideoCommon: Add custom stride for framedumping. --- Source/Core/VideoCommon/RenderBase.cpp | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) (limited to 'Source/Core/VideoCommon/RenderBase.cpp') diff --git a/Source/Core/VideoCommon/RenderBase.cpp b/Source/Core/VideoCommon/RenderBase.cpp index 6f1a581b6e..e523fd8a67 100644 --- a/Source/Core/VideoCommon/RenderBase.cpp +++ b/Source/Core/VideoCommon/RenderBase.cpp @@ -555,30 +555,20 @@ bool Renderer::IsFrameDumping() return false; } -void Renderer::DumpFrameData(const u8* data, int w, int h, AVIDump::DumpFormat format, +void Renderer::DumpFrameData(const u8* data, int w, int h, int stride, AVIDump::DumpFormat format, bool swap_upside_down) { #if defined(HAVE_LIBAV) || defined(_WIN32) if (w == 0 || h == 0) return; - size_t image_size; - switch (format) - { - case AVIDump::DumpFormat::FORMAT_BGR: - image_size = 3 * w * h; - break; - case AVIDump::DumpFormat::FORMAT_RGBA: - image_size = 4 * w * h; - break; - } - m_last_framedump_width = w; m_last_framedump_height = h; m_last_framedump_format = format; + m_last_framedump_stride = stride; // TODO: Refactor this. Right now it's needed for the implace flipping of the image. - m_frame_data.assign(data, data + image_size); + m_frame_data.assign(data, data + stride * h); if (!m_last_frame_dumped) { @@ -598,7 +588,7 @@ void Renderer::DumpFrameData(const u8* data, int w, int h, AVIDump::DumpFormat f { if (swap_upside_down) FlipImageData(m_frame_data.data(), w, h, 4); - AVIDump::AddFrame(m_frame_data.data(), w, h); + AVIDump::AddFrame(m_frame_data.data(), w, h, stride); } m_last_frame_dumped = true; -- cgit v1.2.3