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

RTCP XR: cosmetic

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