This document is intended for mediasoup developers.
The root folder of the project contains a Makefile
to build the mediasoup worker subproject (under the worker/
folder).
The default task runs the Release
task unless the environment MEDIASOUP_BUILDTYPE
is set to Debug
(if so it runs the Debug
task).
Builds the production ready mediasoup worker binary at worker/out/Release/
. This is the binary used in production when installing the mediasoup NPM module with npm install mediasoup
.
Builds a more verbose and non optimized mediasoup worker binary at worker/out/Debug/
with some C flags enabled (such as -O0
) and some macros defined (such as DEBUG
and MS_LOG_FILE_LINE
).
Check the meaning of these macros in the Logger.hpp header file.
In order to instruct the mediasoup Node.js module to use the Debug
mediasoup worker binary, an environment variable must be set before running the Node.js application:
$ MEDIASOUP_BUILDTYPE=Debug node myapp.js
Runs the test-Release
task unless the environment MEDIASOUP_BUILDTYPE
is set to Debug
(if so it runs the test-Debug
task).
Builds the mediasoup-worker-test
test unit binary at worker/out/Release/
.
Builds the mediasoup-worker-test
test unit binary in Debug
mode at worker/out/Debug/
.
Builds a Xcode project for the mediasoup worker subproject.
Cleans objects and binaries related to the mediasoup worker.
Cleans all the objects and binaries, including those generated for library dependencies (such as libuv, openssl and libsrtp).
mediasoup comes with a gulpfile.js
file to enable gulp tasks.
In order to tun these tasks, gulp-cli
(version >= 1.2.2) must be globally installed:
$ npm install -g gulp-cli
The default task runs the gulp:lint
and gulp:test
tasks.
Reads mediasoup supported RTP capabilities and inserts them into the worker C++ code. After that, make Release
and/or make Debug
must be called.
Runs both the lint:node
and lint:worker
gulp tasks.
Validates the Node.js JavaScript code/syntax.
Validates the worker C++ code/syntax using clang-format following worker/.clang-format
rules.
Runs the format:worker
gulp task.
Rewrites worker source and include files using clang-format.
Runs the tidy:worker
gulp task.
Performs C++ code check using clang-tidy following following worker/.clang-tidy
rules.
NOTE: It just works on Linux and OSX.
Runs both the test:node
and test:worker
gulp tasks.
Runs the Node.js test units. Before it, it invokes the make
command.
In order to run the JavaScript test units with the mediasoup worker in Debug
mode the MEDIASOUP_BUILDTYPE
environment variable must be set to Debug
:
$ MEDIASOUP_BUILDTYPE=Debug gulp test:node
Runs the mediasoup worker test units. Before it, it invokes the make test
command.
In order to run the worker test units with the mediasoup worker in Debug
mode the MEDIASOUP_BUILDTYPE
environment variable must be set to Debug
:
$ MEDIASOUP_BUILDTYPE=Debug gulp test:worker