Permalink
Browse files

ref(TPC): add 'isSimulcastOn'

  • Loading branch information...
paweldomas committed Feb 9, 2017
1 parent 085d11d commit 040960f69b6035faa58c72fff45a33e582b26a78
Showing with 12 additions and 5 deletions.
  1. +11 −4 modules/RTC/TraceablePeerConnection.js
  2. +1 −1 modules/xmpp/MungeLocalSdp.js
@@ -245,6 +245,15 @@ const dumpSDP = function(description) {
return 'type: ' + description.type + '\r\n' + description.sdp;
};
/**
* Tells whether or not this TPC instance is using Simulcast.
* @return {boolean} <tt>true</tt> if simulcast is enabled and active or
* <tt>false</tt> if it's turned off.
*/
TraceablePeerConnection.prototype.isSimulcastOn = function () {
return !this.options.disableSimulcast && this.simulcast.isSupported();
};
/**
* Handles {@link SignallingEvents.PEER_VIDEO_TYPE_CHANGED}
* @param {string} endpointId the video owner's ID (MUC nickname)
@@ -1468,8 +1477,7 @@ TraceablePeerConnection.prototype.createAnswer
}
// Add simulcast streams if simulcast is enabled
if (!this.options.disableSimulcast
&& this.simulcast.isSupported()) {
if (this.isSimulcastOn()) {
answer = this.simulcast.mungeLocalDescription(answer);
this.trace(
'createAnswerOnSuccess::postTransform (simulcast)',
@@ -1601,8 +1609,7 @@ TraceablePeerConnection.prototype.generateNewStreamSSRCInfo = function (track) {
if (ssrcInfo) {
logger.error("Will overwrite local SSRCs for track ID: " + rtcId);
}
if (!this.options.disableSimulcast
&& this.simulcast.isSupported()) {
if (this.isSimulcastOn()) {
ssrcInfo = {ssrcs: [], groups: []};
for (let i = 0; i < SIMULCAST_LAYERS; i++) {
ssrcInfo.ssrcs.push(SDPUtil.generateSsrc());
@@ -153,7 +153,7 @@ export default class MungeLocalSdp {
if (shouldFakeSdp) {
// Inject removed SSRCs
let requiredSSRCs
= (this.pc.options.disableSimulcast || this.pc.isP2P)
= (!this.pc.isSimulcastOn())
? [this.pc.sdpConsistency.cachedPrimarySsrc]
: this.pc.simulcast.ssrcCache;
if (!requiredSSRCs.length) {

0 comments on commit 040960f

Please sign in to comment.