GUAC-236: Fully implement sync instruction. Stub timestamp update for display.

This commit is contained in:
Michael Jumper 2016-02-26 23:44:58 -08:00
parent 4634ce391a
commit 899cdb4c00
2 changed files with 16 additions and 3 deletions

View File

@ -22,14 +22,28 @@
#include "config.h" #include "config.h"
#include "display.h" #include "display.h"
#include "log.h"
#include <guacamole/client.h>
#include <guacamole/timestamp.h> #include <guacamole/timestamp.h>
#include <stdlib.h> #include <stdlib.h>
int guacenc_display_sync(guacenc_display* display, guac_timestamp timestamp) { int guacenc_display_sync(guacenc_display* display, guac_timestamp timestamp) {
/* Verify timestamp is not decreasing */
if (timestamp < display->last_sync) {
guacenc_log(GUAC_LOG_DEBUG, "Decreasing sync timestamp");
return 1;
}
/* Update timestamp of display */
display->last_sync = timestamp;
/* STUB */ /* STUB */
return 0; return 0;
} }
guacenc_display* guacenc_display_alloc() { guacenc_display* guacenc_display_alloc() {

View File

@ -75,9 +75,8 @@ int guacenc_handle_sync(guacenc_display* display, int argc, char** argv) {
/* Parse arguments */ /* Parse arguments */
guac_timestamp timestamp = guacenc_parse_timestamp(argv[0]); guac_timestamp timestamp = guacenc_parse_timestamp(argv[0]);
/* STUB */ /* Update timestamp / flush frame */
guacenc_log(GUAC_LOG_DEBUG, "sync: timestamp=%" PRId64, timestamp); return guacenc_display_sync(display, timestamp);
return 0;
} }