You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@guacamole.apache.org by jm...@apache.org on 2017/01/25 07:27:05 UTC

[1/5] incubator-guacamole-server git commit: GUACAMOLE-172: Clarify processing lag calculations.

Repository: incubator-guacamole-server
Updated Branches:
  refs/heads/master 070d46b09 -> 5d5fbb4d4


GUACAMOLE-172: Clarify processing lag calculations.


Project: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-server/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-server/commit/9e6e4e52
Tree: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-server/tree/9e6e4e52
Diff: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-server/diff/9e6e4e52

Branch: refs/heads/master
Commit: 9e6e4e520c2f37ff71ce0045372b359e62f1067d
Parents: 0ef87c4
Author: Michael Jumper <mj...@apache.org>
Authored: Tue Oct 4 13:26:32 2016 -0700
Committer: Michael Jumper <mj...@apache.org>
Committed: Tue Jan 24 00:18:00 2017 -0800

----------------------------------------------------------------------
 src/libguac/user-handlers.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-guacamole-server/blob/9e6e4e52/src/libguac/user-handlers.c
----------------------------------------------------------------------
diff --git a/src/libguac/user-handlers.c b/src/libguac/user-handlers.c
index 9cd558c..40ccb89 100644
--- a/src/libguac/user-handlers.c
+++ b/src/libguac/user-handlers.c
@@ -104,9 +104,8 @@ int __guac_handle_sync(guac_user* user, int argc, char** argv) {
     /* Update lag statistics if at least one frame has been rendered */
     if (user->last_frame_duration != 0) {
 
-        /* Approximate processing lag by summing the frame duration deltas */
-        int processing_lag = user->processing_lag + frame_duration
-                           - user->last_frame_duration;
+        /* Calculate lag using the previous frame as a baseline */
+        int processing_lag = frame_duration - user->last_frame_duration;
 
         /* Adjust back to zero if cumulative error leads to a negative value */
         if (processing_lag < 0)
@@ -116,8 +115,8 @@ int __guac_handle_sync(guac_user* user, int argc, char** argv) {
 
     }
 
-    /* Record duration of frame */
-    user->last_frame_duration = frame_duration;
+    /* Record baseline duration of frame by excluding lag */
+    user->last_frame_duration = frame_duration - user->processing_lag;
 
     if (user->sync_handler)
         return user->sync_handler(user, timestamp);


[3/5] incubator-guacamole-server git commit: GUACAMOLE-172: Use frame start as end of previous frame (ignore server-side time).

Posted by jm...@apache.org.
GUACAMOLE-172: Use frame start as end of previous frame (ignore server-side time).


Project: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-server/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-server/commit/234f9870
Tree: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-server/tree/234f9870
Diff: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-server/diff/234f9870

Branch: refs/heads/master
Commit: 234f98705ea8b9a56fda43fb7c1682e675760cb2
Parents: f641d91
Author: Michael Jumper <mj...@apache.org>
Authored: Fri Oct 14 13:31:41 2016 -0700
Committer: Michael Jumper <mj...@apache.org>
Committed: Tue Jan 24 00:18:07 2017 -0800

----------------------------------------------------------------------
 src/protocols/rdp/rdp.c | 14 +++++++-------
 src/protocols/vnc/vnc.c | 12 ++++++------
 2 files changed, 13 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-guacamole-server/blob/234f9870/src/protocols/rdp/rdp.c
----------------------------------------------------------------------
diff --git a/src/protocols/rdp/rdp.c b/src/protocols/rdp/rdp.c
index cf55c75..91f6eb9 100644
--- a/src/protocols/rdp/rdp.c
+++ b/src/protocols/rdp/rdp.c
@@ -832,6 +832,13 @@ static int guac_rdp_handle_connection(guac_client* client) {
                     break;
 
             } while (wait_result > 0);
+
+            /* Record end of frame, excluding server-side rendering time (we
+             * assume server-side rendering time will be consistent between any
+             * two subsequent frames, and that this time should thus be
+             * excluded from the required wait period of the next frame). */
+            last_frame_end = frame_start;
+
         }
 
         /* If an error occurred, fail */
@@ -839,14 +846,7 @@ static int guac_rdp_handle_connection(guac_client* client) {
             guac_client_abort(client, GUAC_PROTOCOL_STATUS_UPSTREAM_ERROR,
                     "Connection closed.");
 
-        /* Record end of frame, excluding server-side rendering time (we assume
-         * server-side rendering time will be consistent between any two
-         * subsequent frames, and that this time should thus be excluded from
-         * the required wait period of the next frame). */
-        last_frame_end = guac_timestamp_current();
-
         /* Flush frame */
-        /* End of frame */
         guac_common_display_flush(rdp_client->display);
         guac_client_end_frame(client);
         guac_socket_flush(client->socket);

http://git-wip-us.apache.org/repos/asf/incubator-guacamole-server/blob/234f9870/src/protocols/vnc/vnc.c
----------------------------------------------------------------------
diff --git a/src/protocols/vnc/vnc.c b/src/protocols/vnc/vnc.c
index 4f1e8da..db56d8b 100644
--- a/src/protocols/vnc/vnc.c
+++ b/src/protocols/vnc/vnc.c
@@ -402,18 +402,18 @@ void* guac_vnc_client_thread(void* data) {
 
             } while (wait_result > 0);
 
+            /* Record end of frame, excluding server-side rendering time (we
+             * assume server-side rendering time will be consistent between any
+             * two subsequent frames, and that this time should thus be
+             * excluded from the required wait period of the next frame). */
+            last_frame_end = frame_start;
+
         }
 
         /* If an error occurs, log it and fail */
         if (wait_result < 0)
             guac_client_abort(client, GUAC_PROTOCOL_STATUS_UPSTREAM_ERROR, "Connection closed.");
 
-        /* Record end of frame, excluding server-side rendering time (we assume
-         * server-side rendering time will be consistent between any two
-         * subsequent frames, and that this time should thus be excluded from
-         * the required wait period of the next frame). */
-        last_frame_end = guac_timestamp_current();
-
         /* Flush frame */
         guac_common_surface_flush(vnc_client->display->default_surface);
         guac_client_end_frame(client);


[2/5] incubator-guacamole-server git commit: GUACAMOLE-172: Exclude server-side rendering time from next frame's required wait (if render times are consistent, then including that time will result in duplicate waiting: once within the render loop, and ag

Posted by jm...@apache.org.
GUACAMOLE-172: Exclude server-side rendering time from next frame's required wait (if render times are consistent, then including that time will result in duplicate waiting: once within the render loop, and again when actually flushing the display).


Project: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-server/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-server/commit/f641d91b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-server/tree/f641d91b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-server/diff/f641d91b

Branch: refs/heads/master
Commit: f641d91b552fdf27ac7de7e253912c7b31d7c0dd
Parents: 9e6e4e5
Author: Michael Jumper <mj...@apache.org>
Authored: Fri Oct 7 14:02:17 2016 -0700
Committer: Michael Jumper <mj...@apache.org>
Committed: Tue Jan 24 00:18:04 2017 -0800

----------------------------------------------------------------------
 src/protocols/rdp/rdp.c | 10 +++++++---
 src/protocols/vnc/vnc.c |  9 ++++++---
 2 files changed, 13 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-guacamole-server/blob/f641d91b/src/protocols/rdp/rdp.c
----------------------------------------------------------------------
diff --git a/src/protocols/rdp/rdp.c b/src/protocols/rdp/rdp.c
index e759888..cf55c75 100644
--- a/src/protocols/rdp/rdp.c
+++ b/src/protocols/rdp/rdp.c
@@ -839,14 +839,18 @@ static int guac_rdp_handle_connection(guac_client* client) {
             guac_client_abort(client, GUAC_PROTOCOL_STATUS_UPSTREAM_ERROR,
                     "Connection closed.");
 
+        /* Record end of frame, excluding server-side rendering time (we assume
+         * server-side rendering time will be consistent between any two
+         * subsequent frames, and that this time should thus be excluded from
+         * the required wait period of the next frame). */
+        last_frame_end = guac_timestamp_current();
+
+        /* Flush frame */
         /* End of frame */
         guac_common_display_flush(rdp_client->display);
         guac_client_end_frame(client);
         guac_socket_flush(client->socket);
 
-        /* Record end of frame */
-        last_frame_end = guac_timestamp_current();
-
     }
 
     pthread_mutex_lock(&(rdp_client->rdp_lock));

http://git-wip-us.apache.org/repos/asf/incubator-guacamole-server/blob/f641d91b/src/protocols/vnc/vnc.c
----------------------------------------------------------------------
diff --git a/src/protocols/vnc/vnc.c b/src/protocols/vnc/vnc.c
index f9ab687..4f1e8da 100644
--- a/src/protocols/vnc/vnc.c
+++ b/src/protocols/vnc/vnc.c
@@ -408,14 +408,17 @@ void* guac_vnc_client_thread(void* data) {
         if (wait_result < 0)
             guac_client_abort(client, GUAC_PROTOCOL_STATUS_UPSTREAM_ERROR, "Connection closed.");
 
+        /* Record end of frame, excluding server-side rendering time (we assume
+         * server-side rendering time will be consistent between any two
+         * subsequent frames, and that this time should thus be excluded from
+         * the required wait period of the next frame). */
+        last_frame_end = guac_timestamp_current();
+
         /* Flush frame */
         guac_common_surface_flush(vnc_client->display->default_surface);
         guac_client_end_frame(client);
         guac_socket_flush(client->socket);
 
-        /* Record end of frame */
-        last_frame_end = guac_timestamp_current();
-
     }
 
     /* Kill client and finish connection */


[4/5] incubator-guacamole-server git commit: GUACAMOLE-172: Ignore insane timestamps when calculating lag.

Posted by jm...@apache.org.
GUACAMOLE-172: Ignore insane timestamps when calculating lag.


Project: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-server/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-server/commit/6131ad03
Tree: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-server/tree/6131ad03
Diff: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-server/diff/6131ad03

Branch: refs/heads/master
Commit: 6131ad03413aadf6667762f20dd28351f80c382a
Parents: 234f987
Author: Michael Jumper <mj...@apache.org>
Authored: Sun Jan 15 13:59:15 2017 -0800
Committer: Michael Jumper <mj...@apache.org>
Committed: Tue Jan 24 00:18:10 2017 -0800

----------------------------------------------------------------------
 src/libguac/user-handlers.c | 36 +++++++++++++++++++++---------------
 1 file changed, 21 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-guacamole-server/blob/6131ad03/src/libguac/user-handlers.c
----------------------------------------------------------------------
diff --git a/src/libguac/user-handlers.c b/src/libguac/user-handlers.c
index 40ccb89..4f1f59b 100644
--- a/src/libguac/user-handlers.c
+++ b/src/libguac/user-handlers.c
@@ -95,28 +95,34 @@ int __guac_handle_sync(guac_user* user, int argc, char** argv) {
     if (timestamp > user->client->last_sent_timestamp)
         return -1;
 
-    /* Update stored timestamp */
-    user->last_received_timestamp = timestamp;
+    /* Only update lag calculations if timestamp is sane */
+    if (timestamp >= user->last_received_timestamp) {
 
-    /* Calculate length of frame, including network and processing lag */
-    frame_duration = current - timestamp;
+        /* Update stored timestamp */
+        user->last_received_timestamp = timestamp;
 
-    /* Update lag statistics if at least one frame has been rendered */
-    if (user->last_frame_duration != 0) {
+        /* Calculate length of frame, including network and processing lag */
+        frame_duration = current - timestamp;
 
-        /* Calculate lag using the previous frame as a baseline */
-        int processing_lag = frame_duration - user->last_frame_duration;
+        /* Update lag statistics if at least one frame has been rendered */
+        if (user->last_frame_duration != 0) {
 
-        /* Adjust back to zero if cumulative error leads to a negative value */
-        if (processing_lag < 0)
-            processing_lag = 0;
+            /* Calculate lag using the previous frame as a baseline */
+            int processing_lag = frame_duration - user->last_frame_duration;
 
-        user->processing_lag = processing_lag;
+            /* Adjust back to zero if cumulative error leads to a negative
+             * value */
+            if (processing_lag < 0)
+                processing_lag = 0;
 
-    }
+            user->processing_lag = processing_lag;
+
+        }
 
-    /* Record baseline duration of frame by excluding lag */
-    user->last_frame_duration = frame_duration - user->processing_lag;
+        /* Record baseline duration of frame by excluding lag */
+        user->last_frame_duration = frame_duration - user->processing_lag;
+
+    }
 
     if (user->sync_handler)
         return user->sync_handler(user, timestamp);


[5/5] incubator-guacamole-server git commit: GUACAMOLE-172: Merge lag calculation improvements.

Posted by jm...@apache.org.
GUACAMOLE-172: Merge lag calculation improvements.


Project: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-server/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-server/commit/5d5fbb4d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-server/tree/5d5fbb4d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-server/diff/5d5fbb4d

Branch: refs/heads/master
Commit: 5d5fbb4d455ce1191d3876513b97bf433189b919
Parents: 070d46b 6131ad0
Author: James Muehlner <ja...@guac-dev.org>
Authored: Tue Jan 24 23:26:29 2017 -0800
Committer: James Muehlner <ja...@guac-dev.org>
Committed: Tue Jan 24 23:26:29 2017 -0800

----------------------------------------------------------------------
 src/libguac/user-handlers.c | 37 +++++++++++++++++++++----------------
 src/protocols/rdp/rdp.c     | 12 ++++++++----
 src/protocols/vnc/vnc.c     |  9 ++++++---
 3 files changed, 35 insertions(+), 23 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-guacamole-server/blob/5d5fbb4d/src/protocols/rdp/rdp.c
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-guacamole-server/blob/5d5fbb4d/src/protocols/vnc/vnc.c
----------------------------------------------------------------------