Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
aa0b28e2
提交
aa0b28e2
authored
10月 03, 2015
作者:
Anthony Minessale
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
WIP not shabby auto vid settings
上级
828d6eaf
隐藏空白字符变更
内嵌
并排
正在显示
8 个修改的文件
包含
110 行增加
和
16 行删除
+110
-16
jquery.jsonrpcclient.js
html5/verto/js/src/jquery.jsonrpcclient.js
+15
-2
verto-min.js
html5/verto/video_demo/js/verto-min.js
+0
-0
verto.js
html5/verto/video_demo/verto.js
+19
-6
switch_core_media.h
src/include/switch_core_media.h
+1
-0
conference_member.c
src/mod/applications/mod_conference/conference_member.c
+22
-0
mod_conference.h
src/mod/applications/mod_conference/mod_conference.h
+1
-0
mod_verto.c
src/mod/endpoints/mod_verto/mod_verto.c
+28
-8
switch_core_media.c
src/switch_core_media.c
+24
-0
没有找到文件。
html5/verto/js/src/jquery.jsonrpcclient.js
浏览文件 @
aa0b28e2
...
...
@@ -97,8 +97,21 @@
if
(
socket
!==
null
)
{
this
.
speedCB
=
cb
;
this
.
speedBytes
=
bytes
;
socket
.
send
(
"#SPU"
);
socket
.
send
(
"#SPB
\n
"
+
new
Array
(
bytes
).
join
(
"."
));
socket
.
send
(
"#SPU "
+
bytes
);
var
loops
=
bytes
/
1024
;
var
rem
=
bytes
%
1024
;
var
i
;
var
data
=
new
Array
(
1024
).
join
(
"."
);
for
(
i
=
0
;
i
<
loops
;
i
++
)
{
socket
.
send
(
"#SPB "
+
data
);
}
if
(
rem
)
{
socket
.
send
(
"#SPB "
+
data
);
}
socket
.
send
(
"#SPE"
);
}
};
...
...
html5/verto/video_demo/js/verto-min.js
浏览文件 @
aa0b28e2
This diff was suppressed by a .gitattributes entry.
html5/verto/video_demo/verto.js
浏览文件 @
aa0b28e2
...
...
@@ -561,17 +561,30 @@ var callbacks = {
if
(
success
)
{
vertoHandle
.
rpcClient
.
speedTest
(
1024
*
256
,
function
(
e
,
obj
)
{
//console.error("Up: " + obj.upKPS, "Down: ", obj.downKPS);
var
vid
=
"default"
;
if
(
outgoingBandwidth
===
"default"
)
{
outgoingBandwidth
=
obj
.
upKPS
*
.
75
;
outgoingBandwidth
=
Math
.
ceil
(
obj
.
upKPS
*
.
75
).
toString
();
$
(
"#vqual_hd"
).
prop
(
"checked"
,
true
);
vid
=
"1280x720"
;
if
(
outgoingBandwidth
<
1024
)
{
$
(
"#vqual_vga"
).
prop
(
"checked"
,
true
);
vid
=
"640x480"
;
}
if
(
outgoingBandwidth
<
512
)
{
$
(
"#vqual_qvga"
).
prop
(
"checked"
,
true
);
vid
=
"320x240"
;
}
}
if
(
incomingBandwidth
===
"default"
)
{
incomingBandwidth
=
obj
.
downKPS
*
.
75
;
incomingBandwidth
=
Math
.
ceil
(
obj
.
downKPS
*
.
75
).
toString
()
;
}
//console.error
(outgoingBandwidth, incomingBandwidth);
console
.
info
(
outgoingBandwidth
,
incomingBandwidth
);
$
(
"#bwinfo"
).
html
(
"<b>Bandwidth: "
+
"Up: "
+
obj
.
upKPS
+
" Down: "
+
obj
.
downKPS
+
"</b>"
);
$
(
"#bwinfo"
).
html
(
"<b>Bandwidth: "
+
"Up: "
+
obj
.
upKPS
+
" Down: "
+
obj
.
downKPS
+
"
Vid: "
+
vid
+
"
</b>"
);
online
(
true
);
goto_page
(
"main"
);
$
(
"input[type='radio']"
).
checkboxradio
(
"refresh"
);
...
...
@@ -782,7 +795,7 @@ function docall() {
$
(
"#main_info"
).
html
(
"Trying"
);
check_vid_res
();
console
.
error
(
outgoingBandwidth
,
incomingBandwidth
);
cur_call
=
vertoHandle
.
newCall
({
destination_number
:
$
(
"#ext"
).
val
(),
caller_id_name
:
$
(
"#cidname"
).
val
(),
...
...
src/include/switch_core_media.h
浏览文件 @
aa0b28e2
...
...
@@ -341,6 +341,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_media_set_video_file(switch_core_ses
SWITCH_DECLARE
(
switch_file_handle_t
*
)
switch_core_media_get_video_file
(
switch_core_session_t
*
session
,
switch_rw_t
rw
);
SWITCH_DECLARE
(
switch_bool_t
)
switch_core_session_in_video_thread
(
switch_core_session_t
*
session
);
SWITCH_DECLARE
(
switch_bool_t
)
switch_core_media_check_dtls
(
switch_core_session_t
*
session
,
switch_media_type_t
type
);
SWITCH_DECLARE
(
switch_status_t
)
switch_core_media_set_outgoing_bitrate
(
switch_core_session_t
*
session
,
switch_media_type_t
type
,
uint32_t
bitrate
);
SWITCH_END_EXTERN_C
#endif
...
...
src/mod/applications/mod_conference/conference_member.c
浏览文件 @
aa0b28e2
...
...
@@ -767,6 +767,28 @@ switch_status_t conference_member_add(conference_obj_t *conference, conference_m
conference_utils_member_set_flag_locked
(
member
,
MFLAG_NO_MINIMIZE_ENCODING
);
}
if
((
var
=
switch_channel_get_variable
(
member
->
channel
,
"rtp_video_max_bandwidth_in"
)))
{
int
tmp
=
atoi
(
var
);
if
(
tmp
>
0
)
{
member
->
max_bw_in
=
tmp
;
}
printf
(
"FORCE MAX %d
\n
"
,
member
->
max_bw_in
);
}
if
((
var
=
switch_channel_get_variable
(
member
->
channel
,
"rtp_video_max_bandwidth_out"
)))
{
int
tmp
=
atoi
(
var
);
if
(
tmp
>
0
)
{
member
->
max_bw_out
=
tmp
;
if
(
member
->
max_bw_out
<
conference
->
video_codec_settings
.
video
.
bandwidth
)
{
printf
(
"DED ENCODER for %d
\n
"
,
member
->
max_bw_out
);
conference_utils_member_set_flag_locked
(
member
,
MFLAG_NO_MINIMIZE_ENCODING
);
switch_core_media_set_outgoing_bitrate
(
member
->
session
,
SWITCH_MEDIA_TYPE_VIDEO
,
member
->
max_bw_out
);
}
}
}
switch_channel_set_variable_printf
(
channel
,
"conference_member_id"
,
"%d"
,
member
->
id
);
switch_channel_set_variable_printf
(
channel
,
"conference_moderator"
,
"%s"
,
conference_utils_member_test_flag
(
member
,
MFLAG_MOD
)
?
"true"
:
"false"
);
switch_channel_set_variable_printf
(
channel
,
"conference_ghost"
,
"%s"
,
conference_utils_member_test_flag
(
member
,
MFLAG_GHOST
)
?
"true"
:
"false"
);
...
...
src/mod/applications/mod_conference/mod_conference.h
浏览文件 @
aa0b28e2
...
...
@@ -761,6 +761,7 @@ struct conference_member {
switch_image_t
*
pcanvas_img
;
int
max_bw_in
;
int
force_bw_in
;
int
max_bw_out
;
};
typedef
enum
{
...
...
src/mod/endpoints/mod_verto/mod_verto.c
浏览文件 @
aa0b28e2
...
...
@@ -1856,30 +1856,49 @@ static void client_run(jsock_t *jsock)
char
*
s
=
(
char
*
)
data
;
if
(
*
s
==
'#'
)
{
char
repl
[
80
]
=
""
,
*
s
=
(
char
*
)
data
;
char
repl
[
2048
]
=
""
;
switch_time_t
a
,
b
;
if
(
s
[
1
]
==
'S'
&&
s
[
2
]
==
'P'
)
{
if
(
s
[
3
]
==
'U'
)
{
int
i
,
size
=
0
;
char
*
p
=
s
+
4
;
int
loops
=
0
;
int
rem
=
0
;
if
(
!
(
size
=
atoi
(
p
)))
{
continue
;
}
a
=
switch_time_now
();
bytes
=
ws_read_frame
(
&
jsock
->
ws
,
&
oc
,
&
data
);
do
{
bytes
=
ws_read_frame
(
&
jsock
->
ws
,
&
oc
,
&
data
);
s
=
(
char
*
)
data
;
}
while
(
bytes
&&
data
&&
s
[
0
]
==
'#'
&&
s
[
3
]
==
'B'
);
b
=
switch_time_now
();
if
(
!
bytes
||
!
data
)
continue
;
if
(
s
[
0
]
!=
'#'
)
goto
nm
;
switch_snprintf
(
repl
,
sizeof
(
repl
),
"#SPU %ld"
,
(
b
-
a
)
/
1000
);
ws_write_frame
(
&
jsock
->
ws
,
WSOC_TEXT
,
repl
,
strlen
(
repl
));
s
=
(
char
*
)
data
;
s
[
3
]
=
'B'
;
loops
=
size
/
1024
;
rem
=
size
%
1024
;
switch_snprintf
(
repl
,
sizeof
(
repl
),
"#SPB "
);
memset
(
repl
+
4
,
'.'
,
1024
);
a
=
switch_time_now
();
ws_write_frame
(
&
jsock
->
ws
,
WSOC_TEXT
,
data
,
bytes
);
for
(
i
=
0
;
i
<
loops
;
i
++
)
{
ws_write_frame
(
&
jsock
->
ws
,
WSOC_TEXT
,
repl
,
1024
);
}
if
(
rem
)
{
ws_write_frame
(
&
jsock
->
ws
,
WSOC_TEXT
,
repl
,
rem
);
}
b
=
switch_time_now
();
switch_snprintf
(
repl
,
sizeof
(
repl
),
"#SPD %ld"
,
(
b
-
a
)
/
10
00
);
switch_snprintf
(
repl
,
sizeof
(
repl
),
"#SPD %ld"
,
(
(
b
-
a
)
/
1000
)
-
2
00
);
ws_write_frame
(
&
jsock
->
ws
,
WSOC_TEXT
,
repl
,
strlen
(
repl
));
}
}
...
...
@@ -1887,6 +1906,7 @@ static void client_run(jsock_t *jsock)
continue
;
}
nm:
if
(
process_input
(
jsock
,
data
,
bytes
)
!=
SWITCH_STATUS_SUCCESS
)
{
die
(
"Input Error
\n
"
);
...
...
src/switch_core_media.c
浏览文件 @
aa0b28e2
...
...
@@ -8890,6 +8890,30 @@ SWITCH_DECLARE(switch_bool_t) switch_core_media_check_dtls(switch_core_session_t
}
SWITCH_DECLARE
(
switch_status_t
)
switch_core_media_set_outgoing_bitrate
(
switch_core_session_t
*
session
,
switch_media_type_t
type
,
uint32_t
bitrate
)
{
switch_media_handle_t
*
smh
;
switch_rtp_engine_t
*
engine
;
switch_status_t
status
=
SWITCH_STATUS_FALSE
;
if
(
!
(
smh
=
session
->
media_handle
))
{
return
SWITCH_STATUS_FALSE
;
}
if
(
switch_channel_down
(
session
->
channel
))
{
return
SWITCH_STATUS_FALSE
;
}
engine
=
&
smh
->
engines
[
type
];
if
(
switch_core_codec_ready
(
&
engine
->
write_codec
))
{
status
=
switch_core_codec_control
(
&
engine
->
write_codec
,
SCC_VIDEO_BANDWIDTH
,
SCCT_INT
,
&
bitrate
,
SCCT_NONE
,
NULL
,
NULL
,
NULL
);
}
return
status
;
}
//?
SWITCH_DECLARE
(
switch_status_t
)
switch_core_media_receive_message
(
switch_core_session_t
*
session
,
switch_core_session_message_t
*
msg
)
{
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论