提交 66b6c647 authored 作者: José Luis Millán's avatar José Luis Millán

RTCP XR: cosmetic

上级 02ff3e80
......@@ -64,7 +64,7 @@ namespace RTC
CommonHeader* header{ nullptr };
private:
uint8_t raw[sizeof(CommonHeader)]{ 0 };
uint8_t raw[sizeof(CommonHeader)];
};
class ExtendedReportPacket : public Packet
......@@ -82,7 +82,6 @@ namespace RTC
void AddReport(ExtendedReportBlock* report);
uint32_t GetSsrc() const;
void SetSsrc(uint32_t ssrc);
Iterator Begin();
Iterator End();
......@@ -103,7 +102,6 @@ namespace RTC
inline ExtendedReportBlock::ExtendedReportBlock(Type type) : type(type)
{
this->header = reinterpret_cast<CommonHeader*>(this->raw);
;
this->header->reserved = 0;
}
......@@ -154,7 +152,9 @@ namespace RTC
size_t size = sizeof(Packet::CommonHeader) + sizeof(this->ssrc);
for (auto* report : this->reports)
{
size += report->GetSize();
}
return size;
}
......
......@@ -53,7 +53,6 @@ namespace RTC
void Dump() const;
size_t Serialize(uint8_t* buffer);
size_t GetSize() const;
uint32_t GetSsrc() const;
void SetSsrc(uint32_t ssrc);
uint32_t GetLastReceiverReport() const;
......@@ -63,7 +62,7 @@ namespace RTC
private:
Body* body{ nullptr };
uint8_t raw[sizeof(Body)]{ 0 };
uint8_t raw[sizeof(Body)];
};
public:
......
......@@ -53,7 +53,7 @@ namespace RTC
private:
Body* body{ nullptr };
uint8_t raw[sizeof(Body)]{ 0 };
uint8_t raw[sizeof(Body)];
};
/* Inline instance methods. */
......
......@@ -39,9 +39,8 @@ namespace RTC
MS_DUMP(" block type : %" PRIu8, this->type);
MS_DUMP(" reserved : 0");
MS_DUMP(" length : 2");
MS_DUMP(" ntp sec : %" PRIu32, GetNtpSec());
MS_DUMP(" ntp frac : %" PRIu32, GetNtpFrac());
MS_DUMP(" ntp sec : %" PRIu32, GetNtpSec());
MS_DUMP(" ntp frac : %" PRIu32, GetNtpFrac());
MS_DUMP("</ReceiverReferenceTime>");
}
......
......@@ -1100,7 +1100,9 @@ namespace RTC
}
default:
{
break;
}
}
}
......
......@@ -29,7 +29,6 @@ SCENARIO("RTCP XrDelaySinceLastRt parsing", "[parser][rtcp][xr-dlrr]")
auto report2 = ReceiverReferenceTime::Parse(bufferReport1, report1->GetSize());
REQUIRE(report1->GetType() == report2->GetType());
REQUIRE(report1->GetNtpSec() == report2->GetNtpSec());
REQUIRE(report1->GetNtpFrac() == report2->GetNtpFrac());
......@@ -44,12 +43,11 @@ SCENARIO("RTCP XrDelaySinceLastRt parsing", "[parser][rtcp][xr-dlrr]")
REQUIRE(packet1->GetCount() == 0);
REQUIRE(packet1->GetSsrc() == 2222);
/* Total size:
* - RTCP common header
* - SSRC
* - block 1
* - block 2
*/
// Total size:
// - RTCP common header
// - SSRC
// - block 1
// - block 2
REQUIRE(packet1->GetSize() == 4 + 4 + 12 + 12);
// Serialize the packet into an external buffer.
......@@ -118,12 +116,11 @@ SCENARIO("RTCP XrDelaySinceLastRt parsing", "[parser][rtcp][xr-dlrr]")
REQUIRE(packet1->GetCount() == 0);
REQUIRE(packet1->GetSsrc() == 2222);
/* Total size:
* - RTCP common header
* - SSRC
* - block 1
* - block 2
*/
// Total size:
// - RTCP common header
// - SSRC
// - block 1
// - block 2
REQUIRE(packet1->GetSize() == 4 + 4 + 16 + 16);
// Serialize the packet into an external buffer.
......
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论