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

stuff

上级 a13a42f5
# TODO in mediasoup v2 (server-side) # 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": * 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 ...@@ -39,3 +42,4 @@ In fact, if the `RtpStreamSend` does not return false, the video automatically w
* Implement `mandatoryCodecPayloadTypes`. * Implement `mandatoryCodecPayloadTypes`.
* Check H246 parameters.
...@@ -373,15 +373,17 @@ exports.getConsumableRtpParameters = function(params, caps, rtpMapping) ...@@ -373,15 +373,17 @@ exports.getConsumableRtpParameters = function(params, caps, rtpMapping)
consumableParams.headerExtensions.push(consumableExt); consumableParams.headerExtensions.push(consumableExt);
} }
// TODO: REMOVE
// console.log('consumableParams:\n', JSON.stringify(consumableParams, null, ' '));
return consumableParams; return consumableParams;
}; };
/** /**
* Generate RTP parameters for a specific Consumer. * 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 {RTCRtpParameters} consumableRtpParameters - Consumable RTP parameters.
* @param {RTCRtpCapabilities} rtpCapabilities - Peer RTP capabilities. * @param {RTCRtpCapabilities} rtpCapabilities - Peer RTP capabilities.
* *
...@@ -400,50 +402,29 @@ exports.getConsumerRtpParameters = function(consumableRtpParameters, rtpCapabili ...@@ -400,50 +402,29 @@ exports.getConsumerRtpParameters = function(consumableRtpParameters, rtpCapabili
let rtxSupported = false; let rtxSupported = false;
for (const codec of consumableRtpParameters.codecs) consumerParams.codecs = consumableRtpParameters.codecs
{ .filter((codec) =>
const matchedCapCodec = rtpCapabilities.codecs
.find((capCodec) => capCodec.preferredPayloadType === codec.payloadType);
if (!matchedCapCodec)
continue;
const consumerCodec =
{ {
name : matchedCapCodec.name, if (codec.name.toLowerCase() !== 'rtx')
mimeType : matchedCapCodec.mimeType, return true;
clockRate : matchedCapCodec.clockRate,
payloadType : matchedCapCodec.preferredPayloadType,
channels : matchedCapCodec.channels,
rtcpFeedback : matchedCapCodec.rtcpFeedback,
parameters : matchedCapCodec.parameters
};
if (!consumerCodec.channels)
delete consumerCodec.channels;
consumerParams.codecs.push(consumerCodec); const hasRtxCodec = rtpCapabilities.codecs
.some((capCodec) => capCodec.preferredPayloadType === codec.payloadType);
if (consumerCodec.name.toLowerCase() === 'rtx')
rtxSupported = true;
}
for (const ext of consumableRtpParameters.headerExtensions) if (hasRtxCodec)
{ {
const matchedCapExt = rtpCapabilities.headerExtensions rtxSupported = true;
.find((capExt) => capExt.preferredId === ext.id);
if (!matchedCapExt) return true;
continue; }
});
const consumerExt = consumerParams.headerExtensions = consumableRtpParameters.headerExtensions
.filter((ext) =>
{ {
uri : matchedCapExt.uri, return rtpCapabilities.headerExtensions
id : matchedCapExt.preferredId .some((capExt) => capExt.preferredId === ext.id);
}; });
consumerParams.headerExtensions.push(consumerExt);
}
const consumerEncoding = const consumerEncoding =
{ {
...@@ -460,9 +441,6 @@ exports.getConsumerRtpParameters = function(consumableRtpParameters, rtpCapabili ...@@ -460,9 +441,6 @@ exports.getConsumerRtpParameters = function(consumableRtpParameters, rtpCapabili
consumerParams.encodings.push(consumerEncoding); consumerParams.encodings.push(consumerEncoding);
// TODO: REMOVE
// console.log('consumerParams:\n', JSON.stringify(consumerParams, null, ' '));
return consumerParams; return consumerParams;
}; };
...@@ -499,7 +477,7 @@ function matchCodec(codecA, codecB, leftIsParam = false) ...@@ -499,7 +477,7 @@ function matchCodec(codecA, codecB, leftIsParam = false)
return false; return false;
} }
// TODO: H264 parameters. // TODO: Check H264 parameters.
return true; return true;
} }
......
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论