Bläddra i källkod

Adds an option to enable adaptive-last-n.

j8
Boris Grozev 11 år sedan
förälder
incheckning
5bec891d41
2 ändrade filer med 17 tillägg och 4 borttagningar
  1. 1
    0
      config.js
  2. 16
    4
      libs/colibri/colibri.focus.js

+ 1
- 0
config.js Visa fil

@@ -20,6 +20,7 @@ var config = {
20 20
     enableRtpStats: true, // Enables RTP stats processing
21 21
     openSctp: true, // Toggle to enable/disable SCTP channels
22 22
     channelLastN: -1, // The default value of the channel attribute last-n.
23
+    adaptiveLastN: false,
23 24
     useRtcpMux: true,
24 25
     useBundle: true,
25 26
     enableRecording: false,

+ 16
- 4
libs/colibri/colibri.focus.js Visa fil

@@ -292,8 +292,14 @@ ColibriFocus.prototype._makeConference = function (errorCallback) {
292 292
         else
293 293
         {
294 294
             elemName = 'channel';
295
-            if (('video' === name) && (self.channelLastN >= 0))
296
-                elemAttrs['last-n'] = self.channelLastN;
295
+            if ('video' === name) {
296
+                if (self.channelLastN >= 0) {
297
+                    elemAttrs['last-n'] = self.channelLastN;
298
+                }
299
+                if (config.adaptiveLastN) {
300
+                    elemAttrs['adaptive-last-n'] = 'true';
301
+                }
302
+            }
297 303
         }
298 304
 
299 305
         elem.c('content', { name: name });
@@ -834,8 +840,14 @@ ColibriFocus.prototype.addNewParticipant = function (peer) {
834 840
         else
835 841
         {
836 842
             elemName = 'channel';
837
-            if (('video' === name) && (self.channelLastN >= 0))
838
-                elemAttrs['last-n'] = self.channelLastN;
843
+            if ('video' === name) {
844
+                if (self.channelLastN >= 0) {
845
+                    elemAttrs['last-n'] = self.channelLastN;
846
+                }
847
+                if (config.adaptiveLastN) {
848
+                    elemAttrs['adaptive-last-n'] = 'true';
849
+                }
850
+            }
839 851
         }
840 852
 
841 853
         elem.c('content', { name: name });

Laddar…
Avbryt
Spara