Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
42a4a3de
提交
42a4a3de
authored
11月 19, 2010
作者:
Anthony Minessale
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
revert FS-2859
上级
0a11b9b4
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
2 行增加
和
51 行删除
+2
-51
switch_types.h
src/include/switch_types.h
+1
-3
switch_rtp.c
src/switch_rtp.c
+1
-48
没有找到文件。
src/include/switch_types.h
浏览文件 @
42a4a3de
...
...
@@ -471,9 +471,7 @@ typedef enum {
SWITCH_VAD_FLAG_TALKING
=
(
1
<<
0
),
SWITCH_VAD_FLAG_EVENTS_TALK
=
(
1
<<
1
),
SWITCH_VAD_FLAG_EVENTS_NOTALK
=
(
1
<<
2
),
SWITCH_VAD_FLAG_CNG
=
(
1
<<
3
),
/* added to keep track when last normal packet sent */
SWITCH_VAD_NPACKET_SENT
=
(
1
<<
4
)
SWITCH_VAD_FLAG_CNG
=
(
1
<<
3
)
}
switch_vad_flag_enum_t
;
typedef
uint32_t
switch_vad_flag_t
;
...
...
src/switch_rtp.c
浏览文件 @
42a4a3de
...
...
@@ -240,7 +240,6 @@ struct switch_rtp {
switch_time_t
send_time
;
switch_byte_t
auto_adj_used
;
int
last_voicepkt
;
};
struct
switch_rtcp_senderinfo
{
...
...
@@ -1357,7 +1356,6 @@ SWITCH_DECLARE(switch_status_t) switch_rtp_create(switch_rtp_t **new_rtp_session
rtp_session
->
pool
=
pool
;
rtp_session
->
te
=
101
;
rtp_session
->
recv_te
=
101
;
rtp_session
->
last_voicepkt
=
0
;
switch_mutex_init
(
&
rtp_session
->
flag_mutex
,
SWITCH_MUTEX_NESTED
,
pool
);
switch_mutex_init
(
&
rtp_session
->
read_mutex
,
SWITCH_MUTEX_NESTED
,
pool
);
...
...
@@ -3157,12 +3155,9 @@ static int rtp_common_write(switch_rtp_t *rtp_session,
{
switch_size_t
bytes
,
rtcp_bytes
;
uint8_t
send
=
1
;
uint8_t
CNdata
[
10
]
=
{
0
};
uint8_t
sendCN
=
0
;
uint32_t
this_ts
=
0
;
int
ret
;
switch_time_t
now
;
CNdata
[
0
]
=
65
;
if
(
!
switch_rtp_ready
(
rtp_session
))
{
return
SWITCH_STATUS_FALSE
;
...
...
@@ -3244,15 +3239,9 @@ static int rtp_common_write(switch_rtp_t *rtp_session,
rtp_session
->
recv_msg
.
header
.
pt
=
102
;
}
if
(
!
switch_test_flag
(
rtp_session
,
SWITCH_RTP_FLAG_VAD
)
)
switch_set_flag
(
rtp_session
,
SWITCH_RTP_FLAG_VAD
);
/*
if
(
switch_test_flag
(
rtp_session
,
SWITCH_RTP_FLAG_VAD
)
&&
rtp_session
->
recv_msg
.
header
.
pt
==
rtp_session
->
vad_data
.
read_codec
->
implementation
->
ianacode
)
{
*/
if
(
switch_test_flag
(
rtp_session
,
SWITCH_RTP_FLAG_VAD
))
{
int16_t
decoded
[
SWITCH_RECOMMENDED_BUFFER_SIZE
/
sizeof
(
int16_t
)]
=
{
0
};
uint32_t
rate
=
0
;
uint32_t
codec_flags
=
0
;
...
...
@@ -3301,7 +3290,6 @@ static int rtp_common_write(switch_rtp_t *rtp_session,
if
(
score
>
rtp_session
->
vad_data
.
bg_level
&&
!
switch_test_flag
(
&
rtp_session
->
vad_data
,
SWITCH_VAD_FLAG_TALKING
))
{
uint32_t
diff
=
score
-
rtp_session
->
vad_data
.
bg_level
;
if
(
rtp_session
->
vad_data
.
hangover_hits
)
{
rtp_session
->
vad_data
.
hangover_hits
--
;
}
...
...
@@ -3354,31 +3342,11 @@ static int rtp_common_write(switch_rtp_t *rtp_session,
this_ts
=
ntohl
(
send_msg
->
header
.
ts
);
/* if previous normal packet is sent but this one is not scheduled to be sent, send a CN packet */
if
(
!
rtp_session
->
last_voicepkt
&&
send
==
0
)
{
send
=
1
;
sendCN
=
1
;
//switch_set_flag(&rtp_session->vad_data,SWITCH_VAD_NPACKET_SENT );
rtp_session
->
last_voicepkt
=
1
;
}
if
(
!
switch_rtp_ready
(
rtp_session
)
||
rtp_session
->
sending_dtmf
||
!
this_ts
)
{
send
=
0
;
}
/* we send CN automatically. ignore other attempts */
if
(
send_msg
->
header
.
pt
==
rtp_session
->
cng_pt
){
send
=
0
;
}
if
(
send
)
{
if
(
!
sendCN
)
rtp_session
->
last_voicepkt
=
0
;
send_msg
->
header
.
seq
=
htons
(
++
rtp_session
->
seq
);
if
(
switch_test_flag
(
rtp_session
,
SWITCH_RTP_FLAG_SECURE_SEND
))
{
...
...
@@ -3473,18 +3441,6 @@ static int rtp_common_write(switch_rtp_t *rtp_session,
}
}
if
(
sendCN
)
{
int
CNdatalen
=
2
;
rtp_session
->
cn
++
;
memcpy
(
send_msg
->
body
,
CNdata
,
CNdatalen
);
bytes
=
CNdatalen
+
rtp_header_len
;
payload
=
rtp_session
->
cng_pt
;
send_msg
->
header
.
pt
=
rtp_session
->
cng_pt
;
send_msg
->
header
.
m
=
0
;
rtp_session
->
last_voicepkt
=
1
;
}
if
(
switch_socket_sendto
(
rtp_session
->
sock_output
,
rtp_session
->
remote_addr
,
0
,
(
void
*
)
send_msg
,
&
bytes
)
!=
SWITCH_STATUS_SUCCESS
)
{
rtp_session
->
seq
--
;
...
...
@@ -3567,9 +3523,6 @@ static int rtp_common_write(switch_rtp_t *rtp_session,
}
}
if
(
rtp_session
->
remote_stun_addr
)
{
do_stun_ping
(
rtp_session
);
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论