# Use only 'java-kotlin' to analyze code written in Java, Kotlin or both
# Use only 'java-kotlin' to analyze code written in Java, Kotlin or both.
# Use only 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
# Use only 'javascript-typescript' to analyze code written in JavaScript,
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
# TypeScript or both.
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support.
env:
env:
MEDIASOUP_SKIP_WORKER_PREBUILT_DOWNLOAD:'true'
MEDIASOUP_SKIP_WORKER_PREBUILT_DOWNLOAD:'true'
...
@@ -50,11 +51,13 @@ jobs:
...
@@ -50,11 +51,13 @@ jobs:
uses:github/codeql-action/init@v3
uses:github/codeql-action/init@v3
with:
with:
languages:${{ matrix.language }}
languages:${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# If you wish to specify custom queries, you can do so here or in a
# By default, queries listed here will override any specified in a config file.
# config file. By default, queries listed here will override any
# Prefix the list here with "+" to use these queries and those in the config file.
# specified in a config file. Prefix the list here with "+" to use
# these queries and those in the config file.
# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
When creating a Pull Request for mediasoup, ensure that you run the following commands to verify that the code in your PR conforms to the code syntax of the project and does not break existing funtionality:
When creating a Pull Request for mediasoup:
*`npm run lint`: Check JavaScript and C++ linting rules.
- Ensure that changes/additions done in TypeScript files (in `node/src` folder) are also applied to the Rust layer (in `rust` folder), and vice-versa.
*`npm run typescript:build`: Compile TypeScript code (under `src/` folder) into JavaScript code (under `lib/` folder).
- Test units must be added for both Node.js and Rust.
*`npm run test`: Run JavaScript and C++ test units.
- Changes/additions in C++ code may need tests in `worker/test` folder.
The full list of `npm` scripts (and `make` tasks) is available in the [doc/Building.md](/doc/Building.md) file.
Once all changes are done, run the following commands to verify that the code in your PR conforms to the code syntax of the project, it does not break existing funtionality and tests pass:
Once all these commands succeed, wait for the Travis CI checks to complete and verify they run successfully (otherwise the PR won't be accepted).
-`npm run lint`: Check TypeScript and C++ linting rules. Formating errors can be automatically fixed by running `npm run format`.
-`npm run typescript:build`: Compile TypeScript code (under `src` folder) into JavaScript code (under `lib` folder).
-`npm run test`: Run JavaScript and C++ test units.
- Instead, you can run `npm run release:check` which will run all those steps.
-`cargo fmt`, `cargo clippy` and `cargo test` to ensure that everything is good in Rust side.
The full list of `npm` scripts, `invoke` tasks and `cargo` commands is available in the [doc/Building.md](/doc/Building.md) file.
## Coding Style
## Coding Style
In adition to automatic checks performed by commands above, we also enforce other minor things related to coding style:
In adition to automatic checks performed by commands above, we also enforce other minor things related to coding style:
### Comments in JavaScript and C++
### Comments in TypeScript and C++
We use `//` for inline comments in both JavaScript and C++ source files.
We use `//` for inline comments in both JavaScript and C++ source files.
* Comments must start with upercase letter.
- Comments must start with upercase letter.
* Comments must not exceed 80 columns (split into different lines if necessary).
- Comments must not exceed 80 columns (split into different lines if necessary).
* Comments must end with a dot.
- Comments must end with a dot.
Example (good):
Example (good):
```js
```ts
// Calculate foo based on bar value.
// Calculate foo based on bar value.
constfoo=bar/2;
constfoo=bar/2;
```
```
Example (bad):
Example (bad):
```js
```ts
// calculate foo based on bar value
// calculate foo based on bar value
constfoo=bar/2;
constfoo=bar/2;
```
```
When adding inline documentation for methods or functions, we use `/** */` syntax. Example:
When adding inline documentation for methods or functions, we use `/** */` syntax. Example:
mediasoup and its client side libraries are designed to accomplish with the following goals:
mediasoup and its client side libraries are designed to accomplish with the following goals:
* Be a [SFU](https://webrtcglossary.com/sfu/)(Selective Forwarding Unit).
- Be a [SFU](https://webrtcglossary.com/sfu)(Selective Forwarding Unit).
* Support both WebRTC and plain RTP input and output.
- Support both WebRTC and plain RTP input and output.
* Be a Node.js module/Rust crate in server side.
- Be a Node.js module or Rust crate in server side.
* Be a tiny JavaScript and C++ libraries in client side.
- Be a tiny TypeScript and C++ libraries in client side.
* Be minimalist: just handle the media layer.
- Be minimalist: just handle the media layer.
* Be signaling agnostic: do not mandate any signaling protocol.
- Be signaling agnostic: do not mandate any signaling protocol.
* Be super low level API.
- Be super low level API.
* Support all existing WebRTC endpoints.
- Support all existing WebRTC endpoints.
* Enable integration with well known multimedia libraries/tools.
- Enable integration with well known multimedia libraries/tools.
## Architecture
## Architecture
![][mediasoup-architecture]
![][mediasoup-architecture]
## Use Cases
## Use Cases
mediasoup and its client side libraries provide a super low level API. They are intended to enable different use cases and scenarios, without any constraint or assumption. Some of these use cases are:
mediasoup and its client side libraries provide a super low level API. They are intended to enable different use cases and scenarios, without any constraint or assumption. Some of these use cases are:
* Group video chat applications.
- Group video chat applications.
* One-to-many (or few-to-many) broadcasting applications in real-time.
- One-to-many (or few-to-many) broadcasting applications in real-time.
* RTP streaming.
- RTP streaming.
## Features
## Features
* ECMAScript 6/Idiomatic Rust low level API.
- ECMAScript 6/Idiomatic Rust low level API.
* Multi-stream: multiple audio/video streams over a single ICE + DTLS transport.
- Multi-stream: multiple audio/video streams over a single ICE + DTLS transport.
* IPv6 ready.
- IPv6 ready.
* ICE / DTLS / RTP / RTCP over UDP and TCP.
- ICE / DTLS / RTP / RTCP over UDP and TCP.
* Simulcast and SVC support.
- Simulcast and SVC support.
* Congestion control.
- Congestion control.
* Sender and receiver bandwidth estimation with spatial/temporal layers distribution algorithm.
- Sender and receiver bandwidth estimation with spatial/temporal layers distribution algorithm.
* Data message exchange (via WebRTC DataChannels, SCTP over plain UDP, and direct termination in Node.js/Rust).
- Data message exchange (via WebRTC DataChannels, SCTP over plain UDP, and direct termination in Node.js/Rust).
* Extremely powerful (media worker thread/subprocess coded in C++ on top of [libuv](https://libuv.org)).
- Extremely powerful (media worker thread/subprocess coded in C++ on top of [libuv](https://libuv.org)).
## Demo Online
## Demo Online
...
@@ -69,31 +62,24 @@ mediasoup and its client side libraries provide a super low level API. They are
...
@@ -69,31 +62,24 @@ mediasoup and its client side libraries provide a super low level API. They are
Try it at [v3demo.mediasoup.org](https://v3demo.mediasoup.org)([source code](https://github.com/versatica/mediasoup-demo)).
Try it at [v3demo.mediasoup.org](https://v3demo.mediasoup.org)([source code](https://github.com/versatica/mediasoup-demo)).
## Authors
## Authors
* Iñaki Baz Castillo [[website](https://inakibaz.me)|[github](https://github.com/ibc/)]
- Iñaki Baz Castillo [[website](https://inakibaz.me)|[github](https://github.com/ibc/)]
* José Luis Millán [[github](https://github.com/jmillan/)]
- José Luis Millán [[github](https://github.com/jmillan/)]
* Nazar Mokynskyi [[github](https://github.com/nazar-pc/)]
- Nazar Mokynskyi [[github](https://github.com/nazar-pc/)]