2c2
< * Copyright (c) 2010 ARM Limited
---
> * Copyright (c) 2010, 2015 ARM Limited
56,58c56,59
< vc(NULL), fbPtr(NULL), videoMode(VideoConvert::UnknownMode),
< _videoWidth(1), _videoHeight(1), captureEnabled(p->frame_capture),
< captureCurrentFrame(0), captureLastHash(0), captureBitmap(0)
---
> fb(&FrameBuffer::dummy),
> _videoWidth(fb->width()), _videoHeight(fb->height()),
> captureEnabled(p->frame_capture),
> captureCurrentFrame(0), captureLastHash(0)
71,72c72
< VncInput::setFrameBufferParams(VideoConvert::Mode mode, uint16_t width,
< uint16_t height)
---
> VncInput::setFrameBuffer(const FrameBuffer *rfb)
74,75c74,75
< DPRINTF(VNC, "Updating video params: mode: %d width: %d height: %d\n", mode,
< width, height);
---
> if (!rfb)
> panic("Trying to VNC frame buffer to NULL!");
77,80c77
< if (mode != videoMode || width != videoWidth() || height != videoHeight()) {
< videoMode = mode;
< _videoWidth = width;
< _videoHeight = height;
---
> fb = rfb;
82,83c79,81
< if (vc)
< delete vc;
---
> // create bitmap of the frame with new attributes
> if (captureEnabled)
> captureBitmap.reset(new Bitmap(rfb));
85,86c83,86
< vc = new VideoConvert(mode, VideoConvert::rgb8888, videoWidth(),
< videoHeight());
---
> // Setting a new frame buffer means that we need to send an update
> // to the client. Mark the internal buffers as dirty to do so.
> setDirty();
> }
88,91c88,92
< if (captureEnabled) {
< // create bitmap of the frame with new attributes
< if (captureBitmap)
< delete captureBitmap;
---
> void
> VncInput::setDirty()
> {
> const unsigned width(fb->width());
> const unsigned height(fb->height());
93,96c94,101
< assert(fbPtr);
< captureBitmap = new Bitmap(videoMode, width, height, fbPtr);
< assert(captureBitmap);
< }
---
> if (_videoWidth != width || _videoHeight != height) {
> DPRINTF(VNC, "Updating video params: width: %d height: %d\n",
> width, height);
>
> _videoWidth = width;
> _videoHeight = height;
>
> frameBufferResized();
97a103,105
>
> if (captureEnabled)
> captureFrameBuffer();
106c114
< uint64_t new_hash = captureBitmap->getHash();
---
> uint64_t new_hash = fb->getHash();
119,120c127,128
< true);
< captureBitmap->write(fb_out);
---
> true);
> captureBitmap->write(*fb_out);