Browse Source

Merge remote-tracking branch 'upstream/master'

master
turint 11 years ago
parent
commit
6fb65e58d4
3 changed files with 50 additions and 5 deletions
  1. 1
    0
      config.js
  2. 22
    1
      libs/colibri/colibri.focus.js
  3. 27
    4
      libs/strophe/strophe.jingle.adapter.js

+ 1
- 0
config.js View File

15
     enableRtpStats: true, // Enables RTP stats processing
15
     enableRtpStats: true, // Enables RTP stats processing
16
     openSctp: true, // Toggle to enable/disable SCTP channels
16
     openSctp: true, // Toggle to enable/disable SCTP channels
17
 //    channelLastN: -1, // The default value of the channel attribute last-n.
17
 //    channelLastN: -1, // The default value of the channel attribute last-n.
18
+//    useRtcpMux: true,
18
     enableRecording: false
19
     enableRecording: false
19
 };
20
 };

+ 22
- 1
libs/colibri/colibri.focus.js View File

303
 
303
 
304
             elem.c(elemName, elemAttrs);
304
             elem.c(elemName, elemAttrs);
305
             elem.attrs({ endpoint: peer.substr(1 + peer.lastIndexOf('/')) });
305
             elem.attrs({ endpoint: peer.substr(1 + peer.lastIndexOf('/')) });
306
+            if ('channel' === elemName && config.useRtcpMux) {
307
+                elem.c('rtcp-mux').up();
308
+            }
306
             elem.up(); // end of channel/sctpconnection
309
             elem.up(); // end of channel/sctpconnection
307
         }
310
         }
308
         elem.up(); // end of content
311
         elem.up(); // end of content
407
         'a=rtpmap:13 CN/8000\r\n' +
410
         'a=rtpmap:13 CN/8000\r\n' +
408
         'a=rtpmap:126 telephone-event/8000\r\n' +
411
         'a=rtpmap:126 telephone-event/8000\r\n' +
409
         'a=maxptime:60\r\n' +
412
         'a=maxptime:60\r\n' +
413
+        (config.useRtcpMux ? 'a=rtcp-mux\r\n' : '') +
410
         /* Video */
414
         /* Video */
411
         'm=video 1 RTP/SAVPF 100 116 117\r\n' +
415
         'm=video 1 RTP/SAVPF 100 116 117\r\n' +
412
         'c=IN IP4 0.0.0.0\r\n' +
416
         'c=IN IP4 0.0.0.0\r\n' +
421
         'a=rtcp-fb:100 goog-remb\r\n' +
425
         'a=rtcp-fb:100 goog-remb\r\n' +
422
         'a=rtpmap:116 red/90000\r\n' +
426
         'a=rtpmap:116 red/90000\r\n' +
423
         'a=rtpmap:117 ulpfec/90000\r\n' +
427
         'a=rtpmap:117 ulpfec/90000\r\n' +
428
+        (config.useRtcpMux ? 'a=rtcp-mux\r\n' : '') +
424
         /* Data SCTP */
429
         /* Data SCTP */
425
         (config.openSctp ?
430
         (config.openSctp ?
426
             'm=application 1 DTLS/SCTP 5000\r\n' +
431
             'm=application 1 DTLS/SCTP 5000\r\n' +
617
         sdp.removeSessionLines('a=group:');
622
         sdp.removeSessionLines('a=group:');
618
         sdp.removeSessionLines('a=msid-semantic:'); // FIXME: not mapped over jingle anyway...
623
         sdp.removeSessionLines('a=msid-semantic:'); // FIXME: not mapped over jingle anyway...
619
         for (var i = 0; i < sdp.media.length; i++) {
624
         for (var i = 0; i < sdp.media.length; i++) {
620
-            sdp.removeMediaLines(i, 'a=rtcp-mux');
625
+            if (!config.useRtcpMux){
626
+                sdp.removeMediaLines(i, 'a=rtcp-mux');
627
+            }
621
             sdp.removeMediaLines(i, 'a=ssrc:');
628
             sdp.removeMediaLines(i, 'a=ssrc:');
622
             sdp.removeMediaLines(i, 'a=crypto:');
629
             sdp.removeMediaLines(i, 'a=crypto:');
623
             sdp.removeMediaLines(i, 'a=candidate:');
630
             sdp.removeMediaLines(i, 'a=candidate:');
774
 
781
 
775
         elem.c('content', { name: name });
782
         elem.c('content', { name: name });
776
         elem.c(elemName, elemAttrs);
783
         elem.c(elemName, elemAttrs);
784
+        if ('channel' === elemName && config.useRtcpMux) {
785
+            elem.c('rtcp-mux').up();
786
+        }
777
         elem.up(); // end of channel/sctpconnection
787
         elem.up(); // end of channel/sctpconnection
778
         elem.up(); // end of content
788
         elem.up(); // end of content
779
     });
789
     });
821
                 endpoint: $(this.channels[participant][channel]).attr('endpoint'),
831
                 endpoint: $(this.channels[participant][channel]).attr('endpoint'),
822
                 expire: self.channelExpire
832
                 expire: self.channelExpire
823
             });
833
             });
834
+            if (config.useRtcpMux) {
835
+                change.c('rtcp-mux').up();
836
+            }
824
 
837
 
825
             var rtpmap = SDPUtil.find_lines(remoteSDP.media[channel], 'a=rtpmap:');
838
             var rtpmap = SDPUtil.find_lines(remoteSDP.media[channel], 'a=rtpmap:');
826
             rtpmap.forEach(function (val) {
839
             rtpmap.forEach(function (val) {
1031
                 endpoint: $(self.channels[participant][channel]).attr('endpoint'),
1044
                 endpoint: $(self.channels[participant][channel]).attr('endpoint'),
1032
                 expire: self.channelExpire
1045
                 expire: self.channelExpire
1033
             });
1046
             });
1047
+
1048
+            if (config.useRtcpMux) {
1049
+                change.c('rtcp-mux').up();
1050
+            }
1034
         }
1051
         }
1035
         else
1052
         else
1036
         {
1053
         {
1114
                     endpoint: $(this.mychannel[cands[0].sdpMLineIndex]).attr('endpoint'),
1131
                     endpoint: $(this.mychannel[cands[0].sdpMLineIndex]).attr('endpoint'),
1115
                     expire: self.channelExpire
1132
                     expire: self.channelExpire
1116
                 });
1133
                 });
1134
+                if (config.useRtcpMux) {
1135
+                    mycands.c('rtcp-mux').up();
1136
+                }
1137
+
1117
             }
1138
             }
1118
             else
1139
             else
1119
             {
1140
             {

+ 27
- 4
libs/strophe/strophe.jingle.adapter.js View File

513
         constraints.video = { mandatory: {}, optional: [] };// same behaviour as true
513
         constraints.video = { mandatory: {}, optional: [] };// same behaviour as true
514
     }
514
     }
515
     if (um.indexOf('audio') >= 0) {
515
     if (um.indexOf('audio') >= 0) {
516
-        constraints.audio = {};// same behaviour as true
516
+        constraints.audio = { mandatory: {}, optional: []};// same behaviour as true
517
     }
517
     }
518
     if (um.indexOf('screen') >= 0) {
518
     if (um.indexOf('screen') >= 0) {
519
         constraints.video = {
519
         constraints.video = {
541
         }
541
         }
542
     }
542
     }
543
 
543
 
544
+    if (constraints.audio) {
545
+        // if it is good enough for hangouts...
546
+        constraints.audio.optional.push(
547
+            {googEchoCancellation: true},
548
+            {googAutoGainControl: true},
549
+            {googNoiseSupression: true},
550
+            {googHighpassFilter: true},
551
+            {googNoisesuppression2: true},
552
+            {googEchoCancellation2: true},
553
+            {googAutoGainControl2: true}
554
+        );
555
+    }
556
+    if (constraints.video) {
557
+        constraints.video.optional.push(
558
+            {googNoiseReduction: true}
559
+        );
560
+        if (um.indexOf('video') >= 0) {
561
+            constraints.video.optional.push(
562
+                {googLeakyBucket: true}
563
+            );
564
+        }
565
+    }
566
+
544
     // Check if we are running on Android device
567
     // Check if we are running on Android device
545
     var isAndroid = navigator.userAgent.indexOf('Android') != -1;
568
     var isAndroid = navigator.userAgent.indexOf('Android') != -1;
546
 
569
 
596
     }
619
     }
597
 
620
 
598
     if (bandwidth) { // doesn't work currently, see webrtc issue 1846
621
     if (bandwidth) { // doesn't work currently, see webrtc issue 1846
599
-        if (!constraints.video) constraints.video = {mandatory: {}};//same behaviour as true
600
-        constraints.video.optional = [{bandwidth: bandwidth}];
622
+        if (!constraints.video) constraints.video = {mandatory: {}, optional: []};//same behaviour as true
623
+        constraints.video.optional.push({bandwidth: bandwidth});
601
     }
624
     }
602
     if (fps) { // for some cameras it might be necessary to request 30fps
625
     if (fps) { // for some cameras it might be necessary to request 30fps
603
         // so they choose 30fps mjpg over 10fps yuy2
626
         // so they choose 30fps mjpg over 10fps yuy2
604
-        if (!constraints.video) constraints.video = {mandatory: {}};// same behaviour as tru;
627
+        if (!constraints.video) constraints.video = {mandatory: {}, optional: []};// same behaviour as true;
605
         constraints.video.mandatory.minFrameRate = fps;
628
         constraints.video.mandatory.minFrameRate = fps;
606
     }
629
     }
607
 
630
 

Loading…
Cancel
Save