@livekit/rtc-node 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,969 @@
1
+ // Copyright 2023 LiveKit, Inc.
2
+ //
3
+ // Licensed under the Apache License, Version 2.0 (the "License");
4
+ // you may not use this file except in compliance with the License.
5
+ // You may obtain a copy of the License at
6
+ //
7
+ // http://www.apache.org/licenses/LICENSE-2.0
8
+ //
9
+ // Unless required by applicable law or agreed to in writing, software
10
+ // distributed under the License is distributed on an "AS IS" BASIS,
11
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ // See the License for the specific language governing permissions and
13
+ // limitations under the License.
14
+
15
+ // @generated by protoc-gen-es v1.4.2 with parameter "target=ts"
16
+ // @generated from file ffi.proto (package livekit.proto, syntax proto3)
17
+ /* eslint-disable */
18
+ // @ts-nocheck
19
+
20
+ import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf";
21
+ import { Message, proto3, protoInt64 } from "@bufbuild/protobuf";
22
+ import { ConnectCallback, ConnectRequest, ConnectResponse, DisconnectCallback, DisconnectRequest, DisconnectResponse, PublishDataCallback, PublishDataRequest, PublishDataResponse, PublishTrackCallback, PublishTrackRequest, PublishTrackResponse, RoomEvent, SetSubscribedRequest, SetSubscribedResponse, UnpublishTrackCallback, UnpublishTrackRequest, UnpublishTrackResponse, UpdateLocalMetadataCallback, UpdateLocalMetadataRequest, UpdateLocalMetadataResponse, UpdateLocalNameCallback, UpdateLocalNameRequest, UpdateLocalNameResponse } from "./room_pb.js";
23
+ import { CreateAudioTrackRequest, CreateAudioTrackResponse, CreateVideoTrackRequest, CreateVideoTrackResponse, GetStatsCallback, GetStatsRequest, GetStatsResponse, TrackEvent } from "./track_pb.js";
24
+ import { AllocVideoBufferRequest, AllocVideoBufferResponse, CaptureVideoFrameRequest, CaptureVideoFrameResponse, NewVideoSourceRequest, NewVideoSourceResponse, NewVideoStreamRequest, NewVideoStreamResponse, ToArgbRequest, ToArgbResponse, ToI420Request, ToI420Response, VideoStreamEvent } from "./video_frame_pb.js";
25
+ import { AllocAudioBufferRequest, AllocAudioBufferResponse, AudioStreamEvent, CaptureAudioFrameCallback, CaptureAudioFrameRequest, CaptureAudioFrameResponse, NewAudioResamplerRequest, NewAudioResamplerResponse, NewAudioSourceRequest, NewAudioSourceResponse, NewAudioStreamRequest, NewAudioStreamResponse, RemixAndResampleRequest, RemixAndResampleResponse } from "./audio_frame_pb.js";
26
+ import { E2eeRequest, E2eeResponse } from "./e2ee_pb.js";
27
+
28
+ /**
29
+ * @generated from enum livekit.proto.LogLevel
30
+ */
31
+ export enum LogLevel {
32
+ /**
33
+ * @generated from enum value: LOG_ERROR = 0;
34
+ */
35
+ LOG_ERROR = 0,
36
+
37
+ /**
38
+ * @generated from enum value: LOG_WARN = 1;
39
+ */
40
+ LOG_WARN = 1,
41
+
42
+ /**
43
+ * @generated from enum value: LOG_INFO = 2;
44
+ */
45
+ LOG_INFO = 2,
46
+
47
+ /**
48
+ * @generated from enum value: LOG_DEBUG = 3;
49
+ */
50
+ LOG_DEBUG = 3,
51
+
52
+ /**
53
+ * @generated from enum value: LOG_TRACE = 4;
54
+ */
55
+ LOG_TRACE = 4,
56
+ }
57
+ // Retrieve enum metadata with: proto3.getEnumType(LogLevel)
58
+ proto3.util.setEnumType(LogLevel, "livekit.proto.LogLevel", [
59
+ { no: 0, name: "LOG_ERROR" },
60
+ { no: 1, name: "LOG_WARN" },
61
+ { no: 2, name: "LOG_INFO" },
62
+ { no: 3, name: "LOG_DEBUG" },
63
+ { no: 4, name: "LOG_TRACE" },
64
+ ]);
65
+
66
+ /**
67
+ * This is the input of livekit_ffi_request function
68
+ * We always expect a response (FFIResponse, even if it's empty)
69
+ *
70
+ * @generated from message livekit.proto.FfiRequest
71
+ */
72
+ export class FfiRequest extends Message<FfiRequest> {
73
+ /**
74
+ * @generated from oneof livekit.proto.FfiRequest.message
75
+ */
76
+ message: {
77
+ /**
78
+ * @generated from field: livekit.proto.InitializeRequest initialize = 1;
79
+ */
80
+ value: InitializeRequest;
81
+ case: "initialize";
82
+ } | {
83
+ /**
84
+ * @generated from field: livekit.proto.DisposeRequest dispose = 2;
85
+ */
86
+ value: DisposeRequest;
87
+ case: "dispose";
88
+ } | {
89
+ /**
90
+ * Room
91
+ *
92
+ * @generated from field: livekit.proto.ConnectRequest connect = 3;
93
+ */
94
+ value: ConnectRequest;
95
+ case: "connect";
96
+ } | {
97
+ /**
98
+ * @generated from field: livekit.proto.DisconnectRequest disconnect = 4;
99
+ */
100
+ value: DisconnectRequest;
101
+ case: "disconnect";
102
+ } | {
103
+ /**
104
+ * @generated from field: livekit.proto.PublishTrackRequest publish_track = 5;
105
+ */
106
+ value: PublishTrackRequest;
107
+ case: "publishTrack";
108
+ } | {
109
+ /**
110
+ * @generated from field: livekit.proto.UnpublishTrackRequest unpublish_track = 6;
111
+ */
112
+ value: UnpublishTrackRequest;
113
+ case: "unpublishTrack";
114
+ } | {
115
+ /**
116
+ * @generated from field: livekit.proto.PublishDataRequest publish_data = 7;
117
+ */
118
+ value: PublishDataRequest;
119
+ case: "publishData";
120
+ } | {
121
+ /**
122
+ * @generated from field: livekit.proto.SetSubscribedRequest set_subscribed = 8;
123
+ */
124
+ value: SetSubscribedRequest;
125
+ case: "setSubscribed";
126
+ } | {
127
+ /**
128
+ * @generated from field: livekit.proto.UpdateLocalMetadataRequest update_local_metadata = 9;
129
+ */
130
+ value: UpdateLocalMetadataRequest;
131
+ case: "updateLocalMetadata";
132
+ } | {
133
+ /**
134
+ * @generated from field: livekit.proto.UpdateLocalNameRequest update_local_name = 10;
135
+ */
136
+ value: UpdateLocalNameRequest;
137
+ case: "updateLocalName";
138
+ } | {
139
+ /**
140
+ * Track
141
+ *
142
+ * @generated from field: livekit.proto.CreateVideoTrackRequest create_video_track = 11;
143
+ */
144
+ value: CreateVideoTrackRequest;
145
+ case: "createVideoTrack";
146
+ } | {
147
+ /**
148
+ * @generated from field: livekit.proto.CreateAudioTrackRequest create_audio_track = 12;
149
+ */
150
+ value: CreateAudioTrackRequest;
151
+ case: "createAudioTrack";
152
+ } | {
153
+ /**
154
+ * @generated from field: livekit.proto.GetStatsRequest get_stats = 13;
155
+ */
156
+ value: GetStatsRequest;
157
+ case: "getStats";
158
+ } | {
159
+ /**
160
+ * Video
161
+ *
162
+ * @generated from field: livekit.proto.AllocVideoBufferRequest alloc_video_buffer = 14;
163
+ */
164
+ value: AllocVideoBufferRequest;
165
+ case: "allocVideoBuffer";
166
+ } | {
167
+ /**
168
+ * @generated from field: livekit.proto.NewVideoStreamRequest new_video_stream = 15;
169
+ */
170
+ value: NewVideoStreamRequest;
171
+ case: "newVideoStream";
172
+ } | {
173
+ /**
174
+ * @generated from field: livekit.proto.NewVideoSourceRequest new_video_source = 16;
175
+ */
176
+ value: NewVideoSourceRequest;
177
+ case: "newVideoSource";
178
+ } | {
179
+ /**
180
+ * @generated from field: livekit.proto.CaptureVideoFrameRequest capture_video_frame = 17;
181
+ */
182
+ value: CaptureVideoFrameRequest;
183
+ case: "captureVideoFrame";
184
+ } | {
185
+ /**
186
+ * @generated from field: livekit.proto.ToI420Request to_i420 = 18;
187
+ */
188
+ value: ToI420Request;
189
+ case: "toI420";
190
+ } | {
191
+ /**
192
+ * @generated from field: livekit.proto.ToArgbRequest to_argb = 19;
193
+ */
194
+ value: ToArgbRequest;
195
+ case: "toArgb";
196
+ } | {
197
+ /**
198
+ * Audio
199
+ *
200
+ * @generated from field: livekit.proto.AllocAudioBufferRequest alloc_audio_buffer = 20;
201
+ */
202
+ value: AllocAudioBufferRequest;
203
+ case: "allocAudioBuffer";
204
+ } | {
205
+ /**
206
+ * @generated from field: livekit.proto.NewAudioStreamRequest new_audio_stream = 21;
207
+ */
208
+ value: NewAudioStreamRequest;
209
+ case: "newAudioStream";
210
+ } | {
211
+ /**
212
+ * @generated from field: livekit.proto.NewAudioSourceRequest new_audio_source = 22;
213
+ */
214
+ value: NewAudioSourceRequest;
215
+ case: "newAudioSource";
216
+ } | {
217
+ /**
218
+ * @generated from field: livekit.proto.CaptureAudioFrameRequest capture_audio_frame = 23;
219
+ */
220
+ value: CaptureAudioFrameRequest;
221
+ case: "captureAudioFrame";
222
+ } | {
223
+ /**
224
+ * @generated from field: livekit.proto.NewAudioResamplerRequest new_audio_resampler = 24;
225
+ */
226
+ value: NewAudioResamplerRequest;
227
+ case: "newAudioResampler";
228
+ } | {
229
+ /**
230
+ * @generated from field: livekit.proto.RemixAndResampleRequest remix_and_resample = 25;
231
+ */
232
+ value: RemixAndResampleRequest;
233
+ case: "remixAndResample";
234
+ } | {
235
+ /**
236
+ * @generated from field: livekit.proto.E2eeRequest e2ee = 26;
237
+ */
238
+ value: E2eeRequest;
239
+ case: "e2ee";
240
+ } | { case: undefined; value?: undefined } = { case: undefined };
241
+
242
+ constructor(data?: PartialMessage<FfiRequest>) {
243
+ super();
244
+ proto3.util.initPartial(data, this);
245
+ }
246
+
247
+ static readonly runtime: typeof proto3 = proto3;
248
+ static readonly typeName = "livekit.proto.FfiRequest";
249
+ static readonly fields: FieldList = proto3.util.newFieldList(() => [
250
+ { no: 1, name: "initialize", kind: "message", T: InitializeRequest, oneof: "message" },
251
+ { no: 2, name: "dispose", kind: "message", T: DisposeRequest, oneof: "message" },
252
+ { no: 3, name: "connect", kind: "message", T: ConnectRequest, oneof: "message" },
253
+ { no: 4, name: "disconnect", kind: "message", T: DisconnectRequest, oneof: "message" },
254
+ { no: 5, name: "publish_track", kind: "message", T: PublishTrackRequest, oneof: "message" },
255
+ { no: 6, name: "unpublish_track", kind: "message", T: UnpublishTrackRequest, oneof: "message" },
256
+ { no: 7, name: "publish_data", kind: "message", T: PublishDataRequest, oneof: "message" },
257
+ { no: 8, name: "set_subscribed", kind: "message", T: SetSubscribedRequest, oneof: "message" },
258
+ { no: 9, name: "update_local_metadata", kind: "message", T: UpdateLocalMetadataRequest, oneof: "message" },
259
+ { no: 10, name: "update_local_name", kind: "message", T: UpdateLocalNameRequest, oneof: "message" },
260
+ { no: 11, name: "create_video_track", kind: "message", T: CreateVideoTrackRequest, oneof: "message" },
261
+ { no: 12, name: "create_audio_track", kind: "message", T: CreateAudioTrackRequest, oneof: "message" },
262
+ { no: 13, name: "get_stats", kind: "message", T: GetStatsRequest, oneof: "message" },
263
+ { no: 14, name: "alloc_video_buffer", kind: "message", T: AllocVideoBufferRequest, oneof: "message" },
264
+ { no: 15, name: "new_video_stream", kind: "message", T: NewVideoStreamRequest, oneof: "message" },
265
+ { no: 16, name: "new_video_source", kind: "message", T: NewVideoSourceRequest, oneof: "message" },
266
+ { no: 17, name: "capture_video_frame", kind: "message", T: CaptureVideoFrameRequest, oneof: "message" },
267
+ { no: 18, name: "to_i420", kind: "message", T: ToI420Request, oneof: "message" },
268
+ { no: 19, name: "to_argb", kind: "message", T: ToArgbRequest, oneof: "message" },
269
+ { no: 20, name: "alloc_audio_buffer", kind: "message", T: AllocAudioBufferRequest, oneof: "message" },
270
+ { no: 21, name: "new_audio_stream", kind: "message", T: NewAudioStreamRequest, oneof: "message" },
271
+ { no: 22, name: "new_audio_source", kind: "message", T: NewAudioSourceRequest, oneof: "message" },
272
+ { no: 23, name: "capture_audio_frame", kind: "message", T: CaptureAudioFrameRequest, oneof: "message" },
273
+ { no: 24, name: "new_audio_resampler", kind: "message", T: NewAudioResamplerRequest, oneof: "message" },
274
+ { no: 25, name: "remix_and_resample", kind: "message", T: RemixAndResampleRequest, oneof: "message" },
275
+ { no: 26, name: "e2ee", kind: "message", T: E2eeRequest, oneof: "message" },
276
+ ]);
277
+
278
+ static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): FfiRequest {
279
+ return new FfiRequest().fromBinary(bytes, options);
280
+ }
281
+
282
+ static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): FfiRequest {
283
+ return new FfiRequest().fromJson(jsonValue, options);
284
+ }
285
+
286
+ static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): FfiRequest {
287
+ return new FfiRequest().fromJsonString(jsonString, options);
288
+ }
289
+
290
+ static equals(a: FfiRequest | PlainMessage<FfiRequest> | undefined, b: FfiRequest | PlainMessage<FfiRequest> | undefined): boolean {
291
+ return proto3.util.equals(FfiRequest, a, b);
292
+ }
293
+ }
294
+
295
+ /**
296
+ * This is the output of livekit_ffi_request function.
297
+ *
298
+ * @generated from message livekit.proto.FfiResponse
299
+ */
300
+ export class FfiResponse extends Message<FfiResponse> {
301
+ /**
302
+ * @generated from oneof livekit.proto.FfiResponse.message
303
+ */
304
+ message: {
305
+ /**
306
+ * @generated from field: livekit.proto.InitializeResponse initialize = 1;
307
+ */
308
+ value: InitializeResponse;
309
+ case: "initialize";
310
+ } | {
311
+ /**
312
+ * @generated from field: livekit.proto.DisposeResponse dispose = 2;
313
+ */
314
+ value: DisposeResponse;
315
+ case: "dispose";
316
+ } | {
317
+ /**
318
+ * Room
319
+ *
320
+ * @generated from field: livekit.proto.ConnectResponse connect = 3;
321
+ */
322
+ value: ConnectResponse;
323
+ case: "connect";
324
+ } | {
325
+ /**
326
+ * @generated from field: livekit.proto.DisconnectResponse disconnect = 4;
327
+ */
328
+ value: DisconnectResponse;
329
+ case: "disconnect";
330
+ } | {
331
+ /**
332
+ * @generated from field: livekit.proto.PublishTrackResponse publish_track = 5;
333
+ */
334
+ value: PublishTrackResponse;
335
+ case: "publishTrack";
336
+ } | {
337
+ /**
338
+ * @generated from field: livekit.proto.UnpublishTrackResponse unpublish_track = 6;
339
+ */
340
+ value: UnpublishTrackResponse;
341
+ case: "unpublishTrack";
342
+ } | {
343
+ /**
344
+ * @generated from field: livekit.proto.PublishDataResponse publish_data = 7;
345
+ */
346
+ value: PublishDataResponse;
347
+ case: "publishData";
348
+ } | {
349
+ /**
350
+ * @generated from field: livekit.proto.SetSubscribedResponse set_subscribed = 8;
351
+ */
352
+ value: SetSubscribedResponse;
353
+ case: "setSubscribed";
354
+ } | {
355
+ /**
356
+ * @generated from field: livekit.proto.UpdateLocalMetadataResponse update_local_metadata = 9;
357
+ */
358
+ value: UpdateLocalMetadataResponse;
359
+ case: "updateLocalMetadata";
360
+ } | {
361
+ /**
362
+ * @generated from field: livekit.proto.UpdateLocalNameResponse update_local_name = 10;
363
+ */
364
+ value: UpdateLocalNameResponse;
365
+ case: "updateLocalName";
366
+ } | {
367
+ /**
368
+ * Track
369
+ *
370
+ * @generated from field: livekit.proto.CreateVideoTrackResponse create_video_track = 11;
371
+ */
372
+ value: CreateVideoTrackResponse;
373
+ case: "createVideoTrack";
374
+ } | {
375
+ /**
376
+ * @generated from field: livekit.proto.CreateAudioTrackResponse create_audio_track = 12;
377
+ */
378
+ value: CreateAudioTrackResponse;
379
+ case: "createAudioTrack";
380
+ } | {
381
+ /**
382
+ * @generated from field: livekit.proto.GetStatsResponse get_stats = 13;
383
+ */
384
+ value: GetStatsResponse;
385
+ case: "getStats";
386
+ } | {
387
+ /**
388
+ * Video
389
+ *
390
+ * @generated from field: livekit.proto.AllocVideoBufferResponse alloc_video_buffer = 14;
391
+ */
392
+ value: AllocVideoBufferResponse;
393
+ case: "allocVideoBuffer";
394
+ } | {
395
+ /**
396
+ * @generated from field: livekit.proto.NewVideoStreamResponse new_video_stream = 15;
397
+ */
398
+ value: NewVideoStreamResponse;
399
+ case: "newVideoStream";
400
+ } | {
401
+ /**
402
+ * @generated from field: livekit.proto.NewVideoSourceResponse new_video_source = 16;
403
+ */
404
+ value: NewVideoSourceResponse;
405
+ case: "newVideoSource";
406
+ } | {
407
+ /**
408
+ * @generated from field: livekit.proto.CaptureVideoFrameResponse capture_video_frame = 17;
409
+ */
410
+ value: CaptureVideoFrameResponse;
411
+ case: "captureVideoFrame";
412
+ } | {
413
+ /**
414
+ * @generated from field: livekit.proto.ToI420Response to_i420 = 18;
415
+ */
416
+ value: ToI420Response;
417
+ case: "toI420";
418
+ } | {
419
+ /**
420
+ * @generated from field: livekit.proto.ToArgbResponse to_argb = 19;
421
+ */
422
+ value: ToArgbResponse;
423
+ case: "toArgb";
424
+ } | {
425
+ /**
426
+ * Audio
427
+ *
428
+ * @generated from field: livekit.proto.AllocAudioBufferResponse alloc_audio_buffer = 20;
429
+ */
430
+ value: AllocAudioBufferResponse;
431
+ case: "allocAudioBuffer";
432
+ } | {
433
+ /**
434
+ * @generated from field: livekit.proto.NewAudioStreamResponse new_audio_stream = 21;
435
+ */
436
+ value: NewAudioStreamResponse;
437
+ case: "newAudioStream";
438
+ } | {
439
+ /**
440
+ * @generated from field: livekit.proto.NewAudioSourceResponse new_audio_source = 22;
441
+ */
442
+ value: NewAudioSourceResponse;
443
+ case: "newAudioSource";
444
+ } | {
445
+ /**
446
+ * @generated from field: livekit.proto.CaptureAudioFrameResponse capture_audio_frame = 23;
447
+ */
448
+ value: CaptureAudioFrameResponse;
449
+ case: "captureAudioFrame";
450
+ } | {
451
+ /**
452
+ * @generated from field: livekit.proto.NewAudioResamplerResponse new_audio_resampler = 24;
453
+ */
454
+ value: NewAudioResamplerResponse;
455
+ case: "newAudioResampler";
456
+ } | {
457
+ /**
458
+ * @generated from field: livekit.proto.RemixAndResampleResponse remix_and_resample = 25;
459
+ */
460
+ value: RemixAndResampleResponse;
461
+ case: "remixAndResample";
462
+ } | {
463
+ /**
464
+ * @generated from field: livekit.proto.E2eeResponse e2ee = 26;
465
+ */
466
+ value: E2eeResponse;
467
+ case: "e2ee";
468
+ } | { case: undefined; value?: undefined } = { case: undefined };
469
+
470
+ constructor(data?: PartialMessage<FfiResponse>) {
471
+ super();
472
+ proto3.util.initPartial(data, this);
473
+ }
474
+
475
+ static readonly runtime: typeof proto3 = proto3;
476
+ static readonly typeName = "livekit.proto.FfiResponse";
477
+ static readonly fields: FieldList = proto3.util.newFieldList(() => [
478
+ { no: 1, name: "initialize", kind: "message", T: InitializeResponse, oneof: "message" },
479
+ { no: 2, name: "dispose", kind: "message", T: DisposeResponse, oneof: "message" },
480
+ { no: 3, name: "connect", kind: "message", T: ConnectResponse, oneof: "message" },
481
+ { no: 4, name: "disconnect", kind: "message", T: DisconnectResponse, oneof: "message" },
482
+ { no: 5, name: "publish_track", kind: "message", T: PublishTrackResponse, oneof: "message" },
483
+ { no: 6, name: "unpublish_track", kind: "message", T: UnpublishTrackResponse, oneof: "message" },
484
+ { no: 7, name: "publish_data", kind: "message", T: PublishDataResponse, oneof: "message" },
485
+ { no: 8, name: "set_subscribed", kind: "message", T: SetSubscribedResponse, oneof: "message" },
486
+ { no: 9, name: "update_local_metadata", kind: "message", T: UpdateLocalMetadataResponse, oneof: "message" },
487
+ { no: 10, name: "update_local_name", kind: "message", T: UpdateLocalNameResponse, oneof: "message" },
488
+ { no: 11, name: "create_video_track", kind: "message", T: CreateVideoTrackResponse, oneof: "message" },
489
+ { no: 12, name: "create_audio_track", kind: "message", T: CreateAudioTrackResponse, oneof: "message" },
490
+ { no: 13, name: "get_stats", kind: "message", T: GetStatsResponse, oneof: "message" },
491
+ { no: 14, name: "alloc_video_buffer", kind: "message", T: AllocVideoBufferResponse, oneof: "message" },
492
+ { no: 15, name: "new_video_stream", kind: "message", T: NewVideoStreamResponse, oneof: "message" },
493
+ { no: 16, name: "new_video_source", kind: "message", T: NewVideoSourceResponse, oneof: "message" },
494
+ { no: 17, name: "capture_video_frame", kind: "message", T: CaptureVideoFrameResponse, oneof: "message" },
495
+ { no: 18, name: "to_i420", kind: "message", T: ToI420Response, oneof: "message" },
496
+ { no: 19, name: "to_argb", kind: "message", T: ToArgbResponse, oneof: "message" },
497
+ { no: 20, name: "alloc_audio_buffer", kind: "message", T: AllocAudioBufferResponse, oneof: "message" },
498
+ { no: 21, name: "new_audio_stream", kind: "message", T: NewAudioStreamResponse, oneof: "message" },
499
+ { no: 22, name: "new_audio_source", kind: "message", T: NewAudioSourceResponse, oneof: "message" },
500
+ { no: 23, name: "capture_audio_frame", kind: "message", T: CaptureAudioFrameResponse, oneof: "message" },
501
+ { no: 24, name: "new_audio_resampler", kind: "message", T: NewAudioResamplerResponse, oneof: "message" },
502
+ { no: 25, name: "remix_and_resample", kind: "message", T: RemixAndResampleResponse, oneof: "message" },
503
+ { no: 26, name: "e2ee", kind: "message", T: E2eeResponse, oneof: "message" },
504
+ ]);
505
+
506
+ static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): FfiResponse {
507
+ return new FfiResponse().fromBinary(bytes, options);
508
+ }
509
+
510
+ static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): FfiResponse {
511
+ return new FfiResponse().fromJson(jsonValue, options);
512
+ }
513
+
514
+ static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): FfiResponse {
515
+ return new FfiResponse().fromJsonString(jsonString, options);
516
+ }
517
+
518
+ static equals(a: FfiResponse | PlainMessage<FfiResponse> | undefined, b: FfiResponse | PlainMessage<FfiResponse> | undefined): boolean {
519
+ return proto3.util.equals(FfiResponse, a, b);
520
+ }
521
+ }
522
+
523
+ /**
524
+ * To minimize complexity, participant events are not included in the protocol.
525
+ * It is easily deducible from the room events and it turned out that is is easier to implement
526
+ * on the ffi client side.
527
+ *
528
+ * @generated from message livekit.proto.FfiEvent
529
+ */
530
+ export class FfiEvent extends Message<FfiEvent> {
531
+ /**
532
+ * @generated from oneof livekit.proto.FfiEvent.message
533
+ */
534
+ message: {
535
+ /**
536
+ * @generated from field: livekit.proto.RoomEvent room_event = 1;
537
+ */
538
+ value: RoomEvent;
539
+ case: "roomEvent";
540
+ } | {
541
+ /**
542
+ * @generated from field: livekit.proto.TrackEvent track_event = 2;
543
+ */
544
+ value: TrackEvent;
545
+ case: "trackEvent";
546
+ } | {
547
+ /**
548
+ * @generated from field: livekit.proto.VideoStreamEvent video_stream_event = 3;
549
+ */
550
+ value: VideoStreamEvent;
551
+ case: "videoStreamEvent";
552
+ } | {
553
+ /**
554
+ * @generated from field: livekit.proto.AudioStreamEvent audio_stream_event = 4;
555
+ */
556
+ value: AudioStreamEvent;
557
+ case: "audioStreamEvent";
558
+ } | {
559
+ /**
560
+ * @generated from field: livekit.proto.ConnectCallback connect = 5;
561
+ */
562
+ value: ConnectCallback;
563
+ case: "connect";
564
+ } | {
565
+ /**
566
+ * @generated from field: livekit.proto.DisconnectCallback disconnect = 6;
567
+ */
568
+ value: DisconnectCallback;
569
+ case: "disconnect";
570
+ } | {
571
+ /**
572
+ * @generated from field: livekit.proto.DisposeCallback dispose = 7;
573
+ */
574
+ value: DisposeCallback;
575
+ case: "dispose";
576
+ } | {
577
+ /**
578
+ * @generated from field: livekit.proto.PublishTrackCallback publish_track = 8;
579
+ */
580
+ value: PublishTrackCallback;
581
+ case: "publishTrack";
582
+ } | {
583
+ /**
584
+ * @generated from field: livekit.proto.UnpublishTrackCallback unpublish_track = 9;
585
+ */
586
+ value: UnpublishTrackCallback;
587
+ case: "unpublishTrack";
588
+ } | {
589
+ /**
590
+ * @generated from field: livekit.proto.PublishDataCallback publish_data = 10;
591
+ */
592
+ value: PublishDataCallback;
593
+ case: "publishData";
594
+ } | {
595
+ /**
596
+ * @generated from field: livekit.proto.CaptureAudioFrameCallback capture_audio_frame = 11;
597
+ */
598
+ value: CaptureAudioFrameCallback;
599
+ case: "captureAudioFrame";
600
+ } | {
601
+ /**
602
+ * @generated from field: livekit.proto.UpdateLocalMetadataCallback update_local_metadata = 12;
603
+ */
604
+ value: UpdateLocalMetadataCallback;
605
+ case: "updateLocalMetadata";
606
+ } | {
607
+ /**
608
+ * @generated from field: livekit.proto.UpdateLocalNameCallback update_local_name = 13;
609
+ */
610
+ value: UpdateLocalNameCallback;
611
+ case: "updateLocalName";
612
+ } | {
613
+ /**
614
+ * @generated from field: livekit.proto.GetStatsCallback get_stats = 14;
615
+ */
616
+ value: GetStatsCallback;
617
+ case: "getStats";
618
+ } | {
619
+ /**
620
+ * @generated from field: livekit.proto.LogBatch logs = 15;
621
+ */
622
+ value: LogBatch;
623
+ case: "logs";
624
+ } | { case: undefined; value?: undefined } = { case: undefined };
625
+
626
+ constructor(data?: PartialMessage<FfiEvent>) {
627
+ super();
628
+ proto3.util.initPartial(data, this);
629
+ }
630
+
631
+ static readonly runtime: typeof proto3 = proto3;
632
+ static readonly typeName = "livekit.proto.FfiEvent";
633
+ static readonly fields: FieldList = proto3.util.newFieldList(() => [
634
+ { no: 1, name: "room_event", kind: "message", T: RoomEvent, oneof: "message" },
635
+ { no: 2, name: "track_event", kind: "message", T: TrackEvent, oneof: "message" },
636
+ { no: 3, name: "video_stream_event", kind: "message", T: VideoStreamEvent, oneof: "message" },
637
+ { no: 4, name: "audio_stream_event", kind: "message", T: AudioStreamEvent, oneof: "message" },
638
+ { no: 5, name: "connect", kind: "message", T: ConnectCallback, oneof: "message" },
639
+ { no: 6, name: "disconnect", kind: "message", T: DisconnectCallback, oneof: "message" },
640
+ { no: 7, name: "dispose", kind: "message", T: DisposeCallback, oneof: "message" },
641
+ { no: 8, name: "publish_track", kind: "message", T: PublishTrackCallback, oneof: "message" },
642
+ { no: 9, name: "unpublish_track", kind: "message", T: UnpublishTrackCallback, oneof: "message" },
643
+ { no: 10, name: "publish_data", kind: "message", T: PublishDataCallback, oneof: "message" },
644
+ { no: 11, name: "capture_audio_frame", kind: "message", T: CaptureAudioFrameCallback, oneof: "message" },
645
+ { no: 12, name: "update_local_metadata", kind: "message", T: UpdateLocalMetadataCallback, oneof: "message" },
646
+ { no: 13, name: "update_local_name", kind: "message", T: UpdateLocalNameCallback, oneof: "message" },
647
+ { no: 14, name: "get_stats", kind: "message", T: GetStatsCallback, oneof: "message" },
648
+ { no: 15, name: "logs", kind: "message", T: LogBatch, oneof: "message" },
649
+ ]);
650
+
651
+ static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): FfiEvent {
652
+ return new FfiEvent().fromBinary(bytes, options);
653
+ }
654
+
655
+ static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): FfiEvent {
656
+ return new FfiEvent().fromJson(jsonValue, options);
657
+ }
658
+
659
+ static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): FfiEvent {
660
+ return new FfiEvent().fromJsonString(jsonString, options);
661
+ }
662
+
663
+ static equals(a: FfiEvent | PlainMessage<FfiEvent> | undefined, b: FfiEvent | PlainMessage<FfiEvent> | undefined): boolean {
664
+ return proto3.util.equals(FfiEvent, a, b);
665
+ }
666
+ }
667
+
668
+ /**
669
+ * Setup the callback where the foreign language can receive events
670
+ * and responses to asynchronous requests
671
+ *
672
+ * @generated from message livekit.proto.InitializeRequest
673
+ */
674
+ export class InitializeRequest extends Message<InitializeRequest> {
675
+ /**
676
+ * @generated from field: uint64 event_callback_ptr = 1;
677
+ */
678
+ eventCallbackPtr = protoInt64.zero;
679
+
680
+ /**
681
+ * When true, the FfiServer will forward logs using LogRecord
682
+ *
683
+ * @generated from field: bool capture_logs = 2;
684
+ */
685
+ captureLogs = false;
686
+
687
+ constructor(data?: PartialMessage<InitializeRequest>) {
688
+ super();
689
+ proto3.util.initPartial(data, this);
690
+ }
691
+
692
+ static readonly runtime: typeof proto3 = proto3;
693
+ static readonly typeName = "livekit.proto.InitializeRequest";
694
+ static readonly fields: FieldList = proto3.util.newFieldList(() => [
695
+ { no: 1, name: "event_callback_ptr", kind: "scalar", T: 4 /* ScalarType.UINT64 */ },
696
+ { no: 2, name: "capture_logs", kind: "scalar", T: 8 /* ScalarType.BOOL */ },
697
+ ]);
698
+
699
+ static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): InitializeRequest {
700
+ return new InitializeRequest().fromBinary(bytes, options);
701
+ }
702
+
703
+ static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): InitializeRequest {
704
+ return new InitializeRequest().fromJson(jsonValue, options);
705
+ }
706
+
707
+ static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): InitializeRequest {
708
+ return new InitializeRequest().fromJsonString(jsonString, options);
709
+ }
710
+
711
+ static equals(a: InitializeRequest | PlainMessage<InitializeRequest> | undefined, b: InitializeRequest | PlainMessage<InitializeRequest> | undefined): boolean {
712
+ return proto3.util.equals(InitializeRequest, a, b);
713
+ }
714
+ }
715
+
716
+ /**
717
+ * @generated from message livekit.proto.InitializeResponse
718
+ */
719
+ export class InitializeResponse extends Message<InitializeResponse> {
720
+ constructor(data?: PartialMessage<InitializeResponse>) {
721
+ super();
722
+ proto3.util.initPartial(data, this);
723
+ }
724
+
725
+ static readonly runtime: typeof proto3 = proto3;
726
+ static readonly typeName = "livekit.proto.InitializeResponse";
727
+ static readonly fields: FieldList = proto3.util.newFieldList(() => [
728
+ ]);
729
+
730
+ static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): InitializeResponse {
731
+ return new InitializeResponse().fromBinary(bytes, options);
732
+ }
733
+
734
+ static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): InitializeResponse {
735
+ return new InitializeResponse().fromJson(jsonValue, options);
736
+ }
737
+
738
+ static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): InitializeResponse {
739
+ return new InitializeResponse().fromJsonString(jsonString, options);
740
+ }
741
+
742
+ static equals(a: InitializeResponse | PlainMessage<InitializeResponse> | undefined, b: InitializeResponse | PlainMessage<InitializeResponse> | undefined): boolean {
743
+ return proto3.util.equals(InitializeResponse, a, b);
744
+ }
745
+ }
746
+
747
+ /**
748
+ * Stop all rooms synchronously (Do we need async here?).
749
+ * e.g: This is used for the Unity Editor after each assemblies reload.
750
+ * TODO(theomonnom): Implement a debug mode where we can find all leaked handles?
751
+ *
752
+ * @generated from message livekit.proto.DisposeRequest
753
+ */
754
+ export class DisposeRequest extends Message<DisposeRequest> {
755
+ /**
756
+ * @generated from field: bool async = 1;
757
+ */
758
+ async = false;
759
+
760
+ constructor(data?: PartialMessage<DisposeRequest>) {
761
+ super();
762
+ proto3.util.initPartial(data, this);
763
+ }
764
+
765
+ static readonly runtime: typeof proto3 = proto3;
766
+ static readonly typeName = "livekit.proto.DisposeRequest";
767
+ static readonly fields: FieldList = proto3.util.newFieldList(() => [
768
+ { no: 1, name: "async", kind: "scalar", T: 8 /* ScalarType.BOOL */ },
769
+ ]);
770
+
771
+ static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): DisposeRequest {
772
+ return new DisposeRequest().fromBinary(bytes, options);
773
+ }
774
+
775
+ static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): DisposeRequest {
776
+ return new DisposeRequest().fromJson(jsonValue, options);
777
+ }
778
+
779
+ static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): DisposeRequest {
780
+ return new DisposeRequest().fromJsonString(jsonString, options);
781
+ }
782
+
783
+ static equals(a: DisposeRequest | PlainMessage<DisposeRequest> | undefined, b: DisposeRequest | PlainMessage<DisposeRequest> | undefined): boolean {
784
+ return proto3.util.equals(DisposeRequest, a, b);
785
+ }
786
+ }
787
+
788
+ /**
789
+ * @generated from message livekit.proto.DisposeResponse
790
+ */
791
+ export class DisposeResponse extends Message<DisposeResponse> {
792
+ /**
793
+ * None if sync
794
+ *
795
+ * @generated from field: optional uint64 async_id = 1;
796
+ */
797
+ asyncId?: bigint;
798
+
799
+ constructor(data?: PartialMessage<DisposeResponse>) {
800
+ super();
801
+ proto3.util.initPartial(data, this);
802
+ }
803
+
804
+ static readonly runtime: typeof proto3 = proto3;
805
+ static readonly typeName = "livekit.proto.DisposeResponse";
806
+ static readonly fields: FieldList = proto3.util.newFieldList(() => [
807
+ { no: 1, name: "async_id", kind: "scalar", T: 4 /* ScalarType.UINT64 */, opt: true },
808
+ ]);
809
+
810
+ static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): DisposeResponse {
811
+ return new DisposeResponse().fromBinary(bytes, options);
812
+ }
813
+
814
+ static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): DisposeResponse {
815
+ return new DisposeResponse().fromJson(jsonValue, options);
816
+ }
817
+
818
+ static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): DisposeResponse {
819
+ return new DisposeResponse().fromJsonString(jsonString, options);
820
+ }
821
+
822
+ static equals(a: DisposeResponse | PlainMessage<DisposeResponse> | undefined, b: DisposeResponse | PlainMessage<DisposeResponse> | undefined): boolean {
823
+ return proto3.util.equals(DisposeResponse, a, b);
824
+ }
825
+ }
826
+
827
+ /**
828
+ * @generated from message livekit.proto.DisposeCallback
829
+ */
830
+ export class DisposeCallback extends Message<DisposeCallback> {
831
+ /**
832
+ * @generated from field: uint64 async_id = 1;
833
+ */
834
+ asyncId = protoInt64.zero;
835
+
836
+ constructor(data?: PartialMessage<DisposeCallback>) {
837
+ super();
838
+ proto3.util.initPartial(data, this);
839
+ }
840
+
841
+ static readonly runtime: typeof proto3 = proto3;
842
+ static readonly typeName = "livekit.proto.DisposeCallback";
843
+ static readonly fields: FieldList = proto3.util.newFieldList(() => [
844
+ { no: 1, name: "async_id", kind: "scalar", T: 4 /* ScalarType.UINT64 */ },
845
+ ]);
846
+
847
+ static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): DisposeCallback {
848
+ return new DisposeCallback().fromBinary(bytes, options);
849
+ }
850
+
851
+ static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): DisposeCallback {
852
+ return new DisposeCallback().fromJson(jsonValue, options);
853
+ }
854
+
855
+ static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): DisposeCallback {
856
+ return new DisposeCallback().fromJsonString(jsonString, options);
857
+ }
858
+
859
+ static equals(a: DisposeCallback | PlainMessage<DisposeCallback> | undefined, b: DisposeCallback | PlainMessage<DisposeCallback> | undefined): boolean {
860
+ return proto3.util.equals(DisposeCallback, a, b);
861
+ }
862
+ }
863
+
864
+ /**
865
+ * @generated from message livekit.proto.LogRecord
866
+ */
867
+ export class LogRecord extends Message<LogRecord> {
868
+ /**
869
+ * @generated from field: livekit.proto.LogLevel level = 1;
870
+ */
871
+ level = LogLevel.LOG_ERROR;
872
+
873
+ /**
874
+ * e.g "livekit", "libwebrtc", "tokio-tungstenite", etc...
875
+ *
876
+ * @generated from field: string target = 2;
877
+ */
878
+ target = "";
879
+
880
+ /**
881
+ * @generated from field: optional string module_path = 3;
882
+ */
883
+ modulePath?: string;
884
+
885
+ /**
886
+ * @generated from field: optional string file = 4;
887
+ */
888
+ file?: string;
889
+
890
+ /**
891
+ * @generated from field: optional uint32 line = 5;
892
+ */
893
+ line?: number;
894
+
895
+ /**
896
+ * @generated from field: string message = 6;
897
+ */
898
+ message = "";
899
+
900
+ constructor(data?: PartialMessage<LogRecord>) {
901
+ super();
902
+ proto3.util.initPartial(data, this);
903
+ }
904
+
905
+ static readonly runtime: typeof proto3 = proto3;
906
+ static readonly typeName = "livekit.proto.LogRecord";
907
+ static readonly fields: FieldList = proto3.util.newFieldList(() => [
908
+ { no: 1, name: "level", kind: "enum", T: proto3.getEnumType(LogLevel) },
909
+ { no: 2, name: "target", kind: "scalar", T: 9 /* ScalarType.STRING */ },
910
+ { no: 3, name: "module_path", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true },
911
+ { no: 4, name: "file", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true },
912
+ { no: 5, name: "line", kind: "scalar", T: 13 /* ScalarType.UINT32 */, opt: true },
913
+ { no: 6, name: "message", kind: "scalar", T: 9 /* ScalarType.STRING */ },
914
+ ]);
915
+
916
+ static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): LogRecord {
917
+ return new LogRecord().fromBinary(bytes, options);
918
+ }
919
+
920
+ static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): LogRecord {
921
+ return new LogRecord().fromJson(jsonValue, options);
922
+ }
923
+
924
+ static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): LogRecord {
925
+ return new LogRecord().fromJsonString(jsonString, options);
926
+ }
927
+
928
+ static equals(a: LogRecord | PlainMessage<LogRecord> | undefined, b: LogRecord | PlainMessage<LogRecord> | undefined): boolean {
929
+ return proto3.util.equals(LogRecord, a, b);
930
+ }
931
+ }
932
+
933
+ /**
934
+ * @generated from message livekit.proto.LogBatch
935
+ */
936
+ export class LogBatch extends Message<LogBatch> {
937
+ /**
938
+ * @generated from field: repeated livekit.proto.LogRecord records = 1;
939
+ */
940
+ records: LogRecord[] = [];
941
+
942
+ constructor(data?: PartialMessage<LogBatch>) {
943
+ super();
944
+ proto3.util.initPartial(data, this);
945
+ }
946
+
947
+ static readonly runtime: typeof proto3 = proto3;
948
+ static readonly typeName = "livekit.proto.LogBatch";
949
+ static readonly fields: FieldList = proto3.util.newFieldList(() => [
950
+ { no: 1, name: "records", kind: "message", T: LogRecord, repeated: true },
951
+ ]);
952
+
953
+ static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): LogBatch {
954
+ return new LogBatch().fromBinary(bytes, options);
955
+ }
956
+
957
+ static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): LogBatch {
958
+ return new LogBatch().fromJson(jsonValue, options);
959
+ }
960
+
961
+ static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): LogBatch {
962
+ return new LogBatch().fromJsonString(jsonString, options);
963
+ }
964
+
965
+ static equals(a: LogBatch | PlainMessage<LogBatch> | undefined, b: LogBatch | PlainMessage<LogBatch> | undefined): boolean {
966
+ return proto3.util.equals(LogBatch, a, b);
967
+ }
968
+ }
969
+