-
-
Notifications
You must be signed in to change notification settings - Fork 338
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update to the latest libwebrtc code and document the building stuff.
- Loading branch information
Showing
15 changed files
with
644 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
# Build *libwebrtc* for cordova-plugin-iosrtc | ||
|
||
|
||
### Get the *libwebrtc* source code | ||
|
||
There are several ways to get and build the library. We choose a project that performs this task nicely: | ||
|
||
* Clone the [webrtc-build-scripts](https://github.com/pristineio/webrtc-build-scripts) project and enter into it: | ||
```bash | ||
$ git clone https://github.com/pristineio/webrtc-build-scripts | ||
$ cd webrtc-build-scripts | ||
``` | ||
|
||
* Follow the project steps and fetch the *libwebrtc* source code: | ||
```bash | ||
$ source ios/build.sh | ||
$ WEBRTC_RELEASE=true | ||
$ get_webrtc | ||
``` | ||
|
||
* Set a specific *libwebrtc* version: | ||
```bash | ||
$ update2Revision 10800 | ||
``` | ||
|
||
|
||
### Apply `libwebrtc-objc-iosrtc.patch` | ||
|
||
Google's *libwebrtc* Objective-C code lacks of `addtrack` and `removetrack` events in its `RTCMediaStream` class, making imposible to emulate them at JavaScript level. Thus a patch is needed to enable these W3C WebRTC features. | ||
|
||
**eFace2Face** created such a patch and sent it to the Google's *WebRTC* project, but [it was rejected](https://webrtc-codereview.appspot.com/50109004/) by arguing that the future of the WebRTC API is "track based" rather than "stream based". | ||
|
||
Since we live in the present we need those two events to properly implement the W3C WebRTC API in *cordova-plugin-iosrtc*, and hence the [patch](../extra/libwebrtc-objc-iosrtc.patch) is provided in the source code. | ||
|
||
* Apply the patch provided at `extra/libwebrtc-objc-iosrtc.patch` into the Objective-C source code of *libwebrtc*: | ||
```bash | ||
$ cd ios/webrtc/src/talk/app/webrtc/objc | ||
$ patch -p1 < PATH_TO_CORDOVA_PLUGIN_IOSRTC/extra/libwebrtc-objc-iosrtc.patch | ||
``` | ||
|
||
|
||
### Remove iOS native H264 encoder/decoder | ||
|
||
(see issue #92 for details, help welcome!) | ||
|
||
Edit `ios/webrtc/src/webrtc/modules/video_coding/codecs/h264/include/h264.h` by removing the line 21: | ||
```c | ||
#define WEBRTC_VIDEO_TOOLBOX_SUPPORTED 1 // <-- remove this line | ||
``` | ||
### Build *libwebrtc* | ||
* Go back to the `webrtc-build-scripts` root folder and build *libwebrtc*: | ||
```bash | ||
$ cd ../../../../../../../ | ||
$ build_webrtc | ||
``` | ||
|
||
* Copy the *libwebrtc* Objective-C headers to *cordova-plugin-iosrtc*: | ||
```bash | ||
$ rm -f PATH_TO_CORDOVA_PLUGIN_IOSRTC/src/webrtc-headers/* | ||
$ cp ios/webrtc/src/talk/app/webrtc/objc/public/* PATH_TO_CORDOVA_PLUGIN_IOSRTC/src/webrtc-headers/ | ||
``` | ||
* Copy the *libwebrtc* static library to *cordova-plugin-iosrtc*: | ||
```bash | ||
$ rm -f PATH_TO_CORDOVA_PLUGIN_IOSRTC/lib/* | ||
$ cp ios/webrtc/libWebRTC-LATEST-Universal-Release.a PATH_TO_CORDOVA_PLUGIN_IOSRTC/lib/ | ||
``` | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.