ISA: Make the decode function part of the ISA's decoder.
[gem5.git] / src / base / vnc / vncserver.hh
index 23b097b111340d58807620030052d4ed7e245908..33d833f263caedfdae2dac58f5d75df5a535a24b 100644 (file)
 
 #include <iostream>
 
+#include "base/vnc/convert.hh"
+#include "base/bitmap.hh"
 #include "base/circlebuf.hh"
 #include "base/pollevent.hh"
 #include "base/socket.hh"
-#include "base/vnc/convert.hh"
 #include "cpu/intr_control.hh"
-#include "sim/sim_object.hh"
 #include "params/VncServer.hh"
+#include "sim/sim_object.hh"
+
 
 /**
  * A device that expects to receive input from the vnc server should derrive
@@ -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();
     }