summaryrefslogtreecommitdiff
path: root/src/base/vnc/convert.hh
diff options
context:
space:
mode:
authorChris Emmons <chris.emmons@arm.com>2011-12-01 00:15:26 -0800
committerChris Emmons <chris.emmons@arm.com>2011-12-01 00:15:26 -0800
commit9aea847f5891214f456cc9d6e173d7fbb1a30c0a (patch)
tree71e5a57a62686debf7b8883d6f87f3a65a609098 /src/base/vnc/convert.hh
parent5bde1d359f0a0ce1d5ed46c3a9bb0ba33882f7b6 (diff)
downloadgem5-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/convert.hh')
-rw-r--r--src/base/vnc/convert.hh18
1 files changed, 14 insertions, 4 deletions
diff --git a/src/base/vnc/convert.hh b/src/base/vnc/convert.hh
index 68a21d677..17df0747b 100644
--- a/src/base/vnc/convert.hh
+++ b/src/base/vnc/convert.hh
@@ -44,6 +44,7 @@
#ifndef __BASE_VNC_CONVERT_HH__
#define __BASE_VNC_CONVERT_HH__
+#include <zlib.h>
#include "base/bitunion.hh"
class VideoConvert
@@ -107,12 +108,21 @@ class VideoConvert
* @param fb the frame buffer to convert
* @return the converted data (user must free)
*/
- uint8_t* convert(uint8_t *fb);
+ uint8_t* convert(const uint8_t *fb) const;
/** Return the number of pixels that this buffer specifies
* @return number of pixels
*/
- int area() { return width * height; }
+ int area() const { return width * height; }
+
+ /**
+ * Returns a hash on the raw data.
+ *
+ * @return hash of the buffer
+ */
+ inline uint64_t getHash(const uint8_t *fb) const {
+ return adler32(0UL, fb, width * height);
+ }
private:
@@ -121,7 +131,7 @@ class VideoConvert
* @param fb the data to convert
* @return converted data
*/
- uint8_t* bgr8888rgb8888(uint8_t *fb);
+ uint8_t* bgr8888rgb8888(const uint8_t *fb) const;
/**
* Convert a bgr565 or rgb565 input to rgb8888.
@@ -129,7 +139,7 @@ class VideoConvert
* @param bgr true if the input data is bgr565
* @return converted data
*/
- uint8_t* m565rgb8888(uint8_t *fb, bool bgr);
+ uint8_t* m565rgb8888(const uint8_t *fb, bool bgr) const;
Mode inputMode;
Mode outputMode;