@vkontakte/calls-sdk 2.8.11-dev.c08ac4e9.0 → 2.8.11-dev.c0a05ac7.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.
- package/CallsSDK.d.ts +49 -23
- package/abstract/BaseApi.d.ts +2 -3
- package/abstract/BaseSignaling.d.ts +5 -7
- package/calls-sdk.cjs.js +11 -11
- package/calls-sdk.esm.js +5638 -5243
- package/classes/AudioFix.d.ts +5 -1
- package/classes/AudioOutput.d.ts +5 -1
- package/classes/CallRegistry.d.ts +22 -0
- package/classes/Conversation.d.ts +17 -6
- package/classes/DebugInfo.d.ts +3 -0
- package/classes/DisplayLayoutRequester.d.ts +8 -1
- package/classes/ExternalIdCache.d.ts +19 -0
- package/classes/MediaSource.d.ts +12 -1
- package/classes/ParticipantIdRegistry.d.ts +3 -0
- package/classes/ProducerCommandSerializationService.d.ts +3 -0
- package/classes/SignalingActor.d.ts +3 -1
- package/classes/SpeakerDetector.d.ts +2 -1
- package/classes/SpecListener.d.ts +7 -1
- package/classes/{Logger.d.ts → StatsLogger.d.ts} +3 -10
- package/classes/VideoEffectsFpsLimiter.d.ts +3 -0
- package/classes/asr/AsrReceiver.d.ts +3 -1
- package/classes/codec/LibVPxDecoder.d.ts +3 -0
- package/classes/codec/LibVPxEncoder.d.ts +3 -1
- package/classes/codec/WebCodecsDecoder.d.ts +3 -0
- package/classes/codec/WebCodecsEncoder.d.ts +3 -1
- package/classes/codec/WorkerBase.d.ts +5 -0
- package/classes/screenshare/BaseStreamBuilder.d.ts +4 -1
- package/classes/screenshare/CanvasRenderer.d.ts +3 -1
- package/classes/screenshare/ScreenCaptureReceiver.d.ts +7 -1
- package/classes/screenshare/ScreenCaptureSender.d.ts +5 -1
- package/classes/screenshare/ScreenCongestionControl.d.ts +3 -1
- package/classes/screenshare/StreamBuilder.d.ts +5 -1
- package/classes/screenshare/TrackGeneratorRenderer.d.ts +3 -1
- package/classes/screenshare/WebmBuilder.d.ts +3 -1
- package/classes/stat/CodecStatsAggregator.d.ts +7 -7
- package/classes/stat/ConversationStats.d.ts +21 -0
- package/classes/stat/StatAggregator.d.ts +6 -6
- package/classes/stat/StatFirstMediaReceived.d.ts +4 -1
- package/classes/stat/StatPings.d.ts +9 -9
- package/classes/stat/StatScreenShareFirstFrame.d.ts +3 -1
- package/classes/stat/StatSignalingCommands.d.ts +8 -8
- package/classes/transport/BaseTransport.d.ts +1 -1
- package/classes/transport/DirectStatReporter.d.ts +3 -1
- package/classes/transport/DirectTransport.d.ts +9 -1
- package/classes/transport/PerfStatReporter.d.ts +5 -1
- package/classes/transport/ServerTransport.d.ts +10 -2
- package/classes/transport/Transport.d.ts +11 -14
- package/default/Api.d.ts +3 -11
- package/default/Signaling.d.ts +13 -3
- package/enums/SignalingNotification.d.ts +2 -1
- package/enums/TransportState.d.ts +10 -0
- package/enums/TransportTopology.d.ts +5 -0
- package/package.json +1 -1
- package/static/Capabilities.d.ts +5 -0
- package/static/Debug.d.ts +27 -8
- package/static/External.d.ts +146 -71
- package/static/Params.d.ts +90 -70
- package/static/Utils.d.ts +3 -2
- package/static/WebRTCUtils.d.ts +6 -4
- package/types/Capabilities.d.ts +24 -0
- package/types/Conversation.d.ts +1 -1
- package/types/FastStart.d.ts +1 -0
- package/types/SignalingMessage.d.ts +8 -1
- package/types/Statistics.d.ts +1 -1
- package/utils/DebugStorage.d.ts +100 -1
- package/classes/stat/EventMetricsService.d.ts +0 -9
- package/static/ConversationDebugLogger.d.ts +0 -13
package/classes/AudioFix.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { type DebugLogger } from '../static/Debug';
|
|
2
|
+
import StatsLogger from './StatsLogger';
|
|
1
3
|
import { MediaSource } from './MediaSource';
|
|
2
4
|
export default class AudioFix {
|
|
3
5
|
private _fixNoPacketsApplied;
|
|
@@ -7,11 +9,13 @@ export default class AudioFix {
|
|
|
7
9
|
private _fixTooManyPacketsFailed;
|
|
8
10
|
private _fixTooManyPacketsTime;
|
|
9
11
|
private _mediaSource;
|
|
12
|
+
private readonly _debug;
|
|
13
|
+
private readonly _logger;
|
|
10
14
|
private _lastPacketsSent;
|
|
11
15
|
private _lastPacketsSentTime;
|
|
12
16
|
private _toggleAudioPromise;
|
|
13
17
|
private _fixNoPacketsAppliedVideo;
|
|
14
|
-
constructor(mediaSource: MediaSource);
|
|
18
|
+
constructor(mediaSource: MediaSource, debug?: DebugLogger, logger?: StatsLogger | null);
|
|
15
19
|
private _fixAudioDeviceNoPackets;
|
|
16
20
|
private _fixAudioDeviceTooManyPackets;
|
|
17
21
|
fix(rtps: any[]): void;
|
package/classes/AudioOutput.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import { type DebugLogger } from '../static/Debug';
|
|
1
2
|
import { ParticipantId } from '../types/Participant';
|
|
3
|
+
import StatsLogger from './StatsLogger';
|
|
2
4
|
import { StatFirstMediaReceived } from './stat/StatFirstMediaReceived';
|
|
3
5
|
/**
|
|
4
6
|
* Единый AudioOutput поддерживающий p2p, audioMix и transparent-audio
|
|
@@ -10,7 +12,9 @@ export default class AudioOutput {
|
|
|
10
12
|
private _volume;
|
|
11
13
|
private readonly _features;
|
|
12
14
|
private readonly _statFirstMediaReceived;
|
|
13
|
-
|
|
15
|
+
protected readonly _debug: DebugLogger;
|
|
16
|
+
private readonly _logger;
|
|
17
|
+
constructor(statFirstMediaReceived: StatFirstMediaReceived, allowMultipleTracks?: boolean, debug?: DebugLogger, logger?: StatsLogger | null);
|
|
14
18
|
add(participantId: ParticipantId, track: MediaStreamTrack): void;
|
|
15
19
|
remove(participantId: ParticipantId, track: MediaStreamTrack): void;
|
|
16
20
|
get volume(): number;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import Conversation from './Conversation';
|
|
2
|
+
export interface HoldableConversation extends Conversation {
|
|
3
|
+
id: string;
|
|
4
|
+
hold(hold: boolean): Promise<void>;
|
|
5
|
+
}
|
|
6
|
+
export declare class CallRegistry {
|
|
7
|
+
private _conversations;
|
|
8
|
+
private _activeId;
|
|
9
|
+
private _mutex;
|
|
10
|
+
add(conversation: HoldableConversation): void;
|
|
11
|
+
remove(id: string | null): void;
|
|
12
|
+
get(id: string): HoldableConversation | undefined;
|
|
13
|
+
getActive(): HoldableConversation | null;
|
|
14
|
+
getActiveId(): string | null;
|
|
15
|
+
has(id: string): boolean;
|
|
16
|
+
getAll(): HoldableConversation[];
|
|
17
|
+
get callsLength(): number;
|
|
18
|
+
setActive(id: string): Promise<void>;
|
|
19
|
+
clear(): void;
|
|
20
|
+
}
|
|
21
|
+
declare const callRegistry: CallRegistry;
|
|
22
|
+
export { callRegistry };
|
|
@@ -16,7 +16,7 @@ import { ConversationData, ConversationOnStartParams } from '../types/Conversati
|
|
|
16
16
|
import { ExternalId, ExternalParticipant, ExternalParticipantId, ExternalParticipantListChunk, ExternalUserId } from '../types/ExternalId';
|
|
17
17
|
import type { FastJoinHandler } from '../types/FastJoin';
|
|
18
18
|
import MediaModifiers from '../types/MediaModifiers';
|
|
19
|
-
import { IVideoDimentions } from '../types/MediaSettings';
|
|
19
|
+
import MediaSettings, { IVideoDimentions } from '../types/MediaSettings';
|
|
20
20
|
import { IAddMovieParams, IUpdateMovieData } from '../types/MovieShare';
|
|
21
21
|
import MuteStates from '../types/MuteStates';
|
|
22
22
|
import { CompositeUserId, IGetParticipantsParameters, ParticipantId, ParticipantStateData } from '../types/Participant';
|
|
@@ -37,11 +37,13 @@ export default class Conversation extends EventEmitter {
|
|
|
37
37
|
private _conversation;
|
|
38
38
|
private _myLastRequestedLayouts;
|
|
39
39
|
private _state;
|
|
40
|
+
private _previousState;
|
|
40
41
|
private _participantState;
|
|
41
42
|
private _participants;
|
|
42
43
|
private _pendingParticipants;
|
|
43
44
|
private _transport;
|
|
44
45
|
private _debugInfo;
|
|
46
|
+
private readonly _debug;
|
|
45
47
|
private _volumesDetector;
|
|
46
48
|
private _speakerDetector;
|
|
47
49
|
private _localVolumeDetector;
|
|
@@ -50,12 +52,12 @@ export default class Conversation extends EventEmitter {
|
|
|
50
52
|
private _lastSignalledActiveSpeakerId;
|
|
51
53
|
private _isRealTimeAsrRequested;
|
|
52
54
|
private _serverSettings;
|
|
53
|
-
private
|
|
54
|
-
private
|
|
55
|
-
private
|
|
56
|
-
private static _abortController;
|
|
55
|
+
private _serverTimeOffset;
|
|
56
|
+
private _delayedHangup;
|
|
57
|
+
private _abortController;
|
|
57
58
|
private readonly _onUnload;
|
|
58
59
|
private readonly _audioOutput;
|
|
60
|
+
private readonly _stats;
|
|
59
61
|
private _lastStalled;
|
|
60
62
|
private _audioMixStalled;
|
|
61
63
|
private _audioFix;
|
|
@@ -70,6 +72,13 @@ export default class Conversation extends EventEmitter {
|
|
|
70
72
|
static current(): Conversation | null;
|
|
71
73
|
static hangupAfterInit(): void;
|
|
72
74
|
static id(): string | null;
|
|
75
|
+
get id(): string;
|
|
76
|
+
get externalId(): ExternalParticipantId | undefined;
|
|
77
|
+
get mediaSettings(): MediaSettings | undefined;
|
|
78
|
+
get isCallHeld(): boolean;
|
|
79
|
+
static debugSessionId(): string | null;
|
|
80
|
+
static getSyncedTime(): number;
|
|
81
|
+
get debugSessionId(): string | null;
|
|
73
82
|
onStart({ opponentIds, opponentType, mediaOptions, payload, joiningAllowed, requireAuthToJoin, onlyAdminCanShareMovie, externalIds, onFastStart, conversationId, }: ConversationOnStartParams): Promise<ConversationData>;
|
|
74
83
|
onJoin(joinArgs: {
|
|
75
84
|
conversationId?: string;
|
|
@@ -281,7 +290,6 @@ export default class Conversation extends EventEmitter {
|
|
|
281
290
|
startStream(isRecord?: boolean, name?: string | null, movieId?: string | null, privacy?: 'PUBLIC' | 'FRIENDS' | 'DIRECT_LINK', groupId?: string | null, roomId?: number | null): Promise<undefined>;
|
|
282
291
|
stopStream(roomId?: number | null, remove?: boolean): Promise<undefined>;
|
|
283
292
|
publishStream(roomId?: number | null): Promise<undefined>;
|
|
284
|
-
recordSetConf(king?: ParticipantId, pawns?: ParticipantId[], hideParticipantCount?: boolean, roomId?: number | null): Promise<void>;
|
|
285
293
|
getStreamInfo(): Promise<{
|
|
286
294
|
movieId: any;
|
|
287
295
|
preview: any;
|
|
@@ -395,6 +403,7 @@ export default class Conversation extends EventEmitter {
|
|
|
395
403
|
private _onFeedback;
|
|
396
404
|
private _onDecorativeParticipantIdChanged;
|
|
397
405
|
private _onVideoSuspendSuggest;
|
|
406
|
+
private _onParticipantHold;
|
|
398
407
|
private _isMe;
|
|
399
408
|
private _getMuteStatesForRoomId;
|
|
400
409
|
private _getMuteStatesForCurrentRoom;
|
|
@@ -404,6 +413,8 @@ export default class Conversation extends EventEmitter {
|
|
|
404
413
|
private _getParticipants;
|
|
405
414
|
private _getParticipant;
|
|
406
415
|
}
|
|
416
|
+
declare function _resetPendingInstance(): void;
|
|
417
|
+
export { _resetPendingInstance };
|
|
407
418
|
export declare class UpdateDisplayLayoutError extends Error {
|
|
408
419
|
readonly participantErrors: {
|
|
409
420
|
externalId: ExternalParticipantId;
|
package/classes/DebugInfo.d.ts
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
|
+
import { type DebugLogger } from '../static/Debug';
|
|
1
2
|
import { Participant, ParticipantId } from '../types/Participant';
|
|
2
3
|
import { StatResult } from '../types/Statistics';
|
|
3
4
|
import EventEmitter from './EventEmitter';
|
|
4
5
|
export default class DebugInfo extends EventEmitter {
|
|
5
6
|
private _lastMemoryStat;
|
|
7
|
+
private readonly _debug;
|
|
8
|
+
constructor(debug?: DebugLogger);
|
|
6
9
|
onRemoteDataStats(stats: StatResult, participants: Record<ParticipantId, Participant>): void;
|
|
7
10
|
_calcMemory(): void;
|
|
8
11
|
}
|
|
@@ -1,26 +1,33 @@
|
|
|
1
1
|
import BaseApi from '../abstract/BaseApi';
|
|
2
|
+
import type { DebugLogger } from '../static/Debug';
|
|
2
3
|
import { DisplayLayoutRequest, ParticipantLayout } from '../types/ParticipantLayout';
|
|
3
4
|
import { Participant, ParticipantId } from '../types/Participant';
|
|
4
5
|
type DisplayLayoutRequesterParams = {
|
|
5
6
|
api: BaseApi;
|
|
7
|
+
debug: DebugLogger;
|
|
6
8
|
getParticipants: () => Promise<Record<ParticipantId, Participant>>;
|
|
7
9
|
isMe: (participantId: ParticipantId) => boolean;
|
|
8
10
|
updateDisplayLayout: (layouts: ParticipantLayout[]) => Promise<void>;
|
|
9
11
|
};
|
|
10
12
|
export default class DisplayLayoutRequester {
|
|
11
13
|
private readonly _api;
|
|
14
|
+
private readonly _debug;
|
|
12
15
|
private readonly _getParticipants;
|
|
13
16
|
private readonly _isMe;
|
|
14
17
|
private readonly _updateDisplayLayout;
|
|
15
18
|
private _requestedLayouts;
|
|
19
|
+
private _uncertainLayouts;
|
|
16
20
|
private _pendingRequests;
|
|
17
21
|
private _pendingPromises;
|
|
22
|
+
private _lastRequests;
|
|
18
23
|
private _timer;
|
|
19
24
|
private _inFlight;
|
|
20
25
|
private _lastFlushAt;
|
|
21
26
|
private _generation;
|
|
22
|
-
|
|
27
|
+
private _forceNextFlush;
|
|
28
|
+
constructor({ api, debug, getParticipants, isMe, updateDisplayLayout }: DisplayLayoutRequesterParams);
|
|
23
29
|
request(requests: DisplayLayoutRequest[]): Promise<void>;
|
|
30
|
+
resend(): void;
|
|
24
31
|
cleanupParticipant(participantId: ParticipantId): void;
|
|
25
32
|
clear(): void;
|
|
26
33
|
private _schedule;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ExternalId, ExternalParticipantId } from '../types/ExternalId';
|
|
2
|
+
import { CompositeUserId, OkUserId, ParticipantId } from '../types/Participant';
|
|
3
|
+
export declare class ExternalIdCache {
|
|
4
|
+
private _okIdToExternalId;
|
|
5
|
+
private _externalIdToOkId;
|
|
6
|
+
private _decorativeIdToInitialId;
|
|
7
|
+
private _initialIdToDecorativeId;
|
|
8
|
+
getOkId(externalId: ExternalId): OkUserId | null;
|
|
9
|
+
getExternalId(okId: OkUserId): ExternalParticipantId | null;
|
|
10
|
+
hasByExternalId(externalId: ExternalId): boolean;
|
|
11
|
+
hasByOkId(okId: OkUserId): boolean;
|
|
12
|
+
cache(participantId: OkUserId | CompositeUserId | ParticipantId, externalId: ExternalParticipantId): void;
|
|
13
|
+
mapDecorativeId(decorativeId: OkUserId | CompositeUserId | ParticipantId, initialId: OkUserId | CompositeUserId | ParticipantId): void;
|
|
14
|
+
unmapDecorativeId(initialId: OkUserId | CompositeUserId | ParticipantId): void;
|
|
15
|
+
getDecorativeIdByInitialId(initialId: OkUserId | CompositeUserId | ParticipantId): OkUserId | undefined;
|
|
16
|
+
replaceByInitialIdIdIfExists(id: OkUserId | CompositeUserId | ParticipantId): OkUserId;
|
|
17
|
+
getParticipantIdByExternalId(externalId: ExternalId): ParticipantId | null;
|
|
18
|
+
clear(): void;
|
|
19
|
+
}
|
package/classes/MediaSource.d.ts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import type { IEffect } from '@vkontakte/calls-video-effects';
|
|
2
2
|
import EventEmitter from '../classes/EventEmitter';
|
|
3
3
|
import MediaOption from '../enums/MediaOption';
|
|
4
|
+
import { type DebugLogger } from '../static/Debug';
|
|
4
5
|
import MediaSettings, { IVideoDimentions } from '../types/MediaSettings';
|
|
5
6
|
import { ScreenCaptureSettings } from '../types/ScreenCaptureSettings';
|
|
7
|
+
import StatsLogger from './StatsLogger';
|
|
6
8
|
export declare const enum MediaSourceEvent {
|
|
7
9
|
SOURCE_CHANGED = "SOURCE_CHANGED",
|
|
8
10
|
SOURCE_READY = "SOURCE_READY",
|
|
@@ -45,6 +47,7 @@ export declare class MediaSource extends EventEmitter {
|
|
|
45
47
|
/** Трек аудио эффектов. Не изменяется на протяжении всего времени */
|
|
46
48
|
private _audioEffectsTrack;
|
|
47
49
|
private _mediaSettings;
|
|
50
|
+
private _lastMediaSettings;
|
|
48
51
|
private _videoStatusOnScreenCapturingEnabled;
|
|
49
52
|
private _effect;
|
|
50
53
|
private _audioEffectParams;
|
|
@@ -53,7 +56,9 @@ export declare class MediaSource extends EventEmitter {
|
|
|
53
56
|
private _animojiEnabled;
|
|
54
57
|
/** вычисляем низкую производительность видео эффектов */
|
|
55
58
|
private readonly _videoEffectsFpsLimiter?;
|
|
56
|
-
|
|
59
|
+
private readonly _debug;
|
|
60
|
+
private readonly _logger;
|
|
61
|
+
constructor(debug?: DebugLogger, logger?: StatsLogger | null);
|
|
57
62
|
get cameraVideoTrack(): MediaStreamTrack | null;
|
|
58
63
|
set cameraVideoTrack(track: MediaStreamTrack | null);
|
|
59
64
|
request(mediaOptions?: MediaOption[], needEmptyTracks?: boolean): Promise<void>;
|
|
@@ -63,7 +68,11 @@ export declare class MediaSource extends EventEmitter {
|
|
|
63
68
|
getSendAudioTrack(): MediaStreamTrack | null;
|
|
64
69
|
get isAnimojiRequested(): boolean;
|
|
65
70
|
addTrackToPeerConnection(pc: RTCPeerConnection, observer: boolean, noDataChannel: boolean): void;
|
|
71
|
+
/**
|
|
72
|
+
* @deprecated Используйте гетер mediaSettings
|
|
73
|
+
*/
|
|
66
74
|
getMediaSettings(): MediaSettings;
|
|
75
|
+
get mediaSettings(): MediaSettings;
|
|
67
76
|
changeDevice(kind: MediaDeviceKind): Promise<void>;
|
|
68
77
|
/**
|
|
69
78
|
* Установка кастомного стрима для видео, например внешний шаринг экрана
|
|
@@ -91,6 +100,8 @@ export declare class MediaSource extends EventEmitter {
|
|
|
91
100
|
private _setEffect;
|
|
92
101
|
private _stopEffect;
|
|
93
102
|
destroy(): void;
|
|
103
|
+
stopLocalMedia(): Promise<void>;
|
|
104
|
+
resumeLocalMedia(): Promise<void>;
|
|
94
105
|
toggleScreenCapturing(settings: ScreenCaptureSettings): Promise<void>;
|
|
95
106
|
disableScreenCapturing(): Promise<void>;
|
|
96
107
|
private videoTrackMuteHandler;
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
+
import { type DebugLogger } from '../static/Debug';
|
|
1
2
|
import { ParticipantStreamDescription } from '../types/ParticipantStreamDescription';
|
|
2
3
|
import SignalingMessage from '../types/SignalingMessage';
|
|
3
4
|
export declare class ParticipantIdRegistry {
|
|
4
5
|
private streamDescriptionByCompactId;
|
|
5
6
|
private compactIdByStreamDescription;
|
|
7
|
+
private readonly _debug;
|
|
8
|
+
constructor(debug?: DebugLogger);
|
|
6
9
|
getStreamDescription(compactedId: number): ParticipantStreamDescription | undefined;
|
|
7
10
|
getCompactId(streamDescription: string): number | undefined;
|
|
8
11
|
handleMessage(data: ArrayBuffer): SignalingMessage | null;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type DebugLogger } from '../static/Debug';
|
|
1
2
|
import { NetworkStatReport } from '../types/NetworkStatReport';
|
|
2
3
|
import ParticipantLayout, { RequestKeyFrame, StopStream } from '../types/ParticipantLayout';
|
|
3
4
|
import { RequestAsr } from '../types/RequestAsr';
|
|
@@ -10,6 +11,8 @@ import { SharingStatReport } from './screenshare/SharingStatReport';
|
|
|
10
11
|
import { ParticipantIdRegistry } from './ParticipantIdRegistry';
|
|
11
12
|
export declare class ProducerCommandSerializationService {
|
|
12
13
|
private participantIdRegistry;
|
|
14
|
+
private readonly _debug;
|
|
15
|
+
constructor(debug?: DebugLogger);
|
|
13
16
|
setParticipantIdRegistry(participantIdRegistry: ParticipantIdRegistry): void;
|
|
14
17
|
serializeUpdateDisplayLayout(sequenceNumber: number, layouts: {
|
|
15
18
|
[key: string]: ParticipantLayout | StopStream | RequestKeyFrame;
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
+
import { type DebugLogger } from '../static/Debug';
|
|
1
2
|
import SignalingMessage from '../types/SignalingMessage';
|
|
2
3
|
export declare class SignalingActor {
|
|
3
4
|
private processor;
|
|
4
5
|
private queue;
|
|
5
6
|
private isProcessing;
|
|
6
|
-
|
|
7
|
+
private readonly _debug;
|
|
8
|
+
constructor(processor: (message: SignalingMessage) => Promise<unknown> | unknown, debug?: DebugLogger);
|
|
7
9
|
add(message: SignalingMessage): void;
|
|
8
10
|
private processQueue;
|
|
9
11
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ParticipantId } from '../types/Participant';
|
|
2
2
|
import EventEmitter from './EventEmitter';
|
|
3
|
-
import
|
|
3
|
+
import TransportTopology from '../enums/TransportTopology';
|
|
4
|
+
import { Transport } from './transport/Transport';
|
|
4
5
|
import { VolumeLevel } from './VolumeDetector';
|
|
5
6
|
import { VolumesDetector } from './VolumesDetector';
|
|
6
7
|
export declare const enum SpeakerDetectorEvent {
|
|
@@ -1,17 +1,23 @@
|
|
|
1
|
+
import { type DebugLogger } from '../static/Debug';
|
|
1
2
|
import MediaSettings from '../types/MediaSettings';
|
|
2
3
|
import { Participant, ParticipantId } from '../types/Participant';
|
|
3
4
|
import EventEmitter from './EventEmitter';
|
|
5
|
+
import StatsLogger from './StatsLogger';
|
|
4
6
|
import { Transport } from './transport/Transport';
|
|
5
7
|
import { VolumesDetector } from './VolumesDetector';
|
|
6
8
|
export default class SpecListener extends EventEmitter {
|
|
7
9
|
private _transport;
|
|
8
10
|
private _volumes;
|
|
9
11
|
private readonly _participants;
|
|
12
|
+
private readonly _debug;
|
|
13
|
+
private readonly _logger;
|
|
10
14
|
private _connectionTimeout;
|
|
11
15
|
private _volumeTimeout;
|
|
12
|
-
constructor(transport: Transport, volumesDetector: VolumesDetector, participants: Record<ParticipantId, Participant
|
|
16
|
+
constructor(transport: Transport, volumesDetector: VolumesDetector, participants: Record<ParticipantId, Participant>, debug?: DebugLogger, logger?: StatsLogger | null);
|
|
13
17
|
destroy(): void;
|
|
14
18
|
onChangeRemoteMediaSettings(participantId: ParticipantId, mediaSettings: MediaSettings): void;
|
|
19
|
+
private _getConnectionTimeout;
|
|
20
|
+
private _getVolumeTimeout;
|
|
15
21
|
private _onTransportStateChanged;
|
|
16
22
|
private _onVolumesDetected;
|
|
17
23
|
private _onConnectionTimeout;
|
|
@@ -4,23 +4,16 @@ import StatLog from '../enums/StatLog';
|
|
|
4
4
|
/**
|
|
5
5
|
* Класс отвечает за отправку различной информации в сервис статистики (события, статистика и подобное)
|
|
6
6
|
*/
|
|
7
|
-
export default class
|
|
8
|
-
private static _instance;
|
|
9
|
-
private static _conversationIdProvider;
|
|
10
|
-
static setConversationIdProvider(provider: () => string | null): void;
|
|
11
|
-
static create(api: BaseApi, externalLogger: BaseLogger | null): void;
|
|
12
|
-
static log(name: StatLog, value?: string, immediately?: boolean): void;
|
|
13
|
-
static logClientStats(params: Record<string, string | number | boolean | undefined | null>, immediately?: boolean): void;
|
|
14
|
-
static logClientEvent(params: Record<string, string | number | boolean | undefined | null>, immediately?: boolean): void;
|
|
15
|
-
static destroy(): void;
|
|
7
|
+
export default class StatsLogger extends BaseLogger {
|
|
16
8
|
private readonly _externalLogger;
|
|
17
9
|
private readonly _api;
|
|
10
|
+
private readonly _conversationIdProvider;
|
|
18
11
|
private readonly _batchInterval;
|
|
19
12
|
private _batchedClientStats;
|
|
20
13
|
private _batchedClientEvents;
|
|
21
14
|
private _batchTimeout;
|
|
22
15
|
private _serverTimeDelta;
|
|
23
|
-
constructor(api: BaseApi, externalLogger: BaseLogger | null);
|
|
16
|
+
constructor(api: BaseApi, externalLogger: BaseLogger | null, conversationIdProvider: () => string | null);
|
|
24
17
|
log(name: StatLog, value?: string, immediately?: boolean): void;
|
|
25
18
|
logClientStats(data: Record<string, string | number | boolean | undefined | null>, immediately?: boolean): void;
|
|
26
19
|
logClientEvent(data: Record<string, string | number | boolean | undefined | null>, immediately?: boolean): void;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { VideoEffects } from '@vkontakte/calls-video-effects';
|
|
2
|
+
import { type DebugLogger } from '../static/Debug';
|
|
2
3
|
import EventEmitter from './EventEmitter';
|
|
3
4
|
export declare enum VideoEffectsFpsLimiterEvent {
|
|
4
5
|
FpsLimit = "fps-limit"
|
|
@@ -10,6 +11,8 @@ export declare class VideoEffectsFpsLimiter extends EventEmitter {
|
|
|
10
11
|
private _fpsMeterUnsubscribe;
|
|
11
12
|
private readonly _fpsHistory;
|
|
12
13
|
private _fpsLimitCursor;
|
|
14
|
+
private readonly _debug;
|
|
15
|
+
constructor(debug?: DebugLogger);
|
|
13
16
|
get fpsLimit(): number;
|
|
14
17
|
watch(videoEffect: VideoEffects | null): void;
|
|
15
18
|
private _handleFpsMeter;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type DebugLogger } from '../../static/Debug';
|
|
1
2
|
import { AsrTranscription } from '../../types/Asr';
|
|
2
3
|
import { ParticipantIdRegistry } from '../ParticipantIdRegistry';
|
|
3
4
|
export declare class AsrReceiver {
|
|
@@ -5,7 +6,8 @@ export declare class AsrReceiver {
|
|
|
5
6
|
private readonly _participantIdRegistry;
|
|
6
7
|
private readonly _asrCallback;
|
|
7
8
|
private readonly _textDecoder;
|
|
8
|
-
|
|
9
|
+
private readonly _debug;
|
|
10
|
+
constructor(datachannel: RTCDataChannel, participantIdRegistry: ParticipantIdRegistry, callback: (asr: AsrTranscription) => void, debug?: DebugLogger);
|
|
9
11
|
private static parse;
|
|
10
12
|
private _onDataChannelMessage;
|
|
11
13
|
destroy(): void;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
+
import { type DebugLogger } from '../../static/Debug';
|
|
2
|
+
import StatsLogger from '../StatsLogger';
|
|
1
3
|
import IDecoder from './IDecoder';
|
|
2
4
|
import WorkerBase from './WorkerBase';
|
|
3
5
|
export default class LibVPxDecoder extends WorkerBase implements IDecoder {
|
|
6
|
+
constructor(debug?: DebugLogger, logger?: StatsLogger | null);
|
|
4
7
|
init(onFrameImage: (image: ImageData) => void, onFrameError: (error: unknown) => void, onKeyFrameRequested: () => void): Promise<void>;
|
|
5
8
|
decodeFrame(timestamp: number, data: Uint8Array, isVP9: boolean, keyFrame?: boolean): void;
|
|
6
9
|
destroy(): void;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { type DebugLogger } from '../../static/Debug';
|
|
2
|
+
import StatsLogger from '../StatsLogger';
|
|
1
3
|
import IEncoder from './IEncoder';
|
|
2
4
|
import { OnFrameCallback } from './Types';
|
|
3
5
|
import WorkerBase from './WorkerBase';
|
|
@@ -13,7 +15,7 @@ export default class LibVPxEncoder extends WorkerBase implements IEncoder {
|
|
|
13
15
|
private _canvasCtx;
|
|
14
16
|
private _frameReadTimeout;
|
|
15
17
|
private _lastFrame;
|
|
16
|
-
constructor(sourceTrack: MediaStreamTrack, onFrame: OnFrameCallback, useCongestionControl: boolean, maxBitrate: number);
|
|
18
|
+
constructor(sourceTrack: MediaStreamTrack, onFrame: OnFrameCallback, useCongestionControl: boolean, maxBitrate: number, debug?: DebugLogger, logger?: StatsLogger | null);
|
|
17
19
|
private _createDom;
|
|
18
20
|
private _removeDom;
|
|
19
21
|
private _createStream;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
+
import { type DebugLogger } from '../../static/Debug';
|
|
2
|
+
import StatsLogger from '../StatsLogger';
|
|
1
3
|
import IDecoder from './IDecoder';
|
|
2
4
|
import WorkerBase from './WorkerBase';
|
|
3
5
|
export default class WebCodecsDecoder extends WorkerBase implements IDecoder {
|
|
6
|
+
constructor(debug?: DebugLogger, logger?: StatsLogger | null);
|
|
4
7
|
init(onFrameImage: (frame: VideoFrame) => void, onFrameError: (error: unknown) => void, onKeyFrameRequested: () => void): Promise<void>;
|
|
5
8
|
decodeFrame(timestamp: number, data: Uint8Array, isVP9: boolean, keyFrame?: boolean): void;
|
|
6
9
|
destroy(): void;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { type DebugLogger } from '../../static/Debug';
|
|
2
|
+
import StatsLogger from '../StatsLogger';
|
|
1
3
|
import IEncoder from './IEncoder';
|
|
2
4
|
import { OnFrameCallback } from './Types';
|
|
3
5
|
import WorkerBase from './WorkerBase';
|
|
@@ -9,7 +11,7 @@ export default class WebCodecsEncoder extends WorkerBase implements IEncoder {
|
|
|
9
11
|
private readonly _maxBitrate;
|
|
10
12
|
private readonly _useCbr;
|
|
11
13
|
private readonly _frameRate;
|
|
12
|
-
constructor(sourceTrack: MediaStreamTrack, onFrame: OnFrameCallback, useCongestionControl: boolean, maxBitrate: number, useCbr: boolean, frameRate: number);
|
|
14
|
+
constructor(sourceTrack: MediaStreamTrack, onFrame: OnFrameCallback, useCongestionControl: boolean, maxBitrate: number, useCbr: boolean, frameRate: number, debug?: DebugLogger, logger?: StatsLogger | null);
|
|
13
15
|
init(): Promise<void>;
|
|
14
16
|
requestFrame(keyFrame?: boolean): void;
|
|
15
17
|
setBitrate(bitrate: number, useCbr: boolean, fps: number): void;
|
|
@@ -1,5 +1,10 @@
|
|
|
1
|
+
import { type DebugLogger } from '../../static/Debug';
|
|
2
|
+
import StatsLogger from '../StatsLogger';
|
|
1
3
|
export default abstract class WorkerBase {
|
|
2
4
|
protected _worker: Worker | null;
|
|
5
|
+
protected readonly _debug: DebugLogger;
|
|
6
|
+
protected readonly _logger: StatsLogger | null;
|
|
7
|
+
protected constructor(debug?: DebugLogger, logger?: StatsLogger | null);
|
|
3
8
|
protected _createWorker(workerFunctionData: string, onFrame: (data: any) => void, workerArgs?: any[], initArgs?: {
|
|
4
9
|
[key: string]: any;
|
|
5
10
|
}, transfer?: any[]): Promise<void>;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import { type DebugLogger } from '../../static/Debug';
|
|
1
2
|
import { ParticipantId } from '../../types/Participant';
|
|
2
3
|
import { IScreenShareStat } from '../../types/ScreenSharingStat';
|
|
3
4
|
import { StatScreenShareFirstFrame } from '../stat/StatScreenShareFirstFrame';
|
|
5
|
+
import { StatAggregator } from '../stat/StatAggregator';
|
|
4
6
|
import { FrameChunk } from './Utils';
|
|
5
7
|
export type IOnStat = (stat: IScreenShareStat) => void;
|
|
6
8
|
export type IOnStream = (stream: MediaStream) => void;
|
|
@@ -10,8 +12,9 @@ export declare abstract class BaseStreamBuilder {
|
|
|
10
12
|
protected readonly _onStat: IOnStat;
|
|
11
13
|
protected readonly _onKeyFrameRequested?: VoidFunction;
|
|
12
14
|
protected readonly _statScreenShareFirstFrame: StatScreenShareFirstFrame;
|
|
15
|
+
protected readonly _debug: DebugLogger;
|
|
13
16
|
protected _chunks: FrameChunk[];
|
|
14
|
-
protected constructor(participantId: ParticipantId, onStream: IOnStream, onStat: IOnStat, onKeyFrameRequested?: VoidFunction);
|
|
17
|
+
protected constructor(participantId: ParticipantId, onStream: IOnStream, onStat: IOnStat, statAggregator: StatAggregator | null, onKeyFrameRequested?: VoidFunction, debug?: DebugLogger);
|
|
15
18
|
appendChunk(chunk: FrameChunk): void;
|
|
16
19
|
destroy(): void;
|
|
17
20
|
protected abstract _processFrame(frame: FrameData): void;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type DebugLogger } from '../../static/Debug';
|
|
1
2
|
import BaseRenderer from './BaseRenderer';
|
|
2
3
|
export default class CanvasRenderer extends BaseRenderer {
|
|
3
4
|
private readonly _useImageBitmap;
|
|
@@ -5,7 +6,8 @@ export default class CanvasRenderer extends BaseRenderer {
|
|
|
5
6
|
private _canvasContext;
|
|
6
7
|
private _stream;
|
|
7
8
|
private _track;
|
|
8
|
-
|
|
9
|
+
private readonly _debug;
|
|
10
|
+
constructor(onStream: (stream: MediaStream) => void, debug?: DebugLogger);
|
|
9
11
|
private _createStream;
|
|
10
12
|
private _removeStream;
|
|
11
13
|
private _requestCanvasFrame;
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
+
import { type DebugLogger } from '../../static/Debug';
|
|
1
2
|
import { ParticipantId } from '../../types/Participant';
|
|
3
|
+
import StatsLogger from '../StatsLogger';
|
|
2
4
|
import { ParticipantIdRegistry } from '../ParticipantIdRegistry';
|
|
5
|
+
import { StatAggregator } from '../stat/StatAggregator';
|
|
3
6
|
import { IOnStat } from './BaseStreamBuilder';
|
|
4
7
|
export default class ScreenCaptureReceiver {
|
|
5
8
|
private readonly _datachannel;
|
|
@@ -8,7 +11,10 @@ export default class ScreenCaptureReceiver {
|
|
|
8
11
|
private _onStream;
|
|
9
12
|
private _onEos;
|
|
10
13
|
private _onStat;
|
|
11
|
-
|
|
14
|
+
private readonly _debug;
|
|
15
|
+
private readonly _logger;
|
|
16
|
+
private readonly _statAggregator;
|
|
17
|
+
constructor(datachannel: RTCDataChannel, participantIdRegistry: ParticipantIdRegistry, onStream: (streamId: string, stream: MediaStream) => void, onEos: (streamId: string) => void, onStat: IOnStat, statAggregator?: StatAggregator | null, debug?: DebugLogger, logger?: StatsLogger | null);
|
|
12
18
|
private _onDataChannelMessage;
|
|
13
19
|
/**
|
|
14
20
|
* Отправить запрос ключевого кадра в datachannel.
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import BaseSignaling from '../../abstract/BaseSignaling';
|
|
2
|
+
import { type DebugLogger } from '../../static/Debug';
|
|
3
|
+
import StatsLogger from '../StatsLogger';
|
|
2
4
|
export default class ScreenCaptureSender {
|
|
3
5
|
private readonly _encoder;
|
|
4
6
|
private readonly _datachannel;
|
|
@@ -21,7 +23,9 @@ export default class ScreenCaptureSender {
|
|
|
21
23
|
private readonly _queue;
|
|
22
24
|
private readonly _fpsMeter;
|
|
23
25
|
private readonly _maxFrameDelay;
|
|
24
|
-
|
|
26
|
+
private readonly _debug;
|
|
27
|
+
private readonly _logger;
|
|
28
|
+
constructor(track: MediaStreamTrack, datachannel: RTCDataChannel, signaling: BaseSignaling, fastSharing: boolean, debug?: DebugLogger, logger?: StatsLogger | null);
|
|
25
29
|
private _handleQueue;
|
|
26
30
|
/**
|
|
27
31
|
* Очищает очередь до опорного кадра
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type DebugLogger } from '../../static/Debug';
|
|
1
2
|
import { OnCongestionCallback } from '../codec/Types';
|
|
2
3
|
import { SharingStatReport } from './SharingStatReport';
|
|
3
4
|
export default class ScreenCongestionControl {
|
|
@@ -24,7 +25,8 @@ export default class ScreenCongestionControl {
|
|
|
24
25
|
private _lastFpsCalcMs;
|
|
25
26
|
private _frames;
|
|
26
27
|
private _fps;
|
|
27
|
-
|
|
28
|
+
private readonly _debug;
|
|
29
|
+
constructor(onCongestion: OnCongestionCallback, minBitrate: number, maxBitrate: number, ccEnabled: boolean, fastSharing: boolean, delayThreshold: number, targetFps: number, debug?: DebugLogger);
|
|
28
30
|
checkDelay(frameNum: number, delay: number, bitrateK: number): void;
|
|
29
31
|
private _setBitrate;
|
|
30
32
|
private _calcDelay;
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
+
import { type DebugLogger } from '../../static/Debug';
|
|
1
2
|
import { ParticipantId } from '../../types/Participant';
|
|
3
|
+
import StatsLogger from '../StatsLogger';
|
|
4
|
+
import { StatAggregator } from '../stat/StatAggregator';
|
|
2
5
|
import { BaseStreamBuilder, FrameData, IOnStat, IOnStream } from './BaseStreamBuilder';
|
|
3
6
|
export default class StreamBuilder extends BaseStreamBuilder {
|
|
4
7
|
private _renderer;
|
|
@@ -7,7 +10,8 @@ export default class StreamBuilder extends BaseStreamBuilder {
|
|
|
7
10
|
private _decoderBusy;
|
|
8
11
|
private _decoderQueue;
|
|
9
12
|
private _fpsMeter;
|
|
10
|
-
|
|
13
|
+
private readonly _logger;
|
|
14
|
+
constructor(participantId: ParticipantId, onStream: IOnStream, onStat: IOnStat, statAggregator: StatAggregator | null, onKeyFrameRequested: VoidFunction, debug?: DebugLogger, logger?: StatsLogger | null);
|
|
11
15
|
protected _processFrame(frame: FrameData): void;
|
|
12
16
|
private _initFpsMeter;
|
|
13
17
|
/**
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
+
import { type DebugLogger } from '../../static/Debug';
|
|
1
2
|
import BaseRenderer from './BaseRenderer';
|
|
2
3
|
export default class TrackGeneratorRenderer extends BaseRenderer {
|
|
3
4
|
private readonly _generator;
|
|
4
5
|
private readonly _writer;
|
|
5
6
|
private readonly _stream;
|
|
6
|
-
|
|
7
|
+
private readonly _debug;
|
|
8
|
+
constructor(onStream: (stream: MediaStream) => void, debug?: DebugLogger);
|
|
7
9
|
drawFrame(frame: VideoFrame): Promise<void>;
|
|
8
10
|
destroy(): void;
|
|
9
11
|
static isBrowserSupported(): boolean;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import { type DebugLogger } from '../../static/Debug';
|
|
1
2
|
import { ParticipantId } from '../../types/Participant';
|
|
3
|
+
import { StatAggregator } from '../stat/StatAggregator';
|
|
2
4
|
import { BaseStreamBuilder, FrameData, IOnStat, IOnStream } from './BaseStreamBuilder';
|
|
3
5
|
export default class WebmBuilder extends BaseStreamBuilder {
|
|
4
6
|
private _mediaBuffer;
|
|
@@ -7,7 +9,7 @@ export default class WebmBuilder extends BaseStreamBuilder {
|
|
|
7
9
|
private _earliestTimestamp;
|
|
8
10
|
private _clusterStartTime;
|
|
9
11
|
private _lastFrameTimestamp;
|
|
10
|
-
constructor(participantId: ParticipantId, onStream: IOnStream, onStat: IOnStat);
|
|
12
|
+
constructor(participantId: ParticipantId, onStream: IOnStream, onStat: IOnStat, statAggregator: StatAggregator | null, debug?: DebugLogger);
|
|
11
13
|
private static _intToU16BE;
|
|
12
14
|
private static _genWebmHeader;
|
|
13
15
|
private static _genSegmentHeader;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { StatItem } from '../../types/Statistics';
|
|
2
|
-
import
|
|
2
|
+
import StatsLogger from '../StatsLogger';
|
|
3
|
+
import TransportTopology from '../../enums/TransportTopology';
|
|
3
4
|
export type CodecKind = 'audio' | 'video';
|
|
4
5
|
/**
|
|
5
6
|
* Собирает стату по использованию кодеков в webrtc
|
|
@@ -7,13 +8,12 @@ export type CodecKind = 'audio' | 'video';
|
|
|
7
8
|
* отправляется репорт об использовании кодеков
|
|
8
9
|
*/
|
|
9
10
|
export declare class CodecStatsAggregator {
|
|
10
|
-
private
|
|
11
|
+
private readonly _logger;
|
|
11
12
|
private readonly _codecUsages;
|
|
12
|
-
private getCurrentTransportTopology;
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
private readonly getCurrentTransportTopology;
|
|
14
|
+
constructor(logger: StatsLogger, getCurrentTransportTopology: () => TransportTopology | undefined);
|
|
15
|
+
reportUsage(stat: StatItem): void;
|
|
15
16
|
private saveUsage;
|
|
16
17
|
private report;
|
|
17
|
-
|
|
18
|
-
private _destroy;
|
|
18
|
+
destroy(): void;
|
|
19
19
|
}
|