提交 6e719bde authored 作者: Iñaki Baz Castillo's avatar Iñaki Baz Castillo

2.3.1

上级 b6cd1941
# Changelog
### 2.3.1
* H264: Check if there is room for the indicated NAL unit size (thanks @ggarber).
* H264: Code cleanup.
### 2.3.0
* Add new "spy" feature. A "spy" peer cannot produce media and is invisible for other peers in the room.
......
{
"name": "mediasoup",
"version": "2.3.0",
"version": "2.3.1",
"description": "Cutting Edge WebRTC Video Conferencing",
"author": "Iñaki Baz Castillo <ibc@aliax.net> (https://inakibaz.me)",
"contributors": [
......@@ -36,7 +36,7 @@
"randomatic": "^3.1.0"
},
"devDependencies": {
"eslint": "^5.6.1",
"eslint": "^5.7.0",
"gulp": "^4.0.0",
"gulp-clang-format": "^1.0.27",
"gulp-eslint": "^5.0.0",
......@@ -50,6 +50,7 @@
"clang-tools-prebuilt": "^0.1.4"
},
"scripts": {
"lint": "gulp lint",
"test": "gulp test",
"postinstall": "make Release"
}
......
......@@ -21,51 +21,61 @@ namespace RTC
uint8_t nal = *data & 0x1F;
/** Single NAL unit packet **/
// IDR (instantaneous decoding picture).
if (nal == 7)
switch (nal)
{
payloadDescriptor->isKeyFrame = true;
}
/** Aggreation packet **/
// Single NAL unit packet.
// IDR (instantaneous decoding picture).
case 7:
{
payloadDescriptor->isKeyFrame = true;
// STAP-A.
else if (nal == 24)
{
size_t offset = 1;
len -= 1;
break;
}
// Iterate NAL units.
while (len >= 3)
// Aggreation packet.
// STAP-A.
case 24:
{
auto naluSize = Utils::Byte::Get2Bytes(data, offset);
nal = *(data + offset + sizeof(naluSize)) & 0x1F;
size_t offset = 1;
len -= 1;
if (nal == 7)
// Iterate NAL units.
while (len >= 3)
{
payloadDescriptor->isKeyFrame = true;
auto naluSize = Utils::Byte::Get2Bytes(data, offset);
nal = *(data + offset + sizeof(naluSize)) & 0x1F;
break;
}
if (nal == 7)
{
payloadDescriptor->isKeyFrame = true;
break;
}
// Check if there is room for the indicated NAL unit size.
if (len < (naluSize + sizeof(naluSize)))
break;
// Check if there is room for the indicated NAL unit size.
if (len < (naluSize + sizeof(naluSize)))
break;
offset += naluSize + sizeof(naluSize);
len -= naluSize + sizeof(naluSize);
offset += naluSize + sizeof(naluSize);
len -= naluSize + sizeof(naluSize);
}
break;
}
}
// FU-A, FU-B.
else if (nal == 28 || nal == 29)
{
nal = *(data + 1) & 0x1F;
uint8_t startBit = *(data + 1) & 0x80;
if (nal == 7 && startBit == 128)
payloadDescriptor->isKeyFrame = true;
// Aggreation packet.
// FU-A, FU-B.
case 28:
case 29:
{
nal = *(data + 1) & 0x1F;
uint8_t startBit = *(data + 1) & 0x80;
if (nal == 7 && startBit == 128)
payloadDescriptor->isKeyFrame = true;
break;
}
}
return payloadDescriptor.release();
......
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论