aboutsummaryrefslogtreecommitdiffstats
path: root/vncviewer/CConn.cxx
diff options
context:
space:
mode:
authorPierre Ossman <ossman@cendio.se>2015-11-09 16:34:54 +0100
committerPierre Ossman <ossman@cendio.se>2015-11-27 10:56:26 +0100
commit9f273e9cd806288a37d1aae2d9f9ddae7262b8e5 (patch)
tree606123fc1b4a41eb740ec6750404aa41aa483182 /vncviewer/CConn.cxx
parent0068a4f5faa309b1f5e49dbf37d49f72db806cb4 (diff)
downloadtigervnc-9f273e9cd806288a37d1aae2d9f9ddae7262b8e5.tar.gz
tigervnc-9f273e9cd806288a37d1aae2d9f9ddae7262b8e5.zip
Delegate decoder object management to a separate class
Done in preparation for multi-core decoding. Keeps the complexity out of the other classes. This also moves ownership of the framebuffer in to CConnection. It's the CConnection object that is aware of the threads and how to synchronise with them. Therefore the ownership of the framebuffer must also be there to make sure it isn't deleted whilst threads are working.
Diffstat (limited to 'vncviewer/CConn.cxx')
-rw-r--r--vncviewer/CConn.cxx22
1 files changed, 1 insertions, 21 deletions
diff --git a/vncviewer/CConn.cxx b/vncviewer/CConn.cxx
index 9c127962..54716d3e 100644
--- a/vncviewer/CConn.cxx
+++ b/vncviewer/CConn.cxx
@@ -29,8 +29,6 @@
#include <rfb/CMsgWriter.h>
#include <rfb/CSecurity.h>
-#include <rfb/encodings.h>
-#include <rfb/Decoder.h>
#include <rfb/Hostname.h>
#include <rfb/LogWriter.h>
#include <rfb/Security.h>
@@ -83,8 +81,6 @@ CConn::CConn(const char* vncServerName, network::Socket* socket=NULL)
setShared(::shared);
sock = socket;
- memset(decoders, 0, sizeof(decoders));
-
int encNum = encodingNum(preferredEncoding);
if (encNum != -1)
currentEncoding = encNum;
@@ -137,9 +133,6 @@ CConn::~CConn()
OptionsDialog::removeCallback(handleOptions);
Fl::remove_timeout(handleUpdateTimeout, this);
- for (size_t i = 0; i < sizeof(decoders)/sizeof(decoders[0]); i++)
- delete decoders[i];
-
if (desktop)
delete desktop;
@@ -441,20 +434,7 @@ void CConn::dataRect(const Rect& r, int encoding)
if (encoding != encodingCopyRect)
lastServerEncoding = encoding;
- if (!Decoder::supported(encoding)) {
- // TRANSLATORS: Refers to a VNC protocol encoding type
- vlog.error(_("Unknown encoding %d"), encoding);
- throw Exception(_("Unknown encoding"));
- }
-
- if (!decoders[encoding]) {
- decoders[encoding] = Decoder::createDecoder(encoding, this);
- if (!decoders[encoding]) {
- vlog.error(_("Unknown encoding %d"), encoding);
- throw Exception(_("Unknown encoding"));
- }
- }
- decoders[encoding]->readRect(r, desktop->getFramebuffer());
+ CConnection::dataRect(r, encoding);
sock->inStream().stopTiming();
}