Skip to content

Commit a7d46d8

Browse files
jmillanibcnazar-pc
authored
flatbuffers (#1064)
Flatbuffers WIP to remove JSON in favour of flatbuffers for as the worker communication format. - JSON parsing is CPU intensive. - JSON is not type safe. - flatbuffers does not parse the buffer. Reading the message takes 0ms. - flatbuffers is type safe since code (C++, Typescript, Rust, etc) is autogenerated out of the schema definitions. Extras that come along with this changes: - There is now a single Channel for worker communication. - Previously there were 2 (Channel and PayloadChannel) - Each message sent Node->Worker requires a single write() call to Channel. - Previously 2 calls per message were needed for Channel and 4 for PayloadChannel. - Each message sent Worker->Node previously executed two extra calls to memcpy that are not executed now. --------- Co-authored-by: Iñaki Baz Castillo <[email protected]> Co-authored-by: Nazar Mokrynskyi <[email protected]>
1 parent 0b4d4ef commit a7d46d8

File tree

293 files changed

+24096
-11024
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

293 files changed

+24096
-11024
lines changed

.github/workflows/mediasoup-node.yaml

+5-1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ jobs:
1313
strategy:
1414
matrix:
1515
ci:
16+
- os: ubuntu-20.04
17+
node: 16
1618
- os: ubuntu-20.04
1719
node: 18
1820
- os: ubuntu-22.04
@@ -45,6 +47,8 @@ jobs:
4547
restore-keys: |
4648
${{ matrix.ci.os }}-node-
4749
48-
- run: npm ci
50+
# NOTE: Add --force since otherwise `npm ci` fails in Node 26 because
51+
# @octokit/auth-token dev dependency requires Node >= 16.
52+
- run: npm ci --force
4953
- run: npm run lint:node
5054
- run: npm run test:node

.gitignore

+4-10
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,18 @@
77
## Node.
88
/node_modules
99
/node/lib
10+
# flatc generated files.
11+
/node/src/fbs
1012

1113
## Rust.
12-
/Cargo.lock
1314
/rust/examples-frontend/*/node_modules
1415
/rust/examples-frontend/*/package-lock.json
1516
/target
1617

1718
## Worker.
1819
/worker/scripts/node_modules
20+
# Flatc generated files.
21+
/worker/include/FBS
1922
/worker/prebuild
2023
# Vistual Studio generated Stuff.
2124
/worker/**/Debug
@@ -30,14 +33,5 @@
3033
## Others.
3134
/coverage
3235
/.cache
33-
/NO_GIT
34-
*.swp
35-
*.swo
36-
.DS_Store
37-
# Vistual Studio Code stuff.
38-
/.vscode
39-
# JetBrains IDE stuff.
40-
/.idea
41-
4236
# Packaged module.
4337
*.tgz

CHANGELOG.md

+10
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
11
# Changelog
22

33

4+
### Next
5+
6+
* Switch from JSON based messages to `flatbuffers` ([PR #1064](https://github.com/versatica/mediasoup/pull/1064)).
7+
* Add `ListenInfo` in all transports and send/recv buffer size options ([PR #1084](https://github.com/versatica/mediasoup/pull/1084)).
8+
* Add optional `rtcpListenInfo` in `PlainTransportOptions` ([PR #1099](https://github.com/versatica/mediasoup/pull/1099)).
9+
* Add pause/resume API in `DataProducer` and `DataConsumer` ([PR #1104](https://github.com/versatica/mediasoup/pull/1104)).
10+
* DataChannel subchannels feature ([PR #1152](https://github.com/versatica/mediasoup/pull/1152)).
11+
* `Worker`: Make DTLS fragment stay within MTU size range ([PR #1156](https://github.com/versatica/mediasoup/pull/1156), based on [PR #1143](https://github.com/versatica/mediasoup/pull/1143) by @vpnts-se).
12+
13+
414
### 3.12.16
515

616
* Fix `IceServer` crash when client uses ICE renomination ([PR #1182](https://github.com/versatica/mediasoup/pull/1182)).

0 commit comments

Comments
 (0)