Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
37c2b1ff
提交
37c2b1ff
authored
6月 01, 2011
作者:
Anthony Minessale
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix race
上级
51c21580
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
21 行增加
和
14 行删除
+21
-14
mod_loopback.c
src/mod/endpoints/mod_loopback/mod_loopback.c
+21
-14
没有找到文件。
src/mod/endpoints/mod_loopback/mod_loopback.c
浏览文件 @
37c2b1ff
...
@@ -54,7 +54,8 @@ typedef enum {
...
@@ -54,7 +54,8 @@ typedef enum {
TFLAG_BLEG
=
(
1
<<
6
),
TFLAG_BLEG
=
(
1
<<
6
),
TFLAG_APP
=
(
1
<<
7
),
TFLAG_APP
=
(
1
<<
7
),
TFLAG_RUNNING_APP
=
(
1
<<
8
),
TFLAG_RUNNING_APP
=
(
1
<<
8
),
TFLAG_BOWOUT_USED
=
(
1
<<
9
)
TFLAG_BOWOUT_USED
=
(
1
<<
9
),
TFLAG_CLEAR
=
(
1
<<
10
)
}
TFLAGS
;
}
TFLAGS
;
struct
private_object
{
struct
private_object
{
...
@@ -105,6 +106,17 @@ static switch_status_t channel_read_frame(switch_core_session_t *session, switch
...
@@ -105,6 +106,17 @@ static switch_status_t channel_read_frame(switch_core_session_t *session, switch
static
switch_status_t
channel_write_frame
(
switch_core_session_t
*
session
,
switch_frame_t
*
frame
,
switch_io_flag_t
flags
,
int
stream_id
);
static
switch_status_t
channel_write_frame
(
switch_core_session_t
*
session
,
switch_frame_t
*
frame
,
switch_io_flag_t
flags
,
int
stream_id
);
static
switch_status_t
channel_kill_channel
(
switch_core_session_t
*
session
,
int
sig
);
static
switch_status_t
channel_kill_channel
(
switch_core_session_t
*
session
,
int
sig
);
static
void
clear_queue
(
private_t
*
tech_pvt
)
{
void
*
pop
;
while
(
switch_queue_trypop
(
tech_pvt
->
frame_queue
,
&
pop
)
==
SWITCH_STATUS_SUCCESS
&&
pop
)
{
switch_frame_t
*
frame
=
(
switch_frame_t
*
)
pop
;
switch_frame_free
(
&
frame
);
}
}
static
switch_status_t
tech_init
(
private_t
*
tech_pvt
,
switch_core_session_t
*
session
,
switch_codec_t
*
codec
)
static
switch_status_t
tech_init
(
private_t
*
tech_pvt
,
switch_core_session_t
*
session
,
switch_codec_t
*
codec
)
{
{
const
char
*
iananame
=
"L16"
;
const
char
*
iananame
=
"L16"
;
...
@@ -566,6 +578,12 @@ static switch_status_t channel_read_frame(switch_core_session_t *session, switch
...
@@ -566,6 +578,12 @@ static switch_status_t channel_read_frame(switch_core_session_t *session, switch
mutex
=
tech_pvt
->
mutex
;
mutex
=
tech_pvt
->
mutex
;
switch_mutex_lock
(
mutex
);
switch_mutex_lock
(
mutex
);
if
(
switch_test_flag
(
tech_pvt
,
TFLAG_CLEAR
))
{
clear_queue
(
tech_pvt
);
switch_clear_flag
(
tech_pvt
,
TFLAG_CLEAR
);
}
if
(
switch_queue_trypop
(
tech_pvt
->
frame_queue
,
&
pop
)
==
SWITCH_STATUS_SUCCESS
&&
pop
)
{
if
(
switch_queue_trypop
(
tech_pvt
->
frame_queue
,
&
pop
)
==
SWITCH_STATUS_SUCCESS
&&
pop
)
{
if
(
tech_pvt
->
write_frame
)
{
if
(
tech_pvt
->
write_frame
)
{
switch_frame_free
(
&
tech_pvt
->
write_frame
);
switch_frame_free
(
&
tech_pvt
->
write_frame
);
...
@@ -599,17 +617,6 @@ static switch_status_t channel_read_frame(switch_core_session_t *session, switch
...
@@ -599,17 +617,6 @@ static switch_status_t channel_read_frame(switch_core_session_t *session, switch
return
status
;
return
status
;
}
}
static
void
clear_queue
(
private_t
*
tech_pvt
)
{
void
*
pop
;
while
(
switch_queue_trypop
(
tech_pvt
->
frame_queue
,
&
pop
)
==
SWITCH_STATUS_SUCCESS
&&
pop
)
{
switch_frame_t
*
frame
=
(
switch_frame_t
*
)
pop
;
switch_frame_free
(
&
frame
);
}
}
static
switch_status_t
channel_write_frame
(
switch_core_session_t
*
session
,
switch_frame_t
*
frame
,
switch_io_flag_t
flags
,
int
stream_id
)
static
switch_status_t
channel_write_frame
(
switch_core_session_t
*
session
,
switch_frame_t
*
frame
,
switch_io_flag_t
flags
,
int
stream_id
)
{
{
switch_channel_t
*
channel
=
NULL
;
switch_channel_t
*
channel
=
NULL
;
...
@@ -750,9 +757,9 @@ static switch_status_t channel_receive_message(switch_core_session_t *session, s
...
@@ -750,9 +757,9 @@ static switch_status_t channel_receive_message(switch_core_session_t *session, s
{
{
done
=
1
;
done
=
1
;
switch_set_flag
(
tech_pvt
,
TFLAG_CLEAR
);
switch_set_flag
(
tech_pvt
->
other_tech_pvt
,
TFLAG_CLEAR
);
clear_queue
(
tech_pvt
);
clear_queue
(
tech_pvt
->
other_tech_pvt
);
switch_core_timer_sync
(
&
tech_pvt
->
timer
);
switch_core_timer_sync
(
&
tech_pvt
->
timer
);
switch_core_timer_sync
(
&
tech_pvt
->
other_tech_pvt
->
timer
);
switch_core_timer_sync
(
&
tech_pvt
->
other_tech_pvt
->
timer
);
}
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论