Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
M
mediasoup
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
聂卓夫
mediasoup
Commits
4ace9202
提交
4ace9202
authored
3月 05, 2020
作者:
Iñaki Baz Castillo
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
RtpProbationGenerator: fix memory corruption issue
上级
e2e6f14e
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
20 行增加
和
15 行删除
+20
-15
RtpPacket.hpp
worker/include/RTC/RtpPacket.hpp
+11
-11
RtpProbationGenerator.cpp
worker/src/RTC/RtpProbationGenerator.cpp
+9
-4
没有找到文件。
worker/include/RTC/RtpPacket.hpp
浏览文件 @
4ace9202
...
@@ -165,8 +165,8 @@ namespace RTC
...
@@ -165,8 +165,8 @@ namespace RTC
bool
UpdateMid
(
const
std
::
string
&
mid
);
bool
UpdateMid
(
const
std
::
string
&
mid
);
bool
ReadRid
(
std
::
string
&
rid
)
const
;
bool
ReadRid
(
std
::
string
&
rid
)
const
;
bool
ReadAbsSendTime
(
uint32_t
&
absSendtime
)
const
;
bool
ReadAbsSendTime
(
uint32_t
&
absSendtime
)
const
;
bool
ReadTransportWideCc01
(
uint16_t
&
wideSeqNumber
)
const
;
bool
UpdateAbsSendTime
(
uint64_t
ms
);
bool
UpdateAbsSendTime
(
uint64_t
ms
);
bool
ReadTransportWideCc01
(
uint16_t
&
wideSeqNumber
)
const
;
bool
UpdateTransportWideCc01
(
uint16_t
wideSeqNumber
);
bool
UpdateTransportWideCc01
(
uint16_t
wideSeqNumber
);
bool
ReadFrameMarking
(
RtpPacket
::
FrameMarking
**
frameMarking
,
uint8_t
&
length
)
const
;
bool
ReadFrameMarking
(
RtpPacket
::
FrameMarking
**
frameMarking
,
uint8_t
&
length
)
const
;
bool
ReadSsrcAudioLevel
(
uint8_t
&
volume
,
bool
&
voice
)
const
;
bool
ReadSsrcAudioLevel
(
uint8_t
&
volume
,
bool
&
voice
)
const
;
...
@@ -438,30 +438,30 @@ namespace RTC
...
@@ -438,30 +438,30 @@ namespace RTC
return
true
;
return
true
;
}
}
inline
bool
RtpPacket
::
ReadTransportWideCc01
(
uint16_t
&
wideSeqNumber
)
const
inline
bool
RtpPacket
::
UpdateAbsSendTime
(
uint64_t
ms
)
{
{
uint8_t
extenLen
;
uint8_t
extenLen
;
uint8_t
*
extenValue
=
GetExtension
(
this
->
transportWideCc01
ExtensionId
,
extenLen
);
uint8_t
*
extenValue
=
GetExtension
(
this
->
absSendTime
ExtensionId
,
extenLen
);
if
(
!
extenValue
||
extenLen
!=
2
u
)
if
(
!
extenValue
||
extenLen
!=
3
u
)
return
false
;
return
false
;
wideSeqNumber
=
Utils
::
Byte
::
Get2Bytes
(
extenValue
,
0
);
auto
absSendTime
=
Utils
::
Time
::
TimeMsToAbsSendTime
(
ms
);
Utils
::
Byte
::
Set3Bytes
(
extenValue
,
0
,
absSendTime
);
return
true
;
return
true
;
}
}
inline
bool
RtpPacket
::
UpdateAbsSendTime
(
uint64_t
ms
)
inline
bool
RtpPacket
::
ReadTransportWideCc01
(
uint16_t
&
wideSeqNumber
)
const
{
{
uint8_t
extenLen
;
uint8_t
extenLen
;
uint8_t
*
extenValue
=
GetExtension
(
this
->
absSendTime
ExtensionId
,
extenLen
);
uint8_t
*
extenValue
=
GetExtension
(
this
->
transportWideCc01
ExtensionId
,
extenLen
);
if
(
!
extenValue
||
extenLen
!=
3
u
)
if
(
!
extenValue
||
extenLen
!=
2
u
)
return
false
;
return
false
;
auto
absSendTime
=
Utils
::
Time
::
TimeMsToAbsSendTime
(
ms
);
wideSeqNumber
=
Utils
::
Byte
::
Get2Bytes
(
extenValue
,
0
);
Utils
::
Byte
::
Set3Bytes
(
extenValue
,
0
,
absSendTime
);
return
true
;
return
true
;
}
}
...
...
worker/src/RTC/RtpProbationGenerator.cpp
浏览文件 @
4ace9202
...
@@ -15,19 +15,24 @@ namespace RTC
...
@@ -15,19 +15,24 @@ namespace RTC
// clang-format off
// clang-format off
// Probation RTP header.
// Probation RTP header.
// Caution: This must have an exact size for the RTP extensions to be added
// and must align extensions to 4 bytes.
static
uint8_t
ProbationPacketHeader
[]
=
static
uint8_t
ProbationPacketHeader
[]
=
{
{
0
b10010000
,
0
b01111111
,
0
,
0
,
// PayloadType: 127, Sequence Number: 0
0
b10010000
,
0
b01111111
,
0
,
0
,
// PayloadType: 127, Sequence Number: 0
0
,
0
,
0
,
0
,
// Timestamp: 0
0
,
0
,
0
,
0
,
// Timestamp: 0
0
,
0
,
0
,
0
,
// SSRC: 0
0
,
0
,
0
,
0
,
// SSRC: 0
0xBE
,
0xDE
,
0
,
2
,
// Header Extension (One-Byte Extensions)
0xBE
,
0xDE
,
0
,
4
,
// Header Extension (One-Byte Extensions)
0
,
0
,
0
,
0
,
// Space for abs-send-time extension.
0
,
0
,
0
,
0
,
// Space for MID extension
0
,
0
,
0
,
0
// Space for transport-wide-cc-01 extension.
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
// Space for abs-send-time extension
0
,
0
,
0
// Space for transport-wide-cc-01 extension
};
};
// clang-format on
// clang-format on
static
constexpr
size_t
MaxProbationPacketSize
{
1400u
};
static
constexpr
size_t
MaxProbationPacketSize
{
1400u
};
static
const
std
::
string
MidValue
{
"probator"
};
static
const
std
::
string
MidValue
{
"probator"
};
// 8 bytes, same as RTC::MidMaxLength.
/* Instance methods. */
/* Instance methods. */
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论