-
Notifications
You must be signed in to change notification settings - Fork 1
/
ws_msgs.h
84 lines (78 loc) · 3.72 KB
/
ws_msgs.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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
#ifndef WS_MSGS_H
#define WS_MSGS_H
#include <libwebsockets.h>
int lws_send_json(struct lws *wsi, char *message);
char *generate_hello_msg();
char *generate_offer_msg();
int outgoing_ws_push(char *msg);
int outgoing_ws_shift(char *buf);
#define WS_OFFER_TEMPLATE "\
{ \
\"body\": { \
\"name\": null, \
\"participant\": { \
\"revision\": 1, \
\"tracks\":[] \
}, \
\"peer_connections\": [ \
{ \"description\": { \
\"type\": \"offer\", \
\"revision\": 1, \
\"sdp\": \"???\" \
}, \
\"id\": \"???\" \
} \
], \
\"type\": \"connect\", \
\"version\": 2, \
\"ice_servers\": \"success\", \
\"publisher\": { \
\"name\": \"twilio-video.js\", \
\"sdk_version\": \"2.4.0\", \
\"user_agent\": \"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.183 Safari/537.36\" }, \
\"bandwidth_profile\": { \
\"video\": { \
\"render_dimensions\":{ \
\"standard\": { \
\"width\":640, \
\"height\":360 \
}, \
\"low\": { \
\"width\":160, \
\"height\":90 \
}, \
\"high\": { \
\"width\": 1280, \
\"height\":720 \
} \
}, \
\"mode\": \"collaboration\", \
\"active_speaker_priority\":\"high\" \
} \
}, \
\"media_signaling\": { \
\"active_speaker\": { \
\"transports\": [{\"type\": \"data-channel\"}] \
}, \
\"network_quality\": { \
\"transports\":[{\"type\":\"data-channel\"}] \
}, \
\"track_priority\":{ \
\"transports\":[{\"type\":\"data-channel\"}] \
}, \
\"track_switch_off\":{ \
\"transports\":[{\"type\":\"data-channel\"}] \
} \
}, \
\"subscribe\": { \
\"rules\": [{\"type\":\"include\",\"all\":true}], \
\"revision\":1 \
}, \
\"format\":\"unified\", \
\"token\":\"???\"}, \
\"type\": \"msg\" \
} \
} \
} \
"
#endif