Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,2 +0,0 @@
*.so filter=lfs diff=lfs merge=lfs -text
*.so.* filter=lfs diff=lfs merge=lfs -text
39 changes: 39 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ Ubuntu 18.04 is the only officially supported distro at this moment. For other d

## Compilation

### Option 1: Docker (recommended)

To compile AlphaRTC, please refer to the following steps

1. Prerequisites
Expand Down Expand Up @@ -74,6 +76,43 @@ To compile AlphaRTC, please refer to the following steps

You should then be able to see two Docker images, `alphartc` and `alphartc-compile` using `sudo docker images`

### Option 2: Compile from Scratch
If you don't want to use Docker, or have other reasons to compile from scratch (e.g., you want a native Windows build), you may use this method.

1. Grab essential tools

You may follow the guide [here](https://commondatastorage.googleapis.com/chrome-infra-docs/flat/depot_tools/docs/html/depot_tools_tutorial.html#_setting_up) to obtain a copy of `depot_tools`

2. Clone the repo

```shell
git clone https://github.com/OpenNetLab/AlphaRTC.git
```

3. Sync the dependencies
```shell
cd AlphaRTC
gclient sync
mv -fvn src/* .
```

4. Generate build rules

_Windows users_: Please use __x64 Native Tools Command Prompt for VS2017__. The clang version comes with the project is 9.0.0, hence incompatible with VS2019.

```shell
gn gen out/Default
```

5. Comile
```shell
ninja -C out/Default peerconnection_serverless
```
For Windows users, we also provide a GUI version. You may compile it via
```shell
ninja -C out/Default peerconnection_serverless_win_gui
```

## Demo

AlphaRTC consists of many different components. `peerconnection_serverless` is an application for demo purposes that comes with AlphaRTC. It establishes RTC communication with another peer without the need of a server.
Expand Down
61 changes: 37 additions & 24 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,27 +10,40 @@ trigger:
exclude:
- upstream/*


pool:
vmImage: 'ubuntu-latest'


steps:
- checkout: self
lfs: true

- script: make init
displayName: 'build compile environment'

- script: make sync
displayName: 'sync dependencies'

- script: make app
displayName: 'build application'

- script: make release
displayName: 'build release image'

- script: docker run -d --rm -v `pwd`/examples/peerconnection/serverless/corpus:/app -w /app --name alphartc alphartc peerconnection_serverless receiver.json
&& docker exec alphartc peerconnection_serverless sender.json
displayName: 'run example'
jobs:
- job: Windows
pool:
name: AlphaRTC-build
vmImage: VS2017-Win2016

variables:
- name: DEPOT_TOOLS_WIN_TOOLCHAIN
value: 0
- name: GYP_MSVS_VERSION
value: 2017

steps:

- powershell: |
Invoke-WebRequest -Uri "https://storage.googleapis.com/chrome-infra/depot_tools.zip" -OutFile "depot_tools.zip"
Expand-Archive "./depot_tools.zip"
workingDirectory: $(Pipeline.Workspace)
displayName: "clone depot_tools"

- powershell: |
Write-Host "##vso[task.prependpath]$(Pipeline.Workspace)/depot_tools"
displayName: "set path"

- powershell: gclient sync
displayName: "sync dependencies"

- powershell: |
Get-ChildItem -Path "src" -Recurse | Move-Item -Destination "."
Remove-Item 'src'
displayName: "move src"

- powershell: gn gen out/Default
displayName: "generate build rules"

- powershell: ninja -C out/Default peerconnection_serverless
displayName: "make peerconnection"
72 changes: 59 additions & 13 deletions examples/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -714,6 +714,7 @@ if (is_linux || is_win) {
rtc_executable("peerconnection_serverless") {
testonly = true
sources = [
"peerconnection/serverless/main.cc",
"peerconnection/serverless/conductor.cc",
"peerconnection/serverless/conductor.h",
"peerconnection/serverless/defaults.cc",
Expand Down Expand Up @@ -764,22 +765,67 @@ if (is_linux || is_win) {
"../test:video_test_support",
"//third_party/libyuv",
]
}

if (is_win) {
sources += [
"peerconnection/serverless/main.cc",
"peerconnection/serverless/main_wnd.cc",
"peerconnection/serverless/main_wnd.h",
]
configs += [ "//build/config/win:windowed" ]
}
if (is_win) {
rtc_executable("peerconnection_serverless_win_gui") {
testonly = true
sources = [
"peerconnection/serverless/win/main.cc",
"peerconnection/serverless/win/main_wnd.cc",
"peerconnection/serverless/conductor.cc",
"peerconnection/serverless/conductor.h",
"peerconnection/serverless/defaults.cc",
"peerconnection/serverless/defaults.h",
"peerconnection/serverless/peer_connection_client.cc",
"peerconnection/serverless/peer_connection_client.h",
]

if (is_linux) {
sources += [
"peerconnection/serverless/linux/main.cc"
]
}
deps = [
"../api:audio_options_api",
"../api:create_peerconnection_factory",
"../api:libjingle_peerconnection_api",
"../api:scoped_refptr",
"../api/audio:audio_mixer_api",
"../api/audio_codecs:audio_codecs_api",
"../api/video:video_frame_i420",
"../api/video:video_rtp_headers",
"../api/video_codecs:video_codecs_api",
"../media:rtc_media_base",
"../p2p:rtc_p2p",
"../rtc_base:checks",
"../rtc_base/third_party/sigslot",
"../system_wrappers:field_trial",
"../test:field_trial",
"../test:platform_video_capturer",
"../test:test_support",
"//third_party/abseil-cpp/absl/memory",
"//third_party/abseil-cpp/absl/types:optional",
"../api:libjingle_peerconnection_api",
"../api/audio_codecs:builtin_audio_decoder_factory",
"../api/audio_codecs:builtin_audio_encoder_factory",
"../api/video:video_frame",
"../api/video:video_rtp_headers",
"../api/video_codecs:builtin_video_decoder_factory",
"../api/video_codecs:builtin_video_encoder_factory",
"../media:rtc_audio_video",
"../modules/audio_device",
"../modules/audio_processing",
"../modules/audio_processing:api",
"../modules/video_capture:video_capture_module",
"../pc:libjingle_peerconnection",
"../pc:peerconnection",
"../rtc_base",
"../rtc_base:rtc_base_approved",
"../rtc_base:rtc_json",
"../test:video_test_common",
"../test:test_support",
"../test:video_test_support",
"//third_party/libyuv",
]

configs += [ "//build/config/win:windowed" ]
}
}

rtc_executable("peerconnection_server") {
Expand Down
157 changes: 0 additions & 157 deletions examples/peerconnection/serverless/linux/main.cc

This file was deleted.

Loading