Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
d59d41d7
提交
d59d41d7
authored
2月 25, 2011
作者:
Anthony Minessale
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add param to jb to try to recapture latency (disabled by default)
上级
bc397ab6
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
30 行增加
和
16 行删除
+30
-16
switch_rtp.h
src/include/switch_rtp.h
+1
-1
mod_sofia.c
src/mod/endpoints/mod_sofia/mod_sofia.c
+9
-4
sofia_glue.c
src/mod/endpoints/mod_sofia/sofia_glue.c
+8
-4
switch_ivr.c
src/switch_ivr.c
+1
-1
switch_rtp.c
src/switch_rtp.c
+11
-6
没有找到文件。
src/include/switch_rtp.h
浏览文件 @
d59d41d7
...
@@ -232,7 +232,7 @@ SWITCH_DECLARE(switch_status_t) switch_rtp_activate_rtcp(switch_rtp_t *rtp_sessi
...
@@ -232,7 +232,7 @@ SWITCH_DECLARE(switch_status_t) switch_rtp_activate_rtcp(switch_rtp_t *rtp_sessi
SWITCH_DECLARE
(
switch_status_t
)
switch_rtp_activate_jitter_buffer
(
switch_rtp_t
*
rtp_session
,
SWITCH_DECLARE
(
switch_status_t
)
switch_rtp_activate_jitter_buffer
(
switch_rtp_t
*
rtp_session
,
uint32_t
queue_frames
,
uint32_t
queue_frames
,
uint32_t
max_queue_frames
,
uint32_t
max_queue_frames
,
uint32_t
samples_per_packet
,
uint32_t
samples_per_second
);
uint32_t
samples_per_packet
,
uint32_t
samples_per_second
,
uint32_t
max_drift
);
SWITCH_DECLARE
(
switch_status_t
)
switch_rtp_debug_jitter_buffer
(
switch_rtp_t
*
rtp_session
,
const
char
*
name
);
SWITCH_DECLARE
(
switch_status_t
)
switch_rtp_debug_jitter_buffer
(
switch_rtp_t
*
rtp_session
,
const
char
*
name
);
...
...
src/mod/endpoints/mod_sofia/mod_sofia.c
浏览文件 @
d59d41d7
...
@@ -1349,10 +1349,10 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi
...
@@ -1349,10 +1349,10 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi
case
SWITCH_MESSAGE_INDICATE_JITTER_BUFFER
:
case
SWITCH_MESSAGE_INDICATE_JITTER_BUFFER
:
{
{
if
(
switch_rtp_ready
(
tech_pvt
->
rtp_session
))
{
if
(
switch_rtp_ready
(
tech_pvt
->
rtp_session
))
{
int
len
,
maxlen
=
0
,
qlen
=
0
,
maxqlen
=
50
;
int
len
,
maxlen
=
0
,
qlen
=
0
,
maxqlen
=
50
,
max_drift
=
0
;
if
(
msg
->
string_arg
)
{
if
(
msg
->
string_arg
)
{
char
*
p
;
char
*
p
,
*
q
;
const
char
*
s
;
const
char
*
s
;
if
(
!
strcasecmp
(
msg
->
string_arg
,
"pause"
))
{
if
(
!
strcasecmp
(
msg
->
string_arg
,
"pause"
))
{
...
@@ -1379,6 +1379,10 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi
...
@@ -1379,6 +1379,10 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi
if
((
p
=
strchr
(
msg
->
string_arg
,
':'
)))
{
if
((
p
=
strchr
(
msg
->
string_arg
,
':'
)))
{
p
++
;
p
++
;
maxlen
=
atol
(
p
);
maxlen
=
atol
(
p
);
if
((
q
=
strchr
(
p
,
':'
)))
{
q
++
;
max_drift
=
abs
(
atol
(
q
));
}
}
}
}
}
...
@@ -1391,9 +1395,10 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi
...
@@ -1391,9 +1395,10 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi
if
(
qlen
)
{
if
(
qlen
)
{
if
(
switch_rtp_activate_jitter_buffer
(
tech_pvt
->
rtp_session
,
qlen
,
maxqlen
,
if
(
switch_rtp_activate_jitter_buffer
(
tech_pvt
->
rtp_session
,
qlen
,
maxqlen
,
tech_pvt
->
read_impl
.
samples_per_packet
,
tech_pvt
->
read_impl
.
samples_per_packet
,
tech_pvt
->
read_impl
.
samples_per_second
)
==
SWITCH_STATUS_SUCCESS
)
{
tech_pvt
->
read_impl
.
samples_per_second
,
max_drift
)
==
SWITCH_STATUS_SUCCESS
)
{
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG
(
tech_pvt
->
session
),
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG
(
tech_pvt
->
session
),
SWITCH_LOG_DEBUG
,
"Setting Jitterbuffer to %dms (%d frames) (%d max frames)
\n
"
,
len
,
qlen
,
maxqlen
);
SWITCH_LOG_DEBUG
,
"Setting Jitterbuffer to %dms (%d frames) (%d max frames) (%d max drift)
\n
"
,
len
,
qlen
,
maxqlen
,
max_drift
);
switch_channel_set_flag
(
tech_pvt
->
channel
,
CF_JITTERBUFFER
);
switch_channel_set_flag
(
tech_pvt
->
channel
,
CF_JITTERBUFFER
);
}
else
{
}
else
{
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG
(
tech_pvt
->
session
),
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG
(
tech_pvt
->
session
),
...
...
src/mod/endpoints/mod_sofia/sofia_glue.c
浏览文件 @
d59d41d7
...
@@ -3166,12 +3166,16 @@ switch_status_t sofia_glue_activate_rtp(private_object_t *tech_pvt, switch_rtp_f
...
@@ -3166,12 +3166,16 @@ switch_status_t sofia_glue_activate_rtp(private_object_t *tech_pvt, switch_rtp_f
if
((
val
=
switch_channel_get_variable
(
tech_pvt
->
channel
,
"jitterbuffer_msec"
))
||
(
val
=
tech_pvt
->
profile
->
jb_msec
))
{
if
((
val
=
switch_channel_get_variable
(
tech_pvt
->
channel
,
"jitterbuffer_msec"
))
||
(
val
=
tech_pvt
->
profile
->
jb_msec
))
{
int
jb_msec
=
atoi
(
val
);
int
jb_msec
=
atoi
(
val
);
int
maxlen
=
0
;
int
maxlen
=
0
,
max_drift
=
0
;
char
*
p
;
char
*
p
,
*
q
;
if
((
p
=
strchr
(
val
,
':'
)))
{
if
((
p
=
strchr
(
val
,
':'
)))
{
p
++
;
p
++
;
maxlen
=
atoi
(
p
);
maxlen
=
atoi
(
p
);
if
((
q
=
strchr
(
p
,
':'
)))
{
q
++
;
max_drift
=
abs
(
atoi
(
q
));
}
}
}
if
(
jb_msec
<
20
||
jb_msec
>
10000
)
{
if
(
jb_msec
<
20
||
jb_msec
>
10000
)
{
...
@@ -3188,7 +3192,7 @@ switch_status_t sofia_glue_activate_rtp(private_object_t *tech_pvt, switch_rtp_f
...
@@ -3188,7 +3192,7 @@ switch_status_t sofia_glue_activate_rtp(private_object_t *tech_pvt, switch_rtp_f
if
(
switch_rtp_activate_jitter_buffer
(
tech_pvt
->
rtp_session
,
qlen
,
maxqlen
,
if
(
switch_rtp_activate_jitter_buffer
(
tech_pvt
->
rtp_session
,
qlen
,
maxqlen
,
tech_pvt
->
read_impl
.
samples_per_packet
,
tech_pvt
->
read_impl
.
samples_per_packet
,
tech_pvt
->
read_impl
.
samples_per_second
)
==
SWITCH_STATUS_SUCCESS
)
{
tech_pvt
->
read_impl
.
samples_per_second
,
max_drift
)
==
SWITCH_STATUS_SUCCESS
)
{
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG
(
tech_pvt
->
session
),
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG
(
tech_pvt
->
session
),
SWITCH_LOG_DEBUG
,
"Setting Jitterbuffer to %dms (%d frames)
\n
"
,
jb_msec
,
qlen
);
SWITCH_LOG_DEBUG
,
"Setting Jitterbuffer to %dms (%d frames)
\n
"
,
jb_msec
,
qlen
);
switch_channel_set_flag
(
tech_pvt
->
channel
,
CF_JITTERBUFFER
);
switch_channel_set_flag
(
tech_pvt
->
channel
,
CF_JITTERBUFFER
);
...
...
src/switch_ivr.c
浏览文件 @
d59d41d7
...
@@ -2289,7 +2289,7 @@ SWITCH_DECLARE(void) switch_ivr_delay_echo(switch_core_session_t *session, uint3
...
@@ -2289,7 +2289,7 @@ SWITCH_DECLARE(void) switch_ivr_delay_echo(switch_core_session_t *session, uint3
qlen
=
delay_ms
/
(
interval
);
qlen
=
delay_ms
/
(
interval
);
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG
(
session
),
SWITCH_LOG_DEBUG
,
"Setting delay to %dms (%d frames)
\n
"
,
delay_ms
,
qlen
);
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG
(
session
),
SWITCH_LOG_DEBUG
,
"Setting delay to %dms (%d frames)
\n
"
,
delay_ms
,
qlen
);
jb
=
stfu_n_init
(
qlen
,
qlen
,
read_impl
.
samples_per_packet
,
read_impl
.
samples_per_second
);
jb
=
stfu_n_init
(
qlen
,
qlen
,
read_impl
.
samples_per_packet
,
read_impl
.
samples_per_second
,
0
);
write_frame
.
codec
=
switch_core_session_get_read_codec
(
session
);
write_frame
.
codec
=
switch_core_session_get_read_codec
(
session
);
...
...
src/switch_rtp.c
浏览文件 @
d59d41d7
...
@@ -1909,7 +1909,8 @@ SWITCH_DECLARE(switch_status_t) switch_rtp_activate_jitter_buffer(switch_rtp_t *
...
@@ -1909,7 +1909,8 @@ SWITCH_DECLARE(switch_status_t) switch_rtp_activate_jitter_buffer(switch_rtp_t *
uint32_t
queue_frames
,
uint32_t
queue_frames
,
uint32_t
max_queue_frames
,
uint32_t
max_queue_frames
,
uint32_t
samples_per_packet
,
uint32_t
samples_per_packet
,
uint32_t
samples_per_second
)
uint32_t
samples_per_second
,
uint32_t
max_drift
)
{
{
if
(
!
switch_rtp_ready
(
rtp_session
))
{
if
(
!
switch_rtp_ready
(
rtp_session
))
{
...
@@ -1920,7 +1921,7 @@ SWITCH_DECLARE(switch_status_t) switch_rtp_activate_jitter_buffer(switch_rtp_t *
...
@@ -1920,7 +1921,7 @@ SWITCH_DECLARE(switch_status_t) switch_rtp_activate_jitter_buffer(switch_rtp_t *
if
(
rtp_session
->
jb
)
{
if
(
rtp_session
->
jb
)
{
stfu_n_resize
(
rtp_session
->
jb
,
queue_frames
);
stfu_n_resize
(
rtp_session
->
jb
,
queue_frames
);
}
else
{
}
else
{
rtp_session
->
jb
=
stfu_n_init
(
queue_frames
,
max_queue_frames
?
max_queue_frames
:
50
,
samples_per_packet
,
samples_per_second
);
rtp_session
->
jb
=
stfu_n_init
(
queue_frames
,
max_queue_frames
?
max_queue_frames
:
50
,
samples_per_packet
,
samples_per_second
,
max_drift
);
}
}
READ_DEC
(
rtp_session
);
READ_DEC
(
rtp_session
);
...
@@ -2402,7 +2403,7 @@ static switch_status_t read_rtp_packet(switch_rtp_t *rtp_session, switch_size_t
...
@@ -2402,7 +2403,7 @@ static switch_status_t read_rtp_packet(switch_rtp_t *rtp_session, switch_size_t
uint32_t
ts
;
uint32_t
ts
;
switch_assert
(
bytes
);
switch_assert
(
bytes
);
more
:
*
bytes
=
sizeof
(
rtp_msg_t
);
*
bytes
=
sizeof
(
rtp_msg_t
);
status
=
switch_socket_recvfrom
(
rtp_session
->
from_addr
,
rtp_session
->
sock_input
,
0
,
(
void
*
)
&
rtp_session
->
recv_msg
,
bytes
);
status
=
switch_socket_recvfrom
(
rtp_session
->
from_addr
,
rtp_session
->
sock_input
,
0
,
(
void
*
)
&
rtp_session
->
recv_msg
,
bytes
);
ts
=
ntohl
(
rtp_session
->
recv_msg
.
header
.
ts
);
ts
=
ntohl
(
rtp_session
->
recv_msg
.
header
.
ts
);
...
@@ -2489,9 +2490,13 @@ static switch_status_t read_rtp_packet(switch_rtp_t *rtp_session, switch_size_t
...
@@ -2489,9 +2490,13 @@ static switch_status_t read_rtp_packet(switch_rtp_t *rtp_session, switch_size_t
stfu_n_reset
(
rtp_session
->
jb
);
stfu_n_reset
(
rtp_session
->
jb
);
}
}
stfu_n_eat
(
rtp_session
->
jb
,
rtp_session
->
last_read_ts
,
if
(
stfu_n_eat
(
rtp_session
->
jb
,
rtp_session
->
last_read_ts
,
rtp_session
->
recv_msg
.
header
.
pt
,
rtp_session
->
recv_msg
.
header
.
pt
,
rtp_session
->
recv_msg
.
body
,
*
bytes
-
rtp_header_len
,
rtp_session
->
timer
.
samplecount
);
rtp_session
->
recv_msg
.
body
,
*
bytes
-
rtp_header_len
,
rtp_session
->
timer
.
samplecount
)
==
STFU_ITS_TOO_LATE
)
{
printf
(
"doh
\n
"
);
goto
more
;
}
status
=
SWITCH_STATUS_FALSE
;
status
=
SWITCH_STATUS_FALSE
;
if
(
!
return_jb_packet
)
{
if
(
!
return_jb_packet
)
{
return
status
;
return
status
;
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论