Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
M
mediasoup
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
聂卓夫
mediasoup
Commits
cbf71235
提交
cbf71235
authored
2月 12, 2017
作者:
Iñaki Baz Castillo
提交者:
José Luis Millán
2月 12, 2017
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Update the libuv's “now” periodically (Fixes #58)
上级
fe79296c
显示空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
34 行增加
和
12 行删除
+34
-12
DepLibUV.h
worker/include/DepLibUV.h
+2
-6
DepLibUV.cpp
worker/src/DepLibUV.cpp
+24
-0
RtpStreamSend.cpp
worker/src/RTC/RtpStreamSend.cpp
+8
-6
没有找到文件。
worker/include/DepLibUV.h
浏览文件 @
cbf71235
#ifndef MS_DEP_LIBUV_H
#ifndef MS_DEP_LIBUV_H
#define MS_DEP_LIBUV_H
#define MS_DEP_LIBUV_H
#include "common.h"
#include <uv.h>
#include <uv.h>
class
DepLibUV
class
DepLibUV
...
@@ -15,6 +16,7 @@ public:
...
@@ -15,6 +16,7 @@ public:
private
:
private
:
static
uv_loop_t
*
loop
;
static
uv_loop_t
*
loop
;
static
uint32_t
timeUpdateCounter
;
};
};
/* Inline static methods. */
/* Inline static methods. */
...
@@ -25,10 +27,4 @@ uv_loop_t* DepLibUV::GetLoop()
...
@@ -25,10 +27,4 @@ uv_loop_t* DepLibUV::GetLoop()
return
DepLibUV
::
loop
;
return
DepLibUV
::
loop
;
}
}
inline
uint64_t
DepLibUV
::
GetTime
()
{
return
uv_now
(
DepLibUV
::
loop
);
}
#endif
#endif
worker/src/DepLibUV.cpp
浏览文件 @
cbf71235
...
@@ -8,6 +8,8 @@
...
@@ -8,6 +8,8 @@
/* Static variables. */
/* Static variables. */
uv_loop_t
*
DepLibUV
::
loop
=
nullptr
;
uv_loop_t
*
DepLibUV
::
loop
=
nullptr
;
uint32_t
DepLibUV
::
timeUpdateCounter
=
0
;
static
uint64_t
LAST_NOW
=
0
;
/* Static methods. */
/* Static methods. */
...
@@ -21,6 +23,8 @@ void DepLibUV::ClassInit()
...
@@ -21,6 +23,8 @@ void DepLibUV::ClassInit()
err
=
uv_loop_init
(
DepLibUV
::
loop
);
err
=
uv_loop_init
(
DepLibUV
::
loop
);
if
(
err
)
if
(
err
)
MS_ABORT
(
"libuv initialization failed"
);
MS_ABORT
(
"libuv initialization failed"
);
LAST_NOW
=
uv_now
(
DepLibUV
::
loop
);
}
}
void
DepLibUV
::
ClassDestroy
()
void
DepLibUV
::
ClassDestroy
()
...
@@ -52,3 +56,23 @@ void DepLibUV::RunLoop()
...
@@ -52,3 +56,23 @@ void DepLibUV::RunLoop()
uv_run
(
DepLibUV
::
loop
,
UV_RUN_DEFAULT
);
uv_run
(
DepLibUV
::
loop
,
UV_RUN_DEFAULT
);
}
}
// TODO: Move to inline in the .h file.
uint64_t
DepLibUV
::
GetTime
()
{
static
uint32_t
maxTimeCounter
=
32768
;
// TODO: Remove.
if
(
DepLibUV
::
timeUpdateCounter
==
0
)
MS_DEBUG_DEV
(
"now - LAST_NOW: %"
PRIu64
"ms"
,
uv_now
(
DepLibUV
::
loop
)
-
LAST_NOW
);
// Update the libuv's concept of “now” every N usages.
if
(
++
DepLibUV
::
timeUpdateCounter
==
maxTimeCounter
)
{
LAST_NOW
=
uv_now
(
DepLibUV
::
loop
);
DepLibUV
::
timeUpdateCounter
=
0
;
uv_update_time
(
DepLibUV
::
loop
);
}
return
uv_now
(
DepLibUV
::
loop
);
}
worker/src/RTC/RtpStreamSend.cpp
浏览文件 @
cbf71235
...
@@ -106,7 +106,8 @@ namespace RTC
...
@@ -106,7 +106,8 @@ namespace RTC
// Otherwise just return.
// Otherwise just return.
else
else
{
{
MS_WARN_TAG
(
rtp
,
"requested packet range not in the buffer"
);
// TODO: REMOVE
// MS_WARN_TAG(rtp, "requested packet range not in the buffer");
return
;
return
;
}
}
...
@@ -160,7 +161,8 @@ namespace RTC
...
@@ -160,7 +161,8 @@ namespace RTC
}
}
else
if
(
!
too_old_packet_found
)
else
if
(
!
too_old_packet_found
)
{
{
MS_WARN_TAG
(
rtp
,
"ignoring retransmission for too old packet [max_age:%"
PRIu32
"ms, packet_age:%"
PRIu32
"ms]"
,
MAX_RETRANSMISSION_AGE
,
diff
);
// TODO: REMOVE
// MS_WARN_TAG(rtp, "ignoring retransmission for too old packet [max_age:%" PRIu32 "ms, packet_age:%" PRIu32 "ms]", MAX_RETRANSMISSION_AGE, diff);
too_old_packet_found
=
true
;
too_old_packet_found
=
true
;
}
}
...
@@ -194,10 +196,10 @@ namespace RTC
...
@@ -194,10 +196,10 @@ namespace RTC
UINT16_TO_BINARY
(
orig_bitmask
),
UINT16_TO_BINARY
(
sent_bitmask
));
UINT16_TO_BINARY
(
orig_bitmask
),
UINT16_TO_BINARY
(
sent_bitmask
));
}
}
// TODO: REMOVE
// TODO: REMOVE
else
if
(
first_packet_sent
&&
orig_bitmask
&&
orig_bitmask
==
sent_bitmask
)
//
else if (first_packet_sent && orig_bitmask && orig_bitmask == sent_bitmask)
{
//
{
MS_WARN_TAG
(
rtcp
,
"first packet sent and also all the bitmask packets [bitmask:"
UINT16_TO_BINARY_PATTERN
"]"
,
UINT16_TO_BINARY
(
orig_bitmask
));
//
MS_WARN_TAG(rtcp, "first packet sent and also all the bitmask packets [bitmask:" UINT16_TO_BINARY_PATTERN "]", UINT16_TO_BINARY(orig_bitmask));
}
//
}
// Set the next container element to null.
// Set the next container element to null.
container
[
container_idx
]
=
nullptr
;
container
[
container_idx
]
=
nullptr
;
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论