Remove the audio/video split for the RTCP report intervals.
This is a follow up of a comment in https://webrtc-review.googlesource.com/c/src/+/110105 It was not very useful to split the audio and video report interval since the RTCP module can only either be audio or video. The recent it was written that way in https://webrtc-review.googlesource.com/c/src/+/43201/ was because that was a straightforward transition from two global constants to two variable. Bug: webrtc:8789 Change-Id: I2293de14ba5f363351f379a02022ed5dc7b8d458 Reviewed-on: https://webrtc-review.googlesource.com/c/110824 Reviewed-by: Fredrik Solenberg <solenberg@webrtc.org> Reviewed-by: Patrik Höglund <phoglund@webrtc.org> Reviewed-by: Niels Moller <nisse@webrtc.org> Reviewed-by: Danil Chapovalov <danilchap@webrtc.org> Reviewed-by: Erik Språng <sprang@webrtc.org> Commit-Queue: Jiawei Ou <ouj@fb.com> Cr-Commit-Position: refs/heads/master@{#25741}
This commit is contained in:
@ -107,6 +107,8 @@ constexpr uint32_t kReceiverExtraSsrc = 0x1234567;
|
||||
constexpr uint32_t kNotToUsSsrc = 0x654321;
|
||||
constexpr uint32_t kUnknownSenderSsrc = 0x54321;
|
||||
|
||||
constexpr int64_t kRtcpIntervalMs = 1000;
|
||||
|
||||
} // namespace
|
||||
|
||||
class RtcpReceiverTest : public ::testing::Test {
|
||||
@ -120,6 +122,7 @@ class RtcpReceiverTest : public ::testing::Test {
|
||||
&intra_frame_observer_,
|
||||
&transport_feedback_observer_,
|
||||
&bitrate_allocation_observer_,
|
||||
kRtcpIntervalMs,
|
||||
&rtp_rtcp_impl_) {}
|
||||
void SetUp() {
|
||||
std::set<uint32_t> ssrcs = {kReceiverMainSsrc, kReceiverExtraSsrc};
|
||||
@ -941,13 +944,12 @@ TEST_F(RtcpReceiverTest, StoresLastReceivedRrtrPerSsrc) {
|
||||
}
|
||||
|
||||
TEST_F(RtcpReceiverTest, ReceiveReportTimeout) {
|
||||
const int64_t kRtcpIntervalMs = 1000;
|
||||
const uint16_t kSequenceNumber = 1234;
|
||||
system_clock_.AdvanceTimeMilliseconds(3 * kRtcpIntervalMs);
|
||||
|
||||
// No RR received, shouldn't trigger a timeout.
|
||||
EXPECT_FALSE(rtcp_receiver_.RtcpRrTimeout(kRtcpIntervalMs));
|
||||
EXPECT_FALSE(rtcp_receiver_.RtcpRrSequenceNumberTimeout(kRtcpIntervalMs));
|
||||
EXPECT_FALSE(rtcp_receiver_.RtcpRrTimeout());
|
||||
EXPECT_FALSE(rtcp_receiver_.RtcpRrSequenceNumberTimeout());
|
||||
|
||||
// Add a RR and advance the clock just enough to not trigger a timeout.
|
||||
rtcp::ReportBlock rb1;
|
||||
@ -962,8 +964,8 @@ TEST_F(RtcpReceiverTest, ReceiveReportTimeout) {
|
||||
InjectRtcpPacket(rr1);
|
||||
|
||||
system_clock_.AdvanceTimeMilliseconds(3 * kRtcpIntervalMs - 1);
|
||||
EXPECT_FALSE(rtcp_receiver_.RtcpRrTimeout(kRtcpIntervalMs));
|
||||
EXPECT_FALSE(rtcp_receiver_.RtcpRrSequenceNumberTimeout(kRtcpIntervalMs));
|
||||
EXPECT_FALSE(rtcp_receiver_.RtcpRrTimeout());
|
||||
EXPECT_FALSE(rtcp_receiver_.RtcpRrSequenceNumberTimeout());
|
||||
|
||||
// Add a RR with the same extended max as the previous RR to trigger a
|
||||
// sequence number timeout, but not a RR timeout.
|
||||
@ -972,17 +974,17 @@ TEST_F(RtcpReceiverTest, ReceiveReportTimeout) {
|
||||
InjectRtcpPacket(rr1);
|
||||
|
||||
system_clock_.AdvanceTimeMilliseconds(2);
|
||||
EXPECT_FALSE(rtcp_receiver_.RtcpRrTimeout(kRtcpIntervalMs));
|
||||
EXPECT_TRUE(rtcp_receiver_.RtcpRrSequenceNumberTimeout(kRtcpIntervalMs));
|
||||
EXPECT_FALSE(rtcp_receiver_.RtcpRrTimeout());
|
||||
EXPECT_TRUE(rtcp_receiver_.RtcpRrSequenceNumberTimeout());
|
||||
|
||||
// Advance clock enough to trigger an RR timeout too.
|
||||
system_clock_.AdvanceTimeMilliseconds(3 * kRtcpIntervalMs);
|
||||
EXPECT_TRUE(rtcp_receiver_.RtcpRrTimeout(kRtcpIntervalMs));
|
||||
EXPECT_TRUE(rtcp_receiver_.RtcpRrTimeout());
|
||||
|
||||
// We should only get one timeout even though we still haven't received a new
|
||||
// RR.
|
||||
EXPECT_FALSE(rtcp_receiver_.RtcpRrTimeout(kRtcpIntervalMs));
|
||||
EXPECT_FALSE(rtcp_receiver_.RtcpRrSequenceNumberTimeout(kRtcpIntervalMs));
|
||||
EXPECT_FALSE(rtcp_receiver_.RtcpRrTimeout());
|
||||
EXPECT_FALSE(rtcp_receiver_.RtcpRrSequenceNumberTimeout());
|
||||
|
||||
// Add a new RR with increase sequence number to reset timers.
|
||||
rtcp::ReportBlock rb2;
|
||||
@ -996,8 +998,8 @@ TEST_F(RtcpReceiverTest, ReceiveReportTimeout) {
|
||||
EXPECT_CALL(bandwidth_observer_, OnReceivedRtcpReceiverReport(_, _, _));
|
||||
InjectRtcpPacket(rr2);
|
||||
|
||||
EXPECT_FALSE(rtcp_receiver_.RtcpRrTimeout(kRtcpIntervalMs));
|
||||
EXPECT_FALSE(rtcp_receiver_.RtcpRrSequenceNumberTimeout(kRtcpIntervalMs));
|
||||
EXPECT_FALSE(rtcp_receiver_.RtcpRrTimeout());
|
||||
EXPECT_FALSE(rtcp_receiver_.RtcpRrSequenceNumberTimeout());
|
||||
|
||||
// Verify we can get a timeout again once we've received new RR.
|
||||
system_clock_.AdvanceTimeMilliseconds(2 * kRtcpIntervalMs);
|
||||
@ -1006,11 +1008,11 @@ TEST_F(RtcpReceiverTest, ReceiveReportTimeout) {
|
||||
InjectRtcpPacket(rr2);
|
||||
|
||||
system_clock_.AdvanceTimeMilliseconds(kRtcpIntervalMs + 1);
|
||||
EXPECT_FALSE(rtcp_receiver_.RtcpRrTimeout(kRtcpIntervalMs));
|
||||
EXPECT_TRUE(rtcp_receiver_.RtcpRrSequenceNumberTimeout(kRtcpIntervalMs));
|
||||
EXPECT_FALSE(rtcp_receiver_.RtcpRrTimeout());
|
||||
EXPECT_TRUE(rtcp_receiver_.RtcpRrSequenceNumberTimeout());
|
||||
|
||||
system_clock_.AdvanceTimeMilliseconds(2 * kRtcpIntervalMs);
|
||||
EXPECT_TRUE(rtcp_receiver_.RtcpRrTimeout(kRtcpIntervalMs));
|
||||
EXPECT_TRUE(rtcp_receiver_.RtcpRrTimeout());
|
||||
}
|
||||
|
||||
TEST_F(RtcpReceiverTest, TmmbrReceivedWithNoIncomingPacket) {
|
||||
|
||||
Reference in New Issue
Block a user