diff options
author | Chris Emmons <chris.emmons@arm.com> | 2011-12-01 00:15:26 -0800 |
---|---|---|
committer | Chris Emmons <chris.emmons@arm.com> | 2011-12-01 00:15:26 -0800 |
commit | 9aea847f5891214f456cc9d6e173d7fbb1a30c0a (patch) | |
tree | 71e5a57a62686debf7b8883d6f87f3a65a609098 /src/base/vnc/vncserver.hh | |
parent | 5bde1d359f0a0ce1d5ed46c3a9bb0ba33882f7b6 (diff) | |
download | gem5-9aea847f5891214f456cc9d6e173d7fbb1a30c0a.tar.xz |
VNC: Add support for capturing frame buffer to file each time it is changed.
When a change in the frame buffer from the VNC server is detected, the new
frame is stored out to the m5out/frames_*/ directory. Specifiy the flag
"--frame-capture" when running configs/example/fs.py to enable this behavior.
--HG--
extra : rebase_source : d4e08e83f4fa6ff79f3dc9c433fc1f0487e057fc
Diffstat (limited to 'src/base/vnc/vncserver.hh')
-rw-r--r-- | src/base/vnc/vncserver.hh | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/base/vnc/vncserver.hh b/src/base/vnc/vncserver.hh index 96dbdedda..33d833f26 100644 --- a/src/base/vnc/vncserver.hh +++ b/src/base/vnc/vncserver.hh @@ -48,6 +48,7 @@ #include <iostream> #include "base/vnc/convert.hh" +#include "base/bitmap.hh" #include "base/circlebuf.hh" #include "base/pollevent.hh" #include "base/socket.hh" @@ -55,6 +56,7 @@ #include "params/VncServer.hh" #include "sim/sim_object.hh" + /** * A device that expects to receive input from the vnc server should derrive * (through mulitple inheritence if necessary from VncKeyboard or VncMouse @@ -316,7 +318,25 @@ class VncServer : public SimObject /** The video converter that transforms data for us */ VideoConvert *vc; + /** Flag indicating whether to capture snapshots of frame buffer or not */ + bool captureEnabled; + + /** Current frame number being captured to a file */ + int captureCurrentFrame; + + /** Directory to store captured frames to */ + std::string captureOutputDirectory; + + /** Computed hash of the last captured frame */ + uint64_t captureLastHash; + + /** Cached bitmap object for writing out frame buffers to file */ + Bitmap *captureBitmap; + protected: + /** Captures the current frame buffer to a file */ + void captureFrameBuffer(); + /** * vnc client Interface */ @@ -449,6 +469,8 @@ class VncServer : public SimObject setDirty() { sendUpdate = true; + if (captureEnabled) + captureFrameBuffer(); sendFrameBufferUpdate(); } |