Skip to content

Commit

Permalink
Add a hidden API to disable forced layers in Simulcast (#903)
Browse files Browse the repository at this point in the history
  • Loading branch information
kekkokk authored and jcague committed Jul 4, 2017
1 parent 99d5466 commit 3dff5b5
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
4 changes: 4 additions & 0 deletions erizo/src/erizo/rtp/QualityManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,10 @@ bool QualityManager::isInMaxLayer() {
}

void QualityManager::forceLayers(int spatial_layer, int temporal_layer) {
if (spatial_layer == -1 || temporal_layer == -1) {
forced_layers_ = false;
return;
}
forced_layers_ = true;
setPadding(false);

Expand Down
16 changes: 14 additions & 2 deletions erizo_controller/erizoClient/src/Stream.js
Original file line number Diff line number Diff line change
Expand Up @@ -330,9 +330,9 @@ Erizo.Stream = (specInput) => {
};

// eslint-disable-next-line no-underscore-dangle
that._setQualityLayer = (spatialLayer, temporalLayer, callback = () => {}) => {
that._setStaticQualityLayer = (spatialLayer, temporalLayer, callback = () => {}) => {
if (that.room && that.room.p2p) {
L.Logger.warning('setQualityLayer is not implemented in p2p streams');
L.Logger.warning('setStaticQualityLayer is not implemented in p2p streams');
callback('error');
return;
}
Expand All @@ -341,6 +341,18 @@ Erizo.Stream = (specInput) => {
that.pc.updateSpec(config, callback);
};

// eslint-disable-next-line no-underscore-dangle
that._setDynamicQualityLayer = (callback) => {
if (that.room && that.room.p2p) {
L.Logger.warning('setDynamicQualityLayer is not implemented in p2p streams');
callback('error');
return;
}
const config = { qualityLayer: { spatialLayer: -1, temporalLayer: -1 } };
that.checkOptions(config, true);
that.pc.updateSpec(config, callback);
};

const controlHandler = (handlersInput, publisherSideInput, enable) => {
let publisherSide = publisherSideInput;
let handlers = handlersInput;
Expand Down

0 comments on commit 3dff5b5

Please sign in to comment.