提交 14a902f0 authored 作者: Iñaki Baz Castillo's avatar Iñaki Baz Castillo

Fix test_scene_1.js and cloning of RtpParameters

上级 2ee3ea87
...@@ -25,6 +25,7 @@ tap.test('rtpReceiver.receive() with valid `rtpParameters` must succeed', { time ...@@ -25,6 +25,7 @@ tap.test('rtpReceiver.receive() with valid `rtpParameters` must succeed', { time
{ {
name : 'H264', name : 'H264',
payloadType : 100, payloadType : 100,
clockRate : 90000,
maxptime : 80, maxptime : 80,
ptime : 60, ptime : 60,
numChannels : 2, numChannels : 2,
......
...@@ -39,7 +39,8 @@ tap.test('alice, bob and carol create RtpReceivers and expect RtpSenders', { tim ...@@ -39,7 +39,8 @@ tap.test('alice, bob and carol create RtpReceivers and expect RtpSenders', { tim
encodings : encodings :
[ [
{ {
ssrc : 100000011 ssrc : 100000011,
active : true
} }
], ],
rtcp : rtcp :
...@@ -57,24 +58,24 @@ tap.test('alice, bob and carol create RtpReceivers and expect RtpSenders', { tim ...@@ -57,24 +58,24 @@ tap.test('alice, bob and carol create RtpReceivers and expect RtpSenders', { tim
{ {
name : 'vp9', name : 'vp9',
payloadType : 102, payloadType : 102,
clockRate : 90000
},
{
name : 'rtx',
payloadType : 96,
clockRate : 90000, clockRate : 90000,
rtx : parameters : { apt: 102 }
{
payloadType : 96,
rtxTime : 1000
},
fec :
[
{ mechanism: 'foo', payloadType: 97 }
]
} }
], ],
encodings : encodings :
[ [
{ {
ssrc : 100000021, ssrc : 100000021,
rtxSsrc : 100000022, active : true,
fecSsrc : 100000023 rtx :
{
ssrc : 100000022
}
} }
], ],
rtcp : rtcp :
...@@ -92,19 +93,24 @@ tap.test('alice, bob and carol create RtpReceivers and expect RtpSenders', { tim ...@@ -92,19 +93,24 @@ tap.test('alice, bob and carol create RtpReceivers and expect RtpSenders', { tim
{ {
name : 'vp9', name : 'vp9',
payloadType : 103, payloadType : 103,
clockRate : 90000
},
{
name : 'rtx',
payloadType : 97,
clockRate : 90000, clockRate : 90000,
rtx : parameters : { apt: 103 }
{
payloadType : 97,
rtxTime : 2000
}
} }
], ],
encodings : encodings :
[ [
{ {
ssrc : 200000021, ssrc : 200000021,
rtxSsrc : 200000022 active : true,
rtx :
{
ssrc : 200000022
}
} }
], ],
rtcp : rtcp :
...@@ -121,19 +127,15 @@ tap.test('alice, bob and carol create RtpReceivers and expect RtpSenders', { tim ...@@ -121,19 +127,15 @@ tap.test('alice, bob and carol create RtpReceivers and expect RtpSenders', { tim
[ [
{ {
name : 'opus', name : 'opus',
payloadType : 103, payloadType : 101,
clockRate : 90000, clockRate : 90000
fec :
[
{ mechanism: 'bar', payloadType: 98 }
]
} }
], ],
encodings : encodings :
[ [
{ {
ssrc : 300000011, ssrc : 300000011,
fecSsrc : 300000012 active : true
} }
], ],
rtcp : rtcp :
...@@ -150,19 +152,24 @@ tap.test('alice, bob and carol create RtpReceivers and expect RtpSenders', { tim ...@@ -150,19 +152,24 @@ tap.test('alice, bob and carol create RtpReceivers and expect RtpSenders', { tim
[ [
{ {
name : 'vp9', name : 'vp9',
payloadType : 103, payloadType : 103
rtx : },
{ {
payloadType : 97, name : 'rtx',
rtxTime : 1500 payloadType : 97,
} clockRate : 90000,
parameters : { apt: 103 }
} }
], ],
encodings : encodings :
[ [
{ {
ssrc : 300000021, ssrc : 300000021,
rtxSsrc : 300000022 active : true,
rtx :
{
ssrc : 300000022
}
} }
], ],
rtcp : rtcp :
......
...@@ -32,7 +32,7 @@ namespace RTC ...@@ -32,7 +32,7 @@ namespace RTC
Type type; Type type;
bool booleanValue = false; bool booleanValue = false;
uint32_t integerValue = 0; uint32_t integerValue = 0;
std::string stringValue = ""; std::string stringValue;
}; };
typedef std::unordered_map<std::string, CustomParameterValue> CustomParameters; typedef std::unordered_map<std::string, CustomParameterValue> CustomParameters;
......
...@@ -1032,8 +1032,11 @@ namespace RTC ...@@ -1032,8 +1032,11 @@ namespace RTC
// Get the remote certificate in PEM format. // Get the remote certificate in PEM format.
BIO* bio = BIO_new(BIO_s_mem()); BIO* bio = BIO_new(BIO_s_mem());
// Ensure the underlying BUF_MEM structure is also freed. // Ensure the underlying BUF_MEM structure is also freed.
BIO_set_close(bio, BIO_CLOSE); // NOTE: Avoid stupid "warning: value computed is not used [-Wunused-value]" since
// BIO_set_close() always returns 1.
(void) BIO_set_close(bio, BIO_CLOSE);
ret = PEM_write_bio_X509(bio, certificate); ret = PEM_write_bio_X509(bio, certificate);
if (ret != 1) if (ret != 1)
......
...@@ -529,7 +529,7 @@ namespace RTC ...@@ -529,7 +529,7 @@ namespace RTC
{ {
MS_TRACE(); MS_TRACE();
// We must remove the closed Transport from the RtpReceivers holding it. // Must remove the closed Transport from all the RtpReceivers holding it.
for (auto& kv : this->rtpReceivers) for (auto& kv : this->rtpReceivers)
{ {
RTC::RtpReceiver* rtpReceiver = kv.second; RTC::RtpReceiver* rtpReceiver = kv.second;
......
...@@ -395,7 +395,7 @@ namespace RTC ...@@ -395,7 +395,7 @@ namespace RTC
// from the map. // from the map.
auto rtpSenders = this->mapRtpReceiverRtpSenders[rtpReceiver]; auto rtpSenders = this->mapRtpReceiverRtpSenders[rtpReceiver];
// Safey iterate the copy of the set. // Safely iterate the copy of the set.
for (auto& rtpSender : rtpSenders) for (auto& rtpSender : rtpSenders)
{ {
rtpSender->Close(); rtpSender->Close();
......
...@@ -27,6 +27,9 @@ namespace RTC ...@@ -27,6 +27,9 @@ namespace RTC
{ {
auto& json_codecs = data[k_codecs]; auto& json_codecs = data[k_codecs];
if (json_codecs.size() == 0)
MS_THROW_ERROR("empty `RtpCodecParameters.codecs`");
for (Json::UInt i = 0; i < json_codecs.size(); i++) for (Json::UInt i = 0; i < json_codecs.size(); i++)
{ {
RtpCodecParameters codec(json_codecs[i]); RtpCodecParameters codec(json_codecs[i]);
...@@ -83,7 +86,9 @@ namespace RTC ...@@ -83,7 +86,9 @@ namespace RTC
this->muxId = rtpParameters->muxId; this->muxId = rtpParameters->muxId;
this->codecs = rtpParameters->codecs; this->codecs = rtpParameters->codecs;
this->encodings = rtpParameters->encodings; this->encodings = rtpParameters->encodings;
this->headerExtensions = rtpParameters->headerExtensions;
this->rtcp = rtpParameters->rtcp; this->rtcp = rtpParameters->rtcp;
this->hasRtcp = rtpParameters->hasRtcp;
} }
RtpParameters::~RtpParameters() RtpParameters::~RtpParameters()
......
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论