提交 4ec9e512 authored 作者: Iñaki Baz Castillo's avatar Iñaki Baz Castillo

stuff

上级 a13a42f5
# TODO in mediasoup v2 (server-side)
* If a Producer is closed, those Peers non having a compatible Consumer (due to codecs) won't receive any notification. This is because the "close" event comes from the worker Consumer (which just exists upon succesful `enableConsumer`).
- So it seems that we should create the Consumer in C++ always, being disabled at the beginning.
* When a video Consumer is paused and later resumed, it requests a Full Frame to the Producer. The sending browser does receive the PLI and (obviously) sends a full frame. The problem is that the `RtpStreamSend` of the Consumer ignores that full frame due to "bad sequence number":
```
......@@ -39,3 +42,4 @@ In fact, if the `RtpStreamSend` does not return false, the video automatically w
* Implement `mandatoryCodecPayloadTypes`.
* Check H246 parameters.
......@@ -373,15 +373,17 @@ exports.getConsumableRtpParameters = function(params, caps, rtpMapping)
consumableParams.headerExtensions.push(consumableExt);
}
// TODO: REMOVE
// console.log('consumableParams:\n', JSON.stringify(consumableParams, null, ' '));
return consumableParams;
};
/**
* Generate RTP parameters for a specific Consumer.
*
* NOTE: All the codecs of the consumable RTP parameters are copied verbatim
* (all but RTX codecs in case the Peer does not support RTX). It's up to the
* remote Consumer to check the codecs and decide whether it can enable this
* Consumer or not.
*
* @param {RTCRtpParameters} consumableRtpParameters - Consumable RTP parameters.
* @param {RTCRtpCapabilities} rtpCapabilities - Peer RTP capabilities.
*
......@@ -400,50 +402,29 @@ exports.getConsumerRtpParameters = function(consumableRtpParameters, rtpCapabili
let rtxSupported = false;
for (const codec of consumableRtpParameters.codecs)
{
const matchedCapCodec = rtpCapabilities.codecs
.find((capCodec) => capCodec.preferredPayloadType === codec.payloadType);
if (!matchedCapCodec)
continue;
const consumerCodec =
consumerParams.codecs = consumableRtpParameters.codecs
.filter((codec) =>
{
name : matchedCapCodec.name,
mimeType : matchedCapCodec.mimeType,
clockRate : matchedCapCodec.clockRate,
payloadType : matchedCapCodec.preferredPayloadType,
channels : matchedCapCodec.channels,
rtcpFeedback : matchedCapCodec.rtcpFeedback,
parameters : matchedCapCodec.parameters
};
if (!consumerCodec.channels)
delete consumerCodec.channels;
if (codec.name.toLowerCase() !== 'rtx')
return true;
consumerParams.codecs.push(consumerCodec);
if (consumerCodec.name.toLowerCase() === 'rtx')
rtxSupported = true;
}
const hasRtxCodec = rtpCapabilities.codecs
.some((capCodec) => capCodec.preferredPayloadType === codec.payloadType);
for (const ext of consumableRtpParameters.headerExtensions)
{
const matchedCapExt = rtpCapabilities.headerExtensions
.find((capExt) => capExt.preferredId === ext.id);
if (hasRtxCodec)
{
rtxSupported = true;
if (!matchedCapExt)
continue;
return true;
}
});
const consumerExt =
consumerParams.headerExtensions = consumableRtpParameters.headerExtensions
.filter((ext) =>
{
uri : matchedCapExt.uri,
id : matchedCapExt.preferredId
};
consumerParams.headerExtensions.push(consumerExt);
}
return rtpCapabilities.headerExtensions
.some((capExt) => capExt.preferredId === ext.id);
});
const consumerEncoding =
{
......@@ -460,9 +441,6 @@ exports.getConsumerRtpParameters = function(consumableRtpParameters, rtpCapabili
consumerParams.encodings.push(consumerEncoding);
// TODO: REMOVE
// console.log('consumerParams:\n', JSON.stringify(consumerParams, null, ' '));
return consumerParams;
};
......@@ -499,7 +477,7 @@ function matchCodec(codecA, codecB, leftIsParam = false)
return false;
}
// TODO: H264 parameters.
// TODO: Check H264 parameters.
return true;
}
......
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论