Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
M
mediasoup
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
聂卓夫
mediasoup
Commits
5af3da9b
提交
5af3da9b
authored
4月 28, 2019
作者:
Iñaki Baz Castillo
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Producer: allow unset encodings
上级
7a7b9bbb
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
16 行增加
和
12 行删除
+16
-12
Transport.js
lib/Transport.js
+4
-0
test-Producer.js
test/test-Producer.js
+4
-5
Producer.cpp
worker/src/RTC/Producer.cpp
+8
-7
没有找到文件。
lib/Transport.js
浏览文件 @
5af3da9b
...
...
@@ -285,6 +285,10 @@ class Transport extends EnhancedEventEmitter
else
if
(
appData
&&
typeof
appData
!==
'object'
)
throw
new
TypeError
(
'if given, appData must be an object'
);
// If missing encodings, add one.
if
(
!
rtpParameters
.
encodings
||
!
Array
.
isArray
(
rtpParameters
.
encodings
))
rtpParameters
.
encodings
=
[
{}
];
// Don't do this in PipeTransports since there we must keep CNAME value in
// each Producer.
if
(
this
.
constructor
.
name
!==
'PipeTransport'
)
...
...
test/test-Producer.js
浏览文件 @
5af3da9b
...
...
@@ -99,9 +99,8 @@ test('webRtcTransport.produce() succeeds', async () =>
id
:
12
}
],
// Single encoding without ssrc and rid on purpose.
encodings
:
[
{
dtx
:
true
}
],
rtcp
:
// Missing encodings on purpose.
rtcp
:
{
cname
:
'audio-1'
}
...
...
@@ -483,7 +482,7 @@ test('transport.produce() with no MID and with single encoding without RID or SS
channels
:
2
}
],
encodings
:
[
{
dtx
:
true
}
],
encodings
:
[
{}
],
rtcp
:
{
cname
:
'audio-2'
...
...
@@ -539,7 +538,7 @@ test('producer.dump() succeeds', async () =>
expect
(
data
.
rtpParameters
.
encodings
.
length
).
toBe
(
1
);
expect
(
data
.
rtpParameters
.
encodings
).
toEqual
(
[
{
codecPayloadType
:
111
,
dtx
:
true
}
{
codecPayloadType
:
111
}
]);
expect
(
data
.
type
).
toBe
(
'simple'
);
...
...
worker/src/RTC/Producer.cpp
浏览文件 @
5af3da9b
...
...
@@ -656,7 +656,7 @@ namespace RTC
auto
*
rtpStream
=
it
->
second
;
// Ensure no RTX
SSRC
was previously detected.
// Ensure no RTX
ssrc
was previously detected.
if
(
rtpStream
->
HasRtx
())
{
MS_DEBUG_2TAGS
(
rtp
,
rtx
,
"ignoring RTX packet with new ssrc (ssrc lookup)"
);
...
...
@@ -667,7 +667,7 @@ namespace RTC
// Update the stream RTX data.
rtpStream
->
SetRtx
(
payloadType
,
ssrc
);
// Insert the new RTX
SSRC
into the map.
// Insert the new RTX
ssrc
into the map.
this
->
mapRtxSsrcRtpStream
[
ssrc
]
=
rtpStream
;
return
rtpStream
;
...
...
@@ -720,7 +720,7 @@ namespace RTC
if
(
rtpStream
->
GetRid
()
==
rid
)
{
// Ensure no RTX
SSRC
was previously detected.
// Ensure no RTX
ssrc
was previously detected.
if
(
rtpStream
->
HasRtx
())
{
MS_DEBUG_2TAGS
(
rtp
,
rtx
,
"ignoring RTX packet with new SSRC (RID lookup)"
);
...
...
@@ -731,7 +731,7 @@ namespace RTC
// Update the stream RTX data.
rtpStream
->
SetRtx
(
payloadType
,
ssrc
);
// Insert the new RTX
SSRC
into the map.
// Insert the new RTX
ssrc
into the map.
this
->
mapRtxSsrcRtpStream
[
ssrc
]
=
rtpStream
;
return
rtpStream
;
...
...
@@ -749,13 +749,14 @@ namespace RTC
return
nullptr
;
}
// If not found, and there is a single encoding
, this may be a media or RTX
//
stream and the single encoding does not signal nor SSRC nor RID
.
// If not found, and there is a single encoding
without ssrc and RID, this
//
may be the media or RTX stream
.
//
// clang-format off
if
(
this
->
rtpParameters
.
encodings
.
size
()
==
1
&&
this
->
mapSsrcRtpStream
.
size
()
<=
1
!
this
->
rtpParameters
.
encodings
[
0
].
ssrc
&&
this
->
rtpParameters
.
encodings
[
0
].
rid
.
empty
()
)
// clang-format on
{
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论