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

Fix RTCP ReceiverReport iteration

上级 44dd434a
# Packet Dump
For example, after SRTP decrypting a RTP or SRTP packet, print it in hexadecimal in a Wireshark friendly format:
```c++
void OnRtpDataRecv(RTC::TransportTuple* tuple, const uint8_t* data, size_t len)
{
// [...]
std::printf("-------------- <decrypted RTP> -----------------\n");
for (size_t i{0}; i < len; ++i)
{
if (i % 8 == 0)
std::printf("\n%06X ", (unsigned int)i);
std::printf("%02X ", (unsigned char)data[i]);
}
std::printf("\n-------------- </decrypted RTP> ----------------\n");
std::fflush(stdout);
}
```
...@@ -6,6 +6,7 @@ Internal documentation for developming purposes. Get the **mediasoup** public do ...@@ -6,6 +6,7 @@ Internal documentation for developming purposes. Get the **mediasoup** public do
* [Fuzzer](Fuzzer.md) * [Fuzzer](Fuzzer.md)
* [RTCP](RTCP.md) * [RTCP](RTCP.md)
* [Consumer](Consumer.md) * [Consumer](Consumer.md)
* [Packet Dump](PacketDump.md)
* [ffmpeg](ffmpeg.md) - Usage of `ffmpeg` with mediasoup v3. * [ffmpeg](ffmpeg.md) - Usage of `ffmpeg` with mediasoup v3.
* [Charts](Charts.md) * [Charts](Charts.md)
...@@ -53,8 +53,6 @@ namespace RTC ...@@ -53,8 +53,6 @@ namespace RTC
public: public:
static bool IsRtcp(const uint8_t* data, size_t len); static bool IsRtcp(const uint8_t* data, size_t len);
static Packet* Parse(const uint8_t* data, size_t len); static Packet* Parse(const uint8_t* data, size_t len);
private:
static const std::string& Type2String(Type type); static const std::string& Type2String(Type type);
private: private:
......
...@@ -466,9 +466,8 @@ namespace RTC ...@@ -466,9 +466,8 @@ namespace RTC
case RTC::RTCP::Type::RR: case RTC::RTCP::Type::RR:
{ {
auto* rr = static_cast<RTC::RTCP::ReceiverReportPacket*>(packet); auto* rr = static_cast<RTC::RTCP::ReceiverReportPacket*>(packet);
auto it = rr->Begin();
for (; it != rr->End(); ++it) for (auto it = rr->Begin(); it != rr->End(); ++it)
{ {
auto& report = (*it); auto& report = (*it);
auto* consumer = GetConsumerByMediaSsrc(report->GetSsrc()); auto* consumer = GetConsumerByMediaSsrc(report->GetSsrc());
...@@ -480,7 +479,7 @@ namespace RTC ...@@ -480,7 +479,7 @@ namespace RTC
"no Consumer found for received Receiver Report [ssrc:%" PRIu32 "]", "no Consumer found for received Receiver Report [ssrc:%" PRIu32 "]",
report->GetSsrc()); report->GetSsrc());
break; continue;
} }
consumer->ReceiveRtcpReceiverReport(report); consumer->ReceiveRtcpReceiverReport(report);
...@@ -616,10 +615,9 @@ namespace RTC ...@@ -616,10 +615,9 @@ namespace RTC
case RTC::RTCP::Type::SR: case RTC::RTCP::Type::SR:
{ {
auto* sr = static_cast<RTC::RTCP::SenderReportPacket*>(packet); auto* sr = static_cast<RTC::RTCP::SenderReportPacket*>(packet);
auto it = sr->Begin();
// Even if Sender Report packet can only contains one report... // Even if Sender Report packet can only contains one report...
for (; it != sr->End(); ++it) for (auto it = sr->Begin(); it != sr->End(); ++it)
{ {
auto& report = (*it); auto& report = (*it);
// Get the producer associated to the SSRC indicated in the report. // Get the producer associated to the SSRC indicated in the report.
...@@ -644,9 +642,8 @@ namespace RTC ...@@ -644,9 +642,8 @@ namespace RTC
case RTC::RTCP::Type::SDES: case RTC::RTCP::Type::SDES:
{ {
auto* sdes = static_cast<RTC::RTCP::SdesPacket*>(packet); auto* sdes = static_cast<RTC::RTCP::SdesPacket*>(packet);
auto it = sdes->Begin();
for (; it != sdes->End(); ++it) for (auto it = sdes->Begin(); it != sdes->End(); ++it)
{ {
auto& chunk = (*it); auto& chunk = (*it);
// Get the producer associated to the SSRC indicated in the report. // Get the producer associated to the SSRC indicated in the report.
......
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论