rtcp::Ij renamed to rtcp::ExtendedJitterReport

to match name given in the RFC5450
  private member renamed to inter_arrival_jitters_ for the same reason.
rtcp::ExtendedJitterReport moved into own file
accessors and Parse function added
  to make class usable for parsing packet

Review URL: https://codereview.webrtc.org/1434213004

Cr-Commit-Position: refs/heads/master@{#10636}
This commit is contained in:
danilchap
2015-11-13 07:33:20 -08:00
committed by Commit bot
parent cbe9f51cf8
commit f8506cbdd8
10 changed files with 266 additions and 139 deletions

View File

@ -23,7 +23,6 @@ using webrtc::rtcp::Bye;
using webrtc::rtcp::Dlrr;
using webrtc::rtcp::Empty;
using webrtc::rtcp::Fir;
using webrtc::rtcp::Ij;
using webrtc::rtcp::Nack;
using webrtc::rtcp::Pli;
using webrtc::rtcp::Sdes;
@ -196,50 +195,6 @@ TEST(RtcpPacketTest, SrWithTooManyReportBlocks) {
EXPECT_FALSE(sr.WithReportBlock(rb));
}
TEST(RtcpPacketTest, IjNoItem) {
Ij ij;
rtc::scoped_ptr<RawPacket> packet(ij.Build());
RtcpPacketParser parser;
parser.Parse(packet->Buffer(), packet->Length());
EXPECT_EQ(1, parser.ij()->num_packets());
EXPECT_EQ(0, parser.ij_item()->num_packets());
}
TEST(RtcpPacketTest, IjOneItem) {
Ij ij;
EXPECT_TRUE(ij.WithJitterItem(0x11111111));
rtc::scoped_ptr<RawPacket> packet(ij.Build());
RtcpPacketParser parser;
parser.Parse(packet->Buffer(), packet->Length());
EXPECT_EQ(1, parser.ij()->num_packets());
EXPECT_EQ(1, parser.ij_item()->num_packets());
EXPECT_EQ(0x11111111U, parser.ij_item()->Jitter());
}
TEST(RtcpPacketTest, IjTwoItems) {
Ij ij;
EXPECT_TRUE(ij.WithJitterItem(0x11111111));
EXPECT_TRUE(ij.WithJitterItem(0x22222222));
rtc::scoped_ptr<RawPacket> packet(ij.Build());
RtcpPacketParser parser;
parser.Parse(packet->Buffer(), packet->Length());
EXPECT_EQ(1, parser.ij()->num_packets());
EXPECT_EQ(2, parser.ij_item()->num_packets());
EXPECT_EQ(0x22222222U, parser.ij_item()->Jitter());
}
TEST(RtcpPacketTest, IjTooManyItems) {
Ij ij;
const int kMaxIjItems = (1 << 5) - 1;
for (int i = 0; i < kMaxIjItems; ++i) {
EXPECT_TRUE(ij.WithJitterItem(i));
}
EXPECT_FALSE(ij.WithJitterItem(kMaxIjItems));
}
TEST(RtcpPacketTest, AppWithNoData) {
App app;
app.WithSubType(30);