Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
cd124ad8
提交
cd124ad8
authored
10月 12, 2010
作者:
Moises Silva
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
mod_sangoma_codec: more timing debug code
上级
6e06ba09
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
19 行增加
和
22 行删除
+19
-22
mod_sangoma_codec.c
src/mod/codecs/mod_sangoma_codec/mod_sangoma_codec.c
+19
-22
没有找到文件。
src/mod/codecs/mod_sangoma_codec/mod_sangoma_codec.c
浏览文件 @
cd124ad8
...
...
@@ -137,6 +137,7 @@ struct codec_data {
/* avg Rx time */
switch_time_t
avgrxus
;
switch_time_t
last_rx_time
;
switch_time_t
last_func_call_time
;
/* RTP queue. The bigger the queue, the bigger the possible delay */
struct
sangoma_rtp_payload
rtp_queue
[
SANGOMA_RTP_QUEUE_SIZE
];
...
...
@@ -386,7 +387,7 @@ static switch_status_t switch_sangoma_encode(switch_codec_t *codec, switch_codec
switch_frame_t
encoded_frame
;
switch_status_t
sres
;
switch_time_t
now_time
,
difftime
;
switch_time_t
prevread_time
,
afterrea
d_time
;
switch_time_t
func_start_time
,
func_en
d_time
;
unsigned
char
ebuf_ulaw
[
decoded_data_len
/
2
];
short
*
dbuf_linear
;
int
i
=
0
;
...
...
@@ -394,7 +395,7 @@ static switch_status_t switch_sangoma_encode(switch_codec_t *codec, switch_codec
struct
sangoma_transcoding_session
*
sess
=
codec
->
private_info
;
if
(
sess
->
encoder
.
debug_timing
)
{
prevread
_time
=
switch_micro_time_now
();
func_start
_time
=
switch_micro_time_now
();
}
/* start assuming we will not encode anything */
...
...
@@ -416,13 +417,10 @@ static switch_status_t switch_sangoma_encode(switch_codec_t *codec, switch_codec
switch_mutex_unlock
(
g_sessions_lock
);
}
if
(
sess
->
encoder
.
debug_timing
)
{
now_time
=
switch_micro_time_now
();
if
(
sess
->
encoder
.
last_rx_time
)
{
difftime
=
now_time
-
sess
->
encoder
.
last_rx_time
;
if
(
difftime
>
25000
||
difftime
<
15000
)
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_CRIT
,
"%ldus since last read on encoding session %lu.
\n
"
,
(
long
)
difftime
,
sess
->
sessid
);
}
if
(
sess
->
encoder
.
debug_timing
&&
sess
->
encoder
.
last_func_call_time
)
{
difftime
=
func_start_time
-
sess
->
encoder
.
last_func_call_time
;
if
(
difftime
>
25000
||
difftime
<
15000
)
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_CRIT
,
"%ldus since last read on encoding session %lu
\n
"
,
(
long
)
difftime
,
sess
->
sessid
);
}
}
...
...
@@ -551,11 +549,12 @@ static switch_status_t switch_sangoma_encode(switch_codec_t *codec, switch_codec
}
if
(
sess
->
encoder
.
debug_timing
)
{
afterread_time
=
switch_micro_time_now
();
difftime
=
afterread_time
-
prevread
_time
;
func_end_time
=
switch_micro_time_now
();
difftime
=
func_end_time
-
func_start
_time
;
if
(
difftime
>
5000
)
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_CRIT
,
"%ldus to execute encoding function in session %lu.
\n
"
,
(
long
)
difftime
,
sess
->
sessid
);
}
sess
->
encoder
.
last_func_call_time
=
func_end_time
;
}
return
SWITCH_STATUS_SUCCESS
;
}
...
...
@@ -576,14 +575,14 @@ static switch_status_t switch_sangoma_decode(switch_codec_t *codec, /* codec ses
switch_frame_t
ulaw_frame
;
switch_status_t
sres
;
switch_time_t
now_time
,
difftime
;
switch_time_t
prevread_time
,
afterrea
d_time
;
switch_time_t
func_start_time
,
func_en
d_time
;
short
*
dbuf_linear
;
int
i
=
0
;
int
res
=
0
;
struct
sangoma_transcoding_session
*
sess
=
codec
->
private_info
;
if
(
sess
->
decoder
.
debug_timing
)
{
prevread
_time
=
switch_micro_time_now
();
func_start
_time
=
switch_micro_time_now
();
}
dbuf_linear
=
decoded_data
;
...
...
@@ -613,13 +612,10 @@ static switch_status_t switch_sangoma_decode(switch_codec_t *codec, /* codec ses
switch_mutex_unlock
(
g_sessions_lock
);
}
if
(
sess
->
decoder
.
debug_timing
)
{
now_time
=
switch_micro_time_now
();
if
(
sess
->
decoder
.
last_rx_time
)
{
difftime
=
now_time
-
sess
->
decoder
.
last_rx_time
;
if
(
difftime
>
25000
||
difftime
<
15000
)
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_ERROR
,
"%ldms since last read on decoding session %lu.
\n
"
,
(
long
)
difftime
,
sess
->
sessid
);
}
if
(
sess
->
decoder
.
debug_timing
&&
sess
->
decoder
.
last_func_call_time
)
{
difftime
=
func_start_time
-
sess
->
decoder
.
last_func_call_time
;
if
(
difftime
>
25000
||
difftime
<
15000
)
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_ERROR
,
"%ldms since last read on decoding session %lu.
\n
"
,
(
long
)
difftime
,
sess
->
sessid
);
}
}
...
...
@@ -743,11 +739,12 @@ static switch_status_t switch_sangoma_decode(switch_codec_t *codec, /* codec ses
}
if
(
sess
->
decoder
.
debug_timing
)
{
afterread_time
=
switch_micro_time_now
();
difftime
=
afterread_time
-
prevread
_time
;
func_end_time
=
switch_micro_time_now
();
difftime
=
func_end_time
-
func_start
_time
;
if
(
difftime
>
5000
)
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_ERROR
,
"%ldus to execute decoding function in session %lu.
\n
"
,
(
long
)
difftime
,
sess
->
sessid
);
}
sess
->
decoder
.
last_func_call_time
=
func_end_time
;
}
return
SWITCH_STATUS_SUCCESS
;
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论