Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
b84662ae
提交
b84662ae
authored
4月 17, 2017
作者:
Anthony Minessale
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
FS-10243: [mod_conference] Add conference variables #resolve
上级
3d885ac5
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
304 行增加
和
85 行删除
+304
-85
conference_api.c
src/mod/applications/mod_conference/conference_api.c
+115
-6
conference_member.c
src/mod/applications/mod_conference/conference_member.c
+4
-0
conference_video.c
src/mod/applications/mod_conference/conference_video.c
+116
-64
mod_conference.c
src/mod/applications/mod_conference/mod_conference.c
+49
-2
mod_conference.h
src/mod/applications/mod_conference/mod_conference.h
+19
-12
mod_verto.c
src/mod/endpoints/mod_verto/mod_verto.c
+1
-1
没有找到文件。
src/mod/applications/mod_conference/conference_api.c
浏览文件 @
b84662ae
...
...
@@ -103,6 +103,7 @@ api_command_t conference_api_sub_commands[] = {
{
"vid-banner"
,
(
void_fn_t
)
&
conference_api_sub_vid_banner
,
CONF_API_SUB_MEMBER_TARGET
,
"vid-banner"
,
"<member_id|last> <text>"
},
{
"vid-mute-img"
,
(
void_fn_t
)
&
conference_api_sub_vid_mute_img
,
CONF_API_SUB_MEMBER_TARGET
,
"vid-mute-img"
,
"<member_id|last> [<path>|clear]"
},
{
"vid-logo-img"
,
(
void_fn_t
)
&
conference_api_sub_vid_logo_img
,
CONF_API_SUB_MEMBER_TARGET
,
"vid-logo-img"
,
"<member_id|last> [<path>|clear]"
},
{
"vid-codec-group"
,
(
void_fn_t
)
&
conference_api_sub_vid_codec_group
,
CONF_API_SUB_MEMBER_TARGET
,
"vid-codec-group"
,
"<member_id|last> [<group>|clear]"
},
{
"vid-res-id"
,
(
void_fn_t
)
&
conference_api_sub_vid_res_id
,
CONF_API_SUB_MEMBER_TARGET
,
"vid-res-id"
,
"<member_id|last> <val>|clear"
},
{
"vid-role-id"
,
(
void_fn_t
)
&
conference_api_sub_vid_role_id
,
CONF_API_SUB_MEMBER_TARGET
,
"vid-role-id"
,
"<member_id|last> <val>|clear"
},
{
"get-uuid"
,
(
void_fn_t
)
&
conference_api_sub_get_uuid
,
CONF_API_SUB_MEMBER_TARGET
,
"get-uuid"
,
"<member_id|last>"
},
...
...
@@ -1314,8 +1315,11 @@ switch_status_t conference_api_sub_vid_bandwidth(conference_obj_t *conference, s
{
uint32_t
i
;
int32_t
video_write_bandwidth
;
int
x
=
0
;
int
x
=
0
,
id
=
-
1
;
char
*
group
=
NULL
;
char
*
array
[
4
]
=
{
0
};
int
sdiv
=
0
,
fdiv
=
0
;
if
(
!
conference_utils_test_flag
(
conference
,
CFLAG_MINIMIZE_VIDEO_ENCODING
))
{
stream
->
write_function
(
stream
,
"Bandwidth control not available.
\n
"
);
return
SWITCH_STATUS_SUCCESS
;
...
...
@@ -1325,15 +1329,87 @@ switch_status_t conference_api_sub_vid_bandwidth(conference_obj_t *conference, s
stream
->
write_function
(
stream
,
"Invalid input
\n
"
);
return
SWITCH_STATUS_SUCCESS
;
}
switch_split
(
argv
[
2
],
':'
,
array
);
if
(
array
[
1
])
{
sdiv
=
atoi
(
array
[
2
]);
if
(
sdiv
<
2
||
sdiv
>
8
)
{
sdiv
=
0
;
}
}
if
(
array
[
2
])
{
fdiv
=
atoi
(
array
[
2
]);
if
(
fdiv
<
2
||
fdiv
>
8
)
{
fdiv
=
0
;
}
}
video_write_bandwidth
=
switch_parse_bandwidth_string
(
array
[
0
]);
if
(
argv
[
3
])
{
group
=
argv
[
3
];
}
if
(
argv
[
4
])
{
if
(
argv
[
4
])
{
id
=
atoi
(
argv
[
4
]);
}
video_write_bandwidth
=
switch_parse_bandwidth_string
(
argv
[
2
]);
if
(
id
<
1
||
id
>
MAX_CANVASES
+
1
)
{
id
=
-
1
;
}
if
(
id
<
1
||
id
>
conference
->
canvas_count
)
{
stream
->
write_function
(
stream
,
"-ERR Invalid canvas
\n
"
);
goto
end
;
}
}
switch_mutex_lock
(
conference
->
member_mutex
);
for
(
i
=
0
;
i
<=
conference
->
canvas_count
;
i
++
)
{
if
(
i
>
-
1
&&
i
!=
id
-
1
)
{
continue
;
}
if
(
conference
->
canvases
[
i
])
{
stream
->
write_function
(
stream
,
"Set Bandwidth for canvas %d to %d
\n
"
,
i
+
1
,
video_write_bandwidth
);
x
++
;
conference
->
canvases
[
i
]
->
video_write_bandwidth
=
video_write_bandwidth
;
mcu_canvas_t
*
canvas
=
conference
->
canvases
[
i
];
int
j
;
for
(
j
=
0
;
j
<
canvas
->
write_codecs_count
;
j
++
)
{
if
((
zstr
(
group
)
||
!
strcmp
(
group
,
switch_str_nil
(
canvas
->
write_codecs
[
j
]
->
video_codec_group
))))
{
switch_core_codec_control
(
&
canvas
->
write_codecs
[
j
]
->
codec
,
SCC_VIDEO_BANDWIDTH
,
SCCT_INT
,
&
video_write_bandwidth
,
SCCT_NONE
,
NULL
,
NULL
,
NULL
);
stream
->
write_function
(
stream
,
"Set Bandwidth for canvas %d index %d group[%s] to %d
\n
"
,
i
+
1
,
j
,
switch_str_nil
(
canvas
->
write_codecs
[
j
]
->
video_codec_group
),
video_write_bandwidth
);
if
(
fdiv
)
{
canvas
->
write_codecs
[
j
]
->
fps_divisor
=
fdiv
;
}
if
(
sdiv
)
{
int
w
=
0
,
h
=
0
;
w
=
canvas
->
width
;
h
=
canvas
->
width
;
w
/=
sdiv
;
h
/=
sdiv
;
switch_img_free
(
&
canvas
->
write_codecs
[
j
]
->
scaled_img
);
canvas
->
write_codecs
[
j
]
->
scaled_img
=
switch_img_alloc
(
NULL
,
SWITCH_IMG_FMT_I420
,
w
,
h
,
16
);
}
x
++
;
}
}
}
}
switch_mutex_unlock
(
conference
->
member_mutex
);
end:
if
(
!
x
)
{
stream
->
write_function
(
stream
,
"Bandwidth not set
\n
"
);
...
...
@@ -1903,6 +1979,39 @@ switch_status_t conference_api_sub_vid_logo_img(conference_member_t *member, swi
}
switch_status_t
conference_api_sub_vid_codec_group
(
conference_member_t
*
member
,
switch_stream_handle_t
*
stream
,
void
*
data
)
{
char
*
text
=
(
char
*
)
data
;
if
(
member
==
NULL
)
return
SWITCH_STATUS_GENERR
;
if
(
!
switch_channel_test_flag
(
member
->
channel
,
CF_VIDEO
))
{
return
SWITCH_STATUS_FALSE
;
}
if
(
text
)
{
if
(
!
strcmp
(
text
,
"clear"
))
{
member
->
video_codec_group
=
NULL
;
}
else
{
member
->
video_codec_group
=
switch_core_strdup
(
member
->
pool
,
text
);
}
switch_mutex_lock
(
member
->
conference
->
member_mutex
);
member
->
video_codec_index
=
-
1
;
switch_mutex_unlock
(
member
->
conference
->
member_mutex
);
stream
->
write_function
(
stream
,
"Video codec group %s %s
\n
"
,
member
->
video_codec_group
?
"set"
:
"cleared"
,
switch_str_nil
(
member
->
video_codec_group
));
}
else
{
stream
->
write_function
(
stream
,
"Video codec group is %s
\n
"
,
member
->
video_codec_group
);
}
return
SWITCH_STATUS_SUCCESS
;
}
switch_status_t
conference_api_sub_get_uuid
(
conference_member_t
*
member
,
switch_stream_handle_t
*
stream
,
void
*
data
)
{
if
(
member
->
session
)
{
...
...
src/mod/applications/mod_conference/conference_member.c
浏览文件 @
b84662ae
...
...
@@ -745,6 +745,10 @@ switch_status_t conference_member_add(conference_obj_t *conference, conference_m
conference_member_set_logo
(
member
,
var
);
}
if
((
var
=
switch_channel_get_variable_dup
(
member
->
channel
,
"video_codec_group"
,
SWITCH_FALSE
,
-
1
)))
{
member
->
video_codec_group
=
switch_core_strdup
(
member
->
pool
,
var
);
}
if
((
var
=
switch_channel_get_variable_dup
(
member
->
channel
,
"conference_join_volume_in"
,
SWITCH_FALSE
,
-
1
)))
{
uint32_t
id
=
atoi
(
var
);
...
...
src/mod/applications/mod_conference/conference_video.c
浏览文件 @
b84662ae
差异被折叠。
点击展开。
src/mod/applications/mod_conference/mod_conference.c
浏览文件 @
b84662ae
...
...
@@ -843,6 +843,9 @@ void *SWITCH_THREAD_FUNC conference_thread_run(switch_thread_t *thread, void *ob
switch_core_hash_destroy
(
&
conference
->
layout_group_hash
);
}
switch_mutex_lock
(
conference
->
flag_mutex
);
switch_event_destroy
(
&
conference
->
variables
);
switch_mutex_unlock
(
conference
->
flag_mutex
);
if
(
conference
->
pool
)
{
switch_memory_pool_t
*
pool
=
conference
->
pool
;
...
...
@@ -2550,6 +2553,28 @@ conference_obj_t *conference_find(char *name, char *domain)
return
conference
;
}
void
conference_set_variable
(
conference_obj_t
*
conference
,
const
char
*
var
,
const
char
*
val
)
{
switch_mutex_lock
(
conference
->
flag_mutex
);
switch_event_add_header_string
(
conference
->
variables
,
SWITCH_STACK_BOTTOM
,
var
,
val
);
switch_mutex_unlock
(
conference
->
flag_mutex
);
}
const
char
*
conference_get_variable
(
conference_obj_t
*
conference
,
const
char
*
var
)
{
const
char
*
val
;
switch_mutex_lock
(
conference
->
flag_mutex
);
val
=
switch_event_get_header
(
conference
->
variables
,
var
);
switch_mutex_unlock
(
conference
->
flag_mutex
);
if
(
val
)
{
return
switch_core_strdup
(
conference
->
pool
,
val
);
}
return
NULL
;
}
/* create a new conferene with a specific profile */
conference_obj_t
*
conference_new
(
char
*
name
,
conference_xml_cfg_t
cfg
,
switch_core_session_t
*
session
,
switch_memory_pool_t
*
pool
)
{
...
...
@@ -3070,7 +3095,7 @@ conference_obj_t *conference_new(char *name, conference_xml_cfg_t cfg, switch_co
conference
->
broadcast_chat_messages
=
broadcast_chat_messages
;
conference
->
video_quality
=
conference_video_quality
;
conference
->
auto_kps_debounce
=
auto_kps_debounce
;
switch_event_create_plain
(
&
conference
->
variables
,
SWITCH_EVENT_CHANNEL_DATA
);
conference
->
conference_video_mode
=
conference_video_mode
;
conference
->
scale_h264_canvas_width
=
scale_h264_canvas_width
;
...
...
@@ -3567,7 +3592,7 @@ conference_obj_t *conference_new(char *name, conference_xml_cfg_t cfg, switch_co
if
(
conference
->
conference_video_mode
==
CONF_VIDEO_MODE_MUX
)
{
video_layout_t
*
vlayout
=
conference_video_get_layout
(
conference
,
conference
->
video_layout_name
,
conference
->
video_layout_group
);
if
(
!
vlayout
)
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_CRIT
,
"Cannot find layout
\n
"
);
conference
->
video_layout_name
=
conference
->
video_layout_group
=
NULL
;
...
...
@@ -3598,6 +3623,28 @@ conference_obj_t *conference_new(char *name, conference_xml_cfg_t cfg, switch_co
switch_mutex_unlock
(
conference
->
canvas_mutex
);
}
}
if
(
cfg
.
profile
)
{
for
(
xml_kvp
=
switch_xml_child
(
cfg
.
profile
,
"video-codec-group"
);
xml_kvp
;
xml_kvp
=
xml_kvp
->
next
)
{
char
*
name
=
(
char
*
)
switch_xml_attr_soft
(
xml_kvp
,
"name"
);
char
*
bw
=
(
char
*
)
switch_xml_attr_soft
(
xml_kvp
,
"bandwidth"
);
char
*
fps
=
(
char
*
)
switch_xml_attr_soft
(
xml_kvp
,
"fps-divisor"
);
char
*
res
=
(
char
*
)
switch_xml_attr_soft
(
xml_kvp
,
"res-divisor"
);
if
(
name
&&
bw
)
{
const
char
*
str
=
switch_core_sprintf
(
conference
->
pool
,
"%s%s%s%s%s"
,
bw
,
!
zstr
(
res
)
?
":"
:
""
,
res
,
!
zstr
(
fps
)
?
":"
:
""
,
fps
);
const
char
*
gname
=
switch_core_sprintf
(
conference
->
pool
,
"group-%s"
,
name
);
conference_set_variable
(
conference
,
gname
,
str
);
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_DEBUG
,
"Video codec group preset %s set to [%s]
\n
"
,
gname
,
str
);
}
}
}
}
}
...
...
src/mod/applications/mod_conference/mod_conference.h
浏览文件 @
b84662ae
...
...
@@ -105,7 +105,7 @@
#define CONFFUNCAPISIZE (sizeof(conference_api_sub_commands)/sizeof(conference_api_sub_commands[0]))
#define MAX_MUX_CODECS
1
0
#define MAX_MUX_CODECS
5
0
#define ALC_HRTF_SOFT 0x1992
...
...
@@ -521,6 +521,17 @@ typedef struct layout_group_s {
video_layout_node_t
*
layouts
;
}
layout_group_t
;
typedef
struct
codec_set_s
{
switch_codec_t
codec
;
switch_frame_t
frame
;
uint8_t
*
packet
;
switch_image_t
*
scaled_img
;
uint8_t
fps_divisor
;
uint32_t
frame_count
;
char
*
video_codec_group
;
}
codec_set_t
;
typedef
struct
mcu_canvas_s
{
int
width
;
int
height
;
...
...
@@ -549,13 +560,14 @@ typedef struct mcu_canvas_s {
switch_thread_t
*
video_muxing_thread
;
int
video_timer_reset
;
switch_queue_t
*
video_queue
;
int32_t
video_write_bandwidth
;
int
recording
;
switch_image_t
*
bgimg
;
switch_image_t
*
fgimg
;
switch_thread_rwlock_t
*
video_rwlock
;
int
playing_video_file
;
int
overlay_video_file
;
codec_set_t
*
write_codecs
[
MAX_MUX_CODECS
];
int
write_codecs_count
;
}
mcu_canvas_t
;
/* Record Node */
...
...
@@ -620,6 +632,7 @@ typedef struct conference_obj {
char
*
video_letterbox_bgcolor
;
char
*
video_mute_banner
;
char
*
no_video_avatar
;
switch_event_t
*
variables
;
conference_video_mode_t
conference_video_mode
;
int
video_quality
;
int
members_with_video
;
...
...
@@ -847,6 +860,7 @@ struct conference_member {
char
*
video_mute_png
;
char
*
video_reservation_id
;
char
*
video_role_id
;
char
*
video_codec_group
;
switch_vid_params_t
vid_params
;
uint32_t
auto_kps_debounce_ticks
;
uint32_t
layer_loops
;
...
...
@@ -897,15 +911,6 @@ typedef struct api_command {
char
*
psyntax
;
}
api_command_t
;
typedef
struct
codec_set_s
{
switch_codec_t
codec
;
switch_frame_t
frame
;
uint8_t
*
packet
;
switch_image_t
*
scaled_img
;
uint8_t
fps_divisor
;
uint32_t
frame_count
;
}
codec_set_t
;
typedef
void
(
*
conference_key_callback_t
)
(
conference_member_t
*
,
struct
caller_control_actions
*
);
typedef
struct
{
...
...
@@ -1200,6 +1205,7 @@ switch_status_t conference_api_sub_vid_role_id(conference_member_t *member, swit
switch_status_t
conference_api_sub_get_uuid
(
conference_member_t
*
member
,
switch_stream_handle_t
*
stream
,
void
*
data
);
switch_status_t
conference_api_sub_get
(
conference_obj_t
*
conference
,
switch_stream_handle_t
*
stream
,
int
argc
,
char
**
argv
);
switch_status_t
conference_api_sub_vid_mute_img
(
conference_member_t
*
member
,
switch_stream_handle_t
*
stream
,
void
*
data
);
switch_status_t
conference_api_sub_vid_codec_group
(
conference_member_t
*
member
,
switch_stream_handle_t
*
stream
,
void
*
data
);
switch_status_t
conference_api_sub_vid_logo_img
(
conference_member_t
*
member
,
switch_stream_handle_t
*
stream
,
void
*
data
);
switch_status_t
conference_api_sub_vid_fps
(
conference_obj_t
*
conference
,
switch_stream_handle_t
*
stream
,
int
argc
,
char
**
argv
);
switch_status_t
conference_api_sub_canvas_fgimg
(
conference_obj_t
*
conference
,
switch_stream_handle_t
*
stream
,
int
argc
,
char
**
argv
);
...
...
@@ -1262,7 +1268,8 @@ void conference_loop_exec_app(conference_member_t *member, caller_control_action
void
conference_loop_deaf_toggle
(
conference_member_t
*
member
,
caller_control_action_t
*
action
);
void
conference_loop_deaf_on
(
conference_member_t
*
member
,
caller_control_action_t
*
action
);
void
conference_loop_deaf_off
(
conference_member_t
*
member
,
caller_control_action_t
*
action
);
void
conference_set_variable
(
conference_obj_t
*
conference
,
const
char
*
var
,
const
char
*
val
);
const
char
*
conference_get_variable
(
conference_obj_t
*
conference
,
const
char
*
var
);
/* Global Structs */
...
...
src/mod/endpoints/mod_verto/mod_verto.c
浏览文件 @
b84662ae
...
...
@@ -41,7 +41,7 @@ SWITCH_MODULE_RUNTIME_FUNCTION(mod_verto_runtime);
SWITCH_MODULE_DEFINITION
(
mod_verto
,
mod_verto_load
,
mod_verto_shutdown
,
mod_verto_runtime
);
#define EP_NAME "verto.rtc"
#define WSS_STANDALONE 1
//
#define WSS_STANDALONE 1
#include "ws.h"
//////////////////////////
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论