Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
M
mediasoup
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
聂卓夫
mediasoup
Commits
98771164
提交
98771164
authored
6月 24, 2020
作者:
Iñaki Baz Castillo
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
cosmetic
上级
ab6bd7f1
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
30 行增加
和
0 行删除
+30
-0
Producer.cpp
worker/src/RTC/Producer.cpp
+20
-0
Transport.cpp
worker/src/RTC/Transport.cpp
+10
-0
没有找到文件。
worker/src/RTC/Producer.cpp
浏览文件 @
98771164
...
...
@@ -27,18 +27,24 @@ namespace RTC
auto
jsonKindIt
=
data
.
find
(
"kind"
);
if
(
jsonKindIt
==
data
.
end
()
||
!
jsonKindIt
->
is_string
())
{
MS_THROW_TYPE_ERROR
(
"missing kind"
);
}
// This may throw.
this
->
kind
=
RTC
::
Media
::
GetKind
(
jsonKindIt
->
get
<
std
::
string
>
());
if
(
this
->
kind
==
RTC
::
Media
::
Kind
::
ALL
)
{
MS_THROW_TYPE_ERROR
(
"invalid empty kind"
);
}
auto
jsonRtpParametersIt
=
data
.
find
(
"rtpParameters"
);
if
(
jsonRtpParametersIt
==
data
.
end
()
||
!
jsonRtpParametersIt
->
is_object
())
{
MS_THROW_TYPE_ERROR
(
"missing rtpParameters"
);
}
// This may throw.
this
->
rtpParameters
=
RTC
::
RtpParameters
(
*
jsonRtpParametersIt
);
...
...
@@ -65,17 +71,23 @@ namespace RTC
auto
jsonRtpMappingIt
=
data
.
find
(
"rtpMapping"
);
if
(
jsonRtpMappingIt
==
data
.
end
()
||
!
jsonRtpMappingIt
->
is_object
())
{
MS_THROW_TYPE_ERROR
(
"missing rtpMapping"
);
}
auto
jsonCodecsIt
=
jsonRtpMappingIt
->
find
(
"codecs"
);
if
(
jsonCodecsIt
==
jsonRtpMappingIt
->
end
()
||
!
jsonCodecsIt
->
is_array
())
{
MS_THROW_TYPE_ERROR
(
"missing rtpMapping.codecs"
);
}
for
(
auto
&
codec
:
*
jsonCodecsIt
)
{
if
(
!
codec
.
is_object
())
{
MS_THROW_TYPE_ERROR
(
"wrong entry in rtpMapping.codecs (not an object)"
);
}
auto
jsonPayloadTypeIt
=
codec
.
find
(
"payloadType"
);
...
...
@@ -117,7 +129,9 @@ namespace RTC
for
(
auto
&
encoding
:
*
jsonEncodingsIt
)
{
if
(
!
encoding
.
is_object
())
{
MS_THROW_TYPE_ERROR
(
"wrong entry in rtpMapping.encodings"
);
}
this
->
rtpMapping
.
encodings
.
emplace_back
();
...
...
@@ -140,7 +154,9 @@ namespace RTC
auto
jsonRidIt
=
encoding
.
find
(
"rid"
);
if
(
jsonRidIt
!=
encoding
.
end
()
&&
jsonRidIt
->
is_string
())
{
encodingMapping
.
rid
=
jsonRidIt
->
get
<
std
::
string
>
();
}
// However ssrc or rid must be present (if more than 1 encoding).
// clang-format off
...
...
@@ -187,7 +203,9 @@ namespace RTC
auto
jsonPausedIt
=
data
.
find
(
"paused"
);
if
(
jsonPausedIt
!=
data
.
end
()
&&
jsonPausedIt
->
is_boolean
())
{
this
->
paused
=
jsonPausedIt
->
get
<
bool
>
();
}
// The number of encodings in rtpParameters must match the number of encodings
// in rtpMapping.
...
...
@@ -201,7 +219,9 @@ namespace RTC
for
(
auto
&
exten
:
this
->
rtpParameters
.
headerExtensions
)
{
if
(
exten
.
id
==
0u
)
{
MS_THROW_TYPE_ERROR
(
"RTP extension id cannot be 0"
);
}
if
(
this
->
rtpHeaderExtensionIds
.
mid
==
0u
&&
exten
.
type
==
RTC
::
RtpHeaderExtensionUri
::
Type
::
MID
)
{
...
...
worker/src/RTC/Transport.cpp
浏览文件 @
98771164
...
...
@@ -632,20 +632,30 @@ namespace RTC
const
auto
&
producerRtpHeaderExtensionIds
=
producer
->
GetRtpHeaderExtensionIds
();
if
(
producerRtpHeaderExtensionIds
.
mid
!=
0u
)
{
this
->
recvRtpHeaderExtensionIds
.
mid
=
producerRtpHeaderExtensionIds
.
mid
;
}
if
(
producerRtpHeaderExtensionIds
.
rid
!=
0u
)
{
this
->
recvRtpHeaderExtensionIds
.
rid
=
producerRtpHeaderExtensionIds
.
rid
;
}
if
(
producerRtpHeaderExtensionIds
.
rrid
!=
0u
)
{
this
->
recvRtpHeaderExtensionIds
.
rrid
=
producerRtpHeaderExtensionIds
.
rrid
;
}
if
(
producerRtpHeaderExtensionIds
.
absSendTime
!=
0u
)
{
this
->
recvRtpHeaderExtensionIds
.
absSendTime
=
producerRtpHeaderExtensionIds
.
absSendTime
;
}
if
(
producerRtpHeaderExtensionIds
.
transportWideCc01
!=
0u
)
{
this
->
recvRtpHeaderExtensionIds
.
transportWideCc01
=
producerRtpHeaderExtensionIds
.
transportWideCc01
;
}
// Create status response.
json
data
=
json
::
object
();
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论