Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
M
mediasoup
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
聂卓夫
mediasoup
Commits
b9a26d80
提交
b9a26d80
authored
9月 14, 2017
作者:
Iñaki Baz Castillo
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
NackGenerator: upon key frame receipt remove older items in the NACK list.
上级
0fdd6356
隐藏空白字符变更
内嵌
并排
正在显示
11 个修改的文件
包含
50 行增加
和
17 行删除
+50
-17
Codecs.hpp
worker/include/RTC/Codecs/Codecs.hpp
+1
-1
VP8.hpp
worker/include/RTC/Codecs/VP8.hpp
+1
-1
ConsumerListener.hpp
worker/include/RTC/ConsumerListener.hpp
+1
-1
NackGenerator.hpp
worker/include/RTC/NackGenerator.hpp
+2
-1
RtpPacket.hpp
worker/include/RTC/RtpPacket.hpp
+2
-2
RtpStream.hpp
worker/include/RTC/RtpStream.hpp
+6
-0
Codecs.cpp
worker/src/RTC/Codecs/Codecs.cpp
+1
-2
Consumer.cpp
worker/src/RTC/Consumer.cpp
+5
-5
NackGenerator.cpp
worker/src/RTC/NackGenerator.cpp
+22
-0
Producer.cpp
worker/src/RTC/Producer.cpp
+8
-3
Transport.cpp
worker/src/RTC/Transport.cpp
+1
-1
没有找到文件。
worker/include/RTC/Codecs/Codecs.hpp
浏览文件 @
b9a26d80
...
...
@@ -3,8 +3,8 @@
#include "common.hpp"
#include "RTC/Codecs/VP8.hpp"
#include "RTC/RtpPacket.hpp"
#include "RTC/RtpDictionaries.hpp"
#include "RTC/RtpPacket.hpp"
namespace
RTC
{
...
...
worker/include/RTC/Codecs/VP8.hpp
浏览文件 @
b9a26d80
...
...
@@ -2,8 +2,8 @@
#define MS_RTC_CODECS_VP8_HPP
#include "common.hpp"
#include "RTC/RtpPacket.hpp"
#include "RTC/RtpDictionaries.hpp"
#include "RTC/RtpPacket.hpp"
namespace
RTC
{
...
...
worker/include/RTC/ConsumerListener.hpp
浏览文件 @
b9a26d80
...
...
@@ -12,7 +12,7 @@ namespace RTC
class
ConsumerListener
{
public
:
virtual
void
OnConsumerClosed
(
RTC
::
Consumer
*
consumer
)
=
0
;
virtual
void
OnConsumerClosed
(
RTC
::
Consumer
*
consumer
)
=
0
;
virtual
void
OnConsumerKeyFrameRequired
(
RTC
::
Consumer
*
consumer
)
=
0
;
};
}
// namespace RTC
...
...
worker/include/RTC/NackGenerator.hpp
浏览文件 @
b9a26d80
...
...
@@ -16,7 +16,7 @@ namespace RTC
{
public
:
virtual
void
OnNackGeneratorNackRequired
(
const
std
::
vector
<
uint16_t
>&
seqNumbers
)
=
0
;
virtual
void
OnNackGeneratorKeyFrameRequired
()
=
0
;
virtual
void
OnNackGeneratorKeyFrameRequired
()
=
0
;
};
private
:
...
...
@@ -45,6 +45,7 @@ namespace RTC
private
:
void
AddPacketsToNackList
(
uint32_t
seq32Start
,
uint32_t
seq32End
);
void
RemoveFromNackListOlderThan
(
uint32_t
seq32
);
std
::
vector
<
uint16_t
>
GetNackBatch
(
NackFilter
filter
);
void
MayRunTimer
()
const
;
...
...
worker/include/RTC/RtpPacket.hpp
浏览文件 @
b9a26d80
...
...
@@ -138,8 +138,8 @@ namespace RTC
uint8_t
*
payload
{
nullptr
};
size_t
payloadLength
{
0
};
uint8_t
payloadPadding
{
0
};
size_t
size
{
0
};
// Full size of the packet in bytes.
uint32_t
seq32
{
0
};
// Extended seq number.
size_t
size
{
0
};
// Full size of the packet in bytes.
uint32_t
seq32
{
0
};
// Extended seq number.
bool
isKeyFrame
{
false
};
// Whether this packet contains a key frame.
};
...
...
worker/include/RTC/RtpStream.hpp
浏览文件 @
b9a26d80
...
...
@@ -38,6 +38,7 @@ namespace RTC
virtual
Json
::
Value
ToJson
()
=
0
;
virtual
bool
ReceivePacket
(
RTC
::
RtpPacket
*
packet
);
uint32_t
GetSsrc
();
uint8_t
GetPayloadType
();
const
RTC
::
RtpCodecMimeType
&
GetMimeType
()
const
;
bool
IsHealthy
();
...
...
@@ -83,6 +84,11 @@ namespace RTC
return
this
->
params
.
ssrc
;
}
inline
uint8_t
RtpStream
::
GetPayloadType
()
{
return
this
->
params
.
payloadType
;
}
inline
const
RTC
::
RtpCodecMimeType
&
RtpStream
::
GetMimeType
()
const
{
return
this
->
params
.
mime
;
...
...
worker/src/RTC/Codecs/Codecs.cpp
浏览文件 @
b9a26d80
...
...
@@ -22,8 +22,7 @@ namespace RTC
break
;
}
default
:
;
default
:
;
}
}
}
// namespace Codecs
...
...
worker/src/RTC/Consumer.cpp
浏览文件 @
b9a26d80
...
...
@@ -336,7 +336,7 @@ namespace RTC
// profile.
if
(
this
->
effectiveProfile
!=
this
->
targetProfile
&&
profile
==
this
->
targetProfile
)
{
bool
isKeyFrame
=
false
;
bool
isKeyFrame
=
false
;
bool
canBeKeyFrame
=
Codecs
::
CanBeKeyFrame
(
this
->
rtpStream
->
GetMimeType
());
if
(
canBeKeyFrame
&&
packet
->
IsKeyFrame
())
...
...
@@ -688,9 +688,9 @@ namespace RTC
if
(
this
->
profiles
.
empty
())
{
MS_ASSERT
(
this
->
effectiveProfile
==
RtpEncodingParameters
::
Profile
::
NONE
||
this
->
effectiveProfile
==
RtpEncodingParameters
::
Profile
::
DEFAULT
,
"no profiles, but effective profile is not none nor default"
);
this
->
effectiveProfile
==
RtpEncodingParameters
::
Profile
::
NONE
||
this
->
effectiveProfile
==
RtpEncodingParameters
::
Profile
::
DEFAULT
,
"no profiles, but effective profile is not none nor default"
);
if
(
this
->
effectiveProfile
==
RtpEncodingParameters
::
Profile
::
NONE
)
newTargetProfile
=
RtpEncodingParameters
::
Profile
::
NONE
;
...
...
@@ -700,7 +700,7 @@ namespace RTC
// If there is no preferred profile, take the best one available.
else
if
(
this
->
preferredProfile
==
RTC
::
RtpEncodingParameters
::
Profile
::
DEFAULT
)
{
auto
it
=
this
->
profiles
.
crbegin
();
auto
it
=
this
->
profiles
.
crbegin
();
newTargetProfile
=
*
it
;
}
// Otherwise take the highest available profile equal or lower than the preferred.
...
...
worker/src/RTC/NackGenerator.cpp
浏览文件 @
b9a26d80
...
...
@@ -47,6 +47,10 @@ namespace RTC
return
;
}
// If a key frame remove all the items in the nack list older than this seq.
if
(
packet
->
IsKeyFrame
())
RemoveFromNackListOlderThan
(
seq32
);
// Obviously never nacked, so ignore.
if
(
seq32
==
this
->
lastSeq32
)
{
...
...
@@ -141,8 +145,26 @@ namespace RTC
}
}
void
NackGenerator
::
RemoveFromNackListOlderThan
(
uint32_t
seq32
)
{
MS_TRACE
();
// Delete all the entries in the NACK list whose key (seq32) is older than
// the given one.
MS_ERROR
(
"---- PRE, nackList.size:%zu"
,
this
->
nackList
.
size
());
auto
it
=
this
->
nackList
.
lower_bound
(
seq32
);
this
->
nackList
.
erase
(
this
->
nackList
.
begin
(),
it
);
MS_ERROR
(
"---- POST, nackList.size:%zu"
,
this
->
nackList
.
size
());
}
std
::
vector
<
uint16_t
>
NackGenerator
::
GetNackBatch
(
NackFilter
filter
)
{
MS_TRACE
();
uint64_t
now
=
DepLibUV
::
GetTime
();
std
::
vector
<
uint16_t
>
nackBatch
;
auto
it
=
this
->
nackList
.
begin
();
...
...
worker/src/RTC/Producer.cpp
浏览文件 @
b9a26d80
...
...
@@ -270,6 +270,10 @@ namespace RTC
{
rtpStream
=
this
->
rtpStreams
[
ssrc
];
// Process the packet at codec level.
if
(
packet
->
GetPayloadType
()
==
rtpStream
->
GetPayloadType
())
Codecs
::
ProcessRtpPacket
(
packet
,
rtpStream
->
GetMimeType
());
// Process the packet.
if
(
!
rtpStream
->
ReceivePacket
(
packet
))
return
;
...
...
@@ -278,6 +282,10 @@ namespace RTC
{
rtpStream
=
this
->
mapRtxStreams
[
ssrc
];
// Process the packet at codec level.
if
(
packet
->
GetPayloadType
()
==
rtpStream
->
GetPayloadType
())
Codecs
::
ProcessRtpPacket
(
packet
,
rtpStream
->
GetMimeType
());
// Process the packet.
if
(
!
rtpStream
->
ReceiveRtxPacket
(
packet
))
return
;
...
...
@@ -300,9 +308,6 @@ namespace RTC
return
;
}
// Process the packet at codec level.
Codecs
::
ProcessRtpPacket
(
packet
,
rtpStream
->
GetMimeType
());
if
(
packet
->
IsKeyFrame
())
{
MS_DEBUG_TAG
(
...
...
worker/src/RTC/Transport.cpp
浏览文件 @
b9a26d80
...
...
@@ -39,7 +39,7 @@ namespace RTC
{
/* Static. */
static
constexpr
uint64_t
EffectiveMaxBitrateCheckInterval
{
2000
};
// In ms.
static
constexpr
uint64_t
EffectiveMaxBitrateCheckInterval
{
2000
};
// In ms.
static
constexpr
double
EffectiveMaxBitrateThresholdBeforeKeyFrame
{
0.6
};
// 0.0 - 1.0.
/* Instance methods. */
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论