summaryrefslogtreecommitdiffstats
path: root/third_party/libwebrtc/docs/native-code/development
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 19:33:14 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 19:33:14 +0000
commit36d22d82aa202bb199967e9512281e9a53db42c9 (patch)
tree105e8c98ddea1c1e4784a60a5a6410fa416be2de /third_party/libwebrtc/docs/native-code/development
parentInitial commit. (diff)
downloadfirefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.tar.xz
firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.zip
Adding upstream version 115.7.0esr.upstream/115.7.0esr
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'third_party/libwebrtc/docs/native-code/development')
-rw-r--r--third_party/libwebrtc/docs/native-code/development/contributing.md99
-rw-r--r--third_party/libwebrtc/docs/native-code/development/index.md290
-rw-r--r--third_party/libwebrtc/docs/native-code/development/prerequisite-sw/index.md65
3 files changed, 454 insertions, 0 deletions
diff --git a/third_party/libwebrtc/docs/native-code/development/contributing.md b/third_party/libwebrtc/docs/native-code/development/contributing.md
new file mode 100644
index 0000000000..16814a0876
--- /dev/null
+++ b/third_party/libwebrtc/docs/native-code/development/contributing.md
@@ -0,0 +1,99 @@
+# Contributing to the WebRTC project
+
+## License Agreement
+
+WebRTC welcomes patches for features and bug fixes!
+
+For contributors external to Google, follow the instructions given in the
+[Google Individual Contributor License Agreement][Google individual CLA].
+In all cases, contributors must sign a contributor license agreement before
+a contribution can be accepted. Please complete the agreement for an
+[individual][individual] or a [corporation][corporation] as appropriate.
+
+[Google Individual CLA]: https://cla.developers.google.com/about/google-individual.
+[individual]: https://developers.google.com/open-source/cla/individual
+[corporation]: https://developers.google.com/open-source/cla/corporate
+
+
+## Instructions
+
+### Contributing your First Patch
+You must do some preparation in order to upload your first CL:
+
+* [Check out and build the code][Check out and build the code]
+* Fill in the Contributor agreement (see above)
+* If you’ve never submitted code before, you must add your
+ (or your organization’s in the case the contributor agreement is signed by
+ your organization) name and contact info to the
+ [AUTHORS][AUTHORS] file
+* Go to [https://webrtc.googlesource.com/new-password](new-password)
+ and login with your email account. This should be the same account as
+ returned by `git config user.email`
+* Then, run: `git cl creds-check`. If you get any errors, ask for help on
+ [discuss-webrtc][discuss-webrtc]
+
+You will not have to repeat the above. After all that, you’re ready to upload:
+
+[Check out and build the code]: https://webrtc.googlesource.com/src/+/refs/heads/main/docs/native-code/development/index.md
+[AUTHORS]: https://webrtc.googlesource.com/src/+/refs/heads/main/AUTHORS
+[new-password]: https://webrtc.googlesource.com/new-password
+[discuss-webrtc]: https://groups.google.com/forum/#!forum/discuss-webrtc
+
+### Uploading your First Patch
+Now that you have your account set up, you can do the actual upload:
+
+* Do this:
+ * Assuming you're on the main branch:
+ * `git checkout -b my-work-branch`
+ * Make changes, build locally, run tests locally
+ * `git commit -am "Changed x, and it is working"`
+ * `git cl upload`
+
+ This will open a text editor showing all local commit messages, allowing you
+ to modify it before it becomes the CL description.
+
+ Fill out the bug entry properly. Please specify the issue tracker prefix and
+ the issue number, separated by a colon, e.g. `webrtc:123` or `chromium:12345`.
+ If you do not have an issue tracker prefix and an issue number just add `None`.
+
+ Save and close the file to proceed with the upload to the WebRTC
+ [code review server](https://webrtc-review.googlesource.com/q/status:open).
+
+ The command will print a link like
+ [https://webrtc-review.googlesource.com/c/src/+/53121][example CL link].
+ if everything goes well.
+
+* Click this CL Link
+* If you’re not signed in, click the Sign In button in the top right and sign
+ in with your email
+* Click Start Review and add a reviewer. You can find reviewers in OWNERS files
+ around the repository (take the one closest to your changes)
+* Address any reviewer feedback:
+ * Make changes, build locally, run tests locally
+ * `git commit -am "Fixed X and Y"`
+ * `git cl upload`
+* Once the reviewer LGTMs (approves) the patch, ask them to put it into the
+ commit queue
+
+NOTICE: On Windows, you’ll need to run the above in a Git bash shell in order
+for gclient to find the `.gitcookies` file.
+
+[example CL link]: https://webrtc-review.googlesource.com/c/src/+/53121
+
+### Trybots
+
+If you're working a lot in WebRTC, you can apply for *try rights*. This means you
+can run the *trybots*, which run all the tests on all platforms. To do this,
+file a bug using this [template][template-access] and the WebRTC EngProd team
+will review your request.
+
+To run a tryjob, upload a CL as described above and click either CQ dry run or
+Choose Trybots in the Gerrit UI. You need to have try rights for this. Otherwise,
+ask your reviewer to kick off the bots for you.
+
+If you encounter any issues with the bots (flakiness, failing unrelated to your change etc),
+please file a bug using this [template][template-issue].
+
+[template-access]: https://bugs.chromium.org/p/webrtc/issues/entry?template=Get+tryjob+access
+[template-issue]: https://bugs.chromium.org/p/webrtc/issues/entry?template=trybot+issue
+
diff --git a/third_party/libwebrtc/docs/native-code/development/index.md b/third_party/libwebrtc/docs/native-code/development/index.md
new file mode 100644
index 0000000000..d969c7621f
--- /dev/null
+++ b/third_party/libwebrtc/docs/native-code/development/index.md
@@ -0,0 +1,290 @@
+# WebRTC development
+
+The currently supported platforms are Windows, Mac OS X, Linux, Android and
+iOS. See the [Android][webrtc-android-development] and [iOS][webrtc-ios-development]
+pages for build instructions and example applications specific to these mobile platforms.
+
+
+## Before You Start
+
+First, be sure to install the [prerequisite software][webrtc-prerequisite-sw].
+
+[webrtc-prerequisite-sw]: https://webrtc.googlesource.com/src/+/main/docs/native-code/development/prerequisite-sw/index.md
+
+
+## Getting the Code
+
+For desktop development:
+
+1. Create a working directory, enter it, and run `fetch webrtc`:
+
+```
+$ mkdir webrtc-checkout
+$ cd webrtc-checkout
+$ fetch --nohooks webrtc
+$ gclient sync
+```
+
+NOTICE: During your first sync, you'll have to accept the license agreement of the Google Play Services SDK.
+
+The checkout size is large due the use of the Chromium build toolchain and many dependencies. Estimated size:
+
+* Linux: 6.4 GB.
+* Linux (with Android): 16 GB (of which ~8 GB is Android SDK+NDK images).
+* Mac (with iOS support): 5.6GB
+
+2. Optionally you can specify how new branches should be tracked:
+
+```
+$ git config branch.autosetupmerge always
+$ git config branch.autosetuprebase always
+```
+
+3. Alternatively, you can create new local branches like this (recommended):
+
+```
+$ cd src
+$ git checkout main
+$ git new-branch your-branch-name
+```
+
+See the [Android][webrtc-android-development] and [iOS][webrtc-ios-development] pages for separate instructions.
+
+**NOTICE:** if you get `Remote: Daily bandwidth rate limit exceeded for <ip>`,
+make sure you're logged in. The quota is much larger for logged in users.
+
+## Updating the Code
+
+Update your current branch with:
+
+```
+$ git checkout main
+$ git pull origin main
+$ gclient sync
+$ git checkout my-branch
+$ git merge main
+```
+
+## Building
+
+[Ninja][ninja] is the default build system for all platforms.
+
+See the [Android][webrtc-android-development] and [iOS][webrtc-ios-development] pages for build
+instructions specific to those platforms.
+
+## Generating Ninja project files
+
+[Ninja][ninja] project files are generated using [GN][gn]. They're put in a
+directory of your choice, like `out/Debug` or `out/Release`, but you can
+use any directory for keeping multiple configurations handy.
+
+To generate project files using the defaults (Debug build), run (standing in
+the src/ directory of your checkout):
+
+```
+$ gn gen out/Default
+```
+
+To generate ninja project files for a Release build instead:
+
+```
+$ gn gen out/Default --args='is_debug=false'
+```
+
+To clean all build artifacts in a directory but leave the current GN
+configuration untouched (stored in the args.gn file), do:
+
+```
+$ gn clean out/Default
+```
+
+To build the fuzzers residing in the [test/fuzzers][fuzzers] directory, use
+```
+$ gn gen out/fuzzers --args='use_libfuzzer=true optimize_for_fuzzing=true'
+```
+Depending on the fuzzer additional arguments like `is_asan`, `is_msan` or `is_ubsan_security` might be required.
+
+See the [GN][gn-doc] documentation for all available options. There are also more
+platform specific tips on the [Android][webrtc-android-development] and
+[iOS][webrtc-ios-development] instructions.
+
+## Compiling
+
+When you have Ninja project files generated (see previous section), compile
+(standing in `src/`) using:
+
+For [Ninja][ninja] project files generated in `out/Default`:
+
+```
+$ autoninja -C out/Default
+```
+
+To build everything in the generated folder (`out/Default`):
+
+```
+$ autoninja all -C out/Default
+```
+
+`autoninja` is a wrapper that automatically provides optimal values for the arguments passed to `ninja`.
+
+See [Ninja build rules][ninja-build-rules] to read more about difference between `ninja` and `ninja all`.
+
+
+## Using Another Build System
+
+Other build systems are **not supported** (and may fail), such as Visual
+Studio on Windows or Xcode on OSX. GN supports a hybrid approach of using
+[Ninja][ninja] for building, but Visual Studio/Xcode for editing and driving
+compilation.
+
+To generate IDE project files, pass the `--ide` flag to the [GN][gn] command.
+See the [GN reference][gn-doc] for more details on the supported IDEs.
+
+
+## Working with Release Branches
+
+To see available release branches, run:
+
+```
+$ git branch -r
+```
+
+To create a local branch tracking a remote release branch (in this example,
+the branch corresponding to Chrome M80):
+
+```
+$ git checkout -b my_branch refs/remotes/branch-heads/3987
+$ gclient sync
+```
+
+**NOTICE**: depot_tools are not tracked with your checkout, so it's possible gclient
+sync will break on sufficiently old branches. In that case, you can try using
+an older depot_tools:
+
+```
+which gclient
+$ # cd to depot_tools dir
+$ # edit update_depot_tools; add an exit command at the top of the file
+$ git log # find a hash close to the date when the branch happened
+$ git checkout <hash>
+$ cd ~/dev/webrtc/src
+$ gclient sync
+$ # When done, go back to depot_tools, git reset --hard, run gclient again and
+$ # verify the current branch becomes REMOTE:origin/main
+```
+
+The above is untested and unsupported, but it might help.
+
+Commit log for the branch: [https://webrtc.googlesource.com/src/+log/branch-heads/3987][m80-log]
+To browse it: [https://webrtc.googlesource.com/src/+/branch-heads/3987][m80]
+
+For more details, read Chromium's [Working with Branches][chromium-work-branches] and
+[Working with Release Branches][chromium-work-release-branches] pages.
+To find the branch corresponding to a Chrome release check the
+[Chromium Dashboard][https://chromiumdash.appspot.com/branches].
+
+
+## Contributing Patches
+
+Please see [Contributing Fixes][contributing] for information on how to run
+`git cl upload`, getting your patch reviewed, and getting it submitted. You can also
+find info on how to run trybots and applying for try rights.
+
+[contributing]: https://webrtc.googlesource.com/src/+/refs/heads/main/docs/native-code/development/contributing.md
+
+
+## Chromium Committers
+
+Many WebRTC committers are also Chromium committers. To make sure to use the
+right account for pushing commits to WebRTC, use the `user.email` Git config
+setting. The recommended way is to have the chromium committer account set globally
+as described at the [depot tools setup page][depot-tools] and then set `user.email`
+locally for the WebRTC repos using:
+
+```
+$ cd /path/to/webrtc/src
+$ git config user.email <YOUR_WEBRTC_COMMITTER_EMAIL>
+```
+
+## Example Applications
+
+WebRTC contains several example applications, which can be found under
+`src/webrtc/examples`. Higher level applications are listed first.
+
+
+### Peerconnection
+
+Peerconnection consist of two applications using the WebRTC Native APIs:
+
+* A server application, with target name `peerconnection_server`
+* A client application, with target name `peerconnection_client` (not currently supported on Mac/Android)
+
+The client application has simple voice and video capabilities. The server
+enables client applications to initiate a call between clients by managing
+signaling messages generated by the clients.
+
+
+#### Setting up P2P calls between peerconnection_clients
+
+Start `peerconnection_server`. You should see the following message indicating
+that it is running:
+
+```
+Server listening on port 8888
+```
+
+Start any number of `peerconnection_clients` and connect them to the server.
+The client UI consists of a few parts:
+
+**Connecting to a server:** When the application is started you must specify
+which machine (by IP address) the server application is running on. Once that
+is done you can press **Connect** or the return button.
+
+**Select a peer:** Once successfully connected to a server, you can connect to
+a peer by double-clicking or select+press return on a peer's name.
+
+**Video chat:** When a peer has been successfully connected to, a video chat
+will be displayed in full window.
+
+**Ending chat session:** Press **Esc**. You will now be back to selecting a
+peer.
+
+**Ending connection:** Press **Esc** and you will now be able to select which
+server to connect to.
+
+
+#### Testing peerconnection_server
+
+Start an instance of `peerconnection_server` application.
+
+Open `src/webrtc/examples/peerconnection/server/server_test.html` in your
+browser. Click **Connect**. Observe that the `peerconnection_server` announces
+your connection. Open one more tab using the same page. Connect it too (with a
+different name). It is now possible to exchange messages between the connected
+peers.
+
+### STUN Server
+
+Target name `stunserver`. Implements the STUN protocol for Session Traversal
+Utilities for NAT as documented in [RFC 5389][rfc-5389].
+
+
+### TURN Server
+
+Target name `turnserver`. Used for unit tests.
+
+
+[ninja]: https://ninja-build.org/
+[ninja-build-rules]: https://gn.googlesource.com/gn/+/master/docs/reference.md#the-all-and-default-rules
+[gn]: https://gn.googlesource.com/gn/+/master/README.md
+[gn-doc]: https://gn.googlesource.com/gn/+/master/docs/reference.md#IDE-options
+[webrtc-android-development]: https://webrtc.googlesource.com/src/+/main/docs/native-code/android/index.md
+[webrtc-ios-development]: https://webrtc.googlesource.com/src/+/main/docs/native-code/ios/index.md
+[chromium-work-branches]: https://www.chromium.org/developers/how-tos/get-the-code/working-with-branches
+[chromium-work-release-branches]: https://www.chromium.org/developers/how-tos/get-the-code/working-with-release-branches
+[depot-tools]: http://commondatastorage.googleapis.com/chrome-infra-docs/flat/depot_tools/docs/html/depot_tools_tutorial.html#_setting_up
+[rfc-5389]: https://tools.ietf.org/html/rfc5389
+[rfc-5766]: https://tools.ietf.org/html/rfc5766
+[m80-log]: https://webrtc.googlesource.com/src/+log/branch-heads/3987
+[m80]: https://webrtc.googlesource.com/src/+/branch-heads/3987
+[fuzzers]: https://webrtc.googlesource.com/src/+/main/test/fuzzers/
diff --git a/third_party/libwebrtc/docs/native-code/development/prerequisite-sw/index.md b/third_party/libwebrtc/docs/native-code/development/prerequisite-sw/index.md
new file mode 100644
index 0000000000..810c87943a
--- /dev/null
+++ b/third_party/libwebrtc/docs/native-code/development/prerequisite-sw/index.md
@@ -0,0 +1,65 @@
+# WebRTC development - Prerequisite software
+
+## Depot Tools
+
+1. [Install the Chromium depot tools][depot-tools].
+
+2. On Windows, depot tools will download a special version of Git during your
+first `gclient sync`. On Mac and Linux, you'll need to install [Git][git] by
+yourself.
+
+## Linux (Ubuntu/Debian)
+
+A script is provided for Ubuntu, which is unfortunately only available after
+your first gclient sync:
+
+```
+$ ./build/install-build-deps.sh
+```
+
+Most of the libraries installed with this script are not needed since we now
+build using Debian sysroot images in build/linux, but there are still some tools
+needed for the build that are installed with
+[install-build-deps.sh][install-build-deps].
+
+You may also want to have a look at the [Chromium Linux Build
+instructions][chromium-linux-build-instructions] if you experience any other problems building.
+
+## Windows
+
+Follow the [Chromium's build instructions for Windows][chromium-win-build-instructions].
+
+WebRTC requires Visual Studio 2017 to be used. If you only have version 2015
+available, you might be able to keep using it for some time by setting
+`GYP_MSVS_VERSION=2015` in your environment. Keep in mind that this is not a
+suppported configuration however.
+
+## macOS
+
+Xcode 12 or higher is required. Latest Xcode is recommended to be able to build
+all code. You may use `xcode-select --install` to install it.
+
+Absence of Xcode will cause errors like:
+```
+xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
+```
+
+## Android
+
+You'll need a Linux development machine. WebRTC is using the same Android
+toolchain as Chrome (downloaded into `third_party/android_tools`) so you won't
+need to install the NDK/SDK separately.
+
+1. Install Java OpenJDK as described in the
+[Chromium Android prerequisites][chromium-android-build-build-instructions]
+2. All set! If you don't run Ubuntu, you may want to have a look at
+[Chromium's Linux prerequisites][chromium-linux-prerequisites] for distro-specific details.
+
+
+[depot-tools]: https://commondatastorage.googleapis.com/chrome-infra-docs/flat/depot_tools/docs/html/depot_tools_tutorial.html#_setting_up
+[git]: http://git-scm.com
+[install-build-deps]: https://cs.chromium.org/chromium/src/build/install-build-deps.sh
+[chromium-linux-build-instructions]: https://chromium.googlesource.com/chromium/src/+/main/docs/linux/build_instructions.md
+[chromium-win-build-instructions]: https://chromium.googlesource.com/chromium/src/+/main/docs/windows_build_instructions.md
+[chromium-linux-prerequisites]: https://chromium.googlesource.com/chromium/src/+/main/docs/linux/build_instructions.md#notes
+[chromium-android-build-build-instructions]: https://chromium.googlesource.com/chromium/src/+/main/docs/android_build_instructions.md