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

Commit 6842833

Browse files
authored
Merge branch 'master' into install-quic
2 parents a016924 + bad5c12 commit 6842833

File tree

9 files changed

+81
-17
lines changed

9 files changed

+81
-17
lines changed

source/agent/conference/conference.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,9 @@ var Conference = function (rpcClient, selfRpcId) {
312312
};
313313

314314
var initRoom = function(roomId, origin) {
315+
if (origin === undefined) {
316+
origin = {isp:"isp", region:"region"};
317+
}
315318
if (is_initializing) {
316319
return new Promise(function(resolve, reject) {
317320
var interval = setInterval(function() {
@@ -1013,6 +1016,18 @@ var Conference = function (rpcClient, selfRpcId) {
10131016
data: subDesc.data,
10141017
legacy: subDesc.legacy,
10151018
};
1019+
if (rtcSubInfo.legacy) {
1020+
// For legacy simulcast rid subscription
1021+
rtcSubInfo.tracks.forEach((subTrack) => {
1022+
if (subTrack.simulcastRid) {
1023+
const trackFrom = streams[subTrack.from].media.tracks.find((t) =>
1024+
(t.type === subTrack.type && t.rid === subTrack.simulcastRid));
1025+
if (trackFrom && trackFrom.id) {
1026+
subTrack.from = trackFrom.id;
1027+
}
1028+
}
1029+
});
1030+
}
10161031
return rtcSubInfo;
10171032
};
10181033

source/agent/conference/roomController.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1463,7 +1463,7 @@ module.exports.create = function (spec, on_init_ok, on_init_failed) {
14631463
rpcClient,
14641464
terminals[t_id].locality.node,
14651465
'linkup',
1466-
[sub_id, undefined, streamId],
1466+
[sub_id, undefined, streamId, undefined],
14671467
function () {
14681468
log.debug('resumed sub_id:', sub_id, 'for streamId:', streamId);
14691469
streams[streamId].video.subscribers = streams[streamId].video.subscribers || [];
@@ -2104,7 +2104,7 @@ module.exports.create = function (spec, on_init_ok, on_init_failed) {
21042104
rpcClient,
21052105
terminals[t_id].locality.node,
21062106
'linkup',
2107-
[sub_id, undefined, stream_id],
2107+
[sub_id, undefined, stream_id, undefined],
21082108
function () {
21092109
streams[stream_id].video.subscribers = streams[stream_id].video.subscribers || [];
21102110
streams[stream_id].video.subscribers.push(t_id);
@@ -2193,7 +2193,7 @@ module.exports.create = function (spec, on_init_ok, on_init_failed) {
21932193
rpcClient,
21942194
terminals[t_id].locality.node,
21952195
'linkup',
2196-
[sub_id, undefined, stream_id],
2196+
[sub_id, undefined, stream_id, undefined],
21972197
function () {
21982198
streams[stream_id].video.subscribers = streams[stream_id].video.subscribers || [];
21992199
streams[stream_id].video.subscribers.push(t_id);
@@ -2324,7 +2324,7 @@ module.exports.create = function (spec, on_init_ok, on_init_failed) {
23242324
rpcClient,
23252325
terminals[t_id].locality.node,
23262326
'linkup',
2327-
[sub_id, stream_id, undefined],
2327+
[sub_id, stream_id, undefined, undefined],
23282328
function () {
23292329
streams[stream_id].audio.subscribers = streams[stream_id].audio.subscribers || [];
23302330
streams[stream_id].audio.subscribers.push(t_id);
@@ -2411,7 +2411,7 @@ module.exports.create = function (spec, on_init_ok, on_init_failed) {
24112411
rpcClient,
24122412
terminals[t_id].locality.node,
24132413
'linkup',
2414-
[sub_id, stream_id, undefined],
2414+
[sub_id, stream_id, undefined, undefined],
24152415
function () {
24162416
streams[stream_id].audio.subscribers = streams[stream_id].audio.subscribers || [];
24172417
streams[stream_id].audio.subscribers.push(t_id);

source/agent/sip/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ module.exports = function (rpcC, selfRpcId, parentRpcId, clusterWorkerIP) {
355355
//check resolution
356356
var fmtp = info.videoResolution,
357357
preferred_resolution,
358-
optional_resolutions = calls[client_id].videoSource.media.video.optional.parameters.resolution;
358+
optional_resolutions = calls[client_id].videoSource.media.tracks.find(t => t.type === "video").optional.parameters.resolution;
359359

360360
const isResolutionEqual = (r1, r2) => {return r1.width === r2.width && r1.height === r2.height;};
361361
//TODO: currently we only check CIF/QCIF, there might be other options in fmtp from other devices.

source/agent/sip/sipIn/sip_gateway/sipua/src/sipua.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ void sipua_call(struct sipua_entity *sipua, sipua_bool audio, sipua_bool video,
276276
call_data = mem_zalloc(sizeof(struct sipua_call_data), NULL);
277277
call_data->audio = NATURAL_BOOL(audio);
278278
call_data->video = NATURAL_BOOL(video);
279-
strcpy_s(call_data->calleeURI, sizeof(call_data->calleeURI), calleeURI);
279+
strncpy(call_data->calleeURI, calleeURI, sizeof(call_data->calleeURI));
280280

281281
mqueue_push(sipua->mq, SIPUA_CALL, call_data);
282282
return;

source/agent/webrtc/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ module.exports = function (rpcClient, selfRpcId, parentRpcId, clusterWorkerIP) {
8888
rid: trackInfo.rid,
8989
active: true,
9090
};
91-
log.warn('notifyTrackUpdate', controller, publicTrackId, updateInfo);
91+
log.debug('notifyTrackUpdate', controller, publicTrackId, updateInfo);
9292
notifyTrackUpdate(controller, transportId, updateInfo);
9393

9494
} else if (trackInfo.type === 'track-removed') {
@@ -350,7 +350,7 @@ module.exports = function (rpcClient, selfRpcId, parentRpcId, clusterWorkerIP) {
350350
if (conn) {
351351
promises = tracks.map(trackId => new Promise((resolve, reject) => {
352352
if (mediaTracks.has(trackId)) {
353-
log.warn('got on off track:', trackId);
353+
log.debug('got on off track:', trackId);
354354
mediaTracks.get(trackId).onTrackControl(
355355
'av', direction, action, resolve, reject);
356356
} else {

source/agent/webrtc/sdpInfo.js

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class SdpInfo {
2424
this.obj = transform.parse(str);
2525
this.obj.media.forEach((media, i) => {
2626
if (media.mid === undefined) {
27-
log.info(`Media ${i} missing mid`);
27+
log.warn(`Media ${i} missing mid`);
2828
media.mid = -1;
2929
}
3030
});
@@ -175,7 +175,7 @@ class SdpInfo {
175175
}
176176
const payloadList = mediaInfo.payloads.toString().split(' ');
177177
if (selectedPayload !== -1) {
178-
payloadList.unshift(selectedPayload);
178+
payloadList.unshift(selectedPayload.toString());
179179
}
180180
mediaInfo.payloads = payloadList
181181
.filter((p) => relatedPayloads.has(parseInt(p)))
@@ -265,7 +265,7 @@ class SdpInfo {
265265
}
266266
const payloadList = mediaInfo.payloads.toString().split(' ');
267267
if (selectedPayload !== -1) {
268-
payloadList.unshift(selectedPayload);
268+
payloadList.unshift(selectedPayload.toString());
269269
}
270270
mediaInfo.payloads = payloadList
271271
.filter((p) => relatedPayloads.has(parseInt(p)))
@@ -366,12 +366,22 @@ class SdpInfo {
366366
});
367367
}
368368

369+
filterMedia(mids) {
370+
this.obj.media = mids.map((mid) => {
371+
const media = this.media(mid);
372+
if (!media) {
373+
log.warn(`Media ${i} missing mid`);
374+
}
375+
return media;
376+
});
377+
}
378+
369379
isMediaClosed(mid) {
370380
const mediaInfo = this.media(mid);
371381
if (!mediaInfo) {
372382
return true;
373383
}
374-
if (mediaInfo.port === 0 && mediaInfo.direction === 'inactive') {
384+
if (mediaInfo.direction === 'inactive') {
375385
return true;
376386
}
377387
return false;
@@ -380,8 +390,10 @@ class SdpInfo {
380390
closeMedia(mid) {
381391
const mediaInfo = this.media(mid);
382392
if (mediaInfo) {
393+
if (!mediaInfo.candidates) {
394+
mediaInfo.port = 0;
395+
}
383396
mediaInfo.direction = 'inactive';
384-
mediaInfo.port = 0;
385397
delete mediaInfo.ext;
386398
delete mediaInfo.ssrcs;
387399
delete mediaInfo.ssrcGroups;

source/agent/webrtc/wrtcConnection.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ class WrtcStream extends EventEmitter {
8080
this.audioFramePacketizer = new AudioFramePacketizer(audio.mid, audio.midExtId);
8181
this.audioFramePacketizer.bindTransport(wrtc.getMediaStream(id));
8282
if (this.owner) {
83-
log.warn('set owner!!!', this.owner);
8483
this.audioFramePacketizer.setOwner(this.owner);
8584
}
8685
}
@@ -276,6 +275,9 @@ module.exports = function (spec, on_status, on_track) {
276275
op.enabled = false;
277276
destroyTransport(mid);
278277
ret = true;
278+
if (localSdp) {
279+
localSdp.closeMedia(mid);
280+
}
279281
}
280282
});
281283
if (msidMap.has(operationId)) {
@@ -442,6 +444,7 @@ module.exports = function (spec, on_status, on_track) {
442444
if (!operationMap.has(mid)) {
443445
log.warn(`MID ${mid} in offer has no mapped operations (disabled)`);
444446
remoteSdp.closeMedia(mid);
447+
localSdp.closeMedia(mid);
445448
return;
446449
}
447450
if (operationMap.get(mid).sdpDirection !== remoteSdp.mediaDirection(mid)) {
@@ -498,7 +501,6 @@ module.exports = function (spec, on_status, on_track) {
498501
} else {
499502
// Later offer
500503
const laterSdp = new SdpInfo(sdp);
501-
const changedMids = laterSdp.compareMedia(remoteSdp);
502504
const addedMids = [];
503505
const removedMids = [];
504506

@@ -539,7 +541,10 @@ module.exports = function (spec, on_status, on_track) {
539541
// Should already be destroyed by 'removeTrackOperation'
540542
// destroyTransport(mid);
541543
}
542-
localSdp.setBundleMids(remoteSdp.bundleMids());
544+
remoteSdp.filterMedia(laterSdp.mids());
545+
localSdp.filterMedia(laterSdp.mids());
546+
remoteSdp.setBundleMids(laterSdp.bundleMids());
547+
localSdp.setBundleMids(laterSdp.bundleMids());
543548
// Produce answer
544549
const message = localSdp.toString();
545550
log.debug('Answer SDP', message);

source/portal/versions/portalDataAdapter.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ const AdatperV1_1 = {
9595
mid: subReq.media.tracks.length.toString(),
9696
from: data.media.video.from,
9797
parameters: data.media.video.parameters,
98+
simulcastRid: data.media.video.simulcastRid,
9899
});
99100
}
100101
return subReq;

third_party/ThirdpartyLicenses.txt

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2994,4 +2994,35 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29942994
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29952995

29962996

2997+
Chromium License
2998+
-----------------------
2999+
3000+
============================
3001+
3002+
Copyright 2015 The Chromium Authors. All rights reserved.
3003+
3004+
Redistribution and use in source and binary forms, with or without
3005+
modification, are permitted provided that the following conditions are
3006+
met:
29973007

3008+
* Redistributions of source code must retain the above copyright
3009+
notice, this list of conditions and the following disclaimer.
3010+
* Redistributions in binary form must reproduce the above
3011+
copyright notice, this list of conditions and the following disclaimer
3012+
in the documentation and/or other materials provided with the
3013+
distribution.
3014+
* Neither the name of Google Inc. nor the names of its
3015+
contributors may be used to endorse or promote products derived from
3016+
this software without specific prior written permission.
3017+
3018+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
3019+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
3020+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
3021+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
3022+
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
3023+
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
3024+
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
3025+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
3026+
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
3027+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
3028+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

0 commit comments

Comments
 (0)