提交 3e3a82f8 authored 作者: Iñaki Baz Castillo's avatar Iñaki Baz Castillo

parseScalabilityMode(): allow "S" as spatial layer (and not just "L")

"L" means "dependent spatial layer" while "S" means "independent spatial layer", which is used in K-SVC (VP9, AV1, etc)
上级 76edda1d
const ScalabilityModeRegex = new RegExp('^L(\\d+)T(\\d+)'); const ScalabilityModeRegex = new RegExp('^[LS](\\d+)T(\\d+)');
exports.parse = function(scalabilityMode) exports.parse = function(scalabilityMode)
{ {
......
...@@ -34,6 +34,7 @@ test('mediasoup.parseScalabilityMode() works', () => ...@@ -34,6 +34,7 @@ test('mediasoup.parseScalabilityMode() works', () =>
{ {
expect(parseScalabilityMode('L1T3')).toEqual({ spatialLayers: 1, temporalLayers: 3 }); expect(parseScalabilityMode('L1T3')).toEqual({ spatialLayers: 1, temporalLayers: 3 });
expect(parseScalabilityMode('L3T2_KEY')).toEqual({ spatialLayers: 3, temporalLayers: 2 }); expect(parseScalabilityMode('L3T2_KEY')).toEqual({ spatialLayers: 3, temporalLayers: 2 });
expect(parseScalabilityMode('S2T3')).toEqual({ spatialLayers: 2, temporalLayers: 3 });
expect(parseScalabilityMode('foo')).toEqual({ spatialLayers: 1, temporalLayers: 1 }); expect(parseScalabilityMode('foo')).toEqual({ spatialLayers: 1, temporalLayers: 1 });
expect(parseScalabilityMode(null)).toEqual({ spatialLayers: 1, temporalLayers: 1 }); expect(parseScalabilityMode(null)).toEqual({ spatialLayers: 1, temporalLayers: 1 });
}, 500); }, 500);
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论