From 5bec891d41ff8b67d77eb57fe86c4bea6158f378 Mon Sep 17 00:00:00 2001 From: Boris Grozev Date: Wed, 1 Oct 2014 14:24:37 +0300 Subject: [PATCH] Adds an option to enable adaptive-last-n. --- config.js | 1 + libs/colibri/colibri.focus.js | 20 ++++++++++++++++---- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/config.js b/config.js index 7c5946894..31b02ea22 100644 --- a/config.js +++ b/config.js @@ -20,6 +20,7 @@ var config = { enableRtpStats: true, // Enables RTP stats processing openSctp: true, // Toggle to enable/disable SCTP channels channelLastN: -1, // The default value of the channel attribute last-n. + adaptiveLastN: false, useRtcpMux: true, useBundle: true, enableRecording: false, diff --git a/libs/colibri/colibri.focus.js b/libs/colibri/colibri.focus.js index 4e40ffe32..38b9fd810 100644 --- a/libs/colibri/colibri.focus.js +++ b/libs/colibri/colibri.focus.js @@ -292,8 +292,14 @@ ColibriFocus.prototype._makeConference = function (errorCallback) { else { elemName = 'channel'; - if (('video' === name) && (self.channelLastN >= 0)) - elemAttrs['last-n'] = self.channelLastN; + if ('video' === name) { + if (self.channelLastN >= 0) { + elemAttrs['last-n'] = self.channelLastN; + } + if (config.adaptiveLastN) { + elemAttrs['adaptive-last-n'] = 'true'; + } + } } elem.c('content', { name: name }); @@ -834,8 +840,14 @@ ColibriFocus.prototype.addNewParticipant = function (peer) { else { elemName = 'channel'; - if (('video' === name) && (self.channelLastN >= 0)) - elemAttrs['last-n'] = self.channelLastN; + if ('video' === name) { + if (self.channelLastN >= 0) { + elemAttrs['last-n'] = self.channelLastN; + } + if (config.adaptiveLastN) { + elemAttrs['adaptive-last-n'] = 'true'; + } + } } elem.c('content', { name: name });