Skip to content

Commit

Permalink
Merge upstream 'v2.42.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
valldrac committed May 22, 2024
2 parents 869eadd + 2a7c164 commit 1dbda1a
Show file tree
Hide file tree
Showing 23 changed files with 298 additions and 56 deletions.
14 changes: 12 additions & 2 deletions BUILDING.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,19 @@ You can then add the Signal repo to sync with upstream changes:
git remote add upstream https://github.com/signalapp/ringrtc.git

## Building

<i>Important: If building the for the first time, it will take a long time to download
WebRTC dependencies and then a long time to build WebRTC and RingRTC.</i>
WebRTC dependencies and then a long time to build WebRTC and RingRTC from scratch.</i>


To quickly build RingRTC on Linux or MacOS using only the rust toolchain, you must add the `prebuilt_webrtc` feature. Note this is limited to arm64 and x86_64 architectures:

Examples:
```sh
cargo build -p ringrtc --features prebuilt_webrtc
cargo build -p ringrtc --features prebuilt_webrtc --target aarch64-apple-darwin
cargo build -p ringrtc --features prebuilt_webrtc --target x86_64-apple-darwin
cargo build -p ringrtc --features prebuilt_webrtc --target aarch64-unknown-linux-gnu
```

### Android

Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## v2.42.0

- Add support for reporting rtc_stats to client application

- Update to webrtc 6261i
- Support for reporting rtc_stats
- Enable per-layer PLI for screen sharing

## v2.41.0

- Call links: Add Call Link state to PeekInfo
Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion SignalRingRTC.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

Pod::Spec.new do |s|
s.name = "SignalRingRTC"
s.version = "2.41.0"
s.version = "2.42.0"
s.summary = "A Swift & Objective-C library used by the Signal iOS app for WebRTC interactions."

s.description = <<-DESC
Expand Down
2 changes: 1 addition & 1 deletion acknowledgments/acknowledgments.html
Original file line number Diff line number Diff line change
Expand Up @@ -735,7 +735,7 @@ <h4>Used by:</h4>
<li><a href="https://crates.io/crates/libsignal-core">libsignal-core 0.1.0</a></li>
<li><a href="https://github.com/signalapp/partial-default">partial-default-derive 0.1.0</a></li>
<li><a href="https://crates.io/crates/regex-aot">regex-aot 0.1.0</a></li>
<li><a href="https://crates.io/crates/ringrtc">ringrtc 2.41.0</a></li>
<li><a href="https://crates.io/crates/ringrtc">ringrtc 2.42.0</a></li>
</ul>
<pre class="license-text">GNU AFFERO GENERAL PUBLIC LICENSE
Version 3, 19 November 2007
Expand Down
2 changes: 1 addition & 1 deletion acknowledgments/acknowledgments.md
Original file line number Diff line number Diff line change
Expand Up @@ -669,7 +669,7 @@ For more information on this, and how to apply and follow the GNU AGPL, see
```

## libsignal-core 0.1.0, partial-default-derive 0.1.0, regex-aot 0.1.0, ringrtc 2.41.0
## libsignal-core 0.1.0, partial-default-derive 0.1.0, regex-aot 0.1.0, ringrtc 2.42.0

```
GNU AFFERO GENERAL PUBLIC LICENSE
Expand Down
2 changes: 1 addition & 1 deletion acknowledgments/acknowledgments.plist
Original file line number Diff line number Diff line change
Expand Up @@ -924,7 +924,7 @@ You should also get your employer (if you work as a programmer) or school, if an
<key>License</key>
<string>GNU Affero General Public License v3.0</string>
<key>Title</key>
<string>libsignal-core 0.1.0, partial-default-derive 0.1.0, regex-aot 0.1.0, ringrtc 2.41.0</string>
<string>libsignal-core 0.1.0, partial-default-derive 0.1.0, regex-aot 0.1.0, ringrtc 2.42.0</string>
<key>Type</key>
<string>PSGroupSpecifier</string>
</dict>
Expand Down
66 changes: 40 additions & 26 deletions bin/fetch-artifact.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,36 +18,50 @@
UNVERIFIED_DOWNLOAD_NAME = "unverified.tmp"

PREBUILD_CHECKSUMS = {
'android': '69958caaefe350057cd2c77d001ee99afe646cb8e52a1f24873ef0db2a8f0aba',
'ios': 'd1bd0e604f60a1799c8453b4c1f374389d5a3572547cc41d7576db1c81482c15',
'linux-arm64': 'f67592faccf361c099b38e1de35ae2d1956e18e98160543f03f67df9d0418f7d',
'linux-x64': '48f7259397c3fc7d811087fa4cc649f49a78d9e53f1d2b23cae8c6f1e1c1b4cd',
'mac-arm64': 'd91539dcb73241702b7eacb4d4c4518d962432eafa2410b718af6c084ed667b4',
'mac-x64': '461a5aee558c3f7bd43fe4e85fe929bc9b87d8ad58af23c95f2f327603a9dbef',
'windows-arm64': '97a0190de3797c45f1b86348e139bef5ef910d1255decb4872569853bb53ec95',
'windows-x64': 'aa1c12170acce307e9d46253f241ec7f91bbb3709939d3c59a8b43f13ae91fcd',
'android': '3dd5d5f1987489aeba4f7048593914fbec6f7c726d3d75bfde9ac61a98d45575',
'ios': '4559bab546155bd6f128d893f7fb92351d154cbff23a615813be885e56db9317',
'linux-arm64': '21a7f0ce6947f42981876fb7cf5c3f1905ccd25b85b922468689d6c80cdc8062',
'linux-x64': '8259927f292e950ebe9ed2e274e23ca6ff7e279a887dbd02d6f6a165026731a2',
'mac-arm64': '7dba81c95d70562d9ce8e0968ecc352fd636596712df9cba3fab3475ee32cc70',
'mac-x64': 'd476e6d86c5b24995e08ff4c5d3a78f428a2fac57f124ebb8b553386fffbf783',
'windows-arm64': '30caf82f2e956f22317830fa183889bf8ddf2184c6ac32bbf901174c4ea7aa9d',
'windows-x64': '798405d6168b603be54aea7c329943f05356cc5184d618bda3ef805bedb88e6f',
}


def resolve_os(os_name: str) -> str:
if os_name in ['darwin', 'macos']:
return 'mac'
return os_name


def resolve_arch(arch_name: str) -> str:
if arch_name in ['x86_64', 'amd64']:
return 'x64'
if arch_name in ['arm64', 'aarch64']:
return 'arm64'
return arch_name


def resolve_platform(platform_name: str) -> str:
if platform_name in PREBUILD_CHECKSUMS:
return platform_name

if platform_name in ['windows', 'mac', 'linux']:
arch_name = platform.machine().lower()
if arch_name in ['x86_64', 'amd64']:
return resolve_platform(platform_name + '-x64')
if arch_name in ['arm64', 'aarch64']:
return resolve_platform(platform_name + '-arm64')
raise AssertionError('unsupported architecture: ' + arch_name)

if platform_name == 'desktop':
os_name = platform.system().lower()
if os_name == 'darwin':
return resolve_platform('mac')
return resolve_platform(os_name)
return resolve_platform(platform.system().lower())

splits = platform_name.split('-')
os_name = resolve_os(splits[0])
if len(splits) > 2:
raise AssertionError('unsupported platform format: ' + platform_name)
elif len(splits) == 2:
arch_name = resolve_arch(splits[1])
else:
arch_name = resolve_arch(platform.machine().lower())

raise AssertionError('unsupported platform: ' + platform_name)
resolved_platform_name = "{}-{}".format(os_name, arch_name)
if resolved_platform_name not in PREBUILD_CHECKSUMS:
raise AssertionError('unsupported platform: ' + resolved_platform_name)
return resolved_platform_name


def build_argument_parser() -> argparse.ArgumentParser:
Expand Down Expand Up @@ -128,11 +142,11 @@ def main() -> None:
if not url:
if not args.webrtc_version:
parser.error(message='--platform requires --webrtc-version')
platform = resolve_platform(args.platform)
platform_name = resolve_platform(args.platform)
build_mode = 'debug' if args.debug else 'release'
url = "https://build-artifacts.signal.org/libraries/webrtc-{}-{}-{}.tar.bz2".format(args.webrtc_version, platform, build_mode)
url = "https://build-artifacts.signal.org/libraries/webrtc-{}-{}-{}.tar.bz2".format(args.webrtc_version, platform_name, build_mode)
if not checksum:
checksum = PREBUILD_CHECKSUMS[platform]
checksum = PREBUILD_CHECKSUMS[platform_name]

if not checksum:
parser.error(message='missing --checksum')
Expand All @@ -145,7 +159,7 @@ def main() -> None:
if args.skip_extract:
return

print("extracting {}...".format(archive_file), file=sys.stderr)
print("extracting {} to {}".format(archive_file, args.output_dir), file=sys.stderr)
open_archive.seek(0)
tarfile.open(fileobj=open_archive).extractall(path=args.output_dir)

Expand Down
4 changes: 2 additions & 2 deletions config/version.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
webrtc.version=6261g
webrtc.version=6261i

ringrtc.version.major=2
ringrtc.version.minor=41
ringrtc.version.minor=42
ringrtc.version.revision=0
2 changes: 1 addition & 1 deletion src/node/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@signalapp/ringrtc",
"version": "2.41.0",
"version": "2.42.0",
"description": "Signal Messenger voice and video calling library.",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down
19 changes: 19 additions & 0 deletions src/node/ringrtc/Service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,8 @@ class NativeCallManager {
Native.cm_getAudioOutputs;
(NativeCallManager.prototype as any).setAudioOutput = Native.cm_setAudioOutput;
(NativeCallManager.prototype as any).processEvents = Native.cm_processEvents;
(NativeCallManager.prototype as any).setRtcStatsInterval =
Native.cm_setRtcStatsInterval;

type GroupId = Buffer;
type GroupCallUserId = Buffer;
Expand Down Expand Up @@ -423,6 +425,8 @@ export class RingRTCType {
) => void)
| null = null;

handleRtcStatsReport: ((reportJson: string) => void) | null = null;

constructor() {
this.callManager = new NativeCallManager(this) as unknown as CallManager;
this._call = null;
Expand Down Expand Up @@ -1476,6 +1480,13 @@ export class RingRTCType {
});
}

// Called by Rust
handleRtcStatsReportComplete(reportJson: string): void {
if (this.handleRtcStatsReport) {
this.handleRtcStatsReport(reportJson);
}
}

// Called by Rust
onLogMessage(
level: number,
Expand Down Expand Up @@ -2610,6 +2621,10 @@ export class GroupCall {
this._observer.onRemoteDeviceStatesChanged(this);
}
}

setRtcStatsInterval(intervalMillis: number): void {
this._callManager.setRtcStatsInterval(this._clientId, intervalMillis);
}
}

// Implements VideoSource for use in CanvasVideoRenderer
Expand Down Expand Up @@ -2911,6 +2926,10 @@ export interface CallManager {
maxWidth: number,
maxHeight: number
): [number, number] | undefined;
setRtcStatsInterval(
clientId: GroupCallClientId,
intervalMillis: number
): void;
// Responses come back via handleCallLinkResponse
readCallLink(
requestId: number,
Expand Down
6 changes: 5 additions & 1 deletion src/node/test/CallingClass.ts
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,10 @@ export class CallingClass {
log('handleGroupCallRingUpdate');
}

private handleRtcStatsReport(reportJson: string): void {
log('handleRtcStatsReport');
}

////////////////////////////////////////////////////////////////////////////////
// Support

Expand Down Expand Up @@ -235,7 +239,7 @@ export class CallingClass {
this.handleSendCallMessageToGroup.bind(this);
RingRTC.handleGroupCallRingUpdate =
this.handleGroupCallRingUpdate.bind(this);

RingRTC.handleRtcStatsReport = this.handleRtcStatsReport.bind(this);
RingRTC.setSelfUuid(Buffer.from(uuidToBytes(this._id)));
}

Expand Down
3 changes: 2 additions & 1 deletion src/rust/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

[package]
name = "ringrtc"
version = "2.41.0"
version = "2.42.0"
authors = ["Calling Team <[email protected]>"]
edition = "2021"
description = "A Rust interface for WebRTC"
Expand Down Expand Up @@ -98,6 +98,7 @@ default = []
sim = []
electron = ["neon", "native"]
native = []
prebuilt_webrtc = ["native"]
simnet = ["injectable_network"]
injectable_network = []
http = ["ureq", "rustls"]
Expand Down
Loading

0 comments on commit 1dbda1a

Please sign in to comment.