Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
334706eb
提交
334706eb
authored
2月 20, 2015
作者:
Anthony Minessale
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
FS-7513: add some controls
上级
3df55891
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
59 行增加
和
7 行删除
+59
-7
mod_conference.c
src/mod/applications/mod_conference/mod_conference.c
+59
-7
没有找到文件。
src/mod/applications/mod_conference/mod_conference.c
浏览文件 @
334706eb
...
@@ -366,6 +366,7 @@ typedef struct mcu_layer_geometry_s {
...
@@ -366,6 +366,7 @@ typedef struct mcu_layer_geometry_s {
int
y
;
int
y
;
int
scale
;
int
scale
;
int
floor
;
int
floor
;
int
flooronly
;
int
overlap
;
int
overlap
;
char
*
res_id
;
char
*
res_id
;
char
*
audio_position
;
char
*
audio_position
;
...
@@ -807,7 +808,7 @@ static void conference_parse_layouts(conference_obj_t *conference)
...
@@ -807,7 +808,7 @@ static void conference_parse_layouts(conference_obj_t *conference)
for
(
x_image
=
switch_xml_child
(
x_layout
,
"image"
);
x_image
;
x_image
=
x_image
->
next
)
{
for
(
x_image
=
switch_xml_child
(
x_layout
,
"image"
);
x_image
;
x_image
=
x_image
->
next
)
{
const
char
*
res_id
=
NULL
,
*
audio_position
=
NULL
;
const
char
*
res_id
=
NULL
,
*
audio_position
=
NULL
;
int x = -1, y = -1, scale = -1, floor = 0, overlap = 0;
int
x
=
-
1
,
y
=
-
1
,
scale
=
-
1
,
floor
=
0
,
flooronly
=
0
,
overlap
=
0
;
if
((
val
=
switch_xml_attr
(
x_image
,
"x"
)))
{
if
((
val
=
switch_xml_attr
(
x_image
,
"x"
)))
{
x
=
atoi
(
val
);
x
=
atoi
(
val
);
...
@@ -825,6 +826,10 @@ static void conference_parse_layouts(conference_obj_t *conference)
...
@@ -825,6 +826,10 @@ static void conference_parse_layouts(conference_obj_t *conference)
floor
=
switch_true
(
val
);
floor
=
switch_true
(
val
);
}
}
if
((
val
=
switch_xml_attr
(
x_image
,
"floor-only"
)))
{
flooronly
=
floor
=
switch_true
(
val
);
}
if
((
val
=
switch_xml_attr
(
x_image
,
"overlap"
)))
{
if
((
val
=
switch_xml_attr
(
x_image
,
"overlap"
)))
{
overlap
=
switch_true
(
val
);
overlap
=
switch_true
(
val
);
}
}
...
@@ -848,6 +853,7 @@ static void conference_parse_layouts(conference_obj_t *conference)
...
@@ -848,6 +853,7 @@ static void conference_parse_layouts(conference_obj_t *conference)
vlayout
->
images
[
vlayout
->
layers
].
y
=
y
;
vlayout
->
images
[
vlayout
->
layers
].
y
=
y
;
vlayout
->
images
[
vlayout
->
layers
].
scale
=
scale
;
vlayout
->
images
[
vlayout
->
layers
].
scale
=
scale
;
vlayout
->
images
[
vlayout
->
layers
].
floor
=
floor
;
vlayout
->
images
[
vlayout
->
layers
].
floor
=
floor
;
vlayout
->
images
[
vlayout
->
layers
].
flooronly
=
flooronly
;
vlayout
->
images
[
vlayout
->
layers
].
overlap
=
overlap
;
vlayout
->
images
[
vlayout
->
layers
].
overlap
=
overlap
;
if
(
res_id
)
{
if
(
res_id
)
{
...
@@ -1294,6 +1300,11 @@ static switch_status_t attach_video_layer(conference_member_t *member, int idx)
...
@@ -1294,6 +1300,11 @@ static switch_status_t attach_video_layer(conference_member_t *member, int idx)
layer
=
&
member
->
conference
->
canvas
->
layers
[
idx
];
layer
=
&
member
->
conference
->
canvas
->
layers
[
idx
];
layer
->
tagged
=
0
;
layer
->
tagged
=
0
;
if
(
layer
->
geometry
.
flooronly
&&
member
->
id
!=
member
->
conference
->
video_floor_holder
)
{
switch_goto_status
(
SWITCH_STATUS_FALSE
,
end
);
}
if
(
layer
->
geometry
.
res_id
)
{
if
(
layer
->
geometry
.
res_id
)
{
if
(
!
member
->
video_reservation_id
||
strcmp
(
layer
->
geometry
.
res_id
,
member
->
video_reservation_id
))
{
if
(
!
member
->
video_reservation_id
||
strcmp
(
layer
->
geometry
.
res_id
,
member
->
video_reservation_id
))
{
switch_goto_status
(
SWITCH_STATUS_FALSE
,
end
);
switch_goto_status
(
SWITCH_STATUS_FALSE
,
end
);
...
@@ -1709,6 +1720,12 @@ static void *SWITCH_THREAD_FUNC conference_video_muxing_thread_run(switch_thread
...
@@ -1709,6 +1720,12 @@ static void *SWITCH_THREAD_FUNC conference_video_muxing_thread_run(switch_thread
attach_video_layer
(
imember
,
i
);
attach_video_layer
(
imember
,
i
);
break
;
break
;
}
}
}
else
if
(
xlayer
->
geometry
.
flooronly
)
{
if
(
imember
->
id
==
conference
->
video_floor_holder
)
{
layer
=
xlayer
;
attach_video_layer
(
imember
,
i
);
break
;
}
}
else
if
(
!
xlayer
->
member_id
)
{
}
else
if
(
!
xlayer
->
member_id
)
{
switch_status_t
lstatus
;
switch_status_t
lstatus
;
...
@@ -2793,7 +2810,7 @@ static cJSON *conference_json_render(conference_obj_t *conference, cJSON *req)
...
@@ -2793,7 +2810,7 @@ static cJSON *conference_json_render(conference_obj_t *conference, cJSON *req)
static
void
conference_mod_event_channel_handler
(
const
char
*
event_channel
,
cJSON
*
json
,
const
char
*
key
,
switch_event_channel_id_t
id
)
static
void
conference_mod_event_channel_handler
(
const
char
*
event_channel
,
cJSON
*
json
,
const
char
*
key
,
switch_event_channel_id_t
id
)
{
{
cJSON *data;
cJSON
*
data
,
*
addobj
=
NULL
;
const
char
*
action
=
NULL
;
const
char
*
action
=
NULL
;
char
*
value
=
NULL
;
char
*
value
=
NULL
;
cJSON
*
jid
=
0
;
cJSON
*
jid
=
0
;
...
@@ -2844,13 +2861,23 @@ static void conference_mod_event_channel_handler(const char *event_channel, cJSO
...
@@ -2844,13 +2861,23 @@ static void conference_mod_event_channel_handler(const char *event_channel, cJSO
SWITCH_STANDARD_STREAM
(
stream
);
SWITCH_STANDARD_STREAM
(
stream
);
if (!strcasecmp(action, "kick") || !strcasecmp(action, "mute") || !strcasecmp(action, "unmute") || !strcasecmp(action, "tmute")) {
if
(
!
strcasecmp
(
action
,
"kick"
)
||
!
strcasecmp
(
action
,
"mute"
)
||
!
strcasecmp
(
action
,
"unmute"
)
||
!
strcasecmp
(
action
,
"tmute"
)
||
!
strcasecmp
(
action
,
"vmute"
)
||
!
strcasecmp
(
action
,
"unvmute"
)
||
!
strcasecmp
(
action
,
"tvmute"
)
)
{
exec
=
switch_mprintf
(
"%s %s %d"
,
conf_name
,
action
,
cid
);
exec
=
switch_mprintf
(
"%s %s %d"
,
conf_name
,
action
,
cid
);
} else if (!strcasecmp(action, "volume_in") || !strcasecmp(action, "volume_out")) {
}
else
if
(
!
strcasecmp
(
action
,
"volume_in"
)
||
!
strcasecmp
(
action
,
"volume_out"
)
||
!
strcasecmp
(
action
,
"vid-res-id"
)
||
!
strcasecmp
(
action
,
"vid-banner"
))
{
exec
=
switch_mprintf
(
"%s %s %d %s"
,
conf_name
,
action
,
cid
,
argv
[
0
]);
exec
=
switch_mprintf
(
"%s %s %d %s"
,
conf_name
,
action
,
cid
,
argv
[
0
]);
}
else
if
(
!
strcasecmp
(
action
,
"play"
)
||
!
strcasecmp
(
action
,
"stop"
))
{
}
else
if
(
!
strcasecmp
(
action
,
"play"
)
||
!
strcasecmp
(
action
,
"stop"
))
{
exec
=
switch_mprintf
(
"%s %s %s"
,
conf_name
,
action
,
argv
[
0
]);
exec
=
switch_mprintf
(
"%s %s %s"
,
conf_name
,
action
,
argv
[
0
]);
} else if (!strcasecmp(action, "recording")) {
}
else
if
(
!
strcasecmp
(
action
,
"recording"
)
||
!
strcasecmp
(
action
,
"vid-layout"
)
)
{
if
(
!
argv
[
1
])
{
if
(
!
argv
[
1
])
{
argv
[
1
]
=
"all"
;
argv
[
1
]
=
"all"
;
}
}
...
@@ -2871,6 +2898,20 @@ static void conference_mod_event_channel_handler(const char *event_channel, cJSO
...
@@ -2871,6 +2898,20 @@ static void conference_mod_event_channel_handler(const char *event_channel, cJSO
switch_thread_rwlock_unlock
(
conference
->
rwlock
);
switch_thread_rwlock_unlock
(
conference
->
rwlock
);
}
}
goto
end
;
goto
end
;
}
else
if
(
!
strcasecmp
(
action
,
"list-videoLayouts"
))
{
switch_hash_index_t
*
hi
;
void
*
val
;
const
void
*
vvar
;
cJSON
*
array
=
cJSON_CreateArray
();
conference_obj_t
*
conference
=
NULL
;
if
((
conference
=
conference_find
(
conf_name
,
NULL
)))
{
for
(
hi
=
switch_core_hash_first
(
conference
->
layout_hash
);
hi
;
hi
=
switch_core_hash_next
(
&
hi
))
{
switch_core_hash_this
(
hi
,
&
vvar
,
NULL
,
&
val
);
cJSON_AddItemToArray
(
array
,
cJSON_CreateString
((
char
*
)
vvar
));
}
switch_thread_rwlock_unlock
(
conference
->
rwlock
);
}
addobj
=
array
;
}
}
if
(
exec
)
{
if
(
exec
)
{
...
@@ -2885,7 +2926,11 @@ static void conference_mod_event_channel_handler(const char *event_channel, cJSO
...
@@ -2885,7 +2926,11 @@ static void conference_mod_event_channel_handler(const char *event_channel, cJSO
cJSON_AddItemToObject
(
msg
,
"eventChannel"
,
cJSON_CreateString
(
event_channel
));
cJSON_AddItemToObject
(
msg
,
"eventChannel"
,
cJSON_CreateString
(
event_channel
));
cJSON_AddItemToObject
(
jdata
,
"action"
,
cJSON_CreateString
(
"response"
));
cJSON_AddItemToObject
(
jdata
,
"action"
,
cJSON_CreateString
(
"response"
));
if (exec) {
if
(
addobj
)
{
cJSON_AddItemToObject
(
jdata
,
"conf-command"
,
cJSON_CreateString
(
action
));
cJSON_AddItemToObject
(
jdata
,
"response"
,
cJSON_CreateString
(
"OK"
));
cJSON_AddItemToObject
(
jdata
,
"responseData"
,
addobj
);
}
else
if
(
exec
)
{
cJSON_AddItemToObject
(
jdata
,
"conf-command"
,
cJSON_CreateString
(
exec
));
cJSON_AddItemToObject
(
jdata
,
"conf-command"
,
cJSON_CreateString
(
exec
));
cJSON_AddItemToObject
(
jdata
,
"response"
,
cJSON_CreateString
((
char
*
)
stream
.
data
));
cJSON_AddItemToObject
(
jdata
,
"response"
,
cJSON_CreateString
((
char
*
)
stream
.
data
));
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_ALERT
,
"RES [%s][%s]
\n
"
,
exec
,
(
char
*
)
stream
.
data
);
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_ALERT
,
"RES [%s][%s]
\n
"
,
exec
,
(
char
*
)
stream
.
data
);
...
@@ -8549,11 +8594,16 @@ static switch_status_t conf_api_sub_vid_res_id(conference_member_t *member, swit
...
@@ -8549,11 +8594,16 @@ static switch_status_t conf_api_sub_vid_res_id(conference_member_t *member, swit
return
SWITCH_STATUS_SUCCESS
;
return
SWITCH_STATUS_SUCCESS
;
}
}
if
(
zstr
(
text
))
{
stream
->
write_function
(
stream
,
"-ERR missing arg
\n
"
);
return
SWITCH_STATUS_SUCCESS
;
}
switch_mutex_lock
(
member
->
conference
->
canvas
->
mutex
);
switch_mutex_lock
(
member
->
conference
->
canvas
->
mutex
);
//layer = &member->conference->canvas->layers[member->video_layer_id];
//layer = &member->conference->canvas->layers[member->video_layer_id];
if (!strcasecmp(text, "clear")) {
if
(
!
strcasecmp
(
text
,
"clear"
)
||
(
member
->
video_reservation_id
&&
!
strcasecmp
(
text
,
member
->
video_reservation_id
))
)
{
member
->
video_reservation_id
=
NULL
;
member
->
video_reservation_id
=
NULL
;
stream
->
write_function
(
stream
,
"+OK reservation_id cleared
\n
"
);
stream
->
write_function
(
stream
,
"+OK reservation_id cleared
\n
"
);
}
else
{
}
else
{
...
@@ -8577,6 +8627,8 @@ static switch_status_t conf_api_sub_vid_banner(conference_member_t *member, swit
...
@@ -8577,6 +8627,8 @@ static switch_status_t conf_api_sub_vid_banner(conference_member_t *member, swit
if
(
member
==
NULL
)
if
(
member
==
NULL
)
return
SWITCH_STATUS_GENERR
;
return
SWITCH_STATUS_GENERR
;
switch_url_decode
(
text
);
if
(
!
switch_channel_test_flag
(
member
->
channel
,
CF_VIDEO
))
{
if
(
!
switch_channel_test_flag
(
member
->
channel
,
CF_VIDEO
))
{
stream
->
write_function
(
stream
,
"Channel %s does not have video capability!
\n
"
,
switch_channel_get_name
(
member
->
channel
));
stream
->
write_function
(
stream
,
"Channel %s does not have video capability!
\n
"
,
switch_channel_get_name
(
member
->
channel
));
return
SWITCH_STATUS_SUCCESS
;
return
SWITCH_STATUS_SUCCESS
;
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论