[kvmfr] decouple cursor flags from frame flags and fix timings

This commit is contained in:
Geoffrey McRae
2018-05-24 09:01:53 +10:00
parent 7a5bbb1e59
commit df7183a572
2 changed files with 79 additions and 74 deletions

View File

@@ -21,7 +21,7 @@ Place, Suite 330, Boston, MA 02111-1307 USA
#include <stdint.h>
#define KVMFR_HEADER_MAGIC "[[KVMFR]]"
#define KVMFR_HEADER_VERSION 5
#define KVMFR_HEADER_VERSION 6
typedef enum FrameType
{
@@ -40,9 +40,10 @@ typedef enum CursorType
}
CursorType;
#define KVMFR_CURSOR_FLAG_VISIBLE 1 // cursor is visible
#define KVMFR_CURSOR_FLAG_SHAPE 2 // shape updated
#define KVMFR_CURSOR_FLAG_POS 4 // position updated
#define KVMFR_CURSOR_FLAG_UPDATE 1 // cursor update available
#define KVMFR_CURSOR_FLAG_VISIBLE 2 // cursor is visible
#define KVMFR_CURSOR_FLAG_SHAPE 4 // shape updated
#define KVMFR_CURSOR_FLAG_POS 8 // position updated
typedef struct KVMFRCursor
{
@@ -58,8 +59,11 @@ typedef struct KVMFRCursor
}
KVMFRCursor;
#define KVMFR_FRAME_FLAG_UPDATE 1 // frame update available
typedef struct KVMFRFrame
{
uint8_t flags; // KVMFR_FRAME_FLAGS
FrameType type; // the frame data type
uint32_t width; // the width
uint32_t height; // the height
@@ -69,23 +73,16 @@ typedef struct KVMFRFrame
}
KVMFRFrame;
#define KVMFR_HEADER_FLAG_FRAME 1 // frame update available
#define KVMFR_HEADER_FLAG_CURSOR 2 // cursor update available
#define KVMFR_HEADER_FLAG_RESTART 4 // restart signal from client
#define KVMFR_HEADER_FLAG_READY 8 // ready signal from client
typedef struct KVMFRDetail
{
KVMFRFrame frame; // the frame information
KVMFRCursor cursor; // the cursor information
}
KVMFRDetail;
#define KVMFR_HEADER_FLAG_RESTART 1 // restart signal from client
#define KVMFR_HEADER_FLAG_READY 2 // ready signal from client
#define KVMFR_HEADER_FLAG_PAUSED 4 // capture has been paused by the host
typedef struct KVMFRHeader
{
char magic[sizeof(KVMFR_HEADER_MAGIC)];
uint32_t version; // version of this structure
uint8_t flags; // KVMFR_HEADER_FLAGS
KVMFRDetail detail; // details
KVMFRFrame frame; // the frame information
KVMFRCursor cursor; // the cursor information
}
KVMFRHeader;
KVMFRHeader;