Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
M
mediasoup
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
聂卓夫
mediasoup
Commits
19e013e1
提交
19e013e1
authored
10月 19, 2017
作者:
Iñaki Baz Castillo
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
worker: Pause status check timers in RtpStream when its Consumer is paused
上级
97c7f8b7
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
44 行增加
和
11 行删除
+44
-11
RtpStream.hpp
worker/include/RTC/RtpStream.hpp
+2
-1
Timer.hpp
worker/include/handles/Timer.hpp
+4
-0
Consumer.cpp
worker/src/RTC/Consumer.cpp
+11
-4
RtpStream.cpp
worker/src/RTC/RtpStream.cpp
+7
-2
Timer.cpp
worker/src/handles/Timer.cpp
+20
-4
没有找到文件。
worker/include/RTC/RtpStream.hpp
浏览文件 @
19e013e1
...
@@ -37,7 +37,8 @@ namespace RTC
...
@@ -37,7 +37,8 @@ namespace RTC
uint8_t
GetPayloadType
()
const
;
uint8_t
GetPayloadType
()
const
;
const
RTC
::
RtpCodecMimeType
&
GetMimeType
()
const
;
const
RTC
::
RtpCodecMimeType
&
GetMimeType
()
const
;
float
GetLossPercentage
()
const
;
float
GetLossPercentage
()
const
;
void
ResetStatusCheckTimer
();
void
RestartStatusCheckTimer
();
void
StopStatusCheckTimer
();
protected
:
protected
:
bool
UpdateSeq
(
RTC
::
RtpPacket
*
packet
);
bool
UpdateSeq
(
RTC
::
RtpPacket
*
packet
);
...
...
worker/include/handles/Timer.hpp
浏览文件 @
19e013e1
...
@@ -29,6 +29,7 @@ public:
...
@@ -29,6 +29,7 @@ public:
void
Start
(
uint64_t
timeout
,
uint64_t
repeat
=
0
);
void
Start
(
uint64_t
timeout
,
uint64_t
repeat
=
0
);
void
Stop
();
void
Stop
();
void
Reset
();
void
Reset
();
void
Restart
();
bool
IsActive
()
const
;
bool
IsActive
()
const
;
/* Callbacks fired by UV events. */
/* Callbacks fired by UV events. */
...
@@ -40,6 +41,9 @@ private:
...
@@ -40,6 +41,9 @@ private:
Listener
*
listener
{
nullptr
};
Listener
*
listener
{
nullptr
};
// Allocated by this.
// Allocated by this.
uv_timer_t
*
uvHandle
{
nullptr
};
uv_timer_t
*
uvHandle
{
nullptr
};
// Others.
uint64_t
timeout
{
0
};
uint64_t
repeat
{
0
};
};
};
/* Inline methods. */
/* Inline methods. */
...
...
worker/src/RTC/Consumer.cpp
浏览文件 @
19e013e1
...
@@ -164,6 +164,7 @@ namespace RTC
...
@@ -164,6 +164,7 @@ namespace RTC
if
(
IsEnabled
()
&&
!
this
->
sourcePaused
)
if
(
IsEnabled
()
&&
!
this
->
sourcePaused
)
{
{
this
->
rtpStream
->
StopStatusCheckTimer
();
this
->
rtpStream
->
ClearRetransmissionBuffer
();
this
->
rtpStream
->
ClearRetransmissionBuffer
();
this
->
rtpPacketsBeforeProbation
=
RtpPacketsBeforeProbation
;
this
->
rtpPacketsBeforeProbation
=
RtpPacketsBeforeProbation
;
...
@@ -188,6 +189,8 @@ namespace RTC
...
@@ -188,6 +189,8 @@ namespace RTC
if
(
IsEnabled
()
&&
!
this
->
sourcePaused
)
if
(
IsEnabled
()
&&
!
this
->
sourcePaused
)
{
{
this
->
rtpStream
->
RestartStatusCheckTimer
();
// We need to sync and wait for a key frame. Otherwise the receiver will
// We need to sync and wait for a key frame. Otherwise the receiver will
// request lot of NACKs due to unknown RTP packets.
// request lot of NACKs due to unknown RTP packets.
this
->
syncRequired
=
true
;
this
->
syncRequired
=
true
;
...
@@ -211,6 +214,7 @@ namespace RTC
...
@@ -211,6 +214,7 @@ namespace RTC
if
(
IsEnabled
()
&&
!
this
->
paused
)
if
(
IsEnabled
()
&&
!
this
->
paused
)
{
{
this
->
rtpStream
->
StopStatusCheckTimer
();
this
->
rtpStream
->
ClearRetransmissionBuffer
();
this
->
rtpStream
->
ClearRetransmissionBuffer
();
this
->
rtpPacketsBeforeProbation
=
RtpPacketsBeforeProbation
;
this
->
rtpPacketsBeforeProbation
=
RtpPacketsBeforeProbation
;
...
@@ -237,6 +241,8 @@ namespace RTC
...
@@ -237,6 +241,8 @@ namespace RTC
if
(
IsEnabled
()
&&
!
this
->
paused
)
if
(
IsEnabled
()
&&
!
this
->
paused
)
{
{
this
->
rtpStream
->
RestartStatusCheckTimer
();
// We need to sync. However we don't need to request a key frame since the source
// We need to sync. However we don't need to request a key frame since the source
// (Producer) already requested it.
// (Producer) already requested it.
this
->
syncRequired
=
true
;
this
->
syncRequired
=
true
;
...
@@ -306,8 +312,9 @@ namespace RTC
...
@@ -306,8 +312,9 @@ namespace RTC
this
->
isProbing
=
false
;
this
->
isProbing
=
false
;
this
->
probingProfile
=
RtpEncodingParameters
::
Profile
::
NONE
;
this
->
probingProfile
=
RtpEncodingParameters
::
Profile
::
NONE
;
// Reset the health check timer so this probation doesn't affect the effective profile.
// Restart the health check timer so this probation doesn't affect the effective
this
->
rtpStream
->
ResetStatusCheckTimer
();
// profile.
this
->
rtpStream
->
RestartStatusCheckTimer
();
return
;
return
;
}
}
...
@@ -795,7 +802,7 @@ namespace RTC
...
@@ -795,7 +802,7 @@ namespace RTC
RequestKeyFrame
();
RequestKeyFrame
();
// We want to be notified about this new profile's health.
// We want to be notified about this new profile's health.
this
->
rtpStream
->
Res
e
tStatusCheckTimer
();
this
->
rtpStream
->
Res
tar
tStatusCheckTimer
();
MS_DEBUG_TAG
(
MS_DEBUG_TAG
(
rtp
,
rtp
,
...
@@ -1017,7 +1024,7 @@ namespace RTC
...
@@ -1017,7 +1024,7 @@ namespace RTC
{
{
this
->
isProbing
=
true
;
this
->
isProbing
=
true
;
this
->
probingProfile
=
newTargetProfile
;
this
->
probingProfile
=
newTargetProfile
;
this
->
rtpStream
->
Res
e
tStatusCheckTimer
();
this
->
rtpStream
->
Res
tar
tStatusCheckTimer
();
MS_DEBUG_TAG
(
MS_DEBUG_TAG
(
rtp
,
rtp
,
...
...
worker/src/RTC/RtpStream.cpp
浏览文件 @
19e013e1
...
@@ -146,11 +146,16 @@ namespace RTC
...
@@ -146,11 +146,16 @@ namespace RTC
return
this
->
transmissionCounter
.
GetRate
(
now
);
return
this
->
transmissionCounter
.
GetRate
(
now
);
}
}
void
RtpStream
::
Res
e
tStatusCheckTimer
()
void
RtpStream
::
Res
tar
tStatusCheckTimer
()
{
{
// Notify about status on next check.
// Notify about status on next check.
this
->
notifyStatus
=
true
;
this
->
notifyStatus
=
true
;
this
->
statusCheckTimer
->
Reset
();
this
->
statusCheckTimer
->
Restart
();
}
void
RtpStream
::
StopStatusCheckTimer
()
{
this
->
statusCheckTimer
->
Stop
();
}
}
void
RtpStream
::
InitSeq
(
uint16_t
seq
)
void
RtpStream
::
InitSeq
(
uint16_t
seq
)
...
...
worker/src/handles/Timer.cpp
浏览文件 @
19e013e1
...
@@ -53,6 +53,9 @@ void Timer::Start(uint64_t timeout, uint64_t repeat)
...
@@ -53,6 +53,9 @@ void Timer::Start(uint64_t timeout, uint64_t repeat)
{
{
MS_TRACE
();
MS_TRACE
();
this
->
timeout
=
timeout
;
this
->
repeat
=
repeat
;
int
err
;
int
err
;
if
(
uv_is_active
(
reinterpret_cast
<
uv_handle_t
*>
(
this
->
uvHandle
))
!=
0
)
if
(
uv_is_active
(
reinterpret_cast
<
uv_handle_t
*>
(
this
->
uvHandle
))
!=
0
)
...
@@ -83,12 +86,25 @@ void Timer::Reset()
...
@@ -83,12 +86,25 @@ void Timer::Reset()
if
(
uv_is_active
(
reinterpret_cast
<
uv_handle_t
*>
(
this
->
uvHandle
))
==
0
)
if
(
uv_is_active
(
reinterpret_cast
<
uv_handle_t
*>
(
this
->
uvHandle
))
==
0
)
return
;
return
;
auto
repeat
=
uv_timer_get_repeat
(
this
->
uvHandle
);
if
(
this
->
repeat
==
0u
)
if
(
repeat
==
0u
)
return
;
return
;
err
=
uv_timer_start
(
this
->
uvHandle
,
static_cast
<
uv_timer_cb
>
(
onTimer
),
repeat
,
repeat
);
err
=
uv_timer_start
(
this
->
uvHandle
,
static_cast
<
uv_timer_cb
>
(
onTimer
),
this
->
repeat
,
this
->
repeat
);
if
(
err
!=
0
)
MS_THROW_ERROR
(
"uv_timer_start() failed: %s"
,
uv_strerror
(
err
));
}
void
Timer
::
Restart
()
{
MS_TRACE
();
int
err
;
if
(
uv_is_active
(
reinterpret_cast
<
uv_handle_t
*>
(
this
->
uvHandle
))
!=
0
)
Stop
();
err
=
uv_timer_start
(
this
->
uvHandle
,
static_cast
<
uv_timer_cb
>
(
onTimer
),
this
->
timeout
,
this
->
repeat
);
if
(
err
!=
0
)
if
(
err
!=
0
)
MS_THROW_ERROR
(
"uv_timer_start() failed: %s"
,
uv_strerror
(
err
));
MS_THROW_ERROR
(
"uv_timer_start() failed: %s"
,
uv_strerror
(
err
));
}
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论