vncinput.hh (9330:4a3269a11230) | vncinput.hh (10839:10cac0f0f419) |
---|---|
1/* | 1/* |
2 * Copyright (c) 2010 ARM Limited | 2 * Copyright (c) 2010, 2015 ARM Limited |
3 * All rights reserved 4 * 5 * The license below extends only to copyright in the software and shall 6 * not be construed as granting a license to any other intellectual 7 * property including but not limited to intellectual property relating 8 * to a hardware implementation of the functionality of the software 9 * licensed hereunder. You may use the software subject to the license 10 * terms below provided that you ensure that this notice is replicated --- 30 unchanged lines hidden (view full) --- 41/** @file 42 * Declaration of a VNC input 43 */ 44 45#ifndef __BASE_VNC_VNC_INPUT_HH__ 46#define __BASE_VNC_VNC_INPUT_HH__ 47 48#include <iostream> | 3 * All rights reserved 4 * 5 * The license below extends only to copyright in the software and shall 6 * not be construed as granting a license to any other intellectual 7 * property including but not limited to intellectual property relating 8 * to a hardware implementation of the functionality of the software 9 * licensed hereunder. You may use the software subject to the license 10 * terms below provided that you ensure that this notice is replicated --- 30 unchanged lines hidden (view full) --- 41/** @file 42 * Declaration of a VNC input 43 */ 44 45#ifndef __BASE_VNC_VNC_INPUT_HH__ 46#define __BASE_VNC_VNC_INPUT_HH__ 47 48#include <iostream> |
49#include <memory> |
|
49 | 50 |
50#include "base/vnc/convert.hh" | |
51#include "base/bitmap.hh" 52#include "params/VncInput.hh" 53#include "sim/sim_object.hh" 54 55/** 56 * A device that expects to receive input from the vnc server should derrive 57 * (through mulitple inheritence if necessary from VncKeyboard or VncMouse 58 * and call setKeyboard() or setMouse() respectively on the vnc server. --- 96 unchanged lines hidden (view full) --- 155 typedef VncInputParams Params; 156 VncInput(const Params *p); 157 158 /** Set the address of the frame buffer we are going to show. 159 * To avoid copying, just have the display controller 160 * tell us where the data is instead of constanly copying it around 161 * @param rfb frame buffer that we're going to use 162 */ | 51#include "base/bitmap.hh" 52#include "params/VncInput.hh" 53#include "sim/sim_object.hh" 54 55/** 56 * A device that expects to receive input from the vnc server should derrive 57 * (through mulitple inheritence if necessary from VncKeyboard or VncMouse 58 * and call setKeyboard() or setMouse() respectively on the vnc server. --- 96 unchanged lines hidden (view full) --- 155 typedef VncInputParams Params; 156 VncInput(const Params *p); 157 158 /** Set the address of the frame buffer we are going to show. 159 * To avoid copying, just have the display controller 160 * tell us where the data is instead of constanly copying it around 161 * @param rfb frame buffer that we're going to use 162 */ |
163 void 164 setFramebufferAddr(uint8_t* rfb) 165 { 166 fbPtr = rfb; 167 } | 163 virtual void setFrameBuffer(const FrameBuffer *rfb); |
168 169 /** Set up the device that would like to receive notifications when keys are 170 * pressed in the vnc client keyboard 171 * @param _keyboard an object that derrives from VncKeyboard 172 */ 173 void setKeyboard(VncKeyboard *_keyboard) { keyboard = _keyboard; } 174 175 /** Setup the device that would like to receive notifications when mouse --- 15 unchanged lines hidden (view full) --- 191 * @return the height of the simulated screen 192 */ 193 uint16_t videoHeight() const { return _videoHeight; } 194 195 /** The frame buffer uses this call to notify the vnc server that 196 * the frame buffer has been updated and a new image needs to be sent to the 197 * client 198 */ | 164 165 /** Set up the device that would like to receive notifications when keys are 166 * pressed in the vnc client keyboard 167 * @param _keyboard an object that derrives from VncKeyboard 168 */ 169 void setKeyboard(VncKeyboard *_keyboard) { keyboard = _keyboard; } 170 171 /** Setup the device that would like to receive notifications when mouse --- 15 unchanged lines hidden (view full) --- 187 * @return the height of the simulated screen 188 */ 189 uint16_t videoHeight() const { return _videoHeight; } 190 191 /** The frame buffer uses this call to notify the vnc server that 192 * the frame buffer has been updated and a new image needs to be sent to the 193 * client 194 */ |
199 virtual void setDirty() 200 { 201 if (captureEnabled) 202 captureFrameBuffer(); 203 } | 195 virtual void setDirty(); |
204 | 196 |
205 /** Set the mode of the data the frame buffer will be sending us 206 * @param mode the mode 207 */ 208 virtual void setFrameBufferParams(VideoConvert::Mode mode, uint16_t width, uint16_t height); 209 | |
210 protected: | 197 protected: |
198 virtual void frameBufferResized() {}; 199 |
|
211 /** The device to notify when we get key events */ 212 VncKeyboard *keyboard; 213 214 /** The device to notify when we get mouse events */ 215 VncMouse *mouse; 216 | 200 /** The device to notify when we get key events */ 201 VncKeyboard *keyboard; 202 203 /** The device to notify when we get mouse events */ 204 VncMouse *mouse; 205 |
217 /** The video converter that transforms data for us */ 218 VideoConvert *vc; 219 | |
220 /** pointer to the actual data that is stored in the frame buffer device */ | 206 /** pointer to the actual data that is stored in the frame buffer device */ |
221 uint8_t* fbPtr; | 207 const FrameBuffer *fb; |
222 | 208 |
223 /** The mode of data we're getting frame buffer in */ 224 VideoConvert::Mode videoMode; 225 | |
226 /** the width of the frame buffer we are sending to the client */ 227 uint16_t _videoWidth; 228 229 /** the height of the frame buffer we are sending to the client */ 230 uint16_t _videoHeight; 231 232 /** Flag indicating whether to capture snapshots of frame buffer or not */ 233 bool captureEnabled; 234 235 /** Current frame number being captured to a file */ 236 int captureCurrentFrame; 237 238 /** Directory to store captured frames to */ 239 std::string captureOutputDirectory; 240 241 /** Computed hash of the last captured frame */ 242 uint64_t captureLastHash; 243 244 /** Cached bitmap object for writing out frame buffers to file */ | 209 /** the width of the frame buffer we are sending to the client */ 210 uint16_t _videoWidth; 211 212 /** the height of the frame buffer we are sending to the client */ 213 uint16_t _videoHeight; 214 215 /** Flag indicating whether to capture snapshots of frame buffer or not */ 216 bool captureEnabled; 217 218 /** Current frame number being captured to a file */ 219 int captureCurrentFrame; 220 221 /** Directory to store captured frames to */ 222 std::string captureOutputDirectory; 223 224 /** Computed hash of the last captured frame */ 225 uint64_t captureLastHash; 226 227 /** Cached bitmap object for writing out frame buffers to file */ |
245 Bitmap *captureBitmap; | 228 std::unique_ptr<Bitmap> captureBitmap; |
246 247 /** Captures the current frame buffer to a file */ 248 void captureFrameBuffer(); 249}; 250#endif | 229 230 /** Captures the current frame buffer to a file */ 231 void captureFrameBuffer(); 232}; 233#endif |