@signalapp/ringrtc 2.33.0 → 2.34.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/dist/acknowledgments.md +38 -40
- package/dist/ringrtc/Service.d.ts +7 -1
- package/dist/ringrtc/Service.js +38 -34
- package/dist/ringrtc/VideoSupport.js +70 -89
- package/package.json +2 -2
package/dist/acknowledgments.md
CHANGED
|
@@ -669,7 +669,7 @@ For more information on this, and how to apply and follow the GNU AGPL, see
|
|
|
669
669
|
|
|
670
670
|
```
|
|
671
671
|
|
|
672
|
-
## regex-aot 0.1.0, ringrtc 2.
|
|
672
|
+
## regex-aot 0.1.0, ringrtc 2.34.0
|
|
673
673
|
|
|
674
674
|
```
|
|
675
675
|
GNU AFFERO GENERAL PUBLIC LICENSE
|
|
@@ -1631,7 +1631,7 @@ DEALINGS IN THE SOFTWARE.
|
|
|
1631
1631
|
|
|
1632
1632
|
```
|
|
1633
1633
|
|
|
1634
|
-
## bitflags 2.4.0, log 0.4.20, regex 1.9.
|
|
1634
|
+
## bitflags 2.4.0, log 0.4.20, regex 1.9.6, regex-automata 0.3.9, regex-syntax 0.6.29, regex-syntax 0.7.5, semver 0.9.0
|
|
1635
1635
|
|
|
1636
1636
|
```
|
|
1637
1637
|
Copyright (c) 2014 The Rust Project Developers
|
|
@@ -1662,7 +1662,7 @@ DEALINGS IN THE SOFTWARE.
|
|
|
1662
1662
|
|
|
1663
1663
|
```
|
|
1664
1664
|
|
|
1665
|
-
## libc 0.2.
|
|
1665
|
+
## libc 0.2.148
|
|
1666
1666
|
|
|
1667
1667
|
```
|
|
1668
1668
|
Copyright (c) 2014-2020 The Rust Project Developers
|
|
@@ -1811,7 +1811,7 @@ DEALINGS IN THE SOFTWARE.
|
|
|
1811
1811
|
|
|
1812
1812
|
```
|
|
1813
1813
|
|
|
1814
|
-
## which 4.4.
|
|
1814
|
+
## which 4.4.2
|
|
1815
1815
|
|
|
1816
1816
|
```
|
|
1817
1817
|
Copyright (c) 2015 fangyuanziti
|
|
@@ -1956,7 +1956,7 @@ DEALINGS IN THE SOFTWARE.
|
|
|
1956
1956
|
|
|
1957
1957
|
```
|
|
1958
1958
|
|
|
1959
|
-
## hashbrown 0.14.
|
|
1959
|
+
## hashbrown 0.14.1
|
|
1960
1960
|
|
|
1961
1961
|
```
|
|
1962
1962
|
Copyright (c) 2016 Amanieu d'Antras
|
|
@@ -2049,7 +2049,7 @@ DEALINGS IN THE SOFTWARE.
|
|
|
2049
2049
|
|
|
2050
2050
|
```
|
|
2051
2051
|
|
|
2052
|
-
## indexmap 2.0.
|
|
2052
|
+
## indexmap 2.0.2
|
|
2053
2053
|
|
|
2054
2054
|
```
|
|
2055
2055
|
Copyright (c) 2016--2017
|
|
@@ -2235,7 +2235,7 @@ DEALINGS IN THE SOFTWARE.
|
|
|
2235
2235
|
|
|
2236
2236
|
```
|
|
2237
2237
|
|
|
2238
|
-
## bytes 1.
|
|
2238
|
+
## bytes 1.5.0
|
|
2239
2239
|
|
|
2240
2240
|
```
|
|
2241
2241
|
Copyright (c) 2018 Carl Lerche
|
|
@@ -2297,7 +2297,7 @@ DEALINGS IN THE SOFTWARE.
|
|
|
2297
2297
|
|
|
2298
2298
|
```
|
|
2299
2299
|
|
|
2300
|
-
## smallvec 1.11.
|
|
2300
|
+
## smallvec 1.11.1
|
|
2301
2301
|
|
|
2302
2302
|
```
|
|
2303
2303
|
Copyright (c) 2018 The Servo Project Developers
|
|
@@ -2633,6 +2633,31 @@ DEALINGS IN THE SOFTWARE.
|
|
|
2633
2633
|
|
|
2634
2634
|
```
|
|
2635
2635
|
|
|
2636
|
+
## toml_edit 0.19.15
|
|
2637
|
+
|
|
2638
|
+
```
|
|
2639
|
+
Copyright (c) Individual contributors
|
|
2640
|
+
|
|
2641
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
2642
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
2643
|
+
in the Software without restriction, including without limitation the rights
|
|
2644
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
2645
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
2646
|
+
furnished to do so, subject to the following conditions:
|
|
2647
|
+
|
|
2648
|
+
The above copyright notice and this permission notice shall be included in all
|
|
2649
|
+
copies or substantial portions of the Software.
|
|
2650
|
+
|
|
2651
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
2652
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
2653
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
2654
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
2655
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
2656
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
2657
|
+
SOFTWARE.
|
|
2658
|
+
|
|
2659
|
+
```
|
|
2660
|
+
|
|
2636
2661
|
## getrandom 0.1.16, rand 0.7.3, rand_chacha 0.2.2, rand_core 0.5.1
|
|
2637
2662
|
|
|
2638
2663
|
```
|
|
@@ -2665,33 +2690,6 @@ DEALINGS IN THE SOFTWARE.
|
|
|
2665
2690
|
|
|
2666
2691
|
```
|
|
2667
2692
|
|
|
2668
|
-
## toml_edit 0.19.14
|
|
2669
|
-
|
|
2670
|
-
```
|
|
2671
|
-
MIT License
|
|
2672
|
-
|
|
2673
|
-
Copyright (c) 2017 Andronik Ordian
|
|
2674
|
-
|
|
2675
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
2676
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
2677
|
-
in the Software without restriction, including without limitation the rights
|
|
2678
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
2679
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
2680
|
-
furnished to do so, subject to the following conditions:
|
|
2681
|
-
|
|
2682
|
-
The above copyright notice and this permission notice shall be included in all
|
|
2683
|
-
copies or substantial portions of the Software.
|
|
2684
|
-
|
|
2685
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
2686
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
2687
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
2688
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
2689
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
2690
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
2691
|
-
SOFTWARE.
|
|
2692
|
-
|
|
2693
|
-
```
|
|
2694
|
-
|
|
2695
2693
|
## static_assertions 1.1.0
|
|
2696
2694
|
|
|
2697
2695
|
```
|
|
@@ -2825,7 +2823,7 @@ SOFTWARE.
|
|
|
2825
2823
|
|
|
2826
2824
|
```
|
|
2827
2825
|
|
|
2828
|
-
## anyhow 1.0.75, fastrand 2.0.0, itoa 1.0.9, linux-raw-sys 0.4.
|
|
2826
|
+
## anyhow 1.0.75, fastrand 2.0.1, home 0.5.5, itoa 1.0.9, linux-raw-sys 0.4.8, num_enum 0.7.0, num_enum_derive 0.7.0, once_cell 1.18.0, pin-project-lite 0.2.13, prettyplease 0.1.25, proc-macro-crate 1.3.1, proc-macro2 1.0.67, quote 1.0.33, rustix 0.38.15, serde 1.0.188, serde_derive 1.0.188, serde_json 1.0.107, syn 1.0.109, syn 2.0.37, syn-mid 0.5.4, thiserror 1.0.49, thiserror-impl 1.0.49, unicode-ident 1.0.12
|
|
2829
2827
|
|
|
2830
2828
|
```
|
|
2831
2829
|
Permission is hereby granted, free of charge, to any
|
|
@@ -2930,7 +2928,7 @@ SOFTWARE.
|
|
|
2930
2928
|
|
|
2931
2929
|
```
|
|
2932
2930
|
|
|
2933
|
-
## typenum 1.
|
|
2931
|
+
## typenum 1.17.0
|
|
2934
2932
|
|
|
2935
2933
|
```
|
|
2936
2934
|
The MIT License (MIT)
|
|
@@ -2957,7 +2955,7 @@ SOFTWARE.
|
|
|
2957
2955
|
|
|
2958
2956
|
```
|
|
2959
2957
|
|
|
2960
|
-
## base64 0.13.1, base64 0.21.
|
|
2958
|
+
## base64 0.13.1, base64 0.21.4
|
|
2961
2959
|
|
|
2962
2960
|
```
|
|
2963
2961
|
The MIT License (MIT)
|
|
@@ -2984,7 +2982,7 @@ THE SOFTWARE.
|
|
|
2984
2982
|
|
|
2985
2983
|
```
|
|
2986
2984
|
|
|
2987
|
-
## aho-corasick 1.
|
|
2985
|
+
## aho-corasick 1.1.1, byteorder 1.4.3, memchr 2.6.3, regex-automata 0.1.10
|
|
2988
2986
|
|
|
2989
2987
|
```
|
|
2990
2988
|
The MIT License (MIT)
|
|
@@ -3146,7 +3144,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
|
3146
3144
|
SOFTWARE.
|
|
3147
3145
|
```
|
|
3148
3146
|
|
|
3149
|
-
## unicode-ident 1.0.
|
|
3147
|
+
## unicode-ident 1.0.12
|
|
3150
3148
|
|
|
3151
3149
|
```
|
|
3152
3150
|
UNICODE, INC. LICENSE AGREEMENT - DATA FILES AND SOFTWARE
|
|
@@ -214,6 +214,7 @@ export declare class RingRTCType {
|
|
|
214
214
|
handleAudioLevels(clientId: GroupCallClientId, capturedLevel: RawAudioLevel, receivedLevels: Array<ReceivedAudioLevel>): void;
|
|
215
215
|
handleLowBandwidthForVideo(clientId: GroupCallClientId, recovered: boolean): void;
|
|
216
216
|
handleReactions(clientId: GroupCallClientId, reactions: Array<Reaction>): void;
|
|
217
|
+
handleRaisedHands(clientId: GroupCallClientId, raisedHands: Array<number>): void;
|
|
217
218
|
handleRemoteDevicesChanged(clientId: GroupCallClientId, remoteDeviceStates: Array<RemoteDeviceState>): void;
|
|
218
219
|
handlePeekChanged(clientId: GroupCallClientId, info: PeekInfo): void;
|
|
219
220
|
handlePeekResponse(requestId: number, statusCode: number, info: PeekInfo | undefined): void;
|
|
@@ -260,6 +261,7 @@ export interface CallSettings {
|
|
|
260
261
|
interface IceServer {
|
|
261
262
|
username?: string;
|
|
262
263
|
password?: string;
|
|
264
|
+
hostname?: string;
|
|
263
265
|
urls: Array<string>;
|
|
264
266
|
}
|
|
265
267
|
export interface AudioDevice {
|
|
@@ -440,6 +442,7 @@ export interface GroupCallObserver {
|
|
|
440
442
|
onAudioLevels(groupCall: GroupCall): void;
|
|
441
443
|
onLowBandwidthForVideo(groupCall: GroupCall, recovered: boolean): void;
|
|
442
444
|
onReactions(groupCall: GroupCall, reactions: Array<Reaction>): void;
|
|
445
|
+
onRaisedHands(groupCall: GroupCall, raisedHands: Array<number>): void;
|
|
443
446
|
onPeekChanged(groupCall: GroupCall): void;
|
|
444
447
|
onEnded(groupCall: GroupCall, reason: GroupCallEndReason): void;
|
|
445
448
|
}
|
|
@@ -463,6 +466,7 @@ export declare class GroupCall {
|
|
|
463
466
|
getPeekInfo(): PeekInfo | undefined;
|
|
464
467
|
setOutgoingAudioMuted(muted: boolean): void;
|
|
465
468
|
react(value: string): void;
|
|
469
|
+
raiseHand(raise: boolean): void;
|
|
466
470
|
setOutgoingVideoMuted(muted: boolean): void;
|
|
467
471
|
setPresenting(presenting: boolean): void;
|
|
468
472
|
setOutgoingVideoIsScreenShare(isScreenShare: boolean): void;
|
|
@@ -484,6 +488,7 @@ export declare class GroupCall {
|
|
|
484
488
|
handleAudioLevels(capturedLevel: RawAudioLevel, receivedLevels: Array<ReceivedAudioLevel>): void;
|
|
485
489
|
handleLowBandwidthForVideo(recovered: boolean): void;
|
|
486
490
|
handleReactions(reactions: Array<Reaction>): void;
|
|
491
|
+
handleRaisedHands(raisedHands: Array<number>): void;
|
|
487
492
|
handleRemoteDevicesChanged(remoteDeviceStates: Array<RemoteDeviceState>): void;
|
|
488
493
|
handlePeekChanged(info: PeekInfo): void;
|
|
489
494
|
handleEnded(reason: GroupCallEndReason): void;
|
|
@@ -571,7 +576,7 @@ export interface CallManager {
|
|
|
571
576
|
setConfig(config: Config): void;
|
|
572
577
|
setSelfUuid(uuid: Buffer): void;
|
|
573
578
|
createOutgoingCall(remoteUserId: UserId, isVideoCall: boolean, localDeviceId: DeviceId): CallId;
|
|
574
|
-
proceed(callId: CallId, iceServerUsername: string, iceServerPassword: string, iceServerUrls: Array<string>, hideIp: boolean, dataMode: DataMode, audioLevelsIntervalMillis: number): void;
|
|
579
|
+
proceed(callId: CallId, iceServerUsername: string, iceServerPassword: string, iceServerHostname: string, iceServerUrls: Array<string>, hideIp: boolean, dataMode: DataMode, audioLevelsIntervalMillis: number): void;
|
|
575
580
|
accept(callId: CallId): void;
|
|
576
581
|
ignore(callId: CallId): void;
|
|
577
582
|
hangup(): void;
|
|
@@ -605,6 +610,7 @@ export interface CallManager {
|
|
|
605
610
|
setOutgoingGroupCallVideoIsScreenShare(clientId: GroupCallClientId, isScreenShare: boolean): void;
|
|
606
611
|
groupRing(clientId: GroupCallClientId, recipient: Buffer | undefined): void;
|
|
607
612
|
groupReact(clientId: GroupCallClientId, value: string): void;
|
|
613
|
+
groupRaiseHand(clientId: GroupCallClientId, raise: boolean): void;
|
|
608
614
|
resendMediaKeys(clientId: GroupCallClientId): void;
|
|
609
615
|
setDataMode(clientId: GroupCallClientId, dataMode: DataMode): void;
|
|
610
616
|
requestVideo(clientId: GroupCallClientId, resolutions: Array<VideoRequest>, activeSpeakerHeight: number): void;
|
package/dist/ringrtc/Service.js
CHANGED
|
@@ -26,15 +26,6 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
26
26
|
__setModuleDefault(result, mod);
|
|
27
27
|
return result;
|
|
28
28
|
};
|
|
29
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
30
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
31
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
32
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
33
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
34
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
35
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
36
|
-
});
|
|
37
|
-
};
|
|
38
29
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
39
30
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
40
31
|
};
|
|
@@ -146,6 +137,7 @@ NativeCallManager.prototype.leave = Native_1.default.cm_leave;
|
|
|
146
137
|
NativeCallManager.prototype.disconnect = Native_1.default.cm_disconnect;
|
|
147
138
|
NativeCallManager.prototype.groupRing = Native_1.default.cm_groupRing;
|
|
148
139
|
NativeCallManager.prototype.groupReact = Native_1.default.cm_groupReact;
|
|
140
|
+
NativeCallManager.prototype.groupRaiseHand = Native_1.default.cm_groupRaiseHand;
|
|
149
141
|
NativeCallManager.prototype.setOutgoingAudioMuted =
|
|
150
142
|
Native_1.default.cm_setOutgoingAudioMuted;
|
|
151
143
|
NativeCallManager.prototype.setOutgoingVideoMuted =
|
|
@@ -382,7 +374,7 @@ class RingRTCType {
|
|
|
382
374
|
}
|
|
383
375
|
proceed(callId, settings) {
|
|
384
376
|
sillyDeadlockProtection(() => {
|
|
385
|
-
this.callManager.proceed(callId, settings.iceServer.username || '', settings.iceServer.password || '', settings.iceServer.urls, settings.hideIp, settings.dataMode, settings.audioLevelsIntervalMillis || 0);
|
|
377
|
+
this.callManager.proceed(callId, settings.iceServer.username || '', settings.iceServer.password || '', settings.iceServer.hostname || '', settings.iceServer.urls, settings.hideIp, settings.dataMode, settings.audioLevelsIntervalMillis || 0);
|
|
386
378
|
});
|
|
387
379
|
}
|
|
388
380
|
// Called by Rust
|
|
@@ -493,13 +485,12 @@ class RingRTCType {
|
|
|
493
485
|
}
|
|
494
486
|
}
|
|
495
487
|
renderVideoFrame(width, height, buffer) {
|
|
496
|
-
var _a, _b;
|
|
497
488
|
const call = this._call;
|
|
498
489
|
if (!call) {
|
|
499
490
|
return;
|
|
500
491
|
}
|
|
501
|
-
if (
|
|
502
|
-
|
|
492
|
+
if (this._call?.renderVideoFrame) {
|
|
493
|
+
this._call?.renderVideoFrame(width, height, buffer);
|
|
503
494
|
}
|
|
504
495
|
}
|
|
505
496
|
// Called by Rust
|
|
@@ -543,9 +534,9 @@ class RingRTCType {
|
|
|
543
534
|
message.destinationDeviceId = remoteDeviceId;
|
|
544
535
|
}
|
|
545
536
|
/* eslint-enable no-param-reassign */
|
|
546
|
-
(() =>
|
|
537
|
+
(async () => {
|
|
547
538
|
if (this.handleOutgoingSignaling) {
|
|
548
|
-
const signalingResult =
|
|
539
|
+
const signalingResult = await this.handleOutgoingSignaling(remoteUserId, message);
|
|
549
540
|
if (signalingResult) {
|
|
550
541
|
this.callManager.signalingMessageSent(callId);
|
|
551
542
|
}
|
|
@@ -556,7 +547,7 @@ class RingRTCType {
|
|
|
556
547
|
else {
|
|
557
548
|
this.callManager.signalingMessageSendFailed(callId);
|
|
558
549
|
}
|
|
559
|
-
})
|
|
550
|
+
})().catch(e => this.logError(e.toString()));
|
|
560
551
|
}
|
|
561
552
|
// Call Links
|
|
562
553
|
/**
|
|
@@ -696,7 +687,7 @@ class RingRTCType {
|
|
|
696
687
|
try {
|
|
697
688
|
this.callManager.receivedHttpResponse(requestId, status, body);
|
|
698
689
|
}
|
|
699
|
-
catch
|
|
690
|
+
catch {
|
|
700
691
|
// We may not have an active connection any more.
|
|
701
692
|
// In which case it doesn't matter
|
|
702
693
|
}
|
|
@@ -707,7 +698,7 @@ class RingRTCType {
|
|
|
707
698
|
try {
|
|
708
699
|
this.callManager.httpRequestFailed(requestId, debugInfo);
|
|
709
700
|
}
|
|
710
|
-
catch
|
|
701
|
+
catch {
|
|
711
702
|
// We may not have an active connection any more.
|
|
712
703
|
// In which case it doesn't matter
|
|
713
704
|
}
|
|
@@ -843,6 +834,15 @@ class RingRTCType {
|
|
|
843
834
|
});
|
|
844
835
|
}
|
|
845
836
|
// Called by Rust
|
|
837
|
+
handleRaisedHands(clientId, raisedHands) {
|
|
838
|
+
sillyDeadlockProtection(() => {
|
|
839
|
+
const groupCall = this._groupCallByClientId.get(clientId);
|
|
840
|
+
if (groupCall) {
|
|
841
|
+
groupCall.handleRaisedHands(raisedHands);
|
|
842
|
+
}
|
|
843
|
+
});
|
|
844
|
+
}
|
|
845
|
+
// Called by Rust
|
|
846
846
|
handleRemoteDevicesChanged(clientId, remoteDeviceStates) {
|
|
847
847
|
sillyDeadlockProtection(() => {
|
|
848
848
|
const groupCall = this._groupCallByClientId.get(clientId);
|
|
@@ -954,13 +954,12 @@ class RingRTCType {
|
|
|
954
954
|
}
|
|
955
955
|
// Called by MessageReceiver
|
|
956
956
|
handleCallingMessage(remoteUserId, remoteUuid, remoteDeviceId, localDeviceId, messageAgeSec, messageReceivedAtCounter, message, senderIdentityKey, receiverIdentityKey) {
|
|
957
|
-
var _a, _b, _c, _d, _e;
|
|
958
957
|
if (message.destinationDeviceId &&
|
|
959
958
|
message.destinationDeviceId !== localDeviceId) {
|
|
960
959
|
// Drop the message as it isn't for this device, handleIgnoredCall() is not needed.
|
|
961
960
|
return;
|
|
962
961
|
}
|
|
963
|
-
if (
|
|
962
|
+
if (message.offer?.callId) {
|
|
964
963
|
const callId = message.offer.callId;
|
|
965
964
|
const opaque = toBuffer(message.offer.opaque);
|
|
966
965
|
// opaque is required. sdp is obsolete, but it might still come with opaque.
|
|
@@ -975,7 +974,7 @@ class RingRTCType {
|
|
|
975
974
|
this._callInfoByCallId.set(this.getCallInfoKey(callId), callInfo);
|
|
976
975
|
this.callManager.receivedOffer(remoteUserId, remoteDeviceId, localDeviceId, messageAgeSec, callId, offerType, opaque, senderIdentityKey, receiverIdentityKey);
|
|
977
976
|
}
|
|
978
|
-
if (
|
|
977
|
+
if (message.answer?.callId) {
|
|
979
978
|
const callId = message.answer.callId;
|
|
980
979
|
const opaque = toBuffer(message.answer.opaque);
|
|
981
980
|
// opaque is required. sdp is obsolete, but it might still come with opaque.
|
|
@@ -1012,19 +1011,19 @@ class RingRTCType {
|
|
|
1012
1011
|
}
|
|
1013
1012
|
this.callManager.receivedIceCandidates(remoteUserId, remoteDeviceId, callId, candidates);
|
|
1014
1013
|
}
|
|
1015
|
-
if (
|
|
1014
|
+
if (message.hangup?.callId) {
|
|
1016
1015
|
const callId = message.hangup.callId;
|
|
1017
1016
|
const hangupType = message.hangup.type || HangupType.Normal;
|
|
1018
1017
|
const hangupDeviceId = message.hangup.deviceId || null;
|
|
1019
1018
|
this.callManager.receivedHangup(remoteUserId, remoteDeviceId, callId, hangupType, hangupDeviceId);
|
|
1020
1019
|
}
|
|
1021
|
-
if (
|
|
1020
|
+
if (message.legacyHangup?.callId) {
|
|
1022
1021
|
const callId = message.legacyHangup.callId;
|
|
1023
1022
|
const hangupType = message.legacyHangup.type || HangupType.Normal;
|
|
1024
1023
|
const hangupDeviceId = message.legacyHangup.deviceId || null;
|
|
1025
1024
|
this.callManager.receivedHangup(remoteUserId, remoteDeviceId, callId, hangupType, hangupDeviceId);
|
|
1026
1025
|
}
|
|
1027
|
-
if (
|
|
1026
|
+
if (message.busy?.callId) {
|
|
1028
1027
|
const callId = message.busy.callId;
|
|
1029
1028
|
this.callManager.receivedBusy(remoteUserId, remoteDeviceId, callId);
|
|
1030
1029
|
}
|
|
@@ -1316,7 +1315,7 @@ class Call {
|
|
|
1316
1315
|
try {
|
|
1317
1316
|
this._callManager.setOutgoingVideoEnabled(enabled);
|
|
1318
1317
|
}
|
|
1319
|
-
catch
|
|
1318
|
+
catch {
|
|
1320
1319
|
// We may not have an active connection any more.
|
|
1321
1320
|
// In which case it doesn't matter
|
|
1322
1321
|
}
|
|
@@ -1327,7 +1326,7 @@ class Call {
|
|
|
1327
1326
|
try {
|
|
1328
1327
|
this._callManager.updateDataMode(dataMode);
|
|
1329
1328
|
}
|
|
1330
|
-
catch
|
|
1329
|
+
catch {
|
|
1331
1330
|
// We may not have an active connection any more.
|
|
1332
1331
|
// In which case it doesn't matter
|
|
1333
1332
|
}
|
|
@@ -1530,6 +1529,10 @@ class GroupCall {
|
|
|
1530
1529
|
this._callManager.groupReact(this._clientId, value);
|
|
1531
1530
|
}
|
|
1532
1531
|
// Called by UI
|
|
1532
|
+
raiseHand(raise) {
|
|
1533
|
+
this._callManager.groupRaiseHand(this._clientId, raise);
|
|
1534
|
+
}
|
|
1535
|
+
// Called by UI
|
|
1533
1536
|
setOutgoingVideoMuted(muted) {
|
|
1534
1537
|
this._localDeviceState.videoMuted = muted;
|
|
1535
1538
|
this._callManager.setOutgoingVideoMuted(this._clientId, muted);
|
|
@@ -1634,13 +1637,15 @@ class GroupCall {
|
|
|
1634
1637
|
handleReactions(reactions) {
|
|
1635
1638
|
this._observer.onReactions(this, reactions);
|
|
1636
1639
|
}
|
|
1640
|
+
handleRaisedHands(raisedHands) {
|
|
1641
|
+
this._observer.onRaisedHands(this, raisedHands);
|
|
1642
|
+
}
|
|
1637
1643
|
// Called by Rust via RingRTC object
|
|
1638
1644
|
handleRemoteDevicesChanged(remoteDeviceStates) {
|
|
1639
|
-
var _a;
|
|
1640
1645
|
// We don't get aspect ratios from RingRTC, so make sure to copy them over.
|
|
1641
1646
|
for (const noo of remoteDeviceStates) {
|
|
1642
|
-
const old =
|
|
1643
|
-
noo.videoAspectRatio = old
|
|
1647
|
+
const old = this._remoteDeviceStates?.find(old => old.demuxId == noo.demuxId);
|
|
1648
|
+
noo.videoAspectRatio = old?.videoAspectRatio;
|
|
1644
1649
|
}
|
|
1645
1650
|
this._remoteDeviceStates = remoteDeviceStates;
|
|
1646
1651
|
this._observer.onRemoteDeviceStatesChanged(this);
|
|
@@ -1666,8 +1671,7 @@ class GroupCall {
|
|
|
1666
1671
|
}
|
|
1667
1672
|
// Called by the GroupCallVideoFrameSource when it receives a video frame.
|
|
1668
1673
|
setRemoteAspectRatio(remoteDemuxId, aspectRatio) {
|
|
1669
|
-
|
|
1670
|
-
const remoteDevice = (_a = this._remoteDeviceStates) === null || _a === void 0 ? void 0 : _a.find(device => device.demuxId == remoteDemuxId);
|
|
1674
|
+
const remoteDevice = this._remoteDeviceStates?.find(device => device.demuxId == remoteDemuxId);
|
|
1671
1675
|
if (!!remoteDevice && remoteDevice.videoAspectRatio != aspectRatio) {
|
|
1672
1676
|
remoteDevice.videoAspectRatio = aspectRatio;
|
|
1673
1677
|
this._observer.onRemoteDeviceStatesChanged(this);
|
|
@@ -1809,11 +1813,11 @@ var CallLogLevel;
|
|
|
1809
1813
|
CallLogLevel[CallLogLevel["Trace"] = 5] = "Trace";
|
|
1810
1814
|
})(CallLogLevel || (exports.CallLogLevel = CallLogLevel = {}));
|
|
1811
1815
|
function sillyDeadlockProtection(f) {
|
|
1812
|
-
void (() =>
|
|
1816
|
+
void (async () => {
|
|
1813
1817
|
// This is a silly way of preventing a deadlock.
|
|
1814
1818
|
// eslint-disable-next-line @typescript-eslint/await-thenable
|
|
1815
|
-
|
|
1819
|
+
await 0;
|
|
1816
1820
|
f();
|
|
1817
|
-
})
|
|
1821
|
+
})();
|
|
1818
1822
|
}
|
|
1819
1823
|
//# sourceMappingURL=Service.js.map
|
|
@@ -3,15 +3,6 @@
|
|
|
3
3
|
// Copyright 2019-2021 Signal Messenger, LLC
|
|
4
4
|
// SPDX-License-Identifier: AGPL-3.0-only
|
|
5
5
|
//
|
|
6
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
7
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
8
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
9
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
10
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
11
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
12
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
13
|
-
});
|
|
14
|
-
};
|
|
15
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
7
|
exports.CanvasVideoRenderer = exports.MAX_VIDEO_CAPTURE_BUFFER_SIZE = exports.MAX_VIDEO_CAPTURE_AREA = exports.MAX_VIDEO_CAPTURE_HEIGHT = exports.MAX_VIDEO_CAPTURE_WIDTH = exports.GumVideoCapturer = exports.GumVideoCaptureOptions = exports.VideoPixelFormatEnum = void 0;
|
|
17
8
|
const index_1 = require("../index");
|
|
@@ -66,8 +57,7 @@ class GumVideoCapturer {
|
|
|
66
57
|
return this.captureOptions != undefined;
|
|
67
58
|
}
|
|
68
59
|
setLocalPreview(localPreview) {
|
|
69
|
-
|
|
70
|
-
const oldLocalPreview = (_a = this.localPreview) === null || _a === void 0 ? void 0 : _a.current;
|
|
60
|
+
const oldLocalPreview = this.localPreview?.current;
|
|
71
61
|
if (oldLocalPreview) {
|
|
72
62
|
oldLocalPreview.srcObject = null;
|
|
73
63
|
}
|
|
@@ -88,7 +78,7 @@ class GumVideoCapturer {
|
|
|
88
78
|
}
|
|
89
79
|
enableCaptureAndSend(sender, options) {
|
|
90
80
|
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
|
91
|
-
this.startCapturing(options
|
|
81
|
+
this.startCapturing(options ?? this.defaultCaptureOptions);
|
|
92
82
|
this.startSending(sender);
|
|
93
83
|
}
|
|
94
84
|
disable() {
|
|
@@ -100,34 +90,29 @@ class GumVideoCapturer {
|
|
|
100
90
|
this.updateLocalPreviewIntervalId = undefined;
|
|
101
91
|
}
|
|
102
92
|
// eslint-disable-next-line @typescript-eslint/require-await
|
|
103
|
-
setPreferredDevice(deviceId) {
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
this.startSending(sender);
|
|
113
|
-
}
|
|
93
|
+
async setPreferredDevice(deviceId) {
|
|
94
|
+
this.preferredDeviceId = deviceId;
|
|
95
|
+
if (this.captureOptions) {
|
|
96
|
+
const { captureOptions, sender } = this;
|
|
97
|
+
this.disable();
|
|
98
|
+
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
|
99
|
+
this.startCapturing(captureOptions);
|
|
100
|
+
if (sender) {
|
|
101
|
+
this.startSending(sender);
|
|
114
102
|
}
|
|
115
|
-
}
|
|
103
|
+
}
|
|
116
104
|
}
|
|
117
|
-
enumerateDevices() {
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
return cameras;
|
|
122
|
-
});
|
|
105
|
+
async enumerateDevices() {
|
|
106
|
+
const devices = await window.navigator.mediaDevices.enumerateDevices();
|
|
107
|
+
const cameras = devices.filter(d => d.kind == 'videoinput');
|
|
108
|
+
return cameras;
|
|
123
109
|
}
|
|
124
110
|
getUserMedia(options) {
|
|
125
|
-
var _a;
|
|
126
111
|
// TODO: Figure out a better way to make typescript accept "mandatory".
|
|
127
112
|
const constraints = {
|
|
128
113
|
audio: false,
|
|
129
114
|
video: {
|
|
130
|
-
deviceId:
|
|
115
|
+
deviceId: options.preferredDeviceId ?? this.preferredDeviceId,
|
|
131
116
|
width: {
|
|
132
117
|
max: options.maxWidth,
|
|
133
118
|
ideal: options.maxWidth,
|
|
@@ -156,60 +141,58 @@ class GumVideoCapturer {
|
|
|
156
141
|
}
|
|
157
142
|
return window.navigator.mediaDevices.getUserMedia(constraints);
|
|
158
143
|
}
|
|
159
|
-
startCapturing(options) {
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
144
|
+
async startCapturing(options) {
|
|
145
|
+
if (this.capturing()) {
|
|
146
|
+
index_1.RingRTC.logWarn('startCapturing(): already capturing');
|
|
147
|
+
return;
|
|
148
|
+
}
|
|
149
|
+
index_1.RingRTC.logInfo(`startCapturing(): ${options.maxWidth}x${options.maxHeight}@${options.maxFramerate}`);
|
|
150
|
+
this.captureOptions = options;
|
|
151
|
+
try {
|
|
152
|
+
// If we start/stop/start, we may have concurrent calls to getUserMedia,
|
|
153
|
+
// which is what we want if we're switching from camera to screenshare.
|
|
154
|
+
// But we need to make sure we deal with the fact that things might be
|
|
155
|
+
// different after the await here.
|
|
156
|
+
const mediaStream = await this.getUserMedia(options);
|
|
157
|
+
// It's possible video was disabled, switched to screenshare, or
|
|
158
|
+
// switched to a different camera while awaiting a response, in
|
|
159
|
+
// which case we need to disable the camera we just accessed.
|
|
160
|
+
if (this.captureOptions != options) {
|
|
161
|
+
index_1.RingRTC.logWarn('startCapturing(): different state after getUserMedia()');
|
|
162
|
+
for (const track of mediaStream.getVideoTracks()) {
|
|
163
|
+
// Make the light turn off faster
|
|
164
|
+
track.stop();
|
|
165
|
+
}
|
|
163
166
|
return;
|
|
164
167
|
}
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
//
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
const mediaStream = yield this.getUserMedia(options);
|
|
173
|
-
// It's possible video was disabled, switched to screenshare, or
|
|
174
|
-
// switched to a different camera while awaiting a response, in
|
|
175
|
-
// which case we need to disable the camera we just accessed.
|
|
176
|
-
if (this.captureOptions != options) {
|
|
177
|
-
index_1.RingRTC.logWarn('startCapturing(): different state after getUserMedia()');
|
|
178
|
-
for (const track of mediaStream.getVideoTracks()) {
|
|
179
|
-
// Make the light turn off faster
|
|
180
|
-
track.stop();
|
|
181
|
-
}
|
|
182
|
-
return;
|
|
168
|
+
if (this.mediaStream !== undefined &&
|
|
169
|
+
this.mediaStream.getVideoTracks().length > 0) {
|
|
170
|
+
// We have a stream and track for the requested camera already. Stop
|
|
171
|
+
// the duplicate track that we just started.
|
|
172
|
+
index_1.RingRTC.logWarn('startCapturing(): dropping duplicate call to startCapturing');
|
|
173
|
+
for (const track of mediaStream.getVideoTracks()) {
|
|
174
|
+
track.stop();
|
|
183
175
|
}
|
|
184
|
-
|
|
185
|
-
this.mediaStream.getVideoTracks().length > 0) {
|
|
186
|
-
// We have a stream and track for the requested camera already. Stop
|
|
187
|
-
// the duplicate track that we just started.
|
|
188
|
-
index_1.RingRTC.logWarn('startCapturing(): dropping duplicate call to startCapturing');
|
|
189
|
-
for (const track of mediaStream.getVideoTracks()) {
|
|
190
|
-
track.stop();
|
|
191
|
-
}
|
|
192
|
-
return;
|
|
193
|
-
}
|
|
194
|
-
this.mediaStream = mediaStream;
|
|
195
|
-
if (!this.spawnedSenderRunning &&
|
|
196
|
-
this.mediaStream != undefined &&
|
|
197
|
-
this.sender != undefined) {
|
|
198
|
-
this.spawnSender(this.mediaStream, this.sender);
|
|
199
|
-
}
|
|
200
|
-
this.updateLocalPreviewSourceObject();
|
|
176
|
+
return;
|
|
201
177
|
}
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
178
|
+
this.mediaStream = mediaStream;
|
|
179
|
+
if (!this.spawnedSenderRunning &&
|
|
180
|
+
this.mediaStream != undefined &&
|
|
181
|
+
this.sender != undefined) {
|
|
182
|
+
this.spawnSender(this.mediaStream, this.sender);
|
|
183
|
+
}
|
|
184
|
+
this.updateLocalPreviewSourceObject();
|
|
185
|
+
}
|
|
186
|
+
catch (e) {
|
|
187
|
+
index_1.RingRTC.logError(`startCapturing(): ${e}`);
|
|
188
|
+
// It's possible video was disabled, switched to screenshare, or
|
|
189
|
+
// switched to a different camera while awaiting a response, in
|
|
190
|
+
// which case we should reset the captureOptions if we set them.
|
|
191
|
+
if (this.captureOptions == options) {
|
|
192
|
+
// We couldn't open the camera. Oh well.
|
|
193
|
+
this.captureOptions = undefined;
|
|
211
194
|
}
|
|
212
|
-
}
|
|
195
|
+
}
|
|
213
196
|
}
|
|
214
197
|
stopCapturing() {
|
|
215
198
|
if (!this.capturing()) {
|
|
@@ -257,11 +240,10 @@ class GumVideoCapturer {
|
|
|
257
240
|
const buffer = Buffer.alloc(exports.MAX_VIDEO_CAPTURE_BUFFER_SIZE);
|
|
258
241
|
this.spawnedSenderRunning = true;
|
|
259
242
|
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
|
260
|
-
(() =>
|
|
261
|
-
var _a;
|
|
243
|
+
(async () => {
|
|
262
244
|
try {
|
|
263
245
|
while (mediaStream == this.mediaStream) {
|
|
264
|
-
const { done, value: frame } =
|
|
246
|
+
const { done, value: frame } = await reader.read();
|
|
265
247
|
if (done) {
|
|
266
248
|
break;
|
|
267
249
|
}
|
|
@@ -269,7 +251,7 @@ class GumVideoCapturer {
|
|
|
269
251
|
continue;
|
|
270
252
|
}
|
|
271
253
|
try {
|
|
272
|
-
const format = videoPixelFormatToEnum(
|
|
254
|
+
const format = videoPixelFormatToEnum(frame.format ?? 'I420');
|
|
273
255
|
if (format == undefined) {
|
|
274
256
|
index_1.RingRTC.logWarn(`Unsupported video frame format: ${frame.format}`);
|
|
275
257
|
break;
|
|
@@ -278,7 +260,7 @@ class GumVideoCapturer {
|
|
|
278
260
|
if (!visibleRect) {
|
|
279
261
|
continue;
|
|
280
262
|
}
|
|
281
|
-
|
|
263
|
+
await frame.copyTo(buffer);
|
|
282
264
|
if (sender !== this.sender) {
|
|
283
265
|
break;
|
|
284
266
|
}
|
|
@@ -300,7 +282,7 @@ class GumVideoCapturer {
|
|
|
300
282
|
reader.releaseLock();
|
|
301
283
|
}
|
|
302
284
|
this.spawnedSenderRunning = false;
|
|
303
|
-
})
|
|
285
|
+
})();
|
|
304
286
|
}
|
|
305
287
|
stopSending() {
|
|
306
288
|
// The spawned sender should stop
|
|
@@ -387,7 +369,6 @@ class CanvasVideoRenderer {
|
|
|
387
369
|
context.fillRect(0, 0, canvas.width, canvas.height);
|
|
388
370
|
}
|
|
389
371
|
renderVideoFrame() {
|
|
390
|
-
var _a, _b;
|
|
391
372
|
if (!this.source || !this.canvas) {
|
|
392
373
|
return;
|
|
393
374
|
}
|
|
@@ -435,7 +416,7 @@ class CanvasVideoRenderer {
|
|
|
435
416
|
context.fillStyle = 'black';
|
|
436
417
|
context.fillRect(0, 0, canvas.width, canvas.height);
|
|
437
418
|
}
|
|
438
|
-
if (
|
|
419
|
+
if (this.imageData?.width !== width || this.imageData?.height !== height) {
|
|
439
420
|
this.imageData = new ImageData(width, height);
|
|
440
421
|
}
|
|
441
422
|
this.imageData.data.set(this.buffer.subarray(0, width * height * 4));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@signalapp/ringrtc",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.34.0",
|
|
4
4
|
"description": "Signal Messenger voice and video calling library.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
},
|
|
25
25
|
"config": {
|
|
26
26
|
"prebuildUrl": "https://build-artifacts.signal.org/libraries/ringrtc-desktop-build-v${npm_package_version}.tar.gz",
|
|
27
|
-
"prebuildChecksum": "
|
|
27
|
+
"prebuildChecksum": "7c61350a51f61c6ea06f68c08479260de21be36cc098bcca1d6392af579bd73f"
|
|
28
28
|
},
|
|
29
29
|
"author": "",
|
|
30
30
|
"license": "AGPL-3.0-only",
|