summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/FrameDumper.cpp
diff options
context:
space:
mode:
authorFiloppi <filippotarpini@hotmail.it>2024-03-03 15:10:23 +0200
committerFiloppi <filippotarpini@hotmail.it>2024-04-08 22:54:45 +0300
commit66592f79f2230bf5589bccb1f51da72150bf89c9 (patch)
treec9c878f44e429437511d6f8e9aab0e1aa9a65e5b /Source/Core/VideoCommon/FrameDumper.cpp
parent72db62e17856265adefaaff6c7827989a2b362a4 (diff)
Video: remove enforced resolution least common multiple of 4 when dumping screenshots and not videos (only videos encoders have this limit).
NOTE: this will likely trigger FIFOCI differences.
Diffstat (limited to 'Source/Core/VideoCommon/FrameDumper.cpp')
-rw-r--r--Source/Core/VideoCommon/FrameDumper.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/Source/Core/VideoCommon/FrameDumper.cpp b/Source/Core/VideoCommon/FrameDumper.cpp
index db4ef5205e..30f6a40e10 100644
--- a/Source/Core/VideoCommon/FrameDumper.cpp
+++ b/Source/Core/VideoCommon/FrameDumper.cpp
@@ -18,6 +18,9 @@
#include "VideoCommon/Present.h"
#include "VideoCommon/VideoConfig.h"
+// The video encoder needs the image to be a multiple of x samples.
+static constexpr int VIDEO_ENCODER_LCM = 4;
+
static bool DumpFrameToPNG(const FrameData& frame, const std::string& file_name)
{
return Common::ConvertRGBAToRGBAndSavePNG(file_name, frame.data, frame.width, frame.height,
@@ -354,6 +357,13 @@ bool FrameDumper::IsFrameDumping() const
return false;
}
+int FrameDumper::GetRequiredResolutionLeastCommonMultiple() const
+{
+ if (Config::Get(Config::MAIN_MOVIE_DUMP_FRAMES))
+ return VIDEO_ENCODER_LCM;
+ return 1;
+}
+
void FrameDumper::DoState(PointerWrap& p)
{
#ifdef HAVE_FFMPEG