|
| 1 | +This is a fork of WebRTC made by [pixiv Inc](https://www.pixiv.co.jp/). |
| 2 | + |
| 3 | +# Changes |
| 4 | +- `rtc_symbol_enable_export` is compatible with Windows build. |
| 5 | +- `tools_webrtc/libs/generate_licenses.py` is compatible with Windows build. |
| 6 | +- Partial C bindings are introduced at `sdk/c` |
| 7 | +- .NET bindings based on C bindings are introduced at `sdk/dotnet` |
| 8 | + - `sdk/dotnet/unity` is a Unity package. Build with MSBuild. |
| 9 | + - `example/unity` is an example to connect to |
| 10 | + [WebRTC SFU Sora](https://sora.shiguredo.jp/) on Unity. |
| 11 | +- Native APIs are availble for Android library. |
| 12 | +- `webrtc::VideoBuffer`, a simple `webrtc::VideoSinkInterface` which allows you |
| 13 | + to retrieve the last frame at an arbitrary time is introduced. |
| 14 | + |
| 15 | +# .NET bindings |
| 16 | + |
| 17 | +## Features |
| 18 | + |
| 19 | +There are a few .NET binding libraries for WebRTC. Such examples include: |
| 20 | + |
| 21 | +- [WebRTC for the Universal Windows Platform (webrtc-uwp)](https://webrtc-uwp.github.io/) |
| 22 | +- [MixedReality-WebRTC](https://github.com/microsoft/MixedReality-WebRTC), based on webrtc-uwp |
| 23 | +- [Unity Render Streaming](https://github.com/Unity-Technologies/UnityRenderStreaming) |
| 24 | +- The unity plugin located at `sdk/unityplugin` |
| 25 | + |
| 26 | +The bindings provided by this fork has following *unique* features: |
| 27 | + |
| 28 | +- Portable |
| 29 | + - .NET Standard 2.0 |
| 30 | + - Satisfies additional requirements of [Mono's full AOT](https://www.mono-project.com/docs/advanced/aot/#full-aot) |
| 31 | + and [IL2CPP](https://docs.unity3d.com/Manual/IL2CPP.html). |
| 32 | + - No Unity or other runtime dependency. |
| 33 | + - No operating system requirements other than WebRTC requirements. |
| 34 | +- Up-to-date |
| 35 | + - [Unified Plan](https://webrtc.org/web-apis/chrome/unified-plan/) |
| 36 | + - Available as a Unity [package](https://docs.unity3d.com/Manual/Packages.html), |
| 37 | + whose format is an enhancement of traditional Unity asset packages. |
| 38 | +- Extensible |
| 39 | + - Its interface-based API design allows to create bindings for C++ code using |
| 40 | + native API. |
| 41 | + - As low-level as native API. |
| 42 | + - No assumption for inputs/outputs. Use [Unity's RenderTexture](https://docs.unity3d.com/Manual/class-RenderTexture.html) |
| 43 | + or whatever. |
| 44 | + - No assumption for signaling. You can use existing signaling server |
| 45 | + implementations such as [Sora](https://sora.shiguredo.jp/) and SaaS such |
| 46 | + as [ImageFlux Live Streaming](https://www.sakura.ad.jp/services/imageflux/livestreaming/). |
| 47 | + - This also means you need more code to integrate it to an application. |
| 48 | +- Provides comprehensive license file |
| 49 | + - Although it may sound ridiculous to say this as a *unique* feature, it is |
| 50 | + almost impossible to create one without |
| 51 | + `tools_webrtc/libs/generate_licenses.py`. |
| 52 | + |
| 53 | +## Tested platforms |
| 54 | + |
| 55 | +- Unity on Android |
| 56 | +- Unity on Linux/X11 |
| 57 | +- Unity on Windows |
| 58 | +- Unity on iOS |
| 59 | +- Unity on macOS |
| 60 | + |
| 61 | +## Why fork instead of implementing C/.NET bindings completely out-of-tree? |
| 62 | + |
| 63 | +By forking and extending the build infrastructure for C/.NET bindings, the |
| 64 | +build system of those bindings are automatically aligned with the one of the |
| 65 | +library itself. |
| 66 | + |
| 67 | +The build system of WebRTC also contributes to the portability because it is of |
| 68 | +course capable to build for any platforms WebRTC supports. |
| 69 | + |
| 70 | +The changes made in existing code for the bindings are minimal, and it is |
| 71 | +expected to be easy to maintain them, comparing with possible tons of build |
| 72 | +scripts and their messes. (Note that it supports multiple platforms.) |
| 73 | + |
| 74 | +## Using the bindings |
| 75 | + |
| 76 | +The bindings are simple mappings for native APIs. See |
| 77 | +https://webrtc.org/native-code/native-apis/ for details of native APIs. |
| 78 | + |
| 79 | +You may also refer to `examples/unity` for .NET/Unity specifics. |
| 80 | + |
| 81 | +## Coding style |
| 82 | + |
| 83 | +C# coding style is conforming to |
| 84 | +[.NET Core coding style](https://github.com/dotnet/corefx/blob/master/Documentation/coding-guidelines/coding-style.md). |
| 85 | + |
| 86 | +## Release build procedure |
| 87 | + |
| 88 | +Currently unity package is built manually because of build system complications. |
| 89 | +The release build procedure is as follows: |
| 90 | + |
| 91 | +1. Prepare a computer with Linux installed for Android, Linux, and Windows |
| 92 | + builds according to https://webrtc.org/native-code/development/. |
| 93 | + |
| 94 | +2. Check out this code base at `src`. |
| 95 | + |
| 96 | +3. Build `unity.msbuildproj` with: |
| 97 | + * `src/sdk/dotnet/unity` as the working directory, |
| 98 | + * `Android;LinuxX64;WinX64` as `Targets` property, and |
| 99 | + * `Release` as `Configuration` property |
| 100 | + |
| 101 | +4. Prepare a computer with macOS installed for iOS and macOS builds according to |
| 102 | + https://webrtc.org/native-code/development/. |
| 103 | + |
| 104 | +5. Check out this code base at `src`. |
| 105 | + |
| 106 | +6. Build `src/sdk/dotnet/unity/unity.msbuildproj` the following properties: |
| 107 | + * `src/sdk/dotnet/unity` as the working directory, |
| 108 | + * `Ios;MacX64` as `Targets` property, and |
| 109 | + * `Release` as `Configuration` property |
| 110 | + |
| 111 | +7. Copy `Editor` and `Editor.meta` in `src/sdk/dotnet/unity/bin/Release` |
| 112 | + produced by 6 to `src/sdk/dotnet/unity/bin/Release` produced by 3. |
| 113 | + |
| 114 | +8. Copy the contents of `src/sdk/dotnet/unity/bin/Release/Runtime` |
| 115 | + produced by 6 to `src/sdk/dotnet/unity/bin/Release/Runtime` produced by 3. |
| 116 | + Do not overwrite exist files. |
| 117 | + |
| 118 | +9. Add license notices included in `src/sdk/dotnet/unity/bin/Release/LICENSE.md` |
| 119 | + produced by 6 to one produced by 3 if they are missing. |
| 120 | + |
| 121 | +9. Make a tarball containing `src/sdk/dotnet/unity/bin/Release/Runtime` |
| 122 | + produced by 3 as `package` directory. |
| 123 | + |
| 124 | +10. Gzip the tarball produced by 9. |
| 125 | + |
| 126 | +# Further enhancements |
| 127 | + |
| 128 | +The following is something nice to have, but it is not currently planned to |
| 129 | +implement them: |
| 130 | + |
| 131 | +- Automated tests |
| 132 | +- Examples for .NET Core, .NET Framework/Mono and Xamarin |
| 133 | +- Examples independent of Sora |
| 134 | +- NuGet package |
| 135 | + |
| 136 | +# Additional copyright notice |
| 137 | + |
| 138 | +`examples/unity/Assets/aint_we_got_fun_billy_jones1921.mp3` is a recording of |
| 139 | +_Ain't We Got Fun_, performed by Billy Jones. It is distributed by Digital |
| 140 | +History. |
| 141 | + Mintz, S., & McNeil, S. (2016). Digital History. |
| 142 | + http://www.digitalhistory.uh.edu/music/music.cfm |
| 143 | + |
| 144 | +The copyrights of the recording has expired and it is in the public domain. |
0 commit comments