-
Notifications
You must be signed in to change notification settings - Fork 0
/
pulsar.h
executable file
·63 lines (54 loc) · 1.15 KB
/
pulsar.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#ifndef PULSAR_H
#define PULSAR_H
#include <X11/X.h>
#include <X11/extensions/Xdamage.h>
#include <sys/queue.h>
#include <stdint.h>
#include <pthread.h>
/**
* A rect region
**/
typedef struct {
int x;
int y;
int width;
int height;
int init;
} pulsar_region_t;
typedef struct {
/**
* the type of graphics encoding mode
**/
enum {
IMAGE,
STREAM
} graphics_mode;
int port;
/**
* pedding list for sending
**/
} pulsar_config_t;
struct encoded_entry {
int x;
int y;
int size;
uint8_t *data;
STAILQ_ENTRY(encoded_entry) pointers;
};
typedef struct {
pulsar_region_t region; // rect region damaged
Display *display;
Window root;
time_t lasttime;
pthread_t xthread; // X11 thread
pthread_t ethread; // encoder thread
pthread_mutex_t mutex;
STAILQ_HEAD(encoded_list, encoded_entry) pending_list;
} pulsar_context_t;
typedef struct {
int size;
uint8_t *data;
} encoded_data_t;
void pulsar_context_init(pulsar_context_t *pulsar_context);
void pulsar_context_region_add(pulsar_context_t *context, int x, int y, int width, int height);
#endif