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

Cosmetic changes

上级 588915de
......@@ -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} capsB
* @param {RTCRtpCapabilities} aCaps
* @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
.find((codecB) =>
const matchedBCodec = bCaps.codecs
.find((bCodec) =>
{
return (
codecA.preferredPayloadType === codecB.preferredPayloadType &&
matchCodecs(codecA, codecB)
aCodec.preferredPayloadType === bCodec.preferredPayloadType &&
matchCodecs(aCodec, bCodec)
);
});
if (!matchedCodecB)
if (!matchedBCodec)
{
throw new Error(
'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
.find((extB) =>
const matchedBExt = bCaps.headerExtensions
.find((bExt) =>
{
return (
extA.preferredId === extB.preferredId &&
matchHeaderExtensions(extA, extB)
aExt.preferredId === bExt.preferredId &&
matchHeaderExtensions(aExt, bExt)
);
});
if (!matchedExtB)
if (!matchedBExt)
{
throw new Error(
`unsupported header extension [kind:${extA.kind}, uri:${extA.uri}]`);
`unsupported header extension [kind:${aExt.kind}, uri:${aExt.uri}]`);
}
}
};
......
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论