forked from livekit/protocol
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlivekit_models.proto
361 lines (310 loc) · 7.54 KB
/
livekit_models.proto
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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
syntax = "proto3";
package livekit;
option go_package = "github.com/livekit/protocol/livekit";
option csharp_namespace = "LiveKit.Proto";
option ruby_package = "LiveKit::Proto";
import "google/protobuf/timestamp.proto";
message Room {
string sid = 1;
string name = 2;
uint32 empty_timeout = 3;
uint32 max_participants = 4;
int64 creation_time = 5;
string turn_password = 6;
repeated Codec enabled_codecs = 7;
string metadata = 8;
uint32 num_participants = 9;
bool active_recording = 10;
string key = 11;
}
message Codec {
string mime = 1;
string fmtp_line = 2;
}
enum AudioCodec {
DEFAULT_AC = 0;
OPUS = 1;
AAC = 2;
}
enum VideoCodec {
DEFAULT_VC = 0;
H264_BASELINE = 1;
H264_MAIN = 2;
H264_HIGH = 3;
VP8 = 4;
}
message ParticipantPermission {
// allow participant to subscribe to other tracks in the room
bool can_subscribe = 1;
// allow participant to publish new tracks to room
bool can_publish = 2;
// allow participant to publish data
bool can_publish_data = 3;
// sources that are allowed to be published
repeated TrackSource can_publish_sources = 9;
// indicates that it's hidden to others
bool hidden = 7;
// indicates it's a recorder instance
bool recorder = 8;
// indicates that participant can update own metadata
bool can_update_metadata = 10;
// NEXT_ID: 11
}
message ParticipantInfo {
enum State {
// websocket' connected, but not offered yet
JOINING = 0;
// server received client offer
JOINED = 1;
// ICE connectivity established
ACTIVE = 2;
// WS disconnected
DISCONNECTED = 3;
}
string sid = 1;
string identity = 2;
State state = 3;
repeated TrackInfo tracks = 4;
string metadata = 5;
// timestamp when participant joined room, in seconds
int64 joined_at = 6;
string name = 9;
uint32 version = 10;
ParticipantPermission permission = 11;
string region = 12;
// indicates the participant has an active publisher connection
// and can publish to the server
bool is_publisher = 13;
bool relayed = 14;
}
enum TrackType {
AUDIO = 0;
VIDEO = 1;
DATA = 2;
}
enum TrackSource {
UNKNOWN = 0;
CAMERA = 1;
MICROPHONE = 2;
SCREEN_SHARE = 3;
SCREEN_SHARE_AUDIO = 4;
}
message Encryption {
enum Type {
NONE=0;
GCM=1;
CUSTOM=2;
}
}
message SimulcastCodecInfo {
string mime_type = 1;
string mid = 2;
string cid = 3;
repeated VideoLayer layers = 4;
}
message TrackInfo {
string sid = 1;
TrackType type = 2;
string name = 3;
bool muted = 4;
// original width of video (unset for audio)
// clients may receive a lower resolution version with simulcast
uint32 width = 5;
// original height of video (unset for audio)
uint32 height = 6;
// true if track is simulcasted
bool simulcast = 7;
// true if DTX (Discontinuous Transmission) is disabled for audio
bool disable_dtx = 8;
// source of media
TrackSource source = 9;
repeated VideoLayer layers = 10;
// mime type of codec
string mime_type = 11;
string mid = 12;
repeated SimulcastCodecInfo codecs = 13;
bool stereo = 14;
// true if RED (Redundant Encoding) is disabled for audio
bool disable_red = 15;
Encryption.Type encryption = 16;
}
enum VideoQuality {
LOW = 0;
MEDIUM = 1;
HIGH = 2;
OFF = 3;
}
// provide information about available spatial layers
message VideoLayer {
// for tracks with a single layer, this should be HIGH
VideoQuality quality = 1;
uint32 width = 2;
uint32 height = 3;
// target bitrate in bit per second (bps), server will measure actual
uint32 bitrate = 4;
uint32 ssrc = 5;
}
// new DataPacket API
message DataPacket {
enum Kind {
RELIABLE = 0;
LOSSY = 1;
}
Kind kind = 1;
oneof value {
UserPacket user = 2;
ActiveSpeakerUpdate speaker = 3;
}
}
message ActiveSpeakerUpdate {
repeated SpeakerInfo speakers = 1;
}
message SpeakerInfo {
string sid = 1;
// audio level, 0-1.0, 1 is loudest
float level = 2;
// true if speaker is currently active
bool active = 3;
}
message UserPacket {
// participant ID of user that sent the message
string participant_sid = 1;
// user defined payload
bytes payload = 2;
// the ID of the participants who will receive the message (the message will be sent to all the people in the room if this variable is empty)
repeated string destination_sids = 3;
// topic under which the message was published
optional string topic = 4;
}
enum ConnectionQuality {
POOR = 0;
GOOD = 1;
EXCELLENT = 2;
}
message ParticipantTracks {
// participant ID of participant to whom the tracks belong
string participant_sid = 1;
repeated string track_sids = 2;
}
// details about the server
message ServerInfo {
enum Edition {
Standard = 0;
Cloud = 1;
}
Edition edition = 1;
string version = 2;
int32 protocol = 3;
string region = 4;
string node_id = 5;
// additional debugging information. sent only if server is in development mode
string debug_info = 6;
}
// details about the client
message ClientInfo {
enum SDK {
UNKNOWN = 0;
JS = 1;
SWIFT = 2;
ANDROID = 3;
FLUTTER = 4;
GO = 5;
UNITY = 6;
REACT_NATIVE = 7;
RUST = 8;
}
SDK sdk = 1;
string version = 2;
int32 protocol = 3;
string os = 4;
string os_version = 5;
string device_model = 6;
string browser = 7;
string browser_version = 8;
string address = 9;
// wifi, wired, cellular, vpn, empty if not known
string network = 10;
}
// server provided client configuration
message ClientConfiguration {
VideoConfiguration video = 1;
VideoConfiguration screen = 2;
ClientConfigSetting resume_connection = 3;
DisabledCodecs disabled_codecs = 4;
ClientConfigSetting force_relay = 5;
}
enum ClientConfigSetting {
UNSET = 0;
DISABLED = 1;
ENABLED = 2;
}
message VideoConfiguration {
ClientConfigSetting hardware_encoder = 1;
}
message DisabledCodecs {
repeated Codec codecs = 1;
}
enum DisconnectReason {
UNKNOWN_REASON = 0;
CLIENT_INITIATED = 1;
DUPLICATE_IDENTITY = 2;
SERVER_SHUTDOWN = 3;
PARTICIPANT_REMOVED = 4;
ROOM_DELETED = 5;
STATE_MISMATCH = 6;
JOIN_FAILURE = 7;
}
message RTPStats {
google.protobuf.Timestamp start_time = 1;
google.protobuf.Timestamp end_time = 2;
double duration = 3;
uint32 packets = 4;
double packet_rate = 5;
uint64 bytes = 6;
uint64 header_bytes = 39;
double bitrate = 7;
uint32 packets_lost = 8;
double packet_loss_rate = 9;
float packet_loss_percentage = 10;
uint32 packets_duplicate = 11;
double packet_duplicate_rate = 12;
uint64 bytes_duplicate = 13;
uint64 header_bytes_duplicate = 40;
double bitrate_duplicate = 14;
uint32 packets_padding = 15;
double packet_padding_rate = 16;
uint64 bytes_padding = 17;
uint64 header_bytes_padding = 41;
double bitrate_padding = 18;
uint32 packets_out_of_order = 19;
uint32 frames = 20;
double frame_rate = 21;
double jitter_current = 22;
double jitter_max = 23;
map<int32, uint32> gap_histogram = 24;
uint32 nacks = 25;
uint32 nack_acks = 37;
uint32 nack_misses = 26;
uint32 nack_repeated = 38;
uint32 plis = 27;
google.protobuf.Timestamp last_pli = 28;
uint32 firs = 29;
google.protobuf.Timestamp last_fir = 30;
uint32 rtt_current = 31;
uint32 rtt_max = 32;
uint32 key_frames = 33;
google.protobuf.Timestamp last_key_frame = 34;
uint32 layer_lock_plis = 35;
google.protobuf.Timestamp last_layer_lock_pli = 36;
}
message TimedVersion {
int64 unix_micro = 1;
int32 ticks = 2;
}
enum ReconnectReason {
RR_UNKOWN = 0;
RR_SIGNAL_DISCONNECTED = 1;
RR_PUBLISHER_FAILED = 2;
RR_SUBSCRIBER_FAILED = 3;
RR_SWITCH_CANDIDATE = 4;
}