68a69,72
> /** @file
> * Implementiation of a VNC server
> */
>
104,108c108,109
< : SimObject(p), listenEvent(NULL), dataEvent(NULL), number(p->number),
< dataFd(-1), _videoWidth(1), _videoHeight(1), clientRfb(0), keyboard(NULL),
< mouse(NULL), sendUpdate(false), videoMode(VideoConvert::UnknownMode),
< vc(NULL), captureEnabled(p->frame_capture), captureCurrentFrame(0),
< captureLastHash(0), captureBitmap(0)
---
> : VncInput(p), listenEvent(NULL), dataEvent(NULL), number(p->number),
> dataFd(-1), sendUpdate(false)
130,138d130
< if (captureEnabled) {
< // remove existing frame output directory if it exists, then create a
< // clean empty directory
< const string FRAME_OUTPUT_SUBDIR = "frames_" + name();
< simout.remove(FRAME_OUTPUT_SUBDIR, true);
< captureOutputDirectory = simout.createSubdirectory(
< FRAME_OUTPUT_SUBDIR);
< }
<
468d459
<
611c602
< if (!clientRfb || dataFd <= 0 || curState != NormalPhase || !sendUpdate) {
---
> if (!fbPtr || dataFd <= 0 || curState != NormalPhase || !sendUpdate) {
646c637
< assert(clientRfb);
---
> assert(fbPtr);
648c639
< uint8_t *tmp = vc->convert(clientRfb);
---
> uint8_t *tmp = vc->convert(fbPtr);
657c648
< assert(clientRfb && dataFd > 0 && curState == NormalPhase);
---
> assert(fbPtr && dataFd > 0 && curState == NormalPhase);
687c678,679
< VncServer::setFrameBufferParams(VideoConvert::Mode mode, int width, int height)
---
> VncServer::setFrameBufferParams(VideoConvert::Mode mode, uint16_t width,
> uint16_t height)
689,690c681
< DPRINTF(VNC, "Updating video params: mode: %d width: %d height: %d\n", mode,
< width, height);
---
> VncInput::setFrameBufferParams(mode, width, height);
693,713c684
< videoMode = mode;
< _videoWidth = width;
< _videoHeight = height;
<
< if (vc)
< delete vc;
<
< vc = new VideoConvert(mode, VideoConvert::rgb8888, videoWidth(),
< videoHeight());
<
< if (captureEnabled) {
< // create bitmap of the frame with new attributes
< if (captureBitmap)
< delete captureBitmap;
<
< assert(clientRfb);
< captureBitmap = new Bitmap(videoMode, width, height, clientRfb);
< assert(captureBitmap);
< }
<
< if (dataFd > 0 && clientRfb && curState == NormalPhase) {
---
> if (dataFd > 0 && fbPtr && curState == NormalPhase) {
730,754d700
< void
< VncServer::captureFrameBuffer()
< {
< assert(captureBitmap);
<
< // skip identical frames
< uint64_t new_hash = captureBitmap->getHash();
< if (captureLastHash == new_hash)
< return;
< captureLastHash = new_hash;
<
< // get the filename for the current frame
< char frameFilenameBuffer[64];
< snprintf(frameFilenameBuffer, 64, "fb.%06d.%lld.bmp.gz",
< captureCurrentFrame, static_cast<long long int>(curTick()));
< const string frameFilename(frameFilenameBuffer);
<
< // create the compressed framebuffer file
< ostream *fb_out = simout.create(captureOutputDirectory + frameFilename,
< true);
< captureBitmap->write(fb_out);
< simout.close(fb_out);
<
< ++captureCurrentFrame;
< }