summaryrefslogtreecommitdiffstats
path: root/src/client/vnc/vncthread.h
diff options
context:
space:
mode:
authorSimon Rettberg2018-07-20 18:21:41 +0200
committerSimon Rettberg2018-07-20 18:21:41 +0200
commit7b57706df76a675592c026264d3a2028ed4b47b5 (patch)
tree3db5146b718e9cfb29e6d61461e36a3b587eb2b8 /src/client/vnc/vncthread.h
parentCMake: Add config fields for compiler flags (diff)
downloadpvs2-7b57706df76a675592c026264d3a2028ed4b47b5.tar.gz
pvs2-7b57706df76a675592c026264d3a2028ed4b47b5.tar.xz
pvs2-7b57706df76a675592c026264d3a2028ed4b47b5.zip
[client] Rewrite thread sync for VNC yet again
Move processing of image (scaling) to GUI thread. Get rid of second (scaled) image buffer. Instead, whenever we redraw parts of the VNC viewer, the according image parts will be copied and scaled from the buffer the vncclient thread is using. The buffer is wrapped in a QImage and handed over using a QSharedPointer, so reinitializing the buffer on the fly should yield no problems.
Diffstat (limited to 'src/client/vnc/vncthread.h')
-rw-r--r--src/client/vnc/vncthread.h11
1 files changed, 2 insertions, 9 deletions
diff --git a/src/client/vnc/vncthread.h b/src/client/vnc/vncthread.h
index 38f5e17..16491fe 100644
--- a/src/client/vnc/vncthread.h
+++ b/src/client/vnc/vncthread.h
@@ -39,19 +39,13 @@ class VncThread : public QThread
private:
rfbClient *_client;
- quint8 *_frameBuffer;
QString _host;
int _port;
QString _passwd;
int _quality;
- QImage _img;
- QSharedPointer<QImage> _imgScaled;
- QSize _clientSize;
- QSize _localSize;
-
- int _srcStepX, _srcStepY, _dstStepX, _dstStepY;
+ QSharedPointer<QImage> _img;
volatile bool _connected;
volatile bool _run;
@@ -71,11 +65,10 @@ public:
VncThread(QString host, int port, QString passwd, int quality);
~VncThread();
- const QSize& getSourceSize() const { return _clientSize; }
const QString getDesktopName() const;
bool isConnected() { return _connected; }
void stop() { _run = false; }
- void setTargetBuffer(QSharedPointer<QImage> &buffer);
+ const QSharedPointer<QImage>& getFrameBuffer() { return _img; }
void run();
int const static HIGH = 0;