Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
578d914b
提交
578d914b
authored
5月 25, 2018
作者:
Anthony Minessale
提交者:
Muteesa Fred
7月 24, 2018
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
FS-11164: [freeswitch-core] Improve audio JB in bad conditions
上级
611e38e8
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
52 行增加
和
26 行删除
+52
-26
mod_commands.c
src/mod/applications/mod_commands/mod_commands.c
+40
-0
switch_jitterbuffer.c
src/switch_jitterbuffer.c
+9
-23
switch_vpx.c
src/switch_vpx.c
+3
-3
没有找到文件。
src/mod/applications/mod_commands/mod_commands.c
浏览文件 @
578d914b
...
...
@@ -4435,6 +4435,44 @@ SWITCH_STANDARD_API(uuid_video_bitrate_function)
return
SWITCH_STATUS_SUCCESS
;
}
#define VIDEO_BITRATE_SYNTAX "<uuid> <bitrate>"
SWITCH_STANDARD_API
(
uuid_video_bandwidth_function
)
{
switch_status_t
status
=
SWITCH_STATUS_FALSE
;
char
*
mycmd
=
NULL
,
*
argv
[
2
]
=
{
0
};
int
argc
=
0
;
if
(
!
zstr
(
cmd
)
&&
(
mycmd
=
strdup
(
cmd
)))
{
argc
=
switch_separate_string
(
mycmd
,
' '
,
argv
,
(
sizeof
(
argv
)
/
sizeof
(
argv
[
0
])));
}
if
(
argc
<
2
)
{
stream
->
write_function
(
stream
,
"-USAGE: %s
\n
"
,
VIDEO_REFRESH_SYNTAX
);
}
else
{
switch_core_session_t
*
lsession
=
NULL
;
if
((
lsession
=
switch_core_session_locate
(
argv
[
0
])))
{
int
kps
;
kps
=
switch_parse_bandwidth_string
(
argv
[
1
]);
switch_core_media_set_outgoing_bitrate
(
lsession
,
SWITCH_MEDIA_TYPE_VIDEO
,
kps
);
status
=
SWITCH_STATUS_SUCCESS
;
switch_core_session_rwunlock
(
lsession
);
}
}
if
(
status
==
SWITCH_STATUS_SUCCESS
)
{
stream
->
write_function
(
stream
,
"+OK Success
\n
"
);
}
else
{
stream
->
write_function
(
stream
,
"-ERR Operation Failed
\n
"
);
}
switch_safe_free
(
mycmd
);
return
SWITCH_STATUS_SUCCESS
;
}
#define CODEC_DEBUG_SYNTAX "<uuid> audio|video <level>"
SWITCH_STANDARD_API
(
uuid_codec_debug_function
)
{
...
...
@@ -7496,6 +7534,7 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_commands_load)
SWITCH_ADD_API
(
commands_api_interface
,
"uuid_send_info"
,
"Send info to the endpoint"
,
uuid_send_info_function
,
INFO_SYNTAX
);
SWITCH_ADD_API
(
commands_api_interface
,
"uuid_set_media_stats"
,
"Set media stats"
,
uuid_set_media_stats
,
UUID_MEDIA_STATS_SYNTAX
);
SWITCH_ADD_API
(
commands_api_interface
,
"uuid_video_bitrate"
,
"Send video bitrate req."
,
uuid_video_bitrate_function
,
VIDEO_BITRATE_SYNTAX
);
SWITCH_ADD_API
(
commands_api_interface
,
"uuid_video_bandwidth"
,
"Send video bandwidth"
,
uuid_video_bandwidth_function
,
VIDEO_BITRATE_SYNTAX
);
SWITCH_ADD_API
(
commands_api_interface
,
"uuid_video_refresh"
,
"Send video refresh."
,
uuid_video_refresh_function
,
VIDEO_REFRESH_SYNTAX
);
SWITCH_ADD_API
(
commands_api_interface
,
"uuid_outgoing_answer"
,
"Answer outgoing channel"
,
outgoing_answer_function
,
OUTGOING_ANSWER_SYNTAX
);
SWITCH_ADD_API
(
commands_api_interface
,
"uuid_limit"
,
"Increase limit resource"
,
uuid_limit_function
,
LIMIT_SYNTAX
);
...
...
@@ -7719,6 +7758,7 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_commands_load)
switch_console_set_complete
(
"add uuid_dual_transfer ::console::list_uuid"
);
switch_console_set_complete
(
"add uuid_video_refresh ::console::list_uuid"
);
switch_console_set_complete
(
"add uuid_video_bitrate ::console::list_uuid"
);
switch_console_set_complete
(
"add uuid_video_bandwidth ::console::list_uuid"
);
switch_console_set_complete
(
"add uuid_xfer_zombie ::console::list_uuid"
);
switch_console_set_complete
(
"add version"
);
switch_console_set_complete
(
"add uuid_warning ::console::list_uuid"
);
...
...
src/switch_jitterbuffer.c
浏览文件 @
578d914b
...
...
@@ -1292,7 +1292,6 @@ SWITCH_DECLARE(switch_status_t) switch_jb_get_packet(switch_jb_t *jb, switch_rtp
switch_jb_node_t
*
node
=
NULL
;
switch_status_t
status
;
int
plc
=
0
;
int
too_big
=
0
;
switch_mutex_lock
(
jb
->
mutex
);
...
...
@@ -1454,30 +1453,17 @@ SWITCH_DECLARE(switch_status_t) switch_jb_get_packet(switch_jb_t *jb, switch_rtp
}
switch_mutex_unlock
(
jb
->
mutex
);
if
(
jb
->
type
==
SJB_VIDEO
)
{
too_big
=
jb
->
max_frame_len
*
15
;
if
(
jb
->
complete_frames
>
jb
->
max_frame_len
*
2
)
{
jb_debug
(
jb
,
2
,
"JB TOO BIG (%d), RESET
\n
"
,
jb
->
complete_frames
);
switch_jb_reset
(
jb
);
}
}
else
{
too_big
=
(
int
)(
jb
->
max_frame_len
*
1
.
5
);
}
if
(
jb
->
visible_nodes
>
too_big
)
{
//if (jb->complete_frames > jb->max_frame_len) {
//int b4 = jb->visible_nodes;
//thin_frames(jb, 2, jb->max_frame_len / 2);
//jb_debug(jb, 2, "JB TOO BIG (%d/%d), DROP SOME\n", b4, jb->visible_nodes);
//switch_jb_reset(jb);
}
//if (jb->complete_frames > jb->max_frame_len * 2) {
// jb_debug(jb, 2, "JB TOO BIG (%d), RESET\n", jb->complete_frames);
// switch_jb_reset(jb);
//}
if
(
jb
->
visible_nodes
>
too_big
&&
status
==
SWITCH_STATUS_SUCCESS
)
{
//if (jb->frame_len >= jb->max_frame_len && status == SWITCH_STATUS_SUCCESS) {
//if (jb->allocated_nodes > jb->max_frame_len) {
status
=
SWITCH_STATUS_TIMEOUT
;
int
too_big
=
(
int
)(
jb
->
max_frame_len
*
1
.
5
);
if
(
jb
->
visible_nodes
>
too_big
&&
status
==
SWITCH_STATUS_SUCCESS
)
{
status
=
SWITCH_STATUS_TIMEOUT
;
}
}
return
status
;
...
...
src/switch_vpx.c
浏览文件 @
578d914b
...
...
@@ -414,7 +414,7 @@ static switch_status_t init_encoder(switch_codec_t *codec)
context
->
start_time
=
switch_micro_time_now
();
config
->
g_timebase
.
num
=
1
;
config
->
g_timebase
.
den
=
1000
;
//
90000;
config
->
g_timebase
.
den
=
90000
;
config
->
g_pass
=
VPX_RC_ONE_PASS
;
config
->
g_w
=
context
->
codec_settings
.
video
.
width
;
config
->
g_h
=
context
->
codec_settings
.
video
.
height
;
...
...
@@ -864,8 +864,8 @@ static switch_status_t switch_vpx_encode(switch_codec_t *codec, switch_frame_t *
context
->
framecount
++
;
pts
=
(
now
-
context
->
start_time
)
/
1000
;
//
pts = frame->timestamp;
//
pts = (now - context->start_time) / 1000;
pts
=
frame
->
timestamp
;
dur
=
context
->
last_ms
?
(
now
-
context
->
last_ms
)
/
1000
:
pts
;
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论