@stream-io/video-client 0.0.1-alpha.7

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.
Files changed (157) hide show
  1. package/LICENSE +219 -0
  2. package/README.md +14 -0
  3. package/dist/index.d.ts +23 -0
  4. package/dist/index.js +14663 -0
  5. package/dist/index.js.map +1 -0
  6. package/dist/src/Batcher.d.ts +12 -0
  7. package/dist/src/CallDropScheduler.d.ts +44 -0
  8. package/dist/src/StreamSfuClient.d.ts +25 -0
  9. package/dist/src/StreamVideoClient.d.ts +145 -0
  10. package/dist/src/__tests__/StreamVideoClient.test.d.ts +1 -0
  11. package/dist/src/config/defaultConfigs.d.ts +2 -0
  12. package/dist/src/config/types.d.ts +29 -0
  13. package/dist/src/coordinator/StreamCoordinatorClient.d.ts +19 -0
  14. package/dist/src/coordinator/connection/base64.d.ts +2 -0
  15. package/dist/src/coordinator/connection/client.d.ts +174 -0
  16. package/dist/src/coordinator/connection/connection.d.ts +139 -0
  17. package/dist/src/coordinator/connection/connection_fallback.d.ts +38 -0
  18. package/dist/src/coordinator/connection/errors.d.ts +16 -0
  19. package/dist/src/coordinator/connection/events.d.ts +7 -0
  20. package/dist/src/coordinator/connection/insights.d.ts +58 -0
  21. package/dist/src/coordinator/connection/signing.d.ts +30 -0
  22. package/dist/src/coordinator/connection/token_manager.d.ts +39 -0
  23. package/dist/src/coordinator/connection/types.d.ts +96 -0
  24. package/dist/src/coordinator/connection/utils.d.ts +25 -0
  25. package/dist/src/devices.d.ts +79 -0
  26. package/dist/src/events/call.d.ts +26 -0
  27. package/dist/src/events/internal.d.ts +8 -0
  28. package/dist/src/events/participant.d.ts +21 -0
  29. package/dist/src/events/speaker.d.ts +10 -0
  30. package/dist/src/gen/coordinator/index.d.ts +1664 -0
  31. package/dist/src/gen/google/protobuf/descriptor.d.ts +1650 -0
  32. package/dist/src/gen/google/protobuf/duration.d.ts +113 -0
  33. package/dist/src/gen/google/protobuf/struct.d.ts +184 -0
  34. package/dist/src/gen/google/protobuf/timestamp.d.ts +158 -0
  35. package/dist/src/gen/video/coordinator/broadcast_v1/broadcast.d.ts +66 -0
  36. package/dist/src/gen/video/coordinator/call_v1/call.d.ts +254 -0
  37. package/dist/src/gen/video/coordinator/client_v1_rpc/client_rpc.client.d.ts +351 -0
  38. package/dist/src/gen/video/coordinator/client_v1_rpc/client_rpc.d.ts +1488 -0
  39. package/dist/src/gen/video/coordinator/client_v1_rpc/envelopes.d.ts +143 -0
  40. package/dist/src/gen/video/coordinator/client_v1_rpc/websocket.d.ts +292 -0
  41. package/dist/src/gen/video/coordinator/edge_v1/edge.d.ts +183 -0
  42. package/dist/src/gen/video/coordinator/event_v1/event.d.ts +411 -0
  43. package/dist/src/gen/video/coordinator/geofence_v1/geofence.d.ts +63 -0
  44. package/dist/src/gen/video/coordinator/member_v1/member.d.ts +59 -0
  45. package/dist/src/gen/video/coordinator/participant_v1/participant.d.ts +103 -0
  46. package/dist/src/gen/video/coordinator/push_v1/push.d.ts +240 -0
  47. package/dist/src/gen/video/coordinator/stat_v1/stat.d.ts +308 -0
  48. package/dist/src/gen/video/coordinator/user_v1/user.d.ts +112 -0
  49. package/dist/src/gen/video/coordinator/utils_v1/utils.d.ts +47 -0
  50. package/dist/src/gen/video/sfu/event/events.d.ts +736 -0
  51. package/dist/src/gen/video/sfu/models/models.d.ts +460 -0
  52. package/dist/src/gen/video/sfu/signal_rpc/signal.client.d.ts +89 -0
  53. package/dist/src/gen/video/sfu/signal_rpc/signal.d.ts +320 -0
  54. package/dist/src/helpers/browsers.d.ts +8 -0
  55. package/dist/src/helpers/sound-detector.d.ts +34 -0
  56. package/dist/src/rpc/createClient.d.ts +10 -0
  57. package/dist/src/rpc/index.d.ts +2 -0
  58. package/dist/src/rpc/latency.d.ts +9 -0
  59. package/dist/src/rtc/Call.d.ts +180 -0
  60. package/dist/src/rtc/CallMetadata.d.ts +9 -0
  61. package/dist/src/rtc/Dispatcher.d.ts +9 -0
  62. package/dist/src/rtc/IceTrickleBuffer.d.ts +11 -0
  63. package/dist/src/rtc/callEventHandlers.d.ts +5 -0
  64. package/dist/src/rtc/codecs.d.ts +2 -0
  65. package/dist/src/rtc/helpers/iceCandidate.d.ts +2 -0
  66. package/dist/src/rtc/helpers/tracks.d.ts +3 -0
  67. package/dist/src/rtc/publisher.d.ts +53 -0
  68. package/dist/src/rtc/signal.d.ts +5 -0
  69. package/dist/src/rtc/subscriber.d.ts +7 -0
  70. package/dist/src/rtc/types.d.ts +84 -0
  71. package/dist/src/rtc/videoLayers.d.ts +17 -0
  72. package/dist/src/stats/coordinator-stats-reporter.d.ts +10 -0
  73. package/dist/src/stats/state-store-stats-reporter.d.ts +57 -0
  74. package/dist/src/stats/types.d.ts +42 -0
  75. package/dist/src/store/index.d.ts +2 -0
  76. package/dist/src/store/rxUtils.d.ts +18 -0
  77. package/dist/src/store/stateStore.d.ts +182 -0
  78. package/generate-openapi.sh +32 -0
  79. package/index.ts +30 -0
  80. package/openapitools.json +7 -0
  81. package/package.json +54 -0
  82. package/rollup.config.mjs +48 -0
  83. package/src/Batcher.ts +43 -0
  84. package/src/CallDropScheduler.ts +192 -0
  85. package/src/StreamSfuClient.ts +185 -0
  86. package/src/StreamVideoClient.ts +487 -0
  87. package/src/__tests__/StreamVideoClient.test.ts +83 -0
  88. package/src/config/defaultConfigs.ts +15 -0
  89. package/src/config/types.ts +30 -0
  90. package/src/coordinator/StreamCoordinatorClient.ts +111 -0
  91. package/src/coordinator/connection/base64.ts +80 -0
  92. package/src/coordinator/connection/client.ts +815 -0
  93. package/src/coordinator/connection/connection.ts +750 -0
  94. package/src/coordinator/connection/connection_fallback.ts +239 -0
  95. package/src/coordinator/connection/errors.ts +70 -0
  96. package/src/coordinator/connection/events.ts +10 -0
  97. package/src/coordinator/connection/insights.ts +88 -0
  98. package/src/coordinator/connection/signing.ts +104 -0
  99. package/src/coordinator/connection/token_manager.ts +160 -0
  100. package/src/coordinator/connection/types.ts +120 -0
  101. package/src/coordinator/connection/utils.ts +148 -0
  102. package/src/devices.ts +266 -0
  103. package/src/events/call.ts +166 -0
  104. package/src/events/internal.ts +47 -0
  105. package/src/events/participant.ts +97 -0
  106. package/src/events/speaker.ts +62 -0
  107. package/src/gen/coordinator/index.ts +1653 -0
  108. package/src/gen/google/protobuf/descriptor.ts +3466 -0
  109. package/src/gen/google/protobuf/duration.ts +232 -0
  110. package/src/gen/google/protobuf/struct.ts +481 -0
  111. package/src/gen/google/protobuf/timestamp.ts +291 -0
  112. package/src/gen/video/coordinator/broadcast_v1/broadcast.ts +154 -0
  113. package/src/gen/video/coordinator/call_v1/call.ts +651 -0
  114. package/src/gen/video/coordinator/client_v1_rpc/client_rpc.client.ts +463 -0
  115. package/src/gen/video/coordinator/client_v1_rpc/client_rpc.ts +3819 -0
  116. package/src/gen/video/coordinator/client_v1_rpc/envelopes.ts +424 -0
  117. package/src/gen/video/coordinator/client_v1_rpc/websocket.ts +719 -0
  118. package/src/gen/video/coordinator/edge_v1/edge.ts +532 -0
  119. package/src/gen/video/coordinator/event_v1/event.ts +1171 -0
  120. package/src/gen/video/coordinator/geofence_v1/geofence.ts +128 -0
  121. package/src/gen/video/coordinator/member_v1/member.ts +138 -0
  122. package/src/gen/video/coordinator/participant_v1/participant.ts +261 -0
  123. package/src/gen/video/coordinator/push_v1/push.ts +651 -0
  124. package/src/gen/video/coordinator/stat_v1/stat.ts +656 -0
  125. package/src/gen/video/coordinator/user_v1/user.ts +277 -0
  126. package/src/gen/video/coordinator/utils_v1/utils.ts +98 -0
  127. package/src/gen/video/sfu/event/events.ts +1962 -0
  128. package/src/gen/video/sfu/models/models.ts +1062 -0
  129. package/src/gen/video/sfu/signal_rpc/signal.client.ts +108 -0
  130. package/src/gen/video/sfu/signal_rpc/signal.ts +906 -0
  131. package/src/helpers/browsers.ts +13 -0
  132. package/src/helpers/sound-detector.ts +85 -0
  133. package/src/rpc/createClient.ts +50 -0
  134. package/src/rpc/index.ts +2 -0
  135. package/src/rpc/latency.ts +43 -0
  136. package/src/rtc/Call.ts +585 -0
  137. package/src/rtc/CallMetadata.ts +24 -0
  138. package/src/rtc/Dispatcher.ts +46 -0
  139. package/src/rtc/IceTrickleBuffer.ts +21 -0
  140. package/src/rtc/callEventHandlers.ts +37 -0
  141. package/src/rtc/codecs.ts +61 -0
  142. package/src/rtc/helpers/iceCandidate.ts +16 -0
  143. package/src/rtc/helpers/tracks.ts +18 -0
  144. package/src/rtc/publisher.ts +305 -0
  145. package/src/rtc/signal.ts +34 -0
  146. package/src/rtc/subscriber.ts +85 -0
  147. package/src/rtc/types.ts +105 -0
  148. package/src/rtc/videoLayers.ts +103 -0
  149. package/src/stats/coordinator-stats-reporter.ts +167 -0
  150. package/src/stats/state-store-stats-reporter.ts +364 -0
  151. package/src/stats/types.ts +46 -0
  152. package/src/store/index.ts +2 -0
  153. package/src/store/rxUtils.ts +42 -0
  154. package/src/store/stateStore.ts +341 -0
  155. package/tsconfig.json +25 -0
  156. package/typedoc.json +11 -0
  157. package/vite.config.ts +11 -0
@@ -0,0 +1,1062 @@
1
+ /* eslint-disable */
2
+ // @generated by protobuf-ts 2.8.1 with parameter long_type_string,client_generic,server_none,eslint_disable
3
+ // @generated from protobuf file "video/sfu/models/models.proto" (package "stream.video.sfu.models", syntax proto3)
4
+ // tslint:disable
5
+ import type { BinaryWriteOptions } from "@protobuf-ts/runtime";
6
+ import type { IBinaryWriter } from "@protobuf-ts/runtime";
7
+ import { WireType } from "@protobuf-ts/runtime";
8
+ import type { BinaryReadOptions } from "@protobuf-ts/runtime";
9
+ import type { IBinaryReader } from "@protobuf-ts/runtime";
10
+ import { UnknownFieldHandler } from "@protobuf-ts/runtime";
11
+ import type { PartialMessage } from "@protobuf-ts/runtime";
12
+ import { reflectionMergePartial } from "@protobuf-ts/runtime";
13
+ import { MESSAGE_TYPE } from "@protobuf-ts/runtime";
14
+ import { MessageType } from "@protobuf-ts/runtime";
15
+ import { Struct } from "../../../google/protobuf/struct";
16
+ import { Timestamp } from "../../../google/protobuf/timestamp";
17
+ /**
18
+ * @generated from protobuf message stream.video.sfu.models.CallState
19
+ */
20
+ export interface CallState {
21
+ /**
22
+ * @generated from protobuf field: repeated stream.video.sfu.models.Participant participants = 1;
23
+ */
24
+ participants: Participant[];
25
+ }
26
+ /**
27
+ * those who are online in the call
28
+ *
29
+ * @generated from protobuf message stream.video.sfu.models.Participant
30
+ */
31
+ export interface Participant {
32
+ /**
33
+ * @generated from protobuf field: string user_id = 1;
34
+ */
35
+ userId: string;
36
+ /**
37
+ * @generated from protobuf field: string session_id = 2;
38
+ */
39
+ sessionId: string;
40
+ /**
41
+ * map of track id to track type
42
+ *
43
+ * @generated from protobuf field: repeated stream.video.sfu.models.TrackType published_tracks = 3;
44
+ */
45
+ publishedTracks: TrackType[];
46
+ /**
47
+ * @generated from protobuf field: google.protobuf.Timestamp joined_at = 4;
48
+ */
49
+ joinedAt?: Timestamp;
50
+ /**
51
+ * @generated from protobuf field: string track_lookup_prefix = 5;
52
+ */
53
+ trackLookupPrefix: string;
54
+ /**
55
+ * @generated from protobuf field: stream.video.sfu.models.ConnectionQuality connection_quality = 6;
56
+ */
57
+ connectionQuality: ConnectionQuality;
58
+ /**
59
+ * @generated from protobuf field: bool is_speaking = 7;
60
+ */
61
+ isSpeaking: boolean;
62
+ /**
63
+ * @generated from protobuf field: bool is_dominant_speaker = 8;
64
+ */
65
+ isDominantSpeaker: boolean;
66
+ /**
67
+ * @generated from protobuf field: float audio_level = 9;
68
+ */
69
+ audioLevel: number;
70
+ }
71
+ /**
72
+ * @generated from protobuf message stream.video.sfu.models.StreamQuality
73
+ */
74
+ export interface StreamQuality {
75
+ /**
76
+ * @generated from protobuf field: stream.video.sfu.models.VideoQuality video_quality = 1;
77
+ */
78
+ videoQuality: VideoQuality;
79
+ /**
80
+ * @generated from protobuf field: string user_id = 2;
81
+ */
82
+ userId: string;
83
+ }
84
+ /**
85
+ * @generated from protobuf message stream.video.sfu.models.VideoDimension
86
+ */
87
+ export interface VideoDimension {
88
+ /**
89
+ * @generated from protobuf field: uint32 width = 1;
90
+ */
91
+ width: number;
92
+ /**
93
+ * @generated from protobuf field: uint32 height = 2;
94
+ */
95
+ height: number;
96
+ }
97
+ /**
98
+ * @generated from protobuf message stream.video.sfu.models.VideoLayer
99
+ */
100
+ export interface VideoLayer {
101
+ /**
102
+ * for tracks with a single layer, this should be HIGH
103
+ *
104
+ * @generated from protobuf field: string rid = 1;
105
+ */
106
+ rid: string;
107
+ /**
108
+ * @generated from protobuf field: stream.video.sfu.models.VideoDimension video_dimension = 2;
109
+ */
110
+ videoDimension?: VideoDimension;
111
+ /**
112
+ * target bitrate, server will measure actual
113
+ *
114
+ * @generated from protobuf field: uint32 bitrate = 4;
115
+ */
116
+ bitrate: number;
117
+ /**
118
+ * @generated from protobuf field: uint32 fps = 5;
119
+ */
120
+ fps: number;
121
+ /**
122
+ * @generated from protobuf field: stream.video.sfu.models.VideoQuality quality = 6;
123
+ */
124
+ quality: VideoQuality;
125
+ }
126
+ /**
127
+ * @generated from protobuf message stream.video.sfu.models.Codec
128
+ */
129
+ export interface Codec {
130
+ /**
131
+ * @generated from protobuf field: uint32 payload_type = 1;
132
+ */
133
+ payloadType: number;
134
+ /**
135
+ * @generated from protobuf field: string name = 2;
136
+ */
137
+ name: string;
138
+ /**
139
+ * @generated from protobuf field: string fmtp_line = 3;
140
+ */
141
+ fmtpLine: string;
142
+ /**
143
+ * @generated from protobuf field: uint32 clock_rate = 4;
144
+ */
145
+ clockRate: number;
146
+ /**
147
+ * @generated from protobuf field: string encoding_parameters = 5;
148
+ */
149
+ encodingParameters: string;
150
+ /**
151
+ * @generated from protobuf field: repeated string feedbacks = 6;
152
+ */
153
+ feedbacks: string[];
154
+ }
155
+ /**
156
+ * @generated from protobuf message stream.video.sfu.models.ICETrickle
157
+ */
158
+ export interface ICETrickle {
159
+ /**
160
+ * @generated from protobuf field: stream.video.sfu.models.PeerType peer_type = 1;
161
+ */
162
+ peerType: PeerType;
163
+ /**
164
+ * @generated from protobuf field: string ice_candidate = 2;
165
+ */
166
+ iceCandidate: string;
167
+ /**
168
+ * @generated from protobuf field: string session_id = 3;
169
+ */
170
+ sessionId: string;
171
+ }
172
+ /**
173
+ * @generated from protobuf message stream.video.sfu.models.TrackInfo
174
+ */
175
+ export interface TrackInfo {
176
+ /**
177
+ * @generated from protobuf field: string track_id = 1;
178
+ */
179
+ trackId: string;
180
+ /**
181
+ * @generated from protobuf field: stream.video.sfu.models.TrackType track_type = 2;
182
+ */
183
+ trackType: TrackType;
184
+ /**
185
+ * @generated from protobuf field: repeated stream.video.sfu.models.VideoLayer layers = 5;
186
+ */
187
+ layers: VideoLayer[];
188
+ /**
189
+ * @generated from protobuf field: string mid = 6;
190
+ */
191
+ mid: string;
192
+ }
193
+ /**
194
+ * todo remove this
195
+ *
196
+ * @generated from protobuf message stream.video.sfu.models.Call
197
+ */
198
+ export interface Call {
199
+ /**
200
+ * the call type
201
+ *
202
+ * @generated from protobuf field: string type = 1;
203
+ */
204
+ type: string;
205
+ /**
206
+ * the call id
207
+ *
208
+ * @generated from protobuf field: string id = 2;
209
+ */
210
+ id: string;
211
+ /**
212
+ * the id of the user that created this call
213
+ *
214
+ * @generated from protobuf field: string created_by_user_id = 3;
215
+ */
216
+ createdByUserId: string;
217
+ /**
218
+ * the id of the current host for this call
219
+ *
220
+ * @generated from protobuf field: string host_user_id = 4;
221
+ */
222
+ hostUserId: string;
223
+ /**
224
+ * @generated from protobuf field: google.protobuf.Struct custom = 5;
225
+ */
226
+ custom?: Struct;
227
+ /**
228
+ * @generated from protobuf field: google.protobuf.Timestamp created_at = 6;
229
+ */
230
+ createdAt?: Timestamp;
231
+ /**
232
+ * @generated from protobuf field: google.protobuf.Timestamp updated_at = 7;
233
+ */
234
+ updatedAt?: Timestamp;
235
+ }
236
+ /**
237
+ * @generated from protobuf message stream.video.sfu.models.Error
238
+ */
239
+ export interface Error {
240
+ /**
241
+ * @generated from protobuf field: stream.video.sfu.models.ErrorCode code = 1;
242
+ */
243
+ code: ErrorCode;
244
+ /**
245
+ * @generated from protobuf field: string message = 2;
246
+ */
247
+ message: string;
248
+ }
249
+ /**
250
+ * @generated from protobuf enum stream.video.sfu.models.PeerType
251
+ */
252
+ export enum PeerType {
253
+ /**
254
+ * todo fix me (marcelo)
255
+ *
256
+ * @generated from protobuf enum value: PEER_TYPE_PUBLISHER_UNSPECIFIED = 0;
257
+ */
258
+ PUBLISHER_UNSPECIFIED = 0,
259
+ /**
260
+ * @generated from protobuf enum value: PEER_TYPE_SUBSCRIBER = 1;
261
+ */
262
+ SUBSCRIBER = 1
263
+ }
264
+ /**
265
+ * @generated from protobuf enum stream.video.sfu.models.ConnectionQuality
266
+ */
267
+ export enum ConnectionQuality {
268
+ /**
269
+ * @generated from protobuf enum value: CONNECTION_QUALITY_UNSPECIFIED = 0;
270
+ */
271
+ UNSPECIFIED = 0,
272
+ /**
273
+ * @generated from protobuf enum value: CONNECTION_QUALITY_POOR = 1;
274
+ */
275
+ POOR = 1,
276
+ /**
277
+ * @generated from protobuf enum value: CONNECTION_QUALITY_GOOD = 2;
278
+ */
279
+ GOOD = 2,
280
+ /**
281
+ * @generated from protobuf enum value: CONNECTION_QUALITY_EXCELLENT = 3;
282
+ */
283
+ EXCELLENT = 3
284
+ }
285
+ /**
286
+ * @generated from protobuf enum stream.video.sfu.models.VideoQuality
287
+ */
288
+ export enum VideoQuality {
289
+ /**
290
+ * @generated from protobuf enum value: VIDEO_QUALITY_LOW_UNSPECIFIED = 0;
291
+ */
292
+ LOW_UNSPECIFIED = 0,
293
+ /**
294
+ * @generated from protobuf enum value: VIDEO_QUALITY_MID = 1;
295
+ */
296
+ MID = 1,
297
+ /**
298
+ * @generated from protobuf enum value: VIDEO_QUALITY_HIGH = 2;
299
+ */
300
+ HIGH = 2,
301
+ /**
302
+ * @generated from protobuf enum value: VIDEO_QUALITY_OFF = 3;
303
+ */
304
+ OFF = 3
305
+ }
306
+ /**
307
+ * @generated from protobuf enum stream.video.sfu.models.TrackType
308
+ */
309
+ export enum TrackType {
310
+ /**
311
+ * @generated from protobuf enum value: TRACK_TYPE_UNSPECIFIED = 0;
312
+ */
313
+ UNSPECIFIED = 0,
314
+ /**
315
+ * @generated from protobuf enum value: TRACK_TYPE_AUDIO = 1;
316
+ */
317
+ AUDIO = 1,
318
+ /**
319
+ * @generated from protobuf enum value: TRACK_TYPE_VIDEO = 2;
320
+ */
321
+ VIDEO = 2,
322
+ /**
323
+ * @generated from protobuf enum value: TRACK_TYPE_SCREEN_SHARE = 3;
324
+ */
325
+ SCREEN_SHARE = 3,
326
+ /**
327
+ * @generated from protobuf enum value: TRACK_TYPE_SCREEN_SHARE_AUDIO = 4;
328
+ */
329
+ SCREEN_SHARE_AUDIO = 4
330
+ }
331
+ /**
332
+ * @generated from protobuf enum stream.video.sfu.models.ErrorCode
333
+ */
334
+ export enum ErrorCode {
335
+ /**
336
+ * @generated from protobuf enum value: ERROR_CODE_UNSPECIFIED = 0;
337
+ */
338
+ UNSPECIFIED = 0,
339
+ /**
340
+ * @generated from protobuf enum value: ERROR_CODE_PUBLISH_TRACK_NOT_FOUND = 100;
341
+ */
342
+ PUBLISH_TRACK_NOT_FOUND = 100,
343
+ /**
344
+ * @generated from protobuf enum value: ERROR_CODE_PUBLISH_TRACKS_MISMATCH = 101;
345
+ */
346
+ PUBLISH_TRACKS_MISMATCH = 101,
347
+ /**
348
+ * @generated from protobuf enum value: ERROR_CODE_PUBLISH_TRACK_OUT_OF_ORDER = 102;
349
+ */
350
+ PUBLISH_TRACK_OUT_OF_ORDER = 102,
351
+ /**
352
+ * @generated from protobuf enum value: ERROR_CODE_PUBLISH_TRACK_VIDEO_LAYER_NOT_FOUND = 103;
353
+ */
354
+ PUBLISH_TRACK_VIDEO_LAYER_NOT_FOUND = 103,
355
+ /**
356
+ * @generated from protobuf enum value: ERROR_CODE_PARTICIPANT_NOT_FOUND = 200;
357
+ */
358
+ PARTICIPANT_NOT_FOUND = 200,
359
+ /**
360
+ * @generated from protobuf enum value: ERROR_CODE_CALL_NOT_FOUND = 300;
361
+ */
362
+ CALL_NOT_FOUND = 300,
363
+ /**
364
+ * @generated from protobuf enum value: ERROR_CODE_INTERNAL_SERVER_ERROR = 500;
365
+ */
366
+ INTERNAL_SERVER_ERROR = 500
367
+ }
368
+ // @generated message type with reflection information, may provide speed optimized methods
369
+ class CallState$Type extends MessageType<CallState> {
370
+ constructor() {
371
+ super("stream.video.sfu.models.CallState", [
372
+ { no: 1, name: "participants", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => Participant }
373
+ ]);
374
+ }
375
+ create(value?: PartialMessage<CallState>): CallState {
376
+ const message = { participants: [] };
377
+ globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
378
+ if (value !== undefined)
379
+ reflectionMergePartial<CallState>(this, message, value);
380
+ return message;
381
+ }
382
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: CallState): CallState {
383
+ let message = target ?? this.create(), end = reader.pos + length;
384
+ while (reader.pos < end) {
385
+ let [fieldNo, wireType] = reader.tag();
386
+ switch (fieldNo) {
387
+ case /* repeated stream.video.sfu.models.Participant participants */ 1:
388
+ message.participants.push(Participant.internalBinaryRead(reader, reader.uint32(), options));
389
+ break;
390
+ default:
391
+ let u = options.readUnknownField;
392
+ if (u === "throw")
393
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
394
+ let d = reader.skip(wireType);
395
+ if (u !== false)
396
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
397
+ }
398
+ }
399
+ return message;
400
+ }
401
+ internalBinaryWrite(message: CallState, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
402
+ /* repeated stream.video.sfu.models.Participant participants = 1; */
403
+ for (let i = 0; i < message.participants.length; i++)
404
+ Participant.internalBinaryWrite(message.participants[i], writer.tag(1, WireType.LengthDelimited).fork(), options).join();
405
+ let u = options.writeUnknownFields;
406
+ if (u !== false)
407
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
408
+ return writer;
409
+ }
410
+ }
411
+ /**
412
+ * @generated MessageType for protobuf message stream.video.sfu.models.CallState
413
+ */
414
+ export const CallState = new CallState$Type();
415
+ // @generated message type with reflection information, may provide speed optimized methods
416
+ class Participant$Type extends MessageType<Participant> {
417
+ constructor() {
418
+ super("stream.video.sfu.models.Participant", [
419
+ { no: 1, name: "user_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
420
+ { no: 2, name: "session_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
421
+ { no: 3, name: "published_tracks", kind: "enum", repeat: 1 /*RepeatType.PACKED*/, T: () => ["stream.video.sfu.models.TrackType", TrackType, "TRACK_TYPE_"] },
422
+ { no: 4, name: "joined_at", kind: "message", T: () => Timestamp },
423
+ { no: 5, name: "track_lookup_prefix", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
424
+ { no: 6, name: "connection_quality", kind: "enum", T: () => ["stream.video.sfu.models.ConnectionQuality", ConnectionQuality, "CONNECTION_QUALITY_"] },
425
+ { no: 7, name: "is_speaking", kind: "scalar", T: 8 /*ScalarType.BOOL*/ },
426
+ { no: 8, name: "is_dominant_speaker", kind: "scalar", T: 8 /*ScalarType.BOOL*/ },
427
+ { no: 9, name: "audio_level", kind: "scalar", T: 2 /*ScalarType.FLOAT*/ }
428
+ ]);
429
+ }
430
+ create(value?: PartialMessage<Participant>): Participant {
431
+ const message = { userId: "", sessionId: "", publishedTracks: [], trackLookupPrefix: "", connectionQuality: 0, isSpeaking: false, isDominantSpeaker: false, audioLevel: 0 };
432
+ globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
433
+ if (value !== undefined)
434
+ reflectionMergePartial<Participant>(this, message, value);
435
+ return message;
436
+ }
437
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Participant): Participant {
438
+ let message = target ?? this.create(), end = reader.pos + length;
439
+ while (reader.pos < end) {
440
+ let [fieldNo, wireType] = reader.tag();
441
+ switch (fieldNo) {
442
+ case /* string user_id */ 1:
443
+ message.userId = reader.string();
444
+ break;
445
+ case /* string session_id */ 2:
446
+ message.sessionId = reader.string();
447
+ break;
448
+ case /* repeated stream.video.sfu.models.TrackType published_tracks */ 3:
449
+ if (wireType === WireType.LengthDelimited)
450
+ for (let e = reader.int32() + reader.pos; reader.pos < e;)
451
+ message.publishedTracks.push(reader.int32());
452
+ else
453
+ message.publishedTracks.push(reader.int32());
454
+ break;
455
+ case /* google.protobuf.Timestamp joined_at */ 4:
456
+ message.joinedAt = Timestamp.internalBinaryRead(reader, reader.uint32(), options, message.joinedAt);
457
+ break;
458
+ case /* string track_lookup_prefix */ 5:
459
+ message.trackLookupPrefix = reader.string();
460
+ break;
461
+ case /* stream.video.sfu.models.ConnectionQuality connection_quality */ 6:
462
+ message.connectionQuality = reader.int32();
463
+ break;
464
+ case /* bool is_speaking */ 7:
465
+ message.isSpeaking = reader.bool();
466
+ break;
467
+ case /* bool is_dominant_speaker */ 8:
468
+ message.isDominantSpeaker = reader.bool();
469
+ break;
470
+ case /* float audio_level */ 9:
471
+ message.audioLevel = reader.float();
472
+ break;
473
+ default:
474
+ let u = options.readUnknownField;
475
+ if (u === "throw")
476
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
477
+ let d = reader.skip(wireType);
478
+ if (u !== false)
479
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
480
+ }
481
+ }
482
+ return message;
483
+ }
484
+ internalBinaryWrite(message: Participant, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
485
+ /* string user_id = 1; */
486
+ if (message.userId !== "")
487
+ writer.tag(1, WireType.LengthDelimited).string(message.userId);
488
+ /* string session_id = 2; */
489
+ if (message.sessionId !== "")
490
+ writer.tag(2, WireType.LengthDelimited).string(message.sessionId);
491
+ /* repeated stream.video.sfu.models.TrackType published_tracks = 3; */
492
+ if (message.publishedTracks.length) {
493
+ writer.tag(3, WireType.LengthDelimited).fork();
494
+ for (let i = 0; i < message.publishedTracks.length; i++)
495
+ writer.int32(message.publishedTracks[i]);
496
+ writer.join();
497
+ }
498
+ /* google.protobuf.Timestamp joined_at = 4; */
499
+ if (message.joinedAt)
500
+ Timestamp.internalBinaryWrite(message.joinedAt, writer.tag(4, WireType.LengthDelimited).fork(), options).join();
501
+ /* string track_lookup_prefix = 5; */
502
+ if (message.trackLookupPrefix !== "")
503
+ writer.tag(5, WireType.LengthDelimited).string(message.trackLookupPrefix);
504
+ /* stream.video.sfu.models.ConnectionQuality connection_quality = 6; */
505
+ if (message.connectionQuality !== 0)
506
+ writer.tag(6, WireType.Varint).int32(message.connectionQuality);
507
+ /* bool is_speaking = 7; */
508
+ if (message.isSpeaking !== false)
509
+ writer.tag(7, WireType.Varint).bool(message.isSpeaking);
510
+ /* bool is_dominant_speaker = 8; */
511
+ if (message.isDominantSpeaker !== false)
512
+ writer.tag(8, WireType.Varint).bool(message.isDominantSpeaker);
513
+ /* float audio_level = 9; */
514
+ if (message.audioLevel !== 0)
515
+ writer.tag(9, WireType.Bit32).float(message.audioLevel);
516
+ let u = options.writeUnknownFields;
517
+ if (u !== false)
518
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
519
+ return writer;
520
+ }
521
+ }
522
+ /**
523
+ * @generated MessageType for protobuf message stream.video.sfu.models.Participant
524
+ */
525
+ export const Participant = new Participant$Type();
526
+ // @generated message type with reflection information, may provide speed optimized methods
527
+ class StreamQuality$Type extends MessageType<StreamQuality> {
528
+ constructor() {
529
+ super("stream.video.sfu.models.StreamQuality", [
530
+ { no: 1, name: "video_quality", kind: "enum", T: () => ["stream.video.sfu.models.VideoQuality", VideoQuality, "VIDEO_QUALITY_"] },
531
+ { no: 2, name: "user_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ }
532
+ ]);
533
+ }
534
+ create(value?: PartialMessage<StreamQuality>): StreamQuality {
535
+ const message = { videoQuality: 0, userId: "" };
536
+ globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
537
+ if (value !== undefined)
538
+ reflectionMergePartial<StreamQuality>(this, message, value);
539
+ return message;
540
+ }
541
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: StreamQuality): StreamQuality {
542
+ let message = target ?? this.create(), end = reader.pos + length;
543
+ while (reader.pos < end) {
544
+ let [fieldNo, wireType] = reader.tag();
545
+ switch (fieldNo) {
546
+ case /* stream.video.sfu.models.VideoQuality video_quality */ 1:
547
+ message.videoQuality = reader.int32();
548
+ break;
549
+ case /* string user_id */ 2:
550
+ message.userId = reader.string();
551
+ break;
552
+ default:
553
+ let u = options.readUnknownField;
554
+ if (u === "throw")
555
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
556
+ let d = reader.skip(wireType);
557
+ if (u !== false)
558
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
559
+ }
560
+ }
561
+ return message;
562
+ }
563
+ internalBinaryWrite(message: StreamQuality, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
564
+ /* stream.video.sfu.models.VideoQuality video_quality = 1; */
565
+ if (message.videoQuality !== 0)
566
+ writer.tag(1, WireType.Varint).int32(message.videoQuality);
567
+ /* string user_id = 2; */
568
+ if (message.userId !== "")
569
+ writer.tag(2, WireType.LengthDelimited).string(message.userId);
570
+ let u = options.writeUnknownFields;
571
+ if (u !== false)
572
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
573
+ return writer;
574
+ }
575
+ }
576
+ /**
577
+ * @generated MessageType for protobuf message stream.video.sfu.models.StreamQuality
578
+ */
579
+ export const StreamQuality = new StreamQuality$Type();
580
+ // @generated message type with reflection information, may provide speed optimized methods
581
+ class VideoDimension$Type extends MessageType<VideoDimension> {
582
+ constructor() {
583
+ super("stream.video.sfu.models.VideoDimension", [
584
+ { no: 1, name: "width", kind: "scalar", T: 13 /*ScalarType.UINT32*/ },
585
+ { no: 2, name: "height", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }
586
+ ]);
587
+ }
588
+ create(value?: PartialMessage<VideoDimension>): VideoDimension {
589
+ const message = { width: 0, height: 0 };
590
+ globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
591
+ if (value !== undefined)
592
+ reflectionMergePartial<VideoDimension>(this, message, value);
593
+ return message;
594
+ }
595
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: VideoDimension): VideoDimension {
596
+ let message = target ?? this.create(), end = reader.pos + length;
597
+ while (reader.pos < end) {
598
+ let [fieldNo, wireType] = reader.tag();
599
+ switch (fieldNo) {
600
+ case /* uint32 width */ 1:
601
+ message.width = reader.uint32();
602
+ break;
603
+ case /* uint32 height */ 2:
604
+ message.height = reader.uint32();
605
+ break;
606
+ default:
607
+ let u = options.readUnknownField;
608
+ if (u === "throw")
609
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
610
+ let d = reader.skip(wireType);
611
+ if (u !== false)
612
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
613
+ }
614
+ }
615
+ return message;
616
+ }
617
+ internalBinaryWrite(message: VideoDimension, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
618
+ /* uint32 width = 1; */
619
+ if (message.width !== 0)
620
+ writer.tag(1, WireType.Varint).uint32(message.width);
621
+ /* uint32 height = 2; */
622
+ if (message.height !== 0)
623
+ writer.tag(2, WireType.Varint).uint32(message.height);
624
+ let u = options.writeUnknownFields;
625
+ if (u !== false)
626
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
627
+ return writer;
628
+ }
629
+ }
630
+ /**
631
+ * @generated MessageType for protobuf message stream.video.sfu.models.VideoDimension
632
+ */
633
+ export const VideoDimension = new VideoDimension$Type();
634
+ // @generated message type with reflection information, may provide speed optimized methods
635
+ class VideoLayer$Type extends MessageType<VideoLayer> {
636
+ constructor() {
637
+ super("stream.video.sfu.models.VideoLayer", [
638
+ { no: 1, name: "rid", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
639
+ { no: 2, name: "video_dimension", kind: "message", T: () => VideoDimension },
640
+ { no: 4, name: "bitrate", kind: "scalar", T: 13 /*ScalarType.UINT32*/ },
641
+ { no: 5, name: "fps", kind: "scalar", T: 13 /*ScalarType.UINT32*/ },
642
+ { no: 6, name: "quality", kind: "enum", T: () => ["stream.video.sfu.models.VideoQuality", VideoQuality, "VIDEO_QUALITY_"] }
643
+ ]);
644
+ }
645
+ create(value?: PartialMessage<VideoLayer>): VideoLayer {
646
+ const message = { rid: "", bitrate: 0, fps: 0, quality: 0 };
647
+ globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
648
+ if (value !== undefined)
649
+ reflectionMergePartial<VideoLayer>(this, message, value);
650
+ return message;
651
+ }
652
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: VideoLayer): VideoLayer {
653
+ let message = target ?? this.create(), end = reader.pos + length;
654
+ while (reader.pos < end) {
655
+ let [fieldNo, wireType] = reader.tag();
656
+ switch (fieldNo) {
657
+ case /* string rid */ 1:
658
+ message.rid = reader.string();
659
+ break;
660
+ case /* stream.video.sfu.models.VideoDimension video_dimension */ 2:
661
+ message.videoDimension = VideoDimension.internalBinaryRead(reader, reader.uint32(), options, message.videoDimension);
662
+ break;
663
+ case /* uint32 bitrate */ 4:
664
+ message.bitrate = reader.uint32();
665
+ break;
666
+ case /* uint32 fps */ 5:
667
+ message.fps = reader.uint32();
668
+ break;
669
+ case /* stream.video.sfu.models.VideoQuality quality */ 6:
670
+ message.quality = reader.int32();
671
+ break;
672
+ default:
673
+ let u = options.readUnknownField;
674
+ if (u === "throw")
675
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
676
+ let d = reader.skip(wireType);
677
+ if (u !== false)
678
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
679
+ }
680
+ }
681
+ return message;
682
+ }
683
+ internalBinaryWrite(message: VideoLayer, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
684
+ /* string rid = 1; */
685
+ if (message.rid !== "")
686
+ writer.tag(1, WireType.LengthDelimited).string(message.rid);
687
+ /* stream.video.sfu.models.VideoDimension video_dimension = 2; */
688
+ if (message.videoDimension)
689
+ VideoDimension.internalBinaryWrite(message.videoDimension, writer.tag(2, WireType.LengthDelimited).fork(), options).join();
690
+ /* uint32 bitrate = 4; */
691
+ if (message.bitrate !== 0)
692
+ writer.tag(4, WireType.Varint).uint32(message.bitrate);
693
+ /* uint32 fps = 5; */
694
+ if (message.fps !== 0)
695
+ writer.tag(5, WireType.Varint).uint32(message.fps);
696
+ /* stream.video.sfu.models.VideoQuality quality = 6; */
697
+ if (message.quality !== 0)
698
+ writer.tag(6, WireType.Varint).int32(message.quality);
699
+ let u = options.writeUnknownFields;
700
+ if (u !== false)
701
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
702
+ return writer;
703
+ }
704
+ }
705
+ /**
706
+ * @generated MessageType for protobuf message stream.video.sfu.models.VideoLayer
707
+ */
708
+ export const VideoLayer = new VideoLayer$Type();
709
+ // @generated message type with reflection information, may provide speed optimized methods
710
+ class Codec$Type extends MessageType<Codec> {
711
+ constructor() {
712
+ super("stream.video.sfu.models.Codec", [
713
+ { no: 1, name: "payload_type", kind: "scalar", T: 13 /*ScalarType.UINT32*/ },
714
+ { no: 2, name: "name", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
715
+ { no: 3, name: "fmtp_line", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
716
+ { no: 4, name: "clock_rate", kind: "scalar", T: 13 /*ScalarType.UINT32*/ },
717
+ { no: 5, name: "encoding_parameters", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
718
+ { no: 6, name: "feedbacks", kind: "scalar", repeat: 2 /*RepeatType.UNPACKED*/, T: 9 /*ScalarType.STRING*/ }
719
+ ]);
720
+ }
721
+ create(value?: PartialMessage<Codec>): Codec {
722
+ const message = { payloadType: 0, name: "", fmtpLine: "", clockRate: 0, encodingParameters: "", feedbacks: [] };
723
+ globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
724
+ if (value !== undefined)
725
+ reflectionMergePartial<Codec>(this, message, value);
726
+ return message;
727
+ }
728
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Codec): Codec {
729
+ let message = target ?? this.create(), end = reader.pos + length;
730
+ while (reader.pos < end) {
731
+ let [fieldNo, wireType] = reader.tag();
732
+ switch (fieldNo) {
733
+ case /* uint32 payload_type */ 1:
734
+ message.payloadType = reader.uint32();
735
+ break;
736
+ case /* string name */ 2:
737
+ message.name = reader.string();
738
+ break;
739
+ case /* string fmtp_line */ 3:
740
+ message.fmtpLine = reader.string();
741
+ break;
742
+ case /* uint32 clock_rate */ 4:
743
+ message.clockRate = reader.uint32();
744
+ break;
745
+ case /* string encoding_parameters */ 5:
746
+ message.encodingParameters = reader.string();
747
+ break;
748
+ case /* repeated string feedbacks */ 6:
749
+ message.feedbacks.push(reader.string());
750
+ break;
751
+ default:
752
+ let u = options.readUnknownField;
753
+ if (u === "throw")
754
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
755
+ let d = reader.skip(wireType);
756
+ if (u !== false)
757
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
758
+ }
759
+ }
760
+ return message;
761
+ }
762
+ internalBinaryWrite(message: Codec, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
763
+ /* uint32 payload_type = 1; */
764
+ if (message.payloadType !== 0)
765
+ writer.tag(1, WireType.Varint).uint32(message.payloadType);
766
+ /* string name = 2; */
767
+ if (message.name !== "")
768
+ writer.tag(2, WireType.LengthDelimited).string(message.name);
769
+ /* string fmtp_line = 3; */
770
+ if (message.fmtpLine !== "")
771
+ writer.tag(3, WireType.LengthDelimited).string(message.fmtpLine);
772
+ /* uint32 clock_rate = 4; */
773
+ if (message.clockRate !== 0)
774
+ writer.tag(4, WireType.Varint).uint32(message.clockRate);
775
+ /* string encoding_parameters = 5; */
776
+ if (message.encodingParameters !== "")
777
+ writer.tag(5, WireType.LengthDelimited).string(message.encodingParameters);
778
+ /* repeated string feedbacks = 6; */
779
+ for (let i = 0; i < message.feedbacks.length; i++)
780
+ writer.tag(6, WireType.LengthDelimited).string(message.feedbacks[i]);
781
+ let u = options.writeUnknownFields;
782
+ if (u !== false)
783
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
784
+ return writer;
785
+ }
786
+ }
787
+ /**
788
+ * @generated MessageType for protobuf message stream.video.sfu.models.Codec
789
+ */
790
+ export const Codec = new Codec$Type();
791
+ // @generated message type with reflection information, may provide speed optimized methods
792
+ class ICETrickle$Type extends MessageType<ICETrickle> {
793
+ constructor() {
794
+ super("stream.video.sfu.models.ICETrickle", [
795
+ { no: 1, name: "peer_type", kind: "enum", T: () => ["stream.video.sfu.models.PeerType", PeerType, "PEER_TYPE_"] },
796
+ { no: 2, name: "ice_candidate", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
797
+ { no: 3, name: "session_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ }
798
+ ]);
799
+ }
800
+ create(value?: PartialMessage<ICETrickle>): ICETrickle {
801
+ const message = { peerType: 0, iceCandidate: "", sessionId: "" };
802
+ globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
803
+ if (value !== undefined)
804
+ reflectionMergePartial<ICETrickle>(this, message, value);
805
+ return message;
806
+ }
807
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ICETrickle): ICETrickle {
808
+ let message = target ?? this.create(), end = reader.pos + length;
809
+ while (reader.pos < end) {
810
+ let [fieldNo, wireType] = reader.tag();
811
+ switch (fieldNo) {
812
+ case /* stream.video.sfu.models.PeerType peer_type */ 1:
813
+ message.peerType = reader.int32();
814
+ break;
815
+ case /* string ice_candidate */ 2:
816
+ message.iceCandidate = reader.string();
817
+ break;
818
+ case /* string session_id */ 3:
819
+ message.sessionId = reader.string();
820
+ break;
821
+ default:
822
+ let u = options.readUnknownField;
823
+ if (u === "throw")
824
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
825
+ let d = reader.skip(wireType);
826
+ if (u !== false)
827
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
828
+ }
829
+ }
830
+ return message;
831
+ }
832
+ internalBinaryWrite(message: ICETrickle, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
833
+ /* stream.video.sfu.models.PeerType peer_type = 1; */
834
+ if (message.peerType !== 0)
835
+ writer.tag(1, WireType.Varint).int32(message.peerType);
836
+ /* string ice_candidate = 2; */
837
+ if (message.iceCandidate !== "")
838
+ writer.tag(2, WireType.LengthDelimited).string(message.iceCandidate);
839
+ /* string session_id = 3; */
840
+ if (message.sessionId !== "")
841
+ writer.tag(3, WireType.LengthDelimited).string(message.sessionId);
842
+ let u = options.writeUnknownFields;
843
+ if (u !== false)
844
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
845
+ return writer;
846
+ }
847
+ }
848
+ /**
849
+ * @generated MessageType for protobuf message stream.video.sfu.models.ICETrickle
850
+ */
851
+ export const ICETrickle = new ICETrickle$Type();
852
+ // @generated message type with reflection information, may provide speed optimized methods
853
+ class TrackInfo$Type extends MessageType<TrackInfo> {
854
+ constructor() {
855
+ super("stream.video.sfu.models.TrackInfo", [
856
+ { no: 1, name: "track_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
857
+ { no: 2, name: "track_type", kind: "enum", T: () => ["stream.video.sfu.models.TrackType", TrackType, "TRACK_TYPE_"] },
858
+ { no: 5, name: "layers", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => VideoLayer },
859
+ { no: 6, name: "mid", kind: "scalar", T: 9 /*ScalarType.STRING*/ }
860
+ ]);
861
+ }
862
+ create(value?: PartialMessage<TrackInfo>): TrackInfo {
863
+ const message = { trackId: "", trackType: 0, layers: [], mid: "" };
864
+ globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
865
+ if (value !== undefined)
866
+ reflectionMergePartial<TrackInfo>(this, message, value);
867
+ return message;
868
+ }
869
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: TrackInfo): TrackInfo {
870
+ let message = target ?? this.create(), end = reader.pos + length;
871
+ while (reader.pos < end) {
872
+ let [fieldNo, wireType] = reader.tag();
873
+ switch (fieldNo) {
874
+ case /* string track_id */ 1:
875
+ message.trackId = reader.string();
876
+ break;
877
+ case /* stream.video.sfu.models.TrackType track_type */ 2:
878
+ message.trackType = reader.int32();
879
+ break;
880
+ case /* repeated stream.video.sfu.models.VideoLayer layers */ 5:
881
+ message.layers.push(VideoLayer.internalBinaryRead(reader, reader.uint32(), options));
882
+ break;
883
+ case /* string mid */ 6:
884
+ message.mid = reader.string();
885
+ break;
886
+ default:
887
+ let u = options.readUnknownField;
888
+ if (u === "throw")
889
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
890
+ let d = reader.skip(wireType);
891
+ if (u !== false)
892
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
893
+ }
894
+ }
895
+ return message;
896
+ }
897
+ internalBinaryWrite(message: TrackInfo, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
898
+ /* string track_id = 1; */
899
+ if (message.trackId !== "")
900
+ writer.tag(1, WireType.LengthDelimited).string(message.trackId);
901
+ /* stream.video.sfu.models.TrackType track_type = 2; */
902
+ if (message.trackType !== 0)
903
+ writer.tag(2, WireType.Varint).int32(message.trackType);
904
+ /* repeated stream.video.sfu.models.VideoLayer layers = 5; */
905
+ for (let i = 0; i < message.layers.length; i++)
906
+ VideoLayer.internalBinaryWrite(message.layers[i], writer.tag(5, WireType.LengthDelimited).fork(), options).join();
907
+ /* string mid = 6; */
908
+ if (message.mid !== "")
909
+ writer.tag(6, WireType.LengthDelimited).string(message.mid);
910
+ let u = options.writeUnknownFields;
911
+ if (u !== false)
912
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
913
+ return writer;
914
+ }
915
+ }
916
+ /**
917
+ * @generated MessageType for protobuf message stream.video.sfu.models.TrackInfo
918
+ */
919
+ export const TrackInfo = new TrackInfo$Type();
920
+ // @generated message type with reflection information, may provide speed optimized methods
921
+ class Call$Type extends MessageType<Call> {
922
+ constructor() {
923
+ super("stream.video.sfu.models.Call", [
924
+ { no: 1, name: "type", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
925
+ { no: 2, name: "id", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
926
+ { no: 3, name: "created_by_user_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
927
+ { no: 4, name: "host_user_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
928
+ { no: 5, name: "custom", kind: "message", T: () => Struct },
929
+ { no: 6, name: "created_at", kind: "message", T: () => Timestamp },
930
+ { no: 7, name: "updated_at", kind: "message", T: () => Timestamp }
931
+ ]);
932
+ }
933
+ create(value?: PartialMessage<Call>): Call {
934
+ const message = { type: "", id: "", createdByUserId: "", hostUserId: "" };
935
+ globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
936
+ if (value !== undefined)
937
+ reflectionMergePartial<Call>(this, message, value);
938
+ return message;
939
+ }
940
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Call): Call {
941
+ let message = target ?? this.create(), end = reader.pos + length;
942
+ while (reader.pos < end) {
943
+ let [fieldNo, wireType] = reader.tag();
944
+ switch (fieldNo) {
945
+ case /* string type */ 1:
946
+ message.type = reader.string();
947
+ break;
948
+ case /* string id */ 2:
949
+ message.id = reader.string();
950
+ break;
951
+ case /* string created_by_user_id */ 3:
952
+ message.createdByUserId = reader.string();
953
+ break;
954
+ case /* string host_user_id */ 4:
955
+ message.hostUserId = reader.string();
956
+ break;
957
+ case /* google.protobuf.Struct custom */ 5:
958
+ message.custom = Struct.internalBinaryRead(reader, reader.uint32(), options, message.custom);
959
+ break;
960
+ case /* google.protobuf.Timestamp created_at */ 6:
961
+ message.createdAt = Timestamp.internalBinaryRead(reader, reader.uint32(), options, message.createdAt);
962
+ break;
963
+ case /* google.protobuf.Timestamp updated_at */ 7:
964
+ message.updatedAt = Timestamp.internalBinaryRead(reader, reader.uint32(), options, message.updatedAt);
965
+ break;
966
+ default:
967
+ let u = options.readUnknownField;
968
+ if (u === "throw")
969
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
970
+ let d = reader.skip(wireType);
971
+ if (u !== false)
972
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
973
+ }
974
+ }
975
+ return message;
976
+ }
977
+ internalBinaryWrite(message: Call, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
978
+ /* string type = 1; */
979
+ if (message.type !== "")
980
+ writer.tag(1, WireType.LengthDelimited).string(message.type);
981
+ /* string id = 2; */
982
+ if (message.id !== "")
983
+ writer.tag(2, WireType.LengthDelimited).string(message.id);
984
+ /* string created_by_user_id = 3; */
985
+ if (message.createdByUserId !== "")
986
+ writer.tag(3, WireType.LengthDelimited).string(message.createdByUserId);
987
+ /* string host_user_id = 4; */
988
+ if (message.hostUserId !== "")
989
+ writer.tag(4, WireType.LengthDelimited).string(message.hostUserId);
990
+ /* google.protobuf.Struct custom = 5; */
991
+ if (message.custom)
992
+ Struct.internalBinaryWrite(message.custom, writer.tag(5, WireType.LengthDelimited).fork(), options).join();
993
+ /* google.protobuf.Timestamp created_at = 6; */
994
+ if (message.createdAt)
995
+ Timestamp.internalBinaryWrite(message.createdAt, writer.tag(6, WireType.LengthDelimited).fork(), options).join();
996
+ /* google.protobuf.Timestamp updated_at = 7; */
997
+ if (message.updatedAt)
998
+ Timestamp.internalBinaryWrite(message.updatedAt, writer.tag(7, WireType.LengthDelimited).fork(), options).join();
999
+ let u = options.writeUnknownFields;
1000
+ if (u !== false)
1001
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
1002
+ return writer;
1003
+ }
1004
+ }
1005
+ /**
1006
+ * @generated MessageType for protobuf message stream.video.sfu.models.Call
1007
+ */
1008
+ export const Call = new Call$Type();
1009
+ // @generated message type with reflection information, may provide speed optimized methods
1010
+ class Error$Type extends MessageType<Error> {
1011
+ constructor() {
1012
+ super("stream.video.sfu.models.Error", [
1013
+ { no: 1, name: "code", kind: "enum", T: () => ["stream.video.sfu.models.ErrorCode", ErrorCode, "ERROR_CODE_"] },
1014
+ { no: 2, name: "message", kind: "scalar", T: 9 /*ScalarType.STRING*/ }
1015
+ ]);
1016
+ }
1017
+ create(value?: PartialMessage<Error>): Error {
1018
+ const message = { code: 0, message: "" };
1019
+ globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
1020
+ if (value !== undefined)
1021
+ reflectionMergePartial<Error>(this, message, value);
1022
+ return message;
1023
+ }
1024
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Error): Error {
1025
+ let message = target ?? this.create(), end = reader.pos + length;
1026
+ while (reader.pos < end) {
1027
+ let [fieldNo, wireType] = reader.tag();
1028
+ switch (fieldNo) {
1029
+ case /* stream.video.sfu.models.ErrorCode code */ 1:
1030
+ message.code = reader.int32();
1031
+ break;
1032
+ case /* string message */ 2:
1033
+ message.message = reader.string();
1034
+ break;
1035
+ default:
1036
+ let u = options.readUnknownField;
1037
+ if (u === "throw")
1038
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
1039
+ let d = reader.skip(wireType);
1040
+ if (u !== false)
1041
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
1042
+ }
1043
+ }
1044
+ return message;
1045
+ }
1046
+ internalBinaryWrite(message: Error, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
1047
+ /* stream.video.sfu.models.ErrorCode code = 1; */
1048
+ if (message.code !== 0)
1049
+ writer.tag(1, WireType.Varint).int32(message.code);
1050
+ /* string message = 2; */
1051
+ if (message.message !== "")
1052
+ writer.tag(2, WireType.LengthDelimited).string(message.message);
1053
+ let u = options.writeUnknownFields;
1054
+ if (u !== false)
1055
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
1056
+ return writer;
1057
+ }
1058
+ }
1059
+ /**
1060
+ * @generated MessageType for protobuf message stream.video.sfu.models.Error
1061
+ */
1062
+ export const Error = new Error$Type();