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

Commit 0f847e5

Browse files
authored
Merge branch 'master' into quic-protocol
2 parents 8e3ae51 + 68c4e56 commit 0f847e5

Some content is hidden

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

60 files changed

+866
-4767
lines changed

doc/servermd/AnalyticsGuide.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -172,10 +172,10 @@ Make sure face detection with cpu pipeline has been installed and model path has
172172
Check ````analytics_agent/plugin.cfg````, The pipeline ID for face detection with CPU is ````dc51138a8284436f873418a21ba8cfa9````, so on the page, in "pipelineID" input text, input the pipeline ID in "analytics id"
173173
edit control, that is, ````dc51138a8284436f873418a21ba8cfa9```` without any extra spaces, and press "startAnalytics" button. The stream you selected will be analyzed, with annotation on the faces in the stream.
174174

175-
Note: If the sample cpu_pipeline analytics failed, please debug as following:
176-
a. Check sample cpu_pipeline is successfully compiled and generated libraries are copied to analytics_agent/lib folder
177-
b. Check ```modelpath``` in analytics_agent/plugin.cfg and make sure it is configured to the correct openmodel zoo model path.
178-
c. For sample cpu_pipeline, the failure is mostly caused by gvadetect and x264enc elements cannot be found, use ```gst-inspect-1.0 gvadetect``` and ```gst-inspect-1.0 x264enc``` to check if used GStreamer elements are successfully installed or configured. If x264enc element is not found, please make sure gstreamer1-plugins-ugly (for CentOS) and gstreamer1.0-plugins-ugly(for Ubuntu). If gvadetect element is not found, please make sure dlstreamer is successfully compiled. Check environment variable GST_PLUGIN_PATH and add x264 and gvadetect libraries to the GST_PLUGIN_PATH as:
175+
**Note:** If the sample cpu_pipeline analytics failed, please debug as following:
176+
a. Check sample cpu_pipeline is successfully compiled and generated libraries are copied to ```analytics_agent/lib``` folder
177+
b. Check ```modelpath``` in ```analytics_agent/plugin.cfg``` and make sure it is configured to the correct openmodel zoo model path.
178+
c. For sample cpu_pipeline, the failure is mostly caused by gvadetect and x264enc elements cannot be found, use ```gst-inspect-1.0 gvadetect``` and ```gst-inspect-1.0 x264enc``` to check if used GStreamer elements are successfully installed or configured. If x264enc element is not found, please make sure ```gstreamer1-plugins-ugly``` (for CentOS) and ```gstreamer1.0-plugins-ugly``` (for Ubuntu). If gvadetect element is not found, please make sure dlstreamer is successfully compiled. Check environment variable ```GST_PLUGIN_PATH``` and add x264 and gvadetect libraries to the ```GST_PLUGIN_PATH``` as:
179179
````
180180
export GST_PLUGIN_PATH=${dl_streamer_lib_path}:/usr/lib/x86_64-linux-gnu/gstreamer-1.0:${GST_PLUGIN_PATH} #for ubuntu18.04
181181
export GST_PLUGIN_PATH=${dl_streamer_lib_path}:/usr/lib64/gstreamer-1.0::${GST_PLUGIN_PATH} #for centos7.6

doc/servermd/Server.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ If you want to set up video conference service with SVT-HEVC Encoder on Ubuntu 1
8282

8383
If you want to set up video conference service powered by GPU-accelerated OWT server through Intel® Media SDK, please follow the below instructions to install server side SDK where the video-agents run.
8484

85-
If you are working on the following platforms with the integrated graphics, please install Intel® Media SDK. The current release is fully tested on MediaSDK 2020 Q3(https://github.com/Intel-Media-SDK/MediaSDK/releases/tag/intel-mediasdk-20.3.0).
85+
If you are working on the following platforms with the integrated graphics, please install Intel® Media SDK. The current release is fully tested on MediaSDK 2020 Q2(https://github.com/Intel-Media-SDK/MediaSDK/releases/tag/intel-mediasdk-20.2.1).
8686

8787
- Intel® Xeon® E3-1200 v4 Family with C226 chipset
8888
- Intel® Xeon® E3-1200 and E3-1500 v5 Family with C236 chipset

scripts/installWebrtc.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ rtc_include_internal_audio_device=false
3939
use_sysroot=false
4040
is_clang=false
4141
treat_warnings_as_errors=false
42+
rtc_enable_libevent=false
43+
rtc_build_libevent=false
4244
is_debug=false
4345
4446
END
Lines changed: 219 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,219 @@
1+
From f02918e6b4ca54eafacb3da057bb519e62a1b8d1 Mon Sep 17 00:00:00 2001
2+
From: Chen Li1 <[email protected]>
3+
Date: Thu, 17 Dec 2020 14:21:31 +0800
4+
Subject: [PATCH] Remove unused includes and add checks
5+
6+
---
7+
erizo/src/erizo/DtlsTransport.cpp | 30 ++++++++++++++----------------
8+
erizo/src/erizo/MediaStream.cpp | 10 ++++++----
9+
erizo/src/erizo/WebRtcConnection.cpp | 8 ++++----
10+
erizo/src/erizo/dtls/DtlsClient.cpp | 2 +-
11+
erizo/src/erizo/rtp/QualityManager.cpp | 10 ++++++++++
12+
erizo/src/erizo/thread/Scheduler.cpp | 2 +-
13+
erizo/src/erizo/thread/Worker.cpp | 4 +++-
14+
7 files changed, 39 insertions(+), 27 deletions(-)
15+
16+
diff --git a/erizo/src/erizo/DtlsTransport.cpp b/erizo/src/erizo/DtlsTransport.cpp
17+
index 8a6539e..6387ffe 100644
18+
--- a/erizo/src/erizo/DtlsTransport.cpp
19+
+++ b/erizo/src/erizo/DtlsTransport.cpp
20+
@@ -49,22 +49,20 @@ void TimeoutChecker::scheduleCheck() {
21+
22+
void TimeoutChecker::scheduleNext() {
23+
scheduled_task_ = transport_->getWorker()->scheduleFromNow([this]() {
24+
- if (transport_->getTransportState() == TRANSPORT_READY) {
25+
- return;
26+
- }
27+
- if (transport_ != nullptr) {
28+
- if (max_checks_-- > 0) {
29+
- ELOG_DEBUG("Handling dtls timeout, checks left: %d", max_checks_);
30+
- if (socket_context_) {
31+
- std::lock_guard<std::mutex> guard(dtls_mutex);
32+
- socket_context_->handleTimeout();
33+
- }
34+
- scheduleNext();
35+
- } else {
36+
- ELOG_DEBUG("%s message: DTLS timeout", transport_->toLog());
37+
- transport_->onHandshakeFailed(socket_context_, "Dtls Timeout on TimeoutChecker");
38+
- }
39+
+ if (!transport_ || transport_->getTransportState() == TRANSPORT_READY) {
40+
+ return;
41+
+ }
42+
+ if (max_checks_-- > 0) {
43+
+ ELOG_DEBUG("Handling dtls timeout, checks left: %d", max_checks_);
44+
+ if (socket_context_) {
45+
+ std::lock_guard<std::mutex> guard(dtls_mutex);
46+
+ socket_context_->handleTimeout();
47+
}
48+
+ scheduleNext();
49+
+ } else {
50+
+ ELOG_DEBUG("%s message: DTLS timeout", transport_->toLog());
51+
+ transport_->onHandshakeFailed(socket_context_, "Dtls Timeout on TimeoutChecker");
52+
+ }
53+
}, std::chrono::seconds(check_seconds_));
54+
}
55+
56+
@@ -261,7 +259,7 @@ void DtlsTransport::onDtlsPacket(DtlsSocketContext *ctx, const unsigned char* da
57+
}
58+
59+
ELOG_DEBUG("%s message: Sending DTLS message, transportName: %s, componentId: %d",
60+
- toLog(), transport_name.c_str(), packet->comp);
61+
+ toLog(), transport_name.c_str(), packet ? packet->comp : 0);
62+
}
63+
64+
void DtlsTransport::writeDtlsPacket(DtlsSocketContext *ctx, packetPtr packet) {
65+
diff --git a/erizo/src/erizo/MediaStream.cpp b/erizo/src/erizo/MediaStream.cpp
66+
index 00e046a..465caa4 100644
67+
--- a/erizo/src/erizo/MediaStream.cpp
68+
+++ b/erizo/src/erizo/MediaStream.cpp
69+
@@ -18,7 +18,7 @@
70+
#include "rtp/RtpHeaders.h"
71+
#include "rtp/RtpVP8Parser.h"
72+
#include "rtp/RtcpAggregator.h"
73+
-#include "rtp/RtcpForwarder.h"
74+
+// #include "rtp/RtcpForwarder.h"
75+
// #include "rtp/RtpSlideShowHandler.h"
76+
// #include "rtp/RtpTrackMuteHandler.h"
77+
// #include "rtp/BandwidthEstimationHandler.h"
78+
@@ -79,7 +79,7 @@ MediaStream::MediaStream(std::shared_ptr<Worker> worker,
79+
audio_sink_ssrc_ = std::rand();
80+
video_sink_ssrc_ = std::rand();
81+
82+
- rtcp_processor_ = std::make_shared<RtcpForwarder>(static_cast<MediaSink*>(this), static_cast<MediaSource*>(this));
83+
+ rtcp_processor_ = nullptr;
84+
85+
should_send_feedback_ = true;
86+
slide_show_mode_ = false;
87+
@@ -158,7 +158,7 @@ bool MediaStream::setRemoteSdp(std::shared_ptr<SdpInfo> sdp) {
88+
remote_sdp_ = std::make_shared<SdpInfo>(*sdp.get());
89+
if (remote_sdp_->videoBandwidth != 0) {
90+
ELOG_DEBUG("%s message: Setting remote BW, maxVideoBW: %u", toLog(), remote_sdp_->videoBandwidth);
91+
- this->rtcp_processor_->setMaxVideoBW(remote_sdp_->videoBandwidth*1000);
92+
+ // this->rtcp_processor_->setMaxVideoBW(remote_sdp_->videoBandwidth*1000);
93+
}
94+
95+
auto video_ssrc_list_it = remote_sdp_->video_ssrc_map.find(getLabel());
96+
@@ -192,10 +192,12 @@ bool MediaStream::setRemoteSdp(std::shared_ptr<SdpInfo> sdp) {
97+
audio_enabled_ = remote_sdp_->hasAudio;
98+
video_enabled_ = remote_sdp_->hasVideo;
99+
100+
+ /*
101+
rtcp_processor_->addSourceSsrc(getAudioSourceSSRC());
102+
std::for_each(video_source_ssrc_list_.begin(), video_source_ssrc_list_.end(), [this] (uint32_t new_ssrc){
103+
rtcp_processor_->addSourceSsrc(new_ssrc);
104+
});
105+
+ */
106+
107+
if (remote_sdp_->rids().size() > 1) {
108+
simulcast_ = true;
109+
@@ -348,7 +350,7 @@ void MediaStream::initializePipeline() {
110+
handler_manager_ = std::make_shared<HandlerManager>(shared_from_this());
111+
pipeline_->addService(shared_from_this());
112+
pipeline_->addService(handler_manager_);
113+
- pipeline_->addService(rtcp_processor_);
114+
+ // pipeline_->addService(rtcp_processor_);
115+
pipeline_->addService(stats_);
116+
pipeline_->addService(quality_manager_);
117+
pipeline_->addService(packet_buffer_);
118+
diff --git a/erizo/src/erizo/WebRtcConnection.cpp b/erizo/src/erizo/WebRtcConnection.cpp
119+
index 5ff5156..b143811 100644
120+
--- a/erizo/src/erizo/WebRtcConnection.cpp
121+
+++ b/erizo/src/erizo/WebRtcConnection.cpp
122+
@@ -16,14 +16,14 @@
123+
// #include "bandwidth/MaxVideoBWDistributor.h"
124+
// #include "bandwidth/TargetVideoBWDistributor.h"
125+
#include "rtp/RtpHeaders.h"
126+
-#include "rtp/RtpVP8Parser.h"
127+
-#include "rtp/RtcpAggregator.h"
128+
-#include "rtp/RtcpForwarder.h"
129+
+// #include "rtp/RtpVP8Parser.h"
130+
+// #include "rtp/RtcpAggregator.h"
131+
+// #include "rtp/RtcpForwarder.h"
132+
// #include "rtp/RtpSlideShowHandler.h"
133+
// #include "rtp/RtpTrackMuteHandler.h"
134+
// #include "rtp/BandwidthEstimationHandler.h"
135+
// #include "rtp/FecReceiverHandler.h"
136+
-#include "rtp/RtcpProcessorHandler.h"
137+
+// #include "rtp/RtcpProcessorHandler.h"
138+
// #include "rtp/RtpRetransmissionHandler.h"
139+
// #include "rtp/RtcpFeedbackGenerationHandler.h"
140+
// #include "rtp/RtpPaddingRemovalHandler.h"
141+
diff --git a/erizo/src/erizo/dtls/DtlsClient.cpp b/erizo/src/erizo/dtls/DtlsClient.cpp
142+
index e77bdd1..8bcc2d5 100644
143+
--- a/erizo/src/erizo/dtls/DtlsClient.cpp
144+
+++ b/erizo/src/erizo/dtls/DtlsClient.cpp
145+
@@ -444,7 +444,7 @@ int createCert(const std::string& pAor, int expireDays, int keyLen, X509*& outCe
146+
ELOG_DEBUG("SRTP Extension negotiated profile=%s", srtp_profile->name);
147+
}
148+
149+
- if (receiver != NULL) {
150+
+ if (receiver != NULL && srtp_profile) {
151+
receiver->onHandshakeCompleted(this, clientKey, serverKey, srtp_profile->name);
152+
}
153+
} else {
154+
diff --git a/erizo/src/erizo/rtp/QualityManager.cpp b/erizo/src/erizo/rtp/QualityManager.cpp
155+
index 20fe2d2..60afdee 100644
156+
--- a/erizo/src/erizo/rtp/QualityManager.cpp
157+
+++ b/erizo/src/erizo/rtp/QualityManager.cpp
158+
@@ -49,6 +49,10 @@ void QualityManager::notifyQualityUpdate() {
159+
return;
160+
}
161+
162+
+ if (!getContext()) {
163+
+ return;
164+
+ }
165+
+
166+
if (!initialized_) {
167+
auto pipeline = getContext()->getPipelineShared();
168+
if (!pipeline) {
169+
@@ -129,6 +133,9 @@ void QualityManager::selectLayer(bool try_higher_layers) {
170+
if (!initialized_ || !stats_->getNode().hasChild("qualityLayers")) {
171+
return;
172+
}
173+
+ if (!getContext() || !getContext()->getPipelineShared()) {
174+
+ return;
175+
+ }
176+
stream_->setSimulcast(true);
177+
last_quality_check_ = clock_->now();
178+
int min_requested_spatial_layer =
179+
@@ -301,6 +308,9 @@ void QualityManager::setTemporalLayer(int temporal_layer) {
180+
}
181+
182+
void QualityManager::setPadding(bool enabled) {
183+
+ if (!getContext() || !getContext()->getPipelineShared()) {
184+
+ return;
185+
+ }
186+
if (padding_enabled_ != enabled) {
187+
padding_enabled_ = enabled;
188+
HandlerManager *manager = getContext()->getPipelineShared()->getService<HandlerManager>().get();
189+
diff --git a/erizo/src/erizo/thread/Scheduler.cpp b/erizo/src/erizo/thread/Scheduler.cpp
190+
index a5fba22..f5e8adb 100644
191+
--- a/erizo/src/erizo/thread/Scheduler.cpp
192+
+++ b/erizo/src/erizo/thread/Scheduler.cpp
193+
@@ -7,7 +7,7 @@
194+
195+
196+
Scheduler::Scheduler(int n_threads_servicing_queue)
197+
-: n_threads_servicing_queue_(n_threads_servicing_queue), stop_requested_(false), stop_when_empty_(false) {
198+
+ : task_queue_(), n_threads_servicing_queue_(n_threads_servicing_queue), stop_requested_(false), stop_when_empty_(false) {
199+
stop_requested_ = false;
200+
stop_when_empty_ = false;
201+
for (int index = 0; index < n_threads_servicing_queue; index++) {
202+
diff --git a/erizo/src/erizo/thread/Worker.cpp b/erizo/src/erizo/thread/Worker.cpp
203+
index 5fc7983..25b3e56 100644
204+
--- a/erizo/src/erizo/thread/Worker.cpp
205+
+++ b/erizo/src/erizo/thread/Worker.cpp
206+
@@ -141,7 +141,9 @@ std::shared_ptr<ScheduledTaskReference> SimulatedWorker::scheduleFromNow(Task f,
207+
208+
void SimulatedWorker::executeTasks() {
209+
for (Task f : tasks_) {
210+
- f();
211+
+ if (f) {
212+
+ f();
213+
+ }
214+
}
215+
tasks_.clear();
216+
}
217+
--
218+
2.7.4
219+

source/agent/addons/quic/test/package-lock.json

Lines changed: 10 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
// Copyright (C) <2019> Intel Corporation
2+
//
3+
// SPDX-License-Identifier: Apache-2.0
4+
5+
'use strict';
6+
7+
const { EventEmitter } = require('events');
8+
const MediaFrameMulticaster = require('../mediaFrameMulticaster/build/Release/mediaFrameMulticaster');
9+
const { AudioRanker } = require('../audioRanker/build/Release/audioRanker');
10+
11+
const logger = require('../logger').logger;
12+
const log = logger.getLogger('ActiveAudioSelector');
13+
14+
const DEFAULT_K = 3;
15+
const DETECT_MUTE = true;
16+
const CHANGE_INTERVAL = 200;
17+
18+
class ActiveAudioSelector extends EventEmitter {
19+
20+
constructor(k) {
21+
super();
22+
k = (k > 0) ? k : DEFAULT_K;
23+
// streamId : { owner, codec, conn }
24+
this.inputs = new Map();
25+
this.ranker = new AudioRanker(
26+
this._onRankChange.bind(this), DETECT_MUTE, CHANGE_INTERVAL);
27+
this.topK = [];
28+
for (let i = 0; i < k; i++) {
29+
let multicaster = new MediaFrameMulticaster();
30+
this.topK.push(multicaster);
31+
this.ranker.addOutput(this.topK[i]);
32+
}
33+
this.currentRank = Array(k).fill('');
34+
log.debug('Init with K:', k);
35+
}
36+
37+
_onRankChange(jsonChanges) {
38+
log.debug('_onRankChange:', jsonChanges);
39+
let changes = JSON.parse(jsonChanges);
40+
// Get rank difference
41+
if (changes.length !== this.currentRank.length) {
42+
log.warn('Changes number not equal to K');
43+
return;
44+
}
45+
46+
let pendingAddIndexes = [];
47+
for (let i = 0; i < this.currentRank.length; i++) {
48+
if (this.currentRank[i] !== changes[i][0]) {
49+
// Remove previous input
50+
let streamId = this.currentRank[i];
51+
if (this.inputs.has(streamId)) {
52+
let { owner, codec } = this.inputs.get(streamId);
53+
log.debug('Inactive input:', owner, streamId);
54+
} else if (streamId !== '') {
55+
log.warn('Unknown stream ID', streamId);
56+
}
57+
pendingAddIndexes.push(i);
58+
}
59+
}
60+
for (let i of pendingAddIndexes) {
61+
// Re-add top K with updated owner/streamId/codec
62+
let streamId = changes[i][0];
63+
if (this.inputs.has(streamId)) {
64+
let { owner, codec } = this.inputs.get(streamId);
65+
log.debug('Active input:', owner, streamId, codec, i);
66+
this.emit('source-change', i, owner, streamId, codec);
67+
} else if (streamId !== '') {
68+
log.warn('Unknown stream ID', streamId);
69+
}
70+
}
71+
this.currentRank = changes.map(pair => pair[0]);
72+
}
73+
74+
addInput(owner, streamId, codec, conn) {
75+
log.debug('addInput:', owner, streamId, codec);
76+
if (!this.inputs.has(streamId)) {
77+
this.inputs.set(streamId, { owner, codec, conn });
78+
this.ranker.addInput(conn, streamId, owner);
79+
return true;
80+
} else {
81+
log.warn(`Duplicate addInput ${streamId}`);
82+
return false;
83+
}
84+
}
85+
86+
removeInput(owner, streamId) {
87+
log.debug('removeInput:', owner, streamId);
88+
if (this.inputs.delete(streamId)) {
89+
this.ranker.removeInput(streamId);
90+
} else {
91+
log.warn(`Remove non-add input ${streamId}`);
92+
}
93+
}
94+
95+
removeOutput() {}
96+
97+
getOutputs() {
98+
return this.topK;
99+
}
100+
}
101+
102+
exports.ActiveAudioSelector = ActiveAudioSelector;

0 commit comments

Comments
 (0)