Commit dc69b20 1 parent 5be7578 commit dc69b20 Copy full SHA for dc69b20
File tree 3 files changed +13
-7
lines changed
3 files changed +13
-7
lines changed Original file line number Diff line number Diff line change @@ -21,10 +21,11 @@ namespace RTC
21
21
size_t GetSize () const ;
22
22
size_t GetSenderReportCount () const ;
23
23
size_t GetReceiverReportCount () const ;
24
- void Dump () const ;
24
+ void Dump ();
25
25
void AddSenderReport (SenderReport* report);
26
26
void AddReceiverReport (ReceiverReport* report);
27
27
void AddSdesChunk (SdesChunk* chunk);
28
+ bool HasSenderReport ();
28
29
void Serialize (uint8_t * data);
29
30
30
31
private:
@@ -66,6 +67,11 @@ namespace RTC
66
67
{
67
68
this ->sdesPacket .AddChunk (chunk);
68
69
}
70
+
71
+ inline bool CompoundPacket::HasSenderReport ()
72
+ {
73
+ return this ->senderReportPacket .Begin () != this ->senderReportPacket .End ();
74
+ }
69
75
} // namespace RTCP
70
76
} // namespace RTC
71
77
Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ namespace RTC
17
17
this ->header = data;
18
18
19
19
// Calculate the total required size for the entire message.
20
- if (this -> senderReportPacket . GetCount () != 0u )
20
+ if (HasSenderReport () )
21
21
{
22
22
this ->size = this ->senderReportPacket .GetSize ();
23
23
@@ -39,7 +39,7 @@ namespace RTC
39
39
// Fill it.
40
40
size_t offset{ 0 };
41
41
42
- if (this -> senderReportPacket . GetCount () != 0u )
42
+ if (HasSenderReport () )
43
43
{
44
44
this ->senderReportPacket .Serialize (this ->header );
45
45
offset = this ->senderReportPacket .GetSize ();
@@ -81,13 +81,13 @@ namespace RTC
81
81
this ->sdesPacket .Serialize (this ->header + offset);
82
82
}
83
83
84
- void CompoundPacket::Dump () const
84
+ void CompoundPacket::Dump ()
85
85
{
86
86
MS_TRACE ();
87
87
88
88
MS_DUMP (" <CompoundPacket>" );
89
89
90
- if (this -> senderReportPacket . GetCount () != 0u )
90
+ if (HasSenderReport () )
91
91
{
92
92
this ->senderReportPacket .Dump ();
93
93
@@ -105,7 +105,7 @@ namespace RTC
105
105
106
106
void CompoundPacket::AddSenderReport (SenderReport* report)
107
107
{
108
- MS_ASSERT (this -> senderReportPacket . GetCount () == 0 , " a sender report is already present" );
108
+ MS_ASSERT (! HasSenderReport () , " a sender report is already present" );
109
109
110
110
this ->senderReportPacket .AddReport (report);
111
111
}
Original file line number Diff line number Diff line change @@ -442,7 +442,7 @@ namespace RTC
442
442
consumer->GetRtcp (packet.get (), now);
443
443
444
444
// Send the RTCP compound packet if there is a sender report.
445
- if (packet->GetSenderReportCount () != 0u )
445
+ if (packet->HasSenderReport () )
446
446
{
447
447
// Ensure that the RTCP packet fits into the RTCP buffer.
448
448
if (packet->GetSize () > RTC::RTCP::BufferSize)
You can’t perform that action at this time.
0 commit comments