Update expectation of OneBitrateObserverTwoRtcpObservers test:
Use different media ssrcs for different RtcpBandwidthObservers Bug: None Change-Id: I1733ddfa5dcd378b700e31fd805d8930ec69064f Reviewed-on: https://chromium-review.googlesource.com/517798 Reviewed-by: Stefan Holmer <stefan@webrtc.org> Commit-Queue: Danil Chapovalov <danilchap@webrtc.org> Cr-Commit-Position: refs/heads/master@{#18536}
This commit is contained in:
parent
f474c19937
commit
7f8369aa3f
@ -184,34 +184,35 @@ TEST_F(BitrateControllerTest, OneBitrateObserverOneRtcpObserver) {
|
||||
}
|
||||
|
||||
TEST_F(BitrateControllerTest, OneBitrateObserverTwoRtcpObservers) {
|
||||
const uint32_t kSsrc1 = 1;
|
||||
const uint32_t kSsrc2 = 2;
|
||||
// REMBs during the first 2 seconds apply immediately.
|
||||
const uint32_t kSenderSsrc1 = 1;
|
||||
const uint32_t kSenderSsrc2 = 2;
|
||||
const uint32_t kMediaSsrc1 = 3;
|
||||
const uint32_t kMediaSsrc2 = 4;
|
||||
|
||||
int64_t time_ms = 1;
|
||||
webrtc::ReportBlockList report_blocks;
|
||||
report_blocks.push_back(CreateReportBlock(kSsrc1, 2, 0, 1));
|
||||
report_blocks = {CreateReportBlock(kSenderSsrc1, kMediaSsrc1, 0, 1)};
|
||||
bandwidth_observer_->OnReceivedRtcpReceiverReport(report_blocks, 50, time_ms);
|
||||
report_blocks.clear();
|
||||
time_ms += 500;
|
||||
|
||||
RtcpBandwidthObserver* second_bandwidth_observer =
|
||||
controller_->CreateRtcpBandwidthObserver();
|
||||
report_blocks = {CreateReportBlock(kSenderSsrc2, kMediaSsrc2, 0, 21)};
|
||||
second_bandwidth_observer->OnReceivedRtcpReceiverReport(
|
||||
report_blocks, 100, time_ms);
|
||||
|
||||
// Test start bitrate.
|
||||
report_blocks.push_back(CreateReportBlock(2, 2, 0, 21));
|
||||
second_bandwidth_observer->OnReceivedRtcpReceiverReport(
|
||||
report_blocks, 100, 1);
|
||||
EXPECT_EQ(200000, bitrate_observer_.last_bitrate_);
|
||||
EXPECT_EQ(0, bitrate_observer_.last_fraction_loss_);
|
||||
EXPECT_EQ(100, bitrate_observer_.last_rtt_);
|
||||
time_ms += 500;
|
||||
|
||||
// Test bitrate increase 8% per second.
|
||||
report_blocks.clear();
|
||||
report_blocks.push_back(CreateReportBlock(kSsrc1, 2, 0, 21));
|
||||
report_blocks = {CreateReportBlock(kSenderSsrc1, kMediaSsrc1, 0, 21)};
|
||||
bandwidth_observer_->OnReceivedRtcpReceiverReport(report_blocks, 50, time_ms);
|
||||
time_ms += 500;
|
||||
report_blocks.front().remoteSSRC = kSsrc2;
|
||||
|
||||
report_blocks = {CreateReportBlock(kSenderSsrc2, kMediaSsrc2, 0, 21)};
|
||||
second_bandwidth_observer->OnReceivedRtcpReceiverReport(
|
||||
report_blocks, 100, time_ms);
|
||||
EXPECT_EQ(217000, bitrate_observer_.last_bitrate_);
|
||||
@ -220,51 +221,44 @@ TEST_F(BitrateControllerTest, OneBitrateObserverTwoRtcpObservers) {
|
||||
time_ms += 500;
|
||||
|
||||
// Extra report should not change estimate.
|
||||
report_blocks.clear();
|
||||
report_blocks.push_back(CreateReportBlock(kSsrc2, 2, 0, 31));
|
||||
report_blocks = {CreateReportBlock(kSenderSsrc2, kMediaSsrc2, 0, 31)};
|
||||
second_bandwidth_observer->OnReceivedRtcpReceiverReport(
|
||||
report_blocks, 100, time_ms);
|
||||
EXPECT_EQ(217000, bitrate_observer_.last_bitrate_);
|
||||
time_ms += 500;
|
||||
|
||||
report_blocks.clear();
|
||||
report_blocks.push_back(CreateReportBlock(kSsrc1, 2, 0, 41));
|
||||
report_blocks = {CreateReportBlock(kSenderSsrc1, kMediaSsrc1, 0, 41)};
|
||||
bandwidth_observer_->OnReceivedRtcpReceiverReport(report_blocks, 50, time_ms);
|
||||
EXPECT_EQ(235360, bitrate_observer_.last_bitrate_);
|
||||
|
||||
// Second report should not change estimate.
|
||||
report_blocks.clear();
|
||||
report_blocks.push_back(CreateReportBlock(kSsrc2, 2, 0, 41));
|
||||
report_blocks = {CreateReportBlock(kSenderSsrc2, kMediaSsrc2, 0, 41)};
|
||||
second_bandwidth_observer->OnReceivedRtcpReceiverReport(
|
||||
report_blocks, 100, time_ms);
|
||||
EXPECT_EQ(235360, bitrate_observer_.last_bitrate_);
|
||||
time_ms += 1000;
|
||||
|
||||
// Reports from only one bandwidth observer is ok.
|
||||
report_blocks.clear();
|
||||
report_blocks.push_back(CreateReportBlock(kSsrc2, 2, 0, 61));
|
||||
report_blocks = {CreateReportBlock(kSenderSsrc2, kMediaSsrc2, 0, 61)};
|
||||
second_bandwidth_observer->OnReceivedRtcpReceiverReport(
|
||||
report_blocks, 50, time_ms);
|
||||
EXPECT_EQ(255189, bitrate_observer_.last_bitrate_);
|
||||
time_ms += 1000;
|
||||
|
||||
report_blocks.clear();
|
||||
report_blocks.push_back(CreateReportBlock(kSsrc2, 2, 0, 81));
|
||||
report_blocks = {CreateReportBlock(kSenderSsrc2, kMediaSsrc2, 0, 81)};
|
||||
second_bandwidth_observer->OnReceivedRtcpReceiverReport(
|
||||
report_blocks, 50, time_ms);
|
||||
EXPECT_EQ(276604, bitrate_observer_.last_bitrate_);
|
||||
time_ms += 1000;
|
||||
|
||||
report_blocks.clear();
|
||||
report_blocks.push_back(CreateReportBlock(kSsrc2, 2, 0, 121));
|
||||
report_blocks = {CreateReportBlock(kSenderSsrc2, kMediaSsrc2, 0, 121)};
|
||||
second_bandwidth_observer->OnReceivedRtcpReceiverReport(
|
||||
report_blocks, 50, time_ms);
|
||||
EXPECT_EQ(299732, bitrate_observer_.last_bitrate_);
|
||||
time_ms += 1000;
|
||||
|
||||
// Reach max cap.
|
||||
report_blocks.clear();
|
||||
report_blocks.push_back(CreateReportBlock(kSsrc2, 2, 0, 141));
|
||||
report_blocks = {CreateReportBlock(kSenderSsrc2, kMediaSsrc2, 0, 141)};
|
||||
second_bandwidth_observer->OnReceivedRtcpReceiverReport(
|
||||
report_blocks, 50, time_ms);
|
||||
EXPECT_EQ(300000, bitrate_observer_.last_bitrate_);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user