Skip to content
This repository was archived by the owner on Oct 23, 2024. It is now read-only.

Commit b2a7894

Browse files
authored
Using M79 stack in webrtc agent (#409)
* Upgrade stack to M79 * Adjust some code structure of webrtc addon * Use upgraded webrtc frame pipeline in SIP agent * Separate rtc adaptor from frame pipeline * Update code formats
1 parent e7695b5 commit b2a7894

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+2350
-1054
lines changed

scripts/build.json

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,12 @@
4040
"video-transcoder-msdk"
4141
]
4242
},
43+
"webrtc" : {
44+
"include" : [
45+
"webrtc-conn",
46+
"webrtc-frame"
47+
]
48+
},
4349
"video-mixer-sw" : {
4450
"path" : "source/agent/video/videoMixer/videoMixer_sw",
4551
"gyp" : "binding.sw.gyp"
@@ -72,8 +78,11 @@
7278
"audio" : {
7379
"path" : "source/agent/audio/audioMixer"
7480
},
75-
"webrtc" : {
76-
"path" : "source/agent/webrtc/webrtcLib"
81+
"webrtc-conn" : {
82+
"path" : "source/agent/webrtc/rtcConn"
83+
},
84+
"webrtc-frame": {
85+
"path" : "source/agent/webrtc/rtcFrame"
7786
},
7887
"sip" : {
7988
"path" : "source/agent/sip/sipIn",

scripts/installCentOSDeps.sh

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,17 +47,19 @@ install_boost(){
4747
}
4848

4949
installYumDeps(){
50-
sudo -E yum groupinstall " Development Tools" "Development Libraries " -y
51-
sudo -E yum install zlib-devel pkgconfig git libcurl-devel.x86_64 curl log4cxx-devel gcc gcc-c++ bzip2 bzip2-devel bzip2-libs python-devel nasm libXext-devel libXfixes-devel libpciaccess-devel libX11-devel yasm cmake -y
52-
sudo -E yum install rabbitmq-server mongodb mongodb-server java-1.7.0-openjdk gyp intel-gpu-tools which libtool freetype-devel -y
53-
sudo -E yum install glib2-devel boost-devel -y
50+
${SUDO} yum groupinstall " Development Tools" "Development Libraries " -y
51+
${SUDO} yum install zlib-devel pkgconfig git libcurl-devel.x86_64 curl log4cxx-devel gcc gcc-c++ bzip2 bzip2-devel bzip2-libs python-devel nasm libXext-devel libXfixes-devel libpciaccess-devel libX11-devel yasm cmake -y
52+
${SUDO} yum install rabbitmq-server mongodb mongodb-server java-1.7.0-openjdk gyp intel-gpu-tools which libtool freetype-devel -y
53+
${SUDO} yum install glib2-devel boost-devel -y
54+
${SUDO} yum install centos-release-scl -y
55+
${SUDO} yum install devtoolset-7-gcc* -y
5456
}
5557

5658
installRepo(){
5759
wget -c http://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
5860
wget -c http://rpms.famillecollet.com/enterprise/remi-release-7.rpm
59-
sudo rpm -Uvh remi-release-7*.rpm epel-release-latest-7*.rpm
60-
sudo sed -i 's/https/http/g' /etc/yum.repos.d/epel.repo
61+
${SUDO} rpm -Uvh remi-release-7*.rpm epel-release-latest-7*.rpm
62+
${SUDO} sed -i 's/https/http/g' /etc/yum.repos.d/epel.repo
6163
rm *.rpm
6264
}
6365

scripts/installCommonDeps.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,18 @@ install_libexpat() {
233233
fi
234234
}
235235

236+
install_webrtc79(){
237+
$INCR_INSTALL && [[ -s $ROOT/third_party/webrtc-m79/libwebrtc.a ]] && \
238+
echo "libwebrtc already installed." && return 0
239+
240+
[[ ! -d $ROOT/third_party/webrtc-m79 ]] && \
241+
mkdir $ROOT/third_party/webrtc-m79
242+
243+
pushd ${ROOT}/third_party/webrtc-m79 >/dev/null
244+
. $PATHNAME/installWebrtc.sh
245+
popd
246+
}
247+
236248
install_webrtc(){
237249
$INCR_INSTALL && [[ -s $ROOT/third_party/webrtc/libwebrtc.a ]] && \
238250
echo "libwebrtc already installed." && return 0
@@ -256,6 +268,8 @@ install_webrtc(){
256268
./src/tools-woogeen/install.sh
257269
./src/tools-woogeen/build.sh
258270
popd
271+
272+
install_webrtc79
259273
}
260274

261275
install_licode(){

scripts/installDeps.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ CLEANUP=false
1313
NO_INTERNAL=false
1414
INCR_INSTALL=false
1515
ONLY_INSTALL=""
16+
SUDO=""
17+
18+
if [[ $EUID -ne 0 ]]; then
19+
SUDO="sudo -E"
20+
fi
1621

1722
parse_arguments(){
1823
while [ "$1" != "" ]; do

scripts/installDepsEnv.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,10 @@ CLEANUP=false
1414
NIGHTLY=false
1515
NO_INTERNAL=false
1616
INCR_INSTALL=false
17+
SUDO=""
18+
19+
if [[ $EUID -ne 0 ]]; then
20+
SUDO="sudo -E"
21+
fi
1722

1823
. ${PATHNAME}/installCommonDeps.sh

scripts/installDepsUnattended.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ CLEANUP=false
1313
NIGHTLY=false
1414
NO_INTERNAL=false
1515
INCR_INSTALL=false
16+
SUDO=""
17+
18+
if [[ $EUID -ne 0 ]]; then
19+
SUDO="sudo -E"
20+
fi
1621

1722
parse_arguments(){
1823
while [ "$1" != "" ]; do

scripts/installUbuntuDeps.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#!/bin/bash
22

33
install_apt_deps(){
4-
sudo -E apt-get update -y
5-
sudo -E apt-get install git make gcc g++ libglib2.0-dev pkg-config libboost-regex-dev libboost-thread-dev libboost-system-dev liblog4cxx-dev rabbitmq-server mongodb openjdk-8-jre curl libboost-test-dev nasm yasm gyp libx11-dev libkrb5-dev intel-gpu-tools m4 autoconf libtool automake cmake libfreetype6-dev -y
4+
${SUDO} apt-get update -y
5+
${SUDO} apt-get install git make gcc g++ libglib2.0-dev pkg-config libboost-regex-dev libboost-thread-dev libboost-system-dev liblog4cxx-dev rabbitmq-server mongodb openjdk-8-jre curl libboost-test-dev nasm yasm gyp libx11-dev libkrb5-dev intel-gpu-tools m4 autoconf libtool automake cmake libfreetype6-dev -y
66
}
77

88
install_mediadeps_nonfree(){

scripts/installWebrtc.sh

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
#!/bin/bash
2+
3+
SSL_GNI=$(cat <<-END
4+
declare_args() {
5+
build_with_owt = false
6+
owt_use_openssl = false
7+
owt_openssl_header_root = ""
8+
owt_openssl_lib_root = ""
9+
rtc_use_h265 = true
10+
}
11+
12+
END
13+
)
14+
15+
GCLIENT_CONFIG=$(cat <<-END
16+
solutions = [
17+
{
18+
"url": "https://github.com/open-webrtc-toolkit/owt-deps-webrtc.git",
19+
"managed": False,
20+
"name": "src",
21+
"deps_file": "DEPS",
22+
"custom_deps": {},
23+
},
24+
]
25+
26+
END
27+
)
28+
29+
# comment is_debug=false for debugging
30+
GN_ARGS=$(cat <<-END
31+
rtc_use_h264=true
32+
ffmpeg_branding="Chrome"
33+
is_component_build=false
34+
use_lld=false
35+
rtc_build_examples=false
36+
rtc_include_tests=false
37+
rtc_include_pulse_audio=false
38+
rtc_include_internal_audio_device=false
39+
use_sysroot=false
40+
is_clang=false
41+
treat_warnings_as_errors=false
42+
is_debug=false
43+
44+
END
45+
)
46+
47+
OWT_DIR="tools-owt"
48+
DEPOT_TOOLS=
49+
50+
install_depot_tools(){
51+
DEPOT_TOOLS=`pwd`"/${OWT_DIR}/depot_tools"
52+
if [ -d $OWT_DIR/depot_tools ]; then
53+
echo "depot_tools already installed."
54+
return 0
55+
fi
56+
if [ ! -d $OWT_DIR ]; then
57+
mkdir -p $OWT_DIR
58+
fi
59+
60+
pushd $OWT_DIR >/dev/null
61+
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
62+
popd >/dev/null
63+
}
64+
65+
download_and_build(){
66+
if [ -d src ]; then
67+
echo "src already exists."
68+
else
69+
git clone -b 79-sdk https://github.com/open-webrtc-toolkit/owt-deps-webrtc.git src
70+
mkdir -p src/build_overrides/ssl
71+
echo $SSL_GNI > src/build_overrides/ssl/ssl.gni
72+
echo $GCLIENT_CONFIG > .gclient
73+
fi
74+
75+
if [[ "$OS" =~ .*centos.* ]]
76+
then
77+
source scl_source enable devtoolset-7
78+
fi
79+
80+
export PATH="$PATH:$DEPOT_TOOLS"
81+
gclient sync
82+
pushd src >/dev/null
83+
gn gen out --args="$GN_ARGS"
84+
ninja -C out call default_task_queue_factory
85+
all=`find ./out/obj/ -name "*.o"`
86+
if [[ -n $all ]];
87+
then
88+
rm -f ../libwebrtc.a
89+
ar cq ../libwebrtc.a $all
90+
echo "Generate libwebrtc.a OK"
91+
else
92+
echo "Generate libwebrtc.a Fail"
93+
fi
94+
popd >/dev/null
95+
}
96+
97+
install_depot_tools
98+
download_and_build

scripts/pack.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -408,6 +408,7 @@ function isLibAllowed(libSrc) {
408408
return false;
409409

410410
const whiteList = [
411+
'rtcadapter',
411412
'libnice',
412413
'libSvtHevcEnc',
413414
'libusrsctp',
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
From f6bfadf6fdf0eb22b5a09d884aaa85cd56b22100 Mon Sep 17 00:00:00 2001
2+
From: Chen Li1 <[email protected]>
3+
Date: Sun, 19 Jan 2020 17:36:37 +0800
4+
Subject: [PATCH] Changes for webrtc upgrade
5+
6+
---
7+
erizo/src/erizo/MediaStream.cpp | 9 +++++----
8+
1 file changed, 5 insertions(+), 4 deletions(-)
9+
10+
diff --git a/erizo/src/erizo/MediaStream.cpp b/erizo/src/erizo/MediaStream.cpp
11+
index 4327c6f..00e046a 100644
12+
--- a/erizo/src/erizo/MediaStream.cpp
13+
+++ b/erizo/src/erizo/MediaStream.cpp
14+
@@ -21,7 +21,7 @@
15+
#include "rtp/RtcpForwarder.h"
16+
// #include "rtp/RtpSlideShowHandler.h"
17+
// #include "rtp/RtpTrackMuteHandler.h"
18+
-#include "rtp/BandwidthEstimationHandler.h"
19+
+// #include "rtp/BandwidthEstimationHandler.h"
20+
// #include "rtp/FecReceiverHandler.h"
21+
#include "rtp/RtcpProcessorHandler.h"
22+
// #include "rtp/RtpRetransmissionHandler.h"
23+
@@ -366,7 +366,7 @@ void MediaStream::initializePipeline() {
24+
// pipeline_->addFront(std::make_shared<RtpPaddingGeneratorHandler>());
25+
// pipeline_->addFront(std::make_shared<PliPacerHandler>());
26+
if (simulcast_ && is_publisher_) {
27+
- pipeline_->addFront(std::make_shared<BandwidthEstimationHandler>());
28+
+ // pipeline_->addFront(std::make_shared<BandwidthEstimationHandler>());
29+
}
30+
// pipeline_->addFront(std::make_shared<RtpPaddingRemovalHandler>());
31+
// pipeline_->addFront(std::make_shared<RtcpFeedbackGenerationHandler>());
32+
@@ -410,10 +410,10 @@ int MediaStream::deliverFeedback_(std::shared_ptr<DataPacket> fb_packet) {
33+
}
34+
if (isVideoSourceSSRC(recvSSRC)) {
35+
fb_packet->type = VIDEO_PACKET;
36+
- sendPacketAsync(fb_packet);
37+
+ sendPacketAsync(std::make_shared<DataPacket>(*fb_packet));
38+
} else if (isAudioSourceSSRC(recvSSRC)) {
39+
fb_packet->type = AUDIO_PACKET;
40+
- sendPacketAsync(fb_packet);
41+
+ sendPacketAsync(std::make_shared<DataPacket>(*fb_packet));
42+
} else {
43+
ELOG_DEBUG("%s deliverFeedback unknownSSRC: %u, localVideoSSRC: %u, localAudioSSRC: %u",
44+
toLog(), recvSSRC, this->getVideoSourceSSRC(), this->getAudioSourceSSRC());
45+
@@ -563,6 +563,7 @@ void MediaStream::sendPLIToFeedback() {
46+
this->getVideoSourceSSRC()));
47+
}
48+
}
49+
+
50+
// changes the outgoing payload type for in the given data packet
51+
void MediaStream::sendPacketAsync(std::shared_ptr<DataPacket> packet) {
52+
if (!sending_) {
53+
--
54+
2.7.4
55+

0 commit comments

Comments
 (0)