Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
1c8088a4
提交
1c8088a4
authored
10月 05, 2015
作者:
Anthony Minessale
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
tweaks
上级
aa0b28e2
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
87 行增加
和
51 行删除
+87
-51
index.html
html5/verto/video_demo/index.html
+1
-0
verto.js
html5/verto/video_demo/verto.js
+68
-42
mod_verto.c
src/mod/endpoints/mod_verto/mod_verto.c
+18
-9
没有找到文件。
html5/verto/video_demo/index.html
浏览文件 @
1c8088a4
...
...
@@ -361,6 +361,7 @@ if ($('#devices').is(':visible')) {
</script>
<!--<button data-inline="true" id="showdemo" onclick="toggle_demo();">View Demo Extensions</button>-->
<button
data-inline=
"true"
id=
"showdevices"
onclick=
"toggle_device();"
>
View Device Settings
</button>
<button
data-inline=
"true"
id=
"speedbtn"
>
Check Speed
</button>
<button
data-inline=
"true"
id=
"logoutbtn"
>
Log Out
</button>
<div
id=
"devices"
style=
"border-style:outset;border-width:2px"
>
...
...
html5/verto/video_demo/verto.js
浏览文件 @
1c8088a4
...
...
@@ -197,7 +197,46 @@ function check_vid() {
return
use_vid
;
}
// Attach audio output device to video element using device/sink ID.
function
do_speed_test
(
fn
)
{
goto_page
(
"bwtest"
);
vertoHandle
.
rpcClient
.
speedTest
(
1024
*
256
,
function
(
e
,
obj
)
{
//console.error("Up: " + obj.upKPS, "Down: ", obj.downKPS);
var
vid
=
"default"
;
if
(
outgoingBandwidth
===
"default"
)
{
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
=
Math
.
ceil
(
obj
.
downKPS
*
.
75
).
toString
();
}
console
.
info
(
outgoingBandwidth
,
incomingBandwidth
);
$
(
"#bwinfo"
).
html
(
"<b>Bandwidth: "
+
"Up: "
+
obj
.
upKPS
+
" Down: "
+
obj
.
downKPS
+
" Vid: "
+
vid
+
"</b>"
);
if
(
fn
)
{
fn
();
}
});
}
// Attach audio output device to video element using device/sink ID.
function
attachSinkId
(
element
,
sinkId
)
{
if
(
typeof
element
.
sinkId
!==
'undefined'
)
{
element
.
setSinkId
(
sinkId
)
...
...
@@ -559,54 +598,34 @@ var callbacks = {
ringing
=
false
;
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
=
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
=
Math
.
ceil
(
obj
.
downKPS
*
.
75
).
toString
();
}
console
.
info
(
outgoingBandwidth
,
incomingBandwidth
);
$
(
"#bwinfo"
).
html
(
"<b>Bandwidth: "
+
"Up: "
+
obj
.
upKPS
+
" Down: "
+
obj
.
downKPS
+
" Vid: "
+
vid
+
"</b>"
);
do_speed_test
(
function
()
{
online
(
true
);
goto_page
(
"main"
);
$
(
"input[type='radio']"
).
checkboxradio
(
"refresh"
);
$
(
"input[type='checkbox']"
).
checkboxradio
(
"refresh"
);
});
/*
verto.subscribe("presence", {
handler: function(v, e) {
console.error("PRESENCE:", e);
}
});
*/
if
(
!
window
.
location
.
hash
)
{
goto_page
(
"main"
);
}
if
(
autocall
)
{
autocall
=
false
;
docall
();
}
/*
verto.subscribe("presence", {
handler: function(v, e) {
console.error("PRESENCE:", e);
}
});
*/
if
(
!
window
.
location
.
hash
)
{
goto_page
(
"main"
);
}
if
(
autocall
)
{
autocall
=
false
;
docall
();
}
});
}
else
{
goto_page
(
"main"
);
goto_dialog
(
"login-error"
);
...
...
@@ -1512,6 +1531,13 @@ function init() {
$
(
"#errordisplay"
).
html
(
""
);
});
$
(
"#speedbtn"
).
click
(
function
()
{
do_speed_test
(
function
()
{
goto_page
(
"main"
);
});
$
(
"#errordisplay"
).
html
(
""
);
});
$
(
"#loginbtn"
).
click
(
function
()
{
online
(
false
);
vertoHandle
.
loginData
({
...
...
src/mod/endpoints/mod_verto/mod_verto.c
浏览文件 @
1c8088a4
...
...
@@ -1866,6 +1866,7 @@ static void client_run(jsock_t *jsock)
char
*
p
=
s
+
4
;
int
loops
=
0
;
int
rem
=
0
;
int
dur
=
0
,
j
=
0
;
if
(
!
(
size
=
atoi
(
p
)))
{
continue
;
...
...
@@ -1884,21 +1885,29 @@ static void client_run(jsock_t *jsock)
switch_snprintf
(
repl
,
sizeof
(
repl
),
"#SPU %ld"
,
(
b
-
a
)
/
1000
);
ws_write_frame
(
&
jsock
->
ws
,
WSOC_TEXT
,
repl
,
strlen
(
repl
));
loops
=
size
/
1024
;
rem
=
size
%
1024
;
switch_snprintf
(
repl
,
sizeof
(
repl
),
"#SPB "
);
memset
(
repl
+
4
,
'.'
,
1024
);
a
=
switch_time_now
();
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
);
for
(
j
=
0
;
j
<
10
;
j
++
)
{
int
ddur
=
0
;
a
=
switch_time_now
();
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
();
ddur
+=
((
b
-
a
)
/
1000
);
dur
+=
ddur
;
}
b
=
switch_time_now
();
switch_snprintf
(
repl
,
sizeof
(
repl
),
"#SPD %ld"
,
((
b
-
a
)
/
1000
)
-
200
);
dur
/=
j
+
1
;
switch_snprintf
(
repl
,
sizeof
(
repl
),
"#SPD %d"
,
dur
);
ws_write_frame
(
&
jsock
->
ws
,
WSOC_TEXT
,
repl
,
strlen
(
repl
));
}
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论