提交 9dd77068 authored 作者: Iñaki Baz Castillo's avatar Iñaki Baz Castillo

Cosmetic changes

上级 588915de
...@@ -110,47 +110,47 @@ exports.generateRoomRtpCapabilities = function(mediaCodecs) ...@@ -110,47 +110,47 @@ exports.generateRoomRtpCapabilities = function(mediaCodecs)
}; };
/** /**
* Checks whether capsA is a valid subset of capsB. It throws otherwise. * Checks whether aCaps is a valid subset of bCaps. It throws otherwise.
* *
* @param {RTCRtpCapabilities} capsA * @param {RTCRtpCapabilities} aCaps
* @param {RTCRtpCapabilities} capsB * @param {RTCRtpCapabilities} bCaps
*/ */
exports.assertCapabilitiesSubset = function(capsA, capsB) exports.assertCapabilitiesSubset = function(aCaps, bCaps)
{ {
for (const codecA of capsA.codecs) for (const aCodec of aCaps.codecs)
{ {
const matchedCodecB = capsB.codecs const matchedBCodec = bCaps.codecs
.find((codecB) => .find((bCodec) =>
{ {
return ( return (
codecA.preferredPayloadType === codecB.preferredPayloadType && aCodec.preferredPayloadType === bCodec.preferredPayloadType &&
matchCodecs(codecA, codecB) matchCodecs(aCodec, bCodec)
); );
}); });
if (!matchedCodecB) if (!matchedBCodec)
{ {
throw new Error( throw new Error(
'unsupported codec ' + 'unsupported codec ' +
`[name:${codecA.name}, preferredPayloadType:${codecA.preferredPayloadType}]`); `[name:${aCodec.name}, preferredPayloadType:${aCodec.preferredPayloadType}]`);
} }
} }
for (const extA of capsA.headerExtensions) for (const aExt of aCaps.headerExtensions)
{ {
const matchedExtB = capsB.headerExtensions const matchedBExt = bCaps.headerExtensions
.find((extB) => .find((bExt) =>
{ {
return ( return (
extA.preferredId === extB.preferredId && aExt.preferredId === bExt.preferredId &&
matchHeaderExtensions(extA, extB) matchHeaderExtensions(aExt, bExt)
); );
}); });
if (!matchedExtB) if (!matchedBExt)
{ {
throw new Error( throw new Error(
`unsupported header extension [kind:${extA.kind}, uri:${extA.uri}]`); `unsupported header extension [kind:${aExt.kind}, uri:${aExt.uri}]`);
} }
} }
}; };
......
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论