소스 검색

Merge remote-tracking branch 'upstream/master'

j8
turint 10 년 전
부모
커밋
6fb65e58d4
3개의 변경된 파일50개의 추가작업 그리고 5개의 파일을 삭제
  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 파일 보기

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

+ 22
- 1
libs/colibri/colibri.focus.js 파일 보기

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

+ 27
- 4
libs/strophe/strophe.jingle.adapter.js 파일 보기

@@ -513,7 +513,7 @@ function getUserMediaWithConstraints(um, success_callback, failure_callback, res
513 513
         constraints.video = { mandatory: {}, optional: [] };// same behaviour as true
514 514
     }
515 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 518
     if (um.indexOf('screen') >= 0) {
519 519
         constraints.video = {
@@ -541,6 +541,29 @@ function getUserMediaWithConstraints(um, success_callback, failure_callback, res
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 567
     // Check if we are running on Android device
545 568
     var isAndroid = navigator.userAgent.indexOf('Android') != -1;
546 569
 
@@ -596,12 +619,12 @@ function getUserMediaWithConstraints(um, success_callback, failure_callback, res
596 619
     }
597 620
 
598 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 625
     if (fps) { // for some cameras it might be necessary to request 30fps
603 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 628
         constraints.video.mandatory.minFrameRate = fps;
606 629
     }
607 630
 

Loading…
취소
저장