提交 500b32b3 authored 作者: Anthony Minessale's avatar Anthony Minessale 提交者: Michael Jerris

FS-7509 FS-7514: another round of cleanup

上级 a883818b
......@@ -99,6 +99,7 @@
<button data-inline="true" id="hold">HOLD</button>
<button data-inline="true" id="hupbtn">End Call</button>
<button data-inline="true" id="mutebtn">Toggle Audio Mute</button>
<!-- <button data-inline="true" class="startxferbtn">Transfer</button>-->
<span class="sharediv">
<button data-inline="true" id="sharebtn">Share</button>
......@@ -109,7 +110,8 @@
<button data-inline="true" id="smallerbtn">Smaller - </button>
<button data-inline="true" id="biggerbtn">Bigger +</button>
<button data-inline="true" id="fullbtn">Full Screen</button>
</span>
<button data-inline="true" id="vmutebtn">Toggle Video Mute</button>
</span>
<div id="media">
<video id="webcam" autoplay="autoplay"></video>
......@@ -168,8 +170,12 @@
FreeSWITCH Verto&trade; Video Transcoding Demo
</div>
<br>
<a target="_CC2104" href="https://www.cluecon.com"><img border="0" width="300" src="img/cc_banner.gif"></a>
<center> <table width="1024" border="0">
<tr><td> <center><a target="_CC2104" href="https://www.cluecon.com"><img border="0" width="300" src="img/cc_banner.gif"></a></center></td>
<td><center> <img src="img/verto_black_web.gif" width="300"></center>
</td></tr>
</table></center><br><br>
<div id="offline">
<div id="errordisplay" style="font-weight:bold;font-size:18px;color:#ae0000"></div>
......@@ -234,20 +240,60 @@ function dial(ext)
<div id="online" align="center" style="width:75%">
<div class="ui-field-contain">
<div id="devices">
<script>
function toggle_demo() {
if ($('#demos').is(':visible')) {
$('#demos').hide();
$('#showdemo').text("Show Demo Extensions");
} else {
$('#devices').hide();$('#showdevices').show();$('#demos').show();
$('#showdemo').text("Hide Demo Extensions");
}
}
function toggle_device() {
if ($('#devices').is(':visible')) {
$('#devices').hide();
$('#showdevices').text("View Device Settings");
} else {
$('#devices').show();$('#demos').hide();
$('#showdevices').text("Hide Device Settings");
}
}
</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="logoutbtn">Log Out</button>
<br><br>
<div id="devices" style="border-style:outset;border-width:2px">
<div id="camdiv">
<legend><b>Camera</b>:</legend><select data-theme="a" data-overlay-theme="a" data-native-menu="false" id="usecamera"></select>
<legend><b>Camera</b>:</legend><select data-theme="a" data-overlay-theme="a" data-native-menu="false" id="usecamera"></select>
<br><br></div>
<legend><b>Microphone</b>:</legend><select data-theme="a" data-overlay-theme="a" data-native-menu="false" id="usemic"></select>
<Br clear="all"><Br>
<center><button data-inline="true" id="refreshbtn">Refresh Device List</button>
<button data-inline="true" id="hidedevices" onclick="$('#devices').hide();$('#showdevices').show()">Save Device Settings</button>
</center>
<Br clear="all"><hr><br>
<div style="xvisibility:hidden">
<label><input id="use_vid" type="checkbox" value="foo" > Use Video</label>
<label><input id="use_stereo" type="checkbox" value="foo" > Stereo Audio</label>
<label><input id="use_stun" type="checkbox" value="foo" > Use STUN</label>
<!-- <label><input id="local_video" type="checkbox" value="foo" > Local Video</label>-->
</div>
<Br clear="all">
<br><br>
<div >
<fieldset data-role="controlgroup" data-type="horizontal">
<legend><b>Video Quality</b>:</legend>
......@@ -336,12 +382,16 @@ function dial(ext)
</fieldset>
</div><br clear="all"><br>
<br><br>
<center><button data-inline="true" id="refreshbtn">Refresh Device List</button>
<button data-inline="true" id="hidedevices" onclick="$('#devices').hide();$('#showdevices').show()">Save Device Settings</button>
</center>
<Br clear="all"><br>
</div>
<button data-inline="true" id="showdemo" onclick="$('#demos').show();$('#showdemo').hide()">View Demo Extensions</button>
<button data-inline="true" id="showdevices" onclick="$('#devices').show();$('#showdevices').hide()">View Device Settings</button>
<br><br>
<div id="demos" style="border-style:outset">
......@@ -371,14 +421,13 @@ function dial(ext)
<div style="border-style:inset;border-width:1px;background-color:#eeeeee">
<button class="vidbtn" data-inline="true" onclick="dial('decode')">Video from your Webcam decoded then re-encoded w/ MOH</button>
<button class="vidbtn" data-inline="true" onclick="dial('3500')">Video Transcoded Conference</button>
<button class="vidbtn" id="hidedemo" data-inline="true" onclick="$('#demos').hide();$('#showdemo').show();">Hide Demos</button>
</div>
</div>
<br><br><br>
<br><br><br><hr><br>
<div class="ui-field-contain" style="text-align:right;">
<label for="name">Name</label>
<input type="text" size="30" id="cidname"/>
......@@ -392,20 +441,15 @@ function dial(ext)
<input type="text" id="ext""/>
</div>
<button data-inline="true" id="callbtn">Call Extension</button>
<br><br>
<br>
<hr>
<br><br>
<div style="color:blue" id="main_info">&nbsp;</div><br><br>
<img src="img/verto_black_web.gif" width="300"><br><br>
<button data-inline="true"id="logoutbtn">Log Out</button>
</div>
<br>
<div style="xvisibility:hidden">
<label><input id="use_vid" type="checkbox" value="foo" > Use Video</label>
<label><input id="use_stereo" type="checkbox" value="foo" > Stereo Audio</label>
<label><input id="use_stun" type="checkbox" value="foo" > Use STUN</label>
<!-- <label><input id="local_video" type="checkbox" value="foo" > Local Video</label>-->
</div>
<br>
<br>
<!--
<b>TEXT</b><br>To: <input type="text" size="20" id="textto"/> MSG: <input type="text" size="40" id="textmsg"/>
......
......@@ -509,6 +509,14 @@ $("#hupbtn").click(function() {
cur_call = null;
});
$("#mutebtn").click(function() {
cur_call.dtmf("0");
});
$("#vmutebtn").click(function() {
cur_call.dtmf("*0");
});
$("#fullbtn").click(function() {
full_screen("webcam");
});
......
......@@ -498,18 +498,15 @@ SWITCH_STANDARD_APP(play_yuv_function)
switch_image_t *img = NULL;
switch_byte_t *yuv = NULL;
int argc;
char *argv[3] = { 0 };
int to = 0;
char *argv[5] = { 0 };
char *mydata = switch_core_session_strdup(session, data);
uint32_t loops = 0;
switch_time_t done = 0;
int nots = 0;
switch_channel_answer(channel);
while (switch_channel_ready(channel) && !switch_channel_test_flag(channel, CF_VIDEO)) {
if ((++loops % 100) == 0) switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Waiting for video......\n");
switch_ivr_sleep(session, 20, SWITCH_TRUE, NULL);
continue;
}
switch_channel_audio_sync(channel);
switch_core_session_raw_read(session);
......@@ -522,6 +519,23 @@ SWITCH_STANDARD_APP(play_yuv_function)
if (argc > 1) width = atoi(argv[1]);
if (argc > 2) height = atoi(argv[2]);
if (argc > 3) to = atoi(argv[3]);
if (argc > 4) nots = atoi(argv[4]);
done = switch_micro_time_now() + (to * 1000);
while (switch_channel_ready(channel) && !switch_channel_test_flag(channel, CF_VIDEO)) {
if ((++loops % 100) == 0) switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Waiting for video......\n");
switch_ivr_sleep(session, 20, SWITCH_TRUE, NULL);
if (switch_micro_time_now() > done) {
goto done;
}
continue;
}
width = width ? width : 352;
height = height ? height : 288;
......@@ -568,6 +582,9 @@ SWITCH_STANDARD_APP(play_yuv_function)
switch_set_flag((&vid_frame), SFF_RAW_RTP);
// switch_set_flag((&vid_frame), SFF_PROXY_PACKET);
switch_core_session_request_video_refresh(session);
switch_core_media_gen_key_frame(session);
while (switch_channel_ready(channel)) {
char ts_str[64];
......@@ -578,6 +595,11 @@ SWITCH_STANDARD_APP(play_yuv_function)
break;
}
if (switch_micro_time_now() > done) {
goto done;
}
switch_ivr_parse_all_events(session);
//check for dtmf interrupts
......@@ -597,10 +619,14 @@ SWITCH_STANDARD_APP(play_yuv_function)
}
}
memset(read_frame->data, 0, read_frame->datalen);
if (read_frame) switch_core_session_write_frame(session, read_frame, SWITCH_IO_FLAG_NONE, 0);
sprintf(ts_str, "%" SWITCH_TIME_T_FMT, switch_micro_time_now() / 1000);
switch_img_add_text(img->planes[SWITCH_PLANE_PACKED], width, 20, 20, ts_str);
if (!nots) {
sprintf(ts_str, "%" SWITCH_TIME_T_FMT, switch_micro_time_now() / 1000);
switch_img_add_text(img->planes[SWITCH_PLANE_PACKED], width, 20, 20, ts_str);
}
vid_frame.img = img;
switch_core_session_write_video_frame(session, &vid_frame, SWITCH_IO_FLAG_NONE, 0);
}
......
......@@ -2691,6 +2691,9 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_execute_application_get_flag
switch_application_interface_t *application_interface;
switch_status_t status = SWITCH_STATUS_SUCCESS;
switch_core_session_request_video_refresh(session);
switch_core_media_gen_key_frame(session);
if (switch_channel_down_nosig(session->channel)) {
char *p;
if (!arg && (p = strstr(app, "::"))) {
......
......@@ -361,7 +361,8 @@ void switch_core_state_machine_init(switch_memory_pool_t *pool)
if (state < CS_HANGUP && switch_channel_get_callstate(session->channel) == CCS_UNHELD) { \
switch_channel_set_callstate(session->channel, CCS_ACTIVE); \
} \
switch_core_session_request_video_refresh(session); \
switch_core_session_request_video_refresh(session); \
switch_core_media_gen_key_frame(session); \
if (!driver_state_handler->on_##__STATE || (driver_state_handler->on_##__STATE(session) == SWITCH_STATUS_SUCCESS \
)) { \
while (do_extra_handlers && (application_state_handler = switch_channel_get_state_handler(session->channel, index++)) != 0) { \
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论