Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
56e4afb2
提交
56e4afb2
authored
9月 04, 2014
作者:
Michael Jerris
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
FS-6595: Enable pause_play and file_seek for conference member fnode #resolve
上级
60bfa544
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
61 行增加
和
22 行删除
+61
-22
mod_conference.c
src/mod/applications/mod_conference/mod_conference.c
+61
-22
没有找到文件。
src/mod/applications/mod_conference/mod_conference.c
浏览文件 @
56e4afb2
...
...
@@ -4633,7 +4633,7 @@ static void member_add_file_data(conference_member_t *member, int16_t *data, swi
pool
=
fnode
->
pool
;
fnode
=
NULL
;
switch_core_destroy_memory_pool
(
&
pool
);
}
else
{
}
else
if
(
!
switch_test_flag
(
member
->
fnode
,
NFLAG_PAUSE
))
{
/* skip this frame until leadin time has expired */
if
(
member
->
fnode
->
leadin
)
{
member
->
fnode
->
leadin
--
;
...
...
@@ -7145,64 +7145,103 @@ static switch_status_t conf_api_sub_xml_list(conference_obj_t *conference, switc
return
SWITCH_STATUS_SUCCESS
;
}
static
switch_status_t
conf_api_sub_pause_play
(
conference_obj_t
*
conference
,
switch_stream_handle_t
*
stream
,
int
argc
,
char
**
argv
)
static
void
switch_fnode_toggle_pause
(
conference_file_node_t
*
fnode
,
switch_stream_handle_t
*
stream
)
{
if
(
argc
==
2
)
{
switch_mutex_lock
(
conference
->
mutex
);
if
(
conference
->
fnode
)
{
if
(
switch_test_flag
(
conference
->
fnode
,
NFLAG_PAUSE
))
{
if
(
fnode
)
{
if
(
switch_test_flag
(
fnode
,
NFLAG_PAUSE
))
{
stream
->
write_function
(
stream
,
"+OK Resume
\n
"
);
switch_clear_flag
(
conference
->
fnode
,
NFLAG_PAUSE
);
switch_clear_flag
(
fnode
,
NFLAG_PAUSE
);
}
else
{
stream
->
write_function
(
stream
,
"+OK Pause
\n
"
);
switch_set_flag
(
conference
->
fnode
,
NFLAG_PAUSE
);
switch_set_flag
(
fnode
,
NFLAG_PAUSE
);
}
}
}
static
switch_status_t
conf_api_sub_pause_play
(
conference_obj_t
*
conference
,
switch_stream_handle_t
*
stream
,
int
argc
,
char
**
argv
)
{
if
(
argc
==
2
)
{
switch_mutex_lock
(
conference
->
mutex
);
switch_fnode_toggle_pause
(
conference
->
fnode
,
stream
);
switch_mutex_unlock
(
conference
->
mutex
);
return
SWITCH_STATUS_SUCCESS
;
}
if
(
argc
==
3
)
{
uint32_t
id
=
atoi
(
argv
[
2
]);
conference_member_t
*
member
;
if
((
member
=
conference_member_get
(
conference
,
id
)))
{
switch_mutex_lock
(
member
->
fnode_mutex
);
switch_fnode_toggle_pause
(
member
->
fnode
,
stream
);
switch_mutex_unlock
(
member
->
fnode_mutex
);
switch_thread_rwlock_unlock
(
member
->
rwlock
);
return
SWITCH_STATUS_SUCCESS
;
}
else
{
stream
->
write_function
(
stream
,
"Member: %u not found.
\n
"
,
id
);
}
}
return
SWITCH_STATUS_GENERR
;
}
static
switch_status_t
conf_api_sub_file_seek
(
conference_obj_t
*
conference
,
switch_stream_handle_t
*
stream
,
int
argc
,
char
**
argv
)
static
void
switch_fnode_seek
(
conference_file_node_t
*
fnode
,
switch_stream_handle_t
*
stream
,
char
*
arg
)
{
if
(
argc
==
3
)
{
if
(
fnode
&&
fnode
->
type
==
NODE_TYPE_FILE
)
{
unsigned
int
samps
=
0
;
unsigned
int
pos
=
0
;
switch_mutex_lock
(
conference
->
mutex
);
if
(
conference
->
fnode
&&
conference
->
fnode
->
type
==
NODE_TYPE_FILE
)
{
if
(
*
argv
[
2
]
==
'+'
||
*
argv
[
2
]
==
'-'
)
{
if
(
*
arg
==
'+'
||
*
arg
==
'-'
)
{
int
step
;
int32_t
target
;
if
(
!
(
step
=
atoi
(
argv
[
2
]
)))
{
if
(
!
(
step
=
atoi
(
arg
)))
{
step
=
1000
;
}
samps
=
step
*
(
conference
->
fnode
->
fh
.
native_rate
/
1000
);
target
=
(
int32_t
)
conference
->
fnode
->
fh
.
pos
+
samps
;
samps
=
step
*
(
fnode
->
fh
.
native_rate
/
1000
);
target
=
(
int32_t
)
fnode
->
fh
.
pos
+
samps
;
if
(
target
<
0
)
{
target
=
0
;
}
stream
->
write_function
(
stream
,
"+OK seek to position %d
\n
"
,
target
);
switch_core_file_seek
(
&
conference
->
fnode
->
fh
,
&
pos
,
target
,
SEEK_SET
);
switch_core_file_seek
(
&
fnode
->
fh
,
&
pos
,
target
,
SEEK_SET
);
}
else
{
samps
=
switch_atoui
(
argv
[
2
])
*
(
conference
->
fnode
->
fh
.
native_rate
/
1000
);
samps
=
switch_atoui
(
arg
)
*
(
fnode
->
fh
.
native_rate
/
1000
);
stream
->
write_function
(
stream
,
"+OK seek to position %d
\n
"
,
samps
);
switch_core_file_seek
(
&
conference
->
fnode
->
fh
,
&
pos
,
samps
,
SEEK_SET
);
switch_core_file_seek
(
&
fnode
->
fh
,
&
pos
,
samps
,
SEEK_SET
);
}
}
}
static
switch_status_t
conf_api_sub_file_seek
(
conference_obj_t
*
conference
,
switch_stream_handle_t
*
stream
,
int
argc
,
char
**
argv
)
{
if
(
argc
==
3
)
{
switch_mutex_lock
(
conference
->
mutex
);
switch_fnode_seek
(
conference
->
fnode
,
stream
,
argv
[
2
]);
switch_mutex_unlock
(
conference
->
mutex
);
return
SWITCH_STATUS_SUCCESS
;
}
if
(
argc
==
4
)
{
uint32_t
id
=
atoi
(
argv
[
3
]);
conference_member_t
*
member
=
conference_member_get
(
conference
,
id
);
if
(
member
==
NULL
)
{
stream
->
write_function
(
stream
,
"Member: %u not found.
\n
"
,
id
);
return
SWITCH_STATUS_GENERR
;
}
switch_mutex_lock
(
member
->
fnode_mutex
);
switch_fnode_seek
(
member
->
fnode
,
stream
,
argv
[
2
]);
switch_mutex_unlock
(
member
->
fnode_mutex
);
switch_thread_rwlock_unlock
(
member
->
rwlock
);
return
SWITCH_STATUS_SUCCESS
;
}
return
SWITCH_STATUS_GENERR
;
}
...
...
@@ -8108,8 +8147,8 @@ static api_command_t conf_api_sub_commands[] = {
{
"position"
,
(
void_fn_t
)
&
conf_api_sub_position
,
CONF_API_SUB_MEMBER_TARGET
,
"position"
,
"<member_id> <x>,<y>,<z>"
},
{
"auto-3d-position"
,
(
void_fn_t
)
&
conf_api_sub_auto_position
,
CONF_API_SUB_ARGS_SPLIT
,
"auto-3d-position"
,
"[on|off]"
},
{
"play"
,
(
void_fn_t
)
&
conf_api_sub_play
,
CONF_API_SUB_ARGS_SPLIT
,
"play"
,
"<file_path> [async|<member_id> [nomux]]"
},
{
"pause_play"
,
(
void_fn_t
)
&
conf_api_sub_pause_play
,
CONF_API_SUB_ARGS_SPLIT
,
"pause"
,
""
},
{
"file_seek"
,
(
void_fn_t
)
&
conf_api_sub_file_seek
,
CONF_API_SUB_ARGS_SPLIT
,
"file_seek"
,
"[+-]<val>"
},
{
"pause_play"
,
(
void_fn_t
)
&
conf_api_sub_pause_play
,
CONF_API_SUB_ARGS_SPLIT
,
"pause"
,
"
[<member_id>]
"
},
{
"file_seek"
,
(
void_fn_t
)
&
conf_api_sub_file_seek
,
CONF_API_SUB_ARGS_SPLIT
,
"file_seek"
,
"[+-]<val>
[<member_id>]
"
},
{
"say"
,
(
void_fn_t
)
&
conf_api_sub_say
,
CONF_API_SUB_ARGS_AS_ONE
,
"say"
,
"<text>"
},
{
"saymember"
,
(
void_fn_t
)
&
conf_api_sub_saymember
,
CONF_API_SUB_ARGS_AS_ONE
,
"saymember"
,
"<member_id> <text>"
},
{
"stop"
,
(
void_fn_t
)
&
conf_api_sub_stop
,
CONF_API_SUB_ARGS_SPLIT
,
"stop"
,
"<[current|all|async|last]> [<member_id>]"
},
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论