aboutsummaryrefslogtreecommitdiffstats
path: root/common/rfb
diff options
context:
space:
mode:
Diffstat (limited to 'common/rfb')
-rw-r--r--common/rfb/SDesktop.h4
-rw-r--r--common/rfb/VNCServer.h2
-rw-r--r--common/rfb/VNCServerST.cxx12
-rw-r--r--common/rfb/VNCServerST.h2
4 files changed, 18 insertions, 2 deletions
diff --git a/common/rfb/SDesktop.h b/common/rfb/SDesktop.h
index 560ee7ff..94e4b028 100644
--- a/common/rfb/SDesktop.h
+++ b/common/rfb/SDesktop.h
@@ -87,6 +87,10 @@ namespace rfb {
return resultProhibited;
}
+ // frameTick() is called whenever a frame update has been processed,
+ // signalling that a good time to render new data
+ virtual void frameTick(uint64_t msc) { (void)msc; }
+
// InputHandler interface
// pointerEvent(), keyEvent() and clientCutText() are called in response to
// the relevant RFB protocol messages from clients.
diff --git a/common/rfb/VNCServer.h b/common/rfb/VNCServer.h
index 3f97634b..314367eb 100644
--- a/common/rfb/VNCServer.h
+++ b/common/rfb/VNCServer.h
@@ -42,6 +42,8 @@ namespace rfb {
virtual void blockUpdates() = 0;
virtual void unblockUpdates() = 0;
+ virtual uint64_t getMsc() = 0;
+
// setPixelBuffer() tells the server to use the given pixel buffer (and
// optionally a modified screen layout). If this differs in size from
// the previous pixel buffer, this may result in protocol messages being
diff --git a/common/rfb/VNCServerST.cxx b/common/rfb/VNCServerST.cxx
index 8d8dbfd7..bea32abe 100644
--- a/common/rfb/VNCServerST.cxx
+++ b/common/rfb/VNCServerST.cxx
@@ -1,5 +1,5 @@
/* Copyright (C) 2002-2005 RealVNC Ltd. All Rights Reserved.
- * Copyright 2009-2019 Pierre Ossman for Cendio AB
+ * Copyright 2009-2024 Pierre Ossman for Cendio AB
*
* This is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -88,7 +88,7 @@ VNCServerST::VNCServerST(const char* name_, SDesktop* desktop_)
renderedCursorInvalid(false),
keyRemapper(&KeyRemapper::defInstance),
idleTimer(this), disconnectTimer(this), connectTimer(this),
- frameTimer(this)
+ msc(0), frameTimer(this)
{
slog.debug("creating single-threaded server %s", name.c_str());
@@ -257,6 +257,11 @@ void VNCServerST::unblockUpdates()
}
}
+uint64_t VNCServerST::getMsc()
+{
+ return msc;
+}
+
void VNCServerST::setPixelBuffer(PixelBuffer* pb_, const ScreenSet& layout)
{
if (comparer)
@@ -634,6 +639,9 @@ void VNCServerST::handleTimeout(Timer* t)
writeUpdate();
+ msc++;
+ desktop->frameTick(msc);
+
// If this is the first iteration then we need to adjust the timeout
frameTimer.repeat(1000/rfb::Server::frameRate);
} else if (t == &idleTimer) {
diff --git a/common/rfb/VNCServerST.h b/common/rfb/VNCServerST.h
index 55d0c889..719b3f36 100644
--- a/common/rfb/VNCServerST.h
+++ b/common/rfb/VNCServerST.h
@@ -81,6 +81,7 @@ namespace rfb {
virtual void blockUpdates();
virtual void unblockUpdates();
+ virtual uint64_t getMsc();
virtual void setPixelBuffer(PixelBuffer* pb, const ScreenSet& layout);
virtual void setPixelBuffer(PixelBuffer* pb);
virtual void setScreenLayout(const ScreenSet& layout);
@@ -206,6 +207,7 @@ namespace rfb {
Timer disconnectTimer;
Timer connectTimer;
+ uint64_t msc;
Timer frameTimer;
};