@signalapp/ringrtc 2.24.0 → 2.25.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.
|
@@ -194,7 +194,7 @@ export declare class Call {
|
|
|
194
194
|
get remoteVideoEnabled(): boolean;
|
|
195
195
|
set remoteVideoEnabled(enabled: boolean);
|
|
196
196
|
sendVideoFrame(width: number, height: number, format: VideoPixelFormatEnum, buffer: Buffer): void;
|
|
197
|
-
receiveVideoFrame(buffer: Buffer): [number, number] | undefined;
|
|
197
|
+
receiveVideoFrame(buffer: Buffer, maxWidth: number, maxHeight: number): [number, number] | undefined;
|
|
198
198
|
private enableOrDisableCapturer;
|
|
199
199
|
private setOutgoingVideoEnabled;
|
|
200
200
|
updateBandwidthMode(bandwidthMode: BandwidthMode): void;
|
|
@@ -340,7 +340,7 @@ declare class GroupCallVideoFrameSource {
|
|
|
340
340
|
private readonly _groupCall;
|
|
341
341
|
private readonly _remoteDemuxId;
|
|
342
342
|
constructor(callManager: CallManager, groupCall: GroupCall, remoteDemuxId: number);
|
|
343
|
-
receiveVideoFrame(buffer: Buffer): [number, number] | undefined;
|
|
343
|
+
receiveVideoFrame(buffer: Buffer, maxWidth: number, maxHeight: number): [number, number] | undefined;
|
|
344
344
|
}
|
|
345
345
|
declare type ProtobufBuffer = Buffer | {
|
|
346
346
|
toArrayBuffer: () => ArrayBuffer;
|
|
@@ -400,9 +400,8 @@ export declare enum HangupType {
|
|
|
400
400
|
NeedPermission = 4
|
|
401
401
|
}
|
|
402
402
|
export declare enum BandwidthMode {
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
Normal = 2
|
|
403
|
+
Low = 0,
|
|
404
|
+
Normal = 1
|
|
406
405
|
}
|
|
407
406
|
export declare enum RingCancelReason {
|
|
408
407
|
DeclinedByUser = 0,
|
|
@@ -424,7 +423,7 @@ export interface CallManager {
|
|
|
424
423
|
setOutgoingVideoIsScreenShare(enabled: boolean): void;
|
|
425
424
|
updateBandwidthMode(bandwidthMode: BandwidthMode): void;
|
|
426
425
|
sendVideoFrame(width: number, height: number, format: VideoPixelFormatEnum, buffer: Buffer): void;
|
|
427
|
-
receiveVideoFrame(buffer: Buffer): [number, number] | undefined;
|
|
426
|
+
receiveVideoFrame(buffer: Buffer, maxWidth: number, maxHeight: number): [number, number] | undefined;
|
|
428
427
|
receivedOffer(remoteUserId: UserId, remoteDeviceId: DeviceId, messageAgeSec: number, callId: CallId, offerType: OfferType, localDeviceId: DeviceId, opaque: Buffer, senderIdentityKey: Buffer, receiverIdentityKey: Buffer): void;
|
|
429
428
|
receivedAnswer(remoteUserId: UserId, remoteDeviceId: DeviceId, callId: CallId, opaque: Buffer, senderIdentityKey: Buffer, receiverIdentityKey: Buffer): void;
|
|
430
429
|
receivedIceCandidates(remoteUserId: UserId, remoteDeviceId: DeviceId, callId: CallId, candidates: Array<Buffer>): void;
|
|
@@ -449,7 +448,7 @@ export interface CallManager {
|
|
|
449
448
|
requestVideo(clientId: GroupCallClientId, resolutions: Array<VideoRequest>, activeSpeakerHeight: number): void;
|
|
450
449
|
setGroupMembers(clientId: GroupCallClientId, members: Array<GroupMemberInfo>): void;
|
|
451
450
|
setMembershipProof(clientId: GroupCallClientId, proof: Buffer): void;
|
|
452
|
-
receiveGroupCallVideoFrame(clientId: GroupCallClientId, remoteDemuxId: number, buffer: Buffer): [number, number] | undefined;
|
|
451
|
+
receiveGroupCallVideoFrame(clientId: GroupCallClientId, remoteDemuxId: number, buffer: Buffer, maxWidth: number, maxHeight: number): [number, number] | undefined;
|
|
453
452
|
peekGroupCall(requestId: number, sfu_url: string, membership_proof: Buffer, group_members: Array<GroupMemberInfo>): Promise<PeekInfo>;
|
|
454
453
|
getAudioInputs(): AudioDevice[];
|
|
455
454
|
setAudioInput(index: number): void;
|
package/dist/ringrtc/Service.js
CHANGED
|
@@ -60,10 +60,16 @@ class NativeCallManager {
|
|
|
60
60
|
const fieldTrialsString = Object.entries(config.field_trials || {})
|
|
61
61
|
.map(([k, v]) => `${k}/${v}`)
|
|
62
62
|
.join('/') + '/';
|
|
63
|
-
const callEndpoint = Native.createCallEndpoint(this, config.use_new_audio_device_module, fieldTrialsString);
|
|
64
63
|
Object.defineProperty(this, Native.callEndpointPropertyKey, {
|
|
65
|
-
|
|
66
|
-
|
|
64
|
+
configurable: true,
|
|
65
|
+
get() {
|
|
66
|
+
const callEndpoint = Native.createCallEndpoint(this, config.use_new_audio_device_module, fieldTrialsString);
|
|
67
|
+
Object.defineProperty(this, Native.callEndpointPropertyKey, {
|
|
68
|
+
configurable: true,
|
|
69
|
+
value: callEndpoint,
|
|
70
|
+
});
|
|
71
|
+
return callEndpoint;
|
|
72
|
+
},
|
|
67
73
|
});
|
|
68
74
|
}
|
|
69
75
|
}
|
|
@@ -1021,13 +1027,13 @@ class Call {
|
|
|
1021
1027
|
}
|
|
1022
1028
|
// With this method, a Call is a VideoFrameSender
|
|
1023
1029
|
sendVideoFrame(width, height, format, buffer) {
|
|
1024
|
-
// This assumes we only have one active
|
|
1030
|
+
// This assumes we only have one active call.
|
|
1025
1031
|
this._callManager.sendVideoFrame(width, height, format, buffer);
|
|
1026
1032
|
}
|
|
1027
1033
|
// With this method, a Call is a VideoFrameSource
|
|
1028
|
-
receiveVideoFrame(buffer) {
|
|
1029
|
-
// This assumes we only have one active
|
|
1030
|
-
return this._callManager.receiveVideoFrame(buffer);
|
|
1034
|
+
receiveVideoFrame(buffer, maxWidth, maxHeight) {
|
|
1035
|
+
// This assumes we only have one active call.
|
|
1036
|
+
return this._callManager.receiveVideoFrame(buffer, maxWidth, maxHeight);
|
|
1031
1037
|
}
|
|
1032
1038
|
enableOrDisableCapturer() {
|
|
1033
1039
|
if (!this._videoCapturer) {
|
|
@@ -1371,7 +1377,7 @@ class GroupCall {
|
|
|
1371
1377
|
}
|
|
1372
1378
|
// With this, a GroupCall is a VideoFrameSender
|
|
1373
1379
|
sendVideoFrame(width, height, format, buffer) {
|
|
1374
|
-
// This assumes we only have one active
|
|
1380
|
+
// This assumes we only have one active call.
|
|
1375
1381
|
this._callManager.sendVideoFrame(width, height, format, buffer);
|
|
1376
1382
|
}
|
|
1377
1383
|
// With this, a GroupCall can provide a VideoFrameSource for each remote device.
|
|
@@ -1397,9 +1403,9 @@ class GroupCallVideoFrameSource {
|
|
|
1397
1403
|
this._groupCall = groupCall;
|
|
1398
1404
|
this._remoteDemuxId = remoteDemuxId;
|
|
1399
1405
|
}
|
|
1400
|
-
receiveVideoFrame(buffer) {
|
|
1401
|
-
// This assumes we only have one active
|
|
1402
|
-
const frame = this._callManager.receiveGroupCallVideoFrame(this._groupCall.clientId, this._remoteDemuxId, buffer);
|
|
1406
|
+
receiveVideoFrame(buffer, maxWidth, maxHeight) {
|
|
1407
|
+
// This assumes we only have one active call.
|
|
1408
|
+
const frame = this._callManager.receiveGroupCallVideoFrame(this._groupCall.clientId, this._remoteDemuxId, buffer, maxWidth, maxHeight);
|
|
1403
1409
|
if (!!frame) {
|
|
1404
1410
|
const [width, height] = frame;
|
|
1405
1411
|
this._groupCall.setRemoteAspectRatio(this._remoteDemuxId, width / height);
|
|
@@ -1452,9 +1458,8 @@ var HangupType;
|
|
|
1452
1458
|
})(HangupType = exports.HangupType || (exports.HangupType = {}));
|
|
1453
1459
|
var BandwidthMode;
|
|
1454
1460
|
(function (BandwidthMode) {
|
|
1455
|
-
BandwidthMode[BandwidthMode["
|
|
1456
|
-
BandwidthMode[BandwidthMode["
|
|
1457
|
-
BandwidthMode[BandwidthMode["Normal"] = 2] = "Normal";
|
|
1461
|
+
BandwidthMode[BandwidthMode["Low"] = 0] = "Low";
|
|
1462
|
+
BandwidthMode[BandwidthMode["Normal"] = 1] = "Normal";
|
|
1458
1463
|
})(BandwidthMode = exports.BandwidthMode || (exports.BandwidthMode = {}));
|
|
1459
1464
|
/// Describes why a ring was cancelled.
|
|
1460
1465
|
var RingCancelReason;
|
|
@@ -8,7 +8,17 @@ export declare enum VideoPixelFormatEnum {
|
|
|
8
8
|
Rgba = 2
|
|
9
9
|
}
|
|
10
10
|
export interface VideoFrameSource {
|
|
11
|
-
|
|
11
|
+
/**
|
|
12
|
+
* Copies the latest frame into `buffer`.
|
|
13
|
+
*
|
|
14
|
+
* Note that `maxWidth` and `maxHeight` specify maximum dimensions,
|
|
15
|
+
* but allow for rotation, i.e. a maximum of 1920x1080 will also allow
|
|
16
|
+
* portrait-mode 1080x1920.
|
|
17
|
+
*
|
|
18
|
+
* Returns a `[width, height]` pair for the resulting frame,
|
|
19
|
+
* or `undefined` if there's no new frame ready to be displayed.
|
|
20
|
+
*/
|
|
21
|
+
receiveVideoFrame(buffer: Buffer, maxWidth: number, maxHeight: number): [number, number] | undefined;
|
|
12
22
|
}
|
|
13
23
|
interface VideoFrameSender {
|
|
14
24
|
sendVideoFrame(width: number, height: number, format: VideoPixelFormatEnum, buffer: Buffer): void;
|
|
@@ -376,7 +376,7 @@ class CanvasVideoRenderer {
|
|
|
376
376
|
if (!context) {
|
|
377
377
|
return;
|
|
378
378
|
}
|
|
379
|
-
const frame = this.source.receiveVideoFrame(this.buffer);
|
|
379
|
+
const frame = this.source.receiveVideoFrame(this.buffer, exports.MAX_VIDEO_CAPTURE_WIDTH, exports.MAX_VIDEO_CAPTURE_HEIGHT);
|
|
380
380
|
if (!frame) {
|
|
381
381
|
return;
|
|
382
382
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@signalapp/ringrtc",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.25.0",
|
|
4
4
|
"description": "Signal Messenger voice and video calling library.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
},
|
|
21
21
|
"config": {
|
|
22
22
|
"prebuildUrl": "https://build-artifacts.signal.org/libraries/ringrtc-desktop-build-v${npm_package_version}.tar.gz",
|
|
23
|
-
"prebuildChecksum": "
|
|
23
|
+
"prebuildChecksum": "99767cde606a663ef881deaa1d3dec8976e2c52981d808c5c95397e773810f22"
|
|
24
24
|
},
|
|
25
25
|
"author": "",
|
|
26
26
|
"license": "AGPL-3.0-only",
|