Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
M
mediasoup
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
聂卓夫
mediasoup
Commits
3cd729da
提交
3cd729da
authored
7月 12, 2016
作者:
Iñaki Baz Castillo
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
RtpSender: remove unsupported RTP parameters (according to the peer capabilities)
上级
e60f0ac8
显示空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
66 行增加
和
15 行删除
+66
-15
Room.cpp
worker/src/RTC/Room.cpp
+8
-3
RtpSender.cpp
worker/src/RTC/RtpSender.cpp
+58
-12
没有找到文件。
worker/src/RTC/Room.cpp
浏览文件 @
3cd729da
...
@@ -435,11 +435,16 @@ namespace RTC
...
@@ -435,11 +435,16 @@ namespace RTC
if
(
roomCodecCapability
.
Matches
(
peerCodecCapability
))
if
(
roomCodecCapability
.
Matches
(
peerCodecCapability
))
break
;
break
;
}
}
if
(
it2
==
this
->
capabilities
.
codecs
.
end
())
it
=
capabilities
->
codecs
.
erase
(
it
);
if
(
it2
!=
this
->
capabilities
.
codecs
.
end
())
else
{
it
++
;
it
++
;
}
}
else
{
it
=
capabilities
->
codecs
.
erase
(
it
);
}
}
// TODO: Remove unsupported header extensions.
// TODO: Remove unsupported header extensions.
...
...
worker/src/RTC/RtpSender.cpp
浏览文件 @
3cd729da
...
@@ -3,6 +3,7 @@
...
@@ -3,6 +3,7 @@
#include "RTC/RtpSender.h"
#include "RTC/RtpSender.h"
#include "MediaSoupError.h"
#include "MediaSoupError.h"
#include "Logger.h"
#include "Logger.h"
#include <unordered_set>
namespace
RTC
namespace
RTC
{
{
...
@@ -132,14 +133,63 @@ namespace RTC
...
@@ -132,14 +133,63 @@ namespace RTC
// Clone given RTP parameters so we manage our own sender parameters.
// Clone given RTP parameters so we manage our own sender parameters.
this
->
rtpParameters
=
new
RTC
::
RtpParameters
(
rtpParameters
);
this
->
rtpParameters
=
new
RTC
::
RtpParameters
(
rtpParameters
);
// Remove RTP parameters not supported by this pper.
std
::
unordered_set
<
uint8_t
>
supportedPayloadTypes
;
// Remove unsupported codecs.
for
(
auto
it
=
this
->
rtpParameters
->
codecs
.
begin
();
it
!=
this
->
rtpParameters
->
codecs
.
end
();)
{
auto
&
codec
=
*
it
;
auto
it2
=
this
->
peerCapabilities
->
codecs
.
begin
();
for
(;
it2
!=
this
->
peerCapabilities
->
codecs
.
end
();
++
it2
)
{
auto
&
codecCapability
=
*
it2
;
if
(
codecCapability
.
Matches
(
codec
))
break
;
}
if
(
it2
!=
this
->
peerCapabilities
->
codecs
.
end
())
{
supportedPayloadTypes
.
insert
(
codec
.
payloadType
);
it
++
;
}
else
{
it
=
this
->
rtpParameters
->
codecs
.
erase
(
it
);
}
}
// Remove unsupported encodings.
for
(
auto
it
=
this
->
rtpParameters
->
encodings
.
begin
();
it
!=
this
->
rtpParameters
->
encodings
.
end
();)
{
auto
&
encoding
=
*
it
;
if
(
supportedPayloadTypes
.
find
(
encoding
.
codecPayloadType
)
!=
supportedPayloadTypes
.
end
())
{
it
++
;
}
else
{
it
=
this
->
rtpParameters
->
encodings
.
erase
(
it
);
}
}
// TODO: Remove unsupported header extensions.
// Build the payload types map.
// Build the payload types map.
SetPayloadTypesMapping
();
SetPayloadTypesMapping
();
// TODO: Must check new parameters and:
// TODO: Must check with PTs and encodings are supported so RTP packets
// - remove unsuported capabilities,
// handling is easy.
// - set this->available if at least there is a capable encoding.
// For now make it easy:
// If there are no encodings set not available.
if
(
this
->
rtpParameters
->
encodings
.
size
()
>
0
)
this
->
available
=
true
;
this
->
available
=
true
;
else
this
->
available
=
false
;
// Emit "parameterschange" if those are new parameters.
// Emit "parameterschange" if those are new parameters.
if
(
previousRtpParameters
)
if
(
previousRtpParameters
)
...
@@ -227,14 +277,10 @@ namespace RTC
...
@@ -227,14 +277,10 @@ namespace RTC
break
;
break
;
}
}
}
}
if
(
it
==
this
->
peerCapabilities
->
codecs
.
end
())
{
// This should not happen.
// TODO: Let's see. Theoretically unsupported codecs has been
MS_ASSERT
(
it
!=
this
->
peerCapabilities
->
codecs
.
end
(),
// already removed in Send(), but it's not done yet.
"no matching room codec found [payloadType:%"
PRIu8
"]"
,
codec
.
payloadType
);
// Once done, this should be a MS_THROW.
MS_ERROR
(
"no matching room codec found [payloadType:%"
PRIu8
"]"
,
codec
.
payloadType
);
}
}
}
}
}
}
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论