summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/Src/AVIDump.cpp
diff options
context:
space:
mode:
authorskidau <skidau@gmail.com>2013-03-01 20:12:56 +1100
committerskidau <skidau@gmail.com>2013-03-01 20:12:56 +1100
commit73da6f4f3f721458072c2ff4b70823f37270ca2f (patch)
tree9b9d2fd409df2c7eff0c6af66ad44b010a28daf4 /Source/Core/VideoCommon/Src/AVIDump.cpp
parent7a04ec6f9220dd66147c86baaebc2f9e05d65ead (diff)
parent99cf57eb393e61bc0a9072a6e4f4f21c57daea9d (diff)
Merge branch 'master' into FIFO-BP
# By Jordan Woyak (46) and others # Via Jordan Woyak (2) and others * master: (70 commits) Fixes two memory leaks, one is pretty bad for OSX. Yell at pauldachz if this doesn't work. Or... say thanks. Added a BluetoothEnumerateInstalledServices call so that the wiimote remembers the pairing. Make ARMJit core default CPU core on ARM architecture Fix a StringUtil regression from the arm-noglsl merge Small improvement to cmpli/cmpi in ARMJit. Merge latest ArmEmitter changes from ppsspp while we're at it. Ah. I blame vim on this typo entirely. Add disabled code for authenticating wiimotes on Windows. Add the missing FPR cache Buildfix. Yell at the user if they change window size while dumping frames, and some other avi dumping stuff. Not sure if this is the right way to handle this, but it makes the save states perfectly stable. That's all that really matters, right? Abort loading states from incompatible graphics backends. ARM Support without GLSL Improve VideoSoftware save states. They are fairly stable, but not perfect. OpcodeDecoder::DoState() needs to be fixed. Begin implementing save states to video software. Kind of works, sometimes. Make error message for loading save state with wrong dsp engine shorter. Abort load state if it uses a different dsp engine, instead of crashing. Update the gameini of F-zero. Efb to Ram is no longer the default choice. fix last commit by neobrain ... Conflicts: Source/Core/VideoCommon/Src/Fifo.cpp
Diffstat (limited to 'Source/Core/VideoCommon/Src/AVIDump.cpp')
-rw-r--r--Source/Core/VideoCommon/Src/AVIDump.cpp20
1 files changed, 16 insertions, 4 deletions
diff --git a/Source/Core/VideoCommon/Src/AVIDump.cpp b/Source/Core/VideoCommon/Src/AVIDump.cpp
index c172903b5d..fefb09fecb 100644
--- a/Source/Core/VideoCommon/Src/AVIDump.cpp
+++ b/Source/Core/VideoCommon/Src/AVIDump.cpp
@@ -157,9 +157,21 @@ void AVIDump::Stop()
NOTICE_LOG(VIDEO, "Stop");
}
-void AVIDump::AddFrame(char *data)
+void AVIDump::AddFrame(const u8* data, int w, int h)
{
- AVIStreamWrite(m_streamCompressed, ++m_frameCount, 1, (LPVOID) data, m_bitmap.biSizeImage, AVIIF_KEYFRAME, NULL, &m_byteBuffer);
+ static bool shown_error = false;
+ if ((w != m_bitmap.biWidth || h != m_bitmap.biHeight) && !shown_error)
+ {
+ PanicAlert("You have resized the window while dumping frames.\n"
+ "Nothing sane can be done to handle this.\n"
+ "Your video will likely be broken.");
+ shown_error = true;
+
+ m_bitmap.biWidth = w;
+ m_bitmap.biHeight = h;
+ }
+
+ AVIStreamWrite(m_streamCompressed, ++m_frameCount, 1, const_cast<u8*>(data), m_bitmap.biSizeImage, AVIIF_KEYFRAME, NULL, &m_byteBuffer);
m_totalBytes += m_byteBuffer;
// Close the recording if the file is more than 2gb
// VfW can't properly save files over 2gb in size, but can keep writing to them up to 4gb.
@@ -298,9 +310,9 @@ bool AVIDump::CreateFile()
return true;
}
-void AVIDump::AddFrame(uint8_t *data, int width, int height)
+void AVIDump::AddFrame(const u8* data, int width, int height)
{
- avpicture_fill((AVPicture *)s_BGRFrame, data, PIX_FMT_BGR24, width, height);
+ avpicture_fill((AVPicture *)s_BGRFrame, const_cast<u8*>(data), PIX_FMT_BGR24, width, height);
// Convert image from BGR24 to desired pixel format, and scale to initial
// width and height