@vkontakte/calls-sdk 2.8.6-dev.3c52c9a0.0 → 2.8.6-dev.3e1160f3.0

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.
@@ -27,47 +27,194 @@ export interface ILocalIceCandidateStat extends IRemoteIceCandidateStat {
27
27
  interface StatRtpOutboundVideo {
28
28
  frameHeight?: number;
29
29
  frameWidth?: number;
30
+ /**
31
+ * Идентификатор потока RTP (RID).
32
+ *
33
+ * Используется для идентификации различных потоков видео (например, simulcast) в сессиях WebRTC.
34
+ */
30
35
  rid?: string;
31
36
  framesSent?: number;
32
37
  framesPerSecond?: number;
33
38
  targetBitrate?: number;
34
39
  }
35
40
  export interface StatRtp extends StatRtpOutboundVideo {
41
+ /**
42
+ * Уникальный идентификатор источника синхронизации RTP
43
+ */
36
44
  ssrc: number;
45
+ /**
46
+ * Идентификатор медиалинии (MID)
47
+ *
48
+ * Используется для уникальной идентификации медиалинии в рамках WebRTC-сессии.
49
+ * MID помогает сопоставлять медиапотоки с их соответствующими трансиверами.
50
+ */
51
+ mid?: string;
52
+ /**
53
+ * Тип статистики (например, inbound-rtp, outbound-rtp)
54
+ */
37
55
  type: string;
56
+ /**
57
+ * Тип медиа (например, audio, video)
58
+ */
38
59
  kind: string;
60
+ /**
61
+ * Общее количество байтов, полученных по этому потоку
62
+ */
39
63
  bytesReceived: number;
64
+ /**
65
+ * Общее количество байтов, отправленных по этому потоку
66
+ */
40
67
  bytesSent: number;
68
+ /**
69
+ * Общее количество байтов заголовков, полученных по этому потоку
70
+ */
41
71
  headerBytesReceived: number;
72
+ /**
73
+ * Общее количество байтов заголовков, отправленных по этому потоку
74
+ */
42
75
  headerBytesSent: number;
76
+ /**
77
+ * Среднее значение джиттера в секундах
78
+ * Джиттер — это вариация задержки в получении пакетов данных.
79
+ */
43
80
  jitter: number;
81
+ /**
82
+ * Общее количество потерянных пакетов
83
+ */
44
84
  packetsLost: number;
85
+ /**
86
+ * Общее количество полученных пакетов
87
+ */
45
88
  packetsReceived: number;
89
+ /**
90
+ * Общее количество отправленных пакетов
91
+ */
46
92
  packetsSent: number;
93
+ /**
94
+ * Доля потерянных пакетов
95
+ */
47
96
  fractionLost: number;
97
+ /**
98
+ * Количество Picture Loss Indication (PLI) сообщений
99
+ * PLI — это сообщения, указывающие на потерю кадров изображения.
100
+ */
48
101
  pliCount: number;
102
+ /**
103
+ * Количество Full Intra Request (FIR) сообщений
104
+ * FIR — это запросы на отправку полного внутрикодированного кадра.
105
+ */
49
106
  firCount: number;
107
+ /**
108
+ * Количество Negative ACKnowledgement (NACK) сообщений
109
+ * NACK — это сообщения, указывающие на потерю пакетов данных.
110
+ */
50
111
  nackCount: number;
112
+ /**
113
+ * Идентификатор пользователя, связанный с этим потоком
114
+ */
51
115
  userId?: string;
116
+ /**
117
+ * Пропускная способность в битах в секунду
118
+ */
52
119
  bandwidth?: number;
120
+ /**
121
+ * Процент потерянных пакетов
122
+ */
53
123
  packetLoss?: number;
124
+ /**
125
+ * Частота дискретизации в герцах
126
+ * Частота дискретизации определяет качество звука.
127
+ */
54
128
  clockRate?: number;
129
+ /**
130
+ * Название кодека
131
+ * @example audio/opus, video/vp8
132
+ */
55
133
  mimeType?: string;
134
+ /**
135
+ * Библиотека, которая используется для кодека
136
+ */
137
+ encoderImplementation?: string;
138
+ /**
139
+ * Библиотека, которая используется для декодера
140
+ */
141
+ decoderImplementation?: string;
142
+ /**
143
+ * Параметры кодека, есть только у audio кодеков
144
+ */
145
+ sdpFmtpLine?: string;
146
+ /**
147
+ * Общее количество декодированных кадров
148
+ */
56
149
  framesDecoded?: number;
150
+ /**
151
+ * Общее количество полученных кадров
152
+ */
57
153
  framesReceived?: number;
154
+ /**
155
+ * Общее количество отброшенных кадров
156
+ */
58
157
  framesDropped?: number;
158
+ /**
159
+ * Изменение количества отброшенных кадров
160
+ */
59
161
  framesDroppedDelta?: number;
162
+ /**
163
+ * Изменение задержки между кадрами
164
+ */
60
165
  interframeDelayVariance?: number;
166
+ /**
167
+ * Общее количество полученных аудиосэмплов
168
+ */
61
169
  totalSamplesReceived?: number;
170
+ /**
171
+ * Общее время кодирования видео в секундах.
172
+ *
173
+ * Показывает, сколько времени было потрачено на кодирование видео кадров.
174
+ * Не применяется для аудио.
175
+ */
176
+ totalEncodeTime?: number;
177
+ /**
178
+ * Общее количество замаскированных сэмплов
179
+ */
62
180
  concealedSamples?: number;
181
+ /**
182
+ * Количество вставленных сэмплов для замедления
183
+ */
63
184
  insertedSamplesForDeceleration?: number;
185
+ /**
186
+ * Количество удаленных сэмплов для ускорения
187
+ */
64
188
  removedSamplesForAcceleration?: number;
189
+ /**
190
+ * Количество замаскированных беззвучных сэмплов
191
+ */
65
192
  silentConcealedSamples?: number;
193
+ /**
194
+ * Количество событий маскировки
195
+ */
66
196
  concealmentEvents?: number;
197
+ /**
198
+ * Общее количество аудиоэнергии
199
+ * Аудиоэнергия — это мера мощности аудиосигнала.
200
+ */
67
201
  totalAudioEnergy?: number;
202
+ /**
203
+ * Общее время замерзания в секундах
204
+ */
68
205
  totalFreezesDuration: number;
206
+ /**
207
+ * Изменение общего времени замерзания
208
+ * Время замерзания — это период, в течение которого поток временно останавливается.
209
+ */
69
210
  totalFreezesDurationDelta?: number;
211
+ /**
212
+ * Количество событий замерзания
213
+ */
70
214
  freezeCount: number;
215
+ /**
216
+ * Изменение количества событий замерзания
217
+ */
71
218
  freezeCountDelta?: number;
72
219
  }
73
220
  export type StatItem = {
@@ -0,0 +1,25 @@
1
+ import { WebTransportOptions } from '@fails-components/webtransport';
2
+ declare class WebTransportEventual {
3
+ private webTransport;
4
+ private stream;
5
+ private writer;
6
+ private reader;
7
+ private readonly url;
8
+ private readonly options;
9
+ private readonly compression;
10
+ private encoder;
11
+ private decoder;
12
+ onopen: ((this: WebTransportEventual, ev: Event) => any) | null;
13
+ onmessage: ((this: WebTransportEventual, ev: MessageEvent) => any) | null;
14
+ onerror: ((this: WebTransportEventual, ev: Event) => any) | null;
15
+ onclose: ((this: WebTransportEventual, ev: CloseEvent) => any) | null;
16
+ readyState: number;
17
+ constructor(url: string, options?: WebTransportOptions);
18
+ private getCompressionTypeFromUrl;
19
+ private connect;
20
+ private readLoop;
21
+ send(data: string): Promise<void>;
22
+ close(code?: number, reason?: string): void;
23
+ static isBrowserSupported(): boolean;
24
+ }
25
+ export { WebTransportEventual as WebTransport };
@@ -0,0 +1,48 @@
1
+ /**
2
+ * Encodes a string into a Uint8Array, prepending the length of the string as a variable-length integer and optionally compressing it.
3
+ */
4
+ declare class LengthPrefixedTextEncoder {
5
+ private readonly encoder;
6
+ private readonly compression;
7
+ private readonly lengthEncoder;
8
+ constructor(compression?: 'gzip' | 'deflate' | 'deflate-raw' | null);
9
+ /**
10
+ * Encodes the given string into a Uint8Array.
11
+ *
12
+ * @param data The string to encode.
13
+ * @returns A Uint8Array containing the length-prefixed and optionally compressed encoded string.
14
+ * @throws {RangeError} If the string length exceeds the maximum representable value.
15
+ */
16
+ encode(data: string): Uint8Array;
17
+ private compress;
18
+ }
19
+ /**
20
+ * Decodes a stream of Uint8Arrays into strings, where each string
21
+ * is prefixed by its length as a variable-length integer and optionally decompressed.
22
+ */
23
+ declare class LengthPrefixedTextDecoder {
24
+ private readonly decoder;
25
+ private readonly compression;
26
+ private readonly lengthDecoder;
27
+ private buffer;
28
+ private expectedLength;
29
+ private offset;
30
+ private lengthPrefixLength;
31
+ constructor(compression?: 'gzip' | 'deflate' | 'deflate-raw' | null);
32
+ /**
33
+ * Decodes a Uint8Array into a list of strings.
34
+ *
35
+ * @param data The Uint8Array to decode.
36
+ * @returns An array of decoded strings.
37
+ */
38
+ decode(data: Uint8Array): string[];
39
+ /**
40
+ * Reads the length prefix from the beginning of the data.
41
+ *
42
+ * @param data The Uint8Array containing the length prefix.
43
+ * @returns The length of the message, or null if there's not enough data to read the length.
44
+ */
45
+ private readLength;
46
+ private decompress;
47
+ }
48
+ export { LengthPrefixedTextEncoder, LengthPrefixedTextDecoder };
package/utils/Lz4.d.ts ADDED
@@ -0,0 +1 @@
1
+ export declare function lz4Decompress(input: Uint8Array, outputLength: number): Uint8Array;
@@ -0,0 +1,18 @@
1
+ declare class VariableLengthIntegerEncoder {
2
+ /**
3
+ * Encodes an integer using a variable-length integer encoding.
4
+ * @param num The number to encode.
5
+ * @returns A Uint8Array representing the encoded integer.
6
+ */
7
+ encode(num: number | bigint): Uint8Array;
8
+ }
9
+ declare class VariableLengthIntegerDecoder {
10
+ /**
11
+ * Decodes an integer from a Uint8Array using variable-length integer encoding.
12
+ * @param data The Uint8Array to decode.
13
+ * @returns The decoded integer.
14
+ */
15
+ decode(data: Uint8Array): bigint | null;
16
+ getNumBytesForLengthInteger(data: Uint8Array): number;
17
+ }
18
+ export { VariableLengthIntegerEncoder, VariableLengthIntegerDecoder };