]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-9281: Add support for QQVGA resolution in Verto
authorChad Phillips <chad@apartmentlines.com>
Sat, 18 Jun 2016 20:02:35 +0000 (15:02 -0500)
committerChad Phillips <chad@apartmentlines.com>
Mon, 15 Aug 2016 17:37:18 +0000 (10:37 -0700)
QQVGA is a standard 160x120 resolution, useful for cases of very slow
upload bandwidth. Adds the resolution to the core FSRTC lib, and to
the Verto video demo and Verto Communicator

html5/verto/js/src/jquery.FSRTC.js
html5/verto/verto_communicator/src/vertoService/services/vertoService.js
html5/verto/video_demo/index.html
html5/verto/video_demo/verto.js

index c0785576ff8bac4ce2fb7ba3ae82cfdcb2243afe..225c1b16ec1f0ef5995bc53ab5b0ea6aa2f98684 100644 (file)
        return [w, h];
     }
 
-    var resList = [[320, 180], [320, 240], [640, 360], [640, 480], [1280, 720], [1920, 1080]];
+    var resList = [[160, 120], [320, 180], [320, 240], [640, 360], [640, 480], [1280, 720], [1920, 1080]];
     var resI = 0;
     var ttl = 0;
 
index 824e5e9e91d57b440724f5d672b2776201d81c7d..12583b45714581ddc08bd23f5b079bcf5eb3b073 100644 (file)
@@ -3,6 +3,11 @@
 /* Controllers */
 var videoQuality = [];
 var videoQualitySource = [{
+  id: 'qqvga',
+  label: 'QQVGA 160x120',
+  width: 160,
+  height: 120
+}, {
   id: 'qvga',
   label: 'QVGA 320x240',
   width: 320,
@@ -35,6 +40,10 @@ var videoQualitySource = [{
 }, ];
 
 var videoResolution = {
+  qqvga: {
+    width: 160,
+    height: 120
+  },
   qvga: {
     width: 320,
     height: 240
@@ -910,7 +919,10 @@ vertoService.service('verto', ['$rootScope', '$cookieStore', '$location', 'stora
             storage.data.useDedenc = false;
             storage.data.vidQual = 'hd';
 
-            if (upBand < 512) {
+            if (upBand < 256) {
+              storage.data.vidQual = 'qqvga';
+            }
+            else if (upBand < 512) {
               storage.data.vidQual = 'qvga';
             }
             else if (upBand < 1024) {
index 74992e5807def15dfb6a458acd541ef999afa8c9..229275e9cf0019604bd28060cd928b08c741cbce 100644 (file)
@@ -394,6 +394,10 @@ if ($('#devices').is(':visible')) {
 <div >
   <fieldset data-role="controlgroup" data-type="horizontal">
     <legend><b>Video Quality</b>:</legend>
+
+    <input type="radio" name="vqual" id="vqual_qqvga" value="qqvga">
+    <label for="vqual_qqvga">QQVGA 160x120</label>
+
     <input type="radio" name="vqual" id="vqual_qvga" value="qvga">
     <label for="vqual_qvga">QVGA 320x240</label>
  
index aba518952bc9328ac3e412de832f2c88e3f8e525..e0ee4aec19b37467a2c2f3106862e1d5d52fe7e7 100644 (file)
@@ -140,7 +140,12 @@ function real_size() {
 
 function check_vid_res()
 {
-    if ($("#vqual_qvga").is(':checked')) {
+    if ($("#vqual_qqvga").is(':checked')) {
+       vid_width = 160;
+       vid_height = 120;
+       local_vid_width = 80;
+       local_vid_height = 60;
+    } else if ($("#vqual_qvga").is(':checked')) {
        vid_width = 320;
        vid_height = 240;
        local_vid_width = 160;
@@ -218,6 +223,10 @@ function do_speed_test(fn)
                $("#vqual_qvga").prop("checked", true);
                vid = "320x240";
            }
+           if (outgoingBandwidth < 256) {
+               $("#vqual_qqvga").prop("checked", true);
+               vid = "160x120";
+           }
        //}
 
        if (incomingBandwidth === "default") {
@@ -1315,6 +1324,15 @@ function init() {
 
 
 
+    $("#vqual_qqvga").prop("checked", vqual === "qqvga").change(function(e) {
+        if ($("#vqual_qqvga").is(':checked')) {
+           vqual = "qqvga";
+           $.cookie("verto_demo_vqual", vqual, {
+               expires: 365
+           });
+       }
+    });
+
     $("#vqual_qvga").prop("checked", vqual === "qvga").change(function(e) {
         if ($("#vqual_qvga").is(':checked')) {
            vqual = "qvga";