Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
878565e4
提交
878565e4
authored
10月 09, 2018
作者:
Anthony Minessale
提交者:
Andrey Volk
7月 16, 2019
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
FS-11446: [freeswitch-core] Improve video JB scaling and fix misreported rtp stats #resolve
上级
e06ed5ad
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
72 行增加
和
69 行删除
+72
-69
switch_jitterbuffer.c
src/switch_jitterbuffer.c
+19
-12
switch_rtp.c
src/switch_rtp.c
+53
-57
没有找到文件。
src/switch_jitterbuffer.c
浏览文件 @
878565e4
...
...
@@ -34,7 +34,6 @@
#define NACK_TIME 80000
#define RENACK_TIME 100000
#define PERIOD_LEN 250
#define MAX_FRAME_PADDING 2
#define MAX_MISSING_SEQ 20
#define jb_debug(_jb, _level, _format, ...) if (_jb->debug_level >= _level) switch_log_printf(SWITCH_CHANNEL_SESSION_LOG_CLEAN(_jb->session), SWITCH_LOG_ALERT, "JB:%p:%s:%d/%d lv:%d ln:%.4d sz:%.3u/%.3u/%.3u/%.3u c:%.3u %.3u/%.3u/%.3u/%.3u %.2f%% ->" _format, (void *) _jb, (jb->type == SJB_TEXT ? "txt" : (jb->type == SJB_AUDIO ? "aud" : "vid")), _jb->allocated_nodes, _jb->visible_nodes, _level, __LINE__, _jb->min_frame_len, _jb->max_frame_len, _jb->frame_len, _jb->complete_frames, _jb->period_count, _jb->consec_good_count, _jb->period_good_count, _jb->consec_miss_count, _jb->period_miss_count, _jb->period_miss_pct, __VA_ARGS__)
...
...
@@ -107,6 +106,7 @@ struct switch_jb_s {
uint32_t
flush
;
uint32_t
packet_count
;
uint32_t
max_packet_len
;
uint32_t
period_len
;
};
...
...
@@ -516,7 +516,8 @@ static void jb_frame_inc_line(switch_jb_t *jb, int i, int line)
}
if
(
old_frame_len
!=
jb
->
frame_len
)
{
jb_debug
(
jb
,
2
,
"%d Change framelen from %u to %u
\n
"
,
line
,
old_frame_len
,
jb
->
frame_len
);
jb_debug
(
jb
,
1
,
"%d Change framelen from %u to %u
\n
"
,
line
,
old_frame_len
,
jb
->
frame_len
);
//if (jb->session) {
// switch_core_session_request_video_refresh(jb->session);
//}
...
...
@@ -641,7 +642,7 @@ static inline void add_node(switch_jb_t *jb, switch_rtp_packet_t *packet, switch
switch_core_inthash_insert
(
jb
->
node_hash_ts
,
node
->
packet
.
header
.
ts
,
node
);
}
jb_debug
(
jb
,
(
packet
->
header
.
m
?
1
:
2
),
"PUT packet last_ts:%u ts:%u seq:%u%s
\n
"
,
jb_debug
(
jb
,
(
packet
->
header
.
m
?
2
:
3
),
"PUT packet last_ts:%u ts:%u seq:%u%s
\n
"
,
ntohl
(
jb
->
highest_wrote_ts
),
ntohl
(
node
->
packet
.
header
.
ts
),
ntohs
(
node
->
packet
.
header
.
seq
),
packet
->
header
.
m
?
" <MARK>"
:
""
);
if
(
jb
->
write_init
&&
jb
->
type
==
SJB_VIDEO
)
{
...
...
@@ -773,11 +774,6 @@ static inline switch_status_t jb_next_packet_by_seq(switch_jb_t *jb, switch_jb_n
if
(
jb
->
type
==
SJB_VIDEO
)
{
int
x
;
if
(
jb
->
period_miss_count
>
1
&&
!
jb
->
period_miss_inc
)
{
jb
->
period_miss_inc
++
;
jb_frame_inc
(
jb
,
1
);
}
if
(
jb
->
session
)
{
switch_core_session_request_video_refresh
(
jb
->
session
);
}
...
...
@@ -792,6 +788,13 @@ static inline switch_status_t jb_next_packet_by_seq(switch_jb_t *jb, switch_jb_n
jb
->
dropped
++
;
drop_ts
(
jb
,
node
->
packet
.
header
.
ts
);
jb
->
highest_dropped_ts
=
ntohl
(
node
->
packet
.
header
.
ts
);
if
(
jb
->
period_miss_count
>
2
&&
jb
->
period_miss_inc
<
1
)
{
jb
->
period_miss_inc
++
;
jb_frame_inc
(
jb
,
1
);
}
node
=
NULL
;
goto
top
;
}
...
...
@@ -1070,7 +1073,11 @@ SWITCH_DECLARE(switch_status_t) switch_jb_create(switch_jb_t **jbp, switch_jb_ty
if
(
jb
->
type
==
SJB_VIDEO
)
{
switch_core_inthash_init
(
&
jb
->
missing_seq_hash
);
jb
->
period_len
=
2500
;
}
else
{
jb
->
period_len
=
250
;
}
switch_core_inthash_init
(
&
jb
->
node_hash
);
switch_mutex_init
(
&
jb
->
mutex
,
SWITCH_MUTEX_NESTED
,
pool
);
switch_mutex_init
(
&
jb
->
list_mutex
,
SWITCH_MUTEX_NESTED
,
pool
);
...
...
@@ -1228,7 +1235,7 @@ SWITCH_DECLARE(switch_status_t) switch_jb_put_packet(switch_jb_t *jb, switch_rtp
switch_jb_reset
(
jb
);
}
else
{
if
(
jb
->
frame_len
<
got
-
want
)
{
if
(
jb
->
type
!=
SJB_VIDEO
&&
jb
->
frame_len
<
got
-
want
)
{
jb_frame_inc
(
jb
,
1
);
}
...
...
@@ -1312,9 +1319,9 @@ SWITCH_DECLARE(switch_status_t) switch_jb_get_packet(switch_jb_t *jb, switch_rtp
jb_debug
(
jb
,
2
,
"GET PACKET %u/%u n:%d
\n
"
,
jb
->
complete_frames
,
jb
->
frame_len
,
jb
->
visible_nodes
);
if
(
++
jb
->
period_count
>=
PERIOD_LEN
)
{
if
(
++
jb
->
period_count
>=
jb
->
period_len
)
{
if
(
jb
->
consec_good_count
>=
(
PERIOD_LEN
-
5
))
{
if
(
jb
->
consec_good_count
>=
(
jb
->
period_len
-
5
))
{
jb_frame_inc
(
jb
,
-
1
);
}
...
...
@@ -1429,7 +1436,7 @@ SWITCH_DECLARE(switch_status_t) switch_jb_get_packet(switch_jb_t *jb, switch_rtp
packet
->
header
.
version
=
2
;
hide_node
(
node
,
SWITCH_TRUE
);
jb_debug
(
jb
,
1
,
"GET packet ts:%u seq:%u %s
\n
"
,
ntohl
(
packet
->
header
.
ts
),
ntohs
(
packet
->
header
.
seq
),
packet
->
header
.
m
?
" <MARK>"
:
""
);
jb_debug
(
jb
,
2
,
"GET packet ts:%u seq:%u %s
\n
"
,
ntohl
(
packet
->
header
.
ts
),
ntohs
(
packet
->
header
.
seq
),
packet
->
header
.
m
?
" <MARK>"
:
""
);
}
else
{
status
=
SWITCH_STATUS_MORE_DATA
;
...
...
src/switch_rtp.c
浏览文件 @
878565e4
差异被折叠。
点击展开。
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论