Skip to content

Commit

Permalink
Revert "Avoid sending empty receiver reports with RtcpTransceiver"
Browse files Browse the repository at this point in the history
This reverts commit e5f1a39.

Reason for revert: Speculative revert due to failing downstream unittest.

Original change's description:
> Avoid sending empty receiver reports with RtcpTransceiver
>
> Bug: None
> Change-Id: Ia017c2df285febefb72ba88ba43366455bde5a78
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/222402
> Reviewed-by: Per Kjellander <[email protected]>
> Commit-Queue: Danil Chapovalov <[email protected]>
> Cr-Commit-Position: refs/heads/master@{#34281}

[email protected],[email protected],[email protected]

Change-Id: I895317ad0381756e97e501a36d6440f83a68b6f8
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: None
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/222440
Reviewed-by: Björn Terelius <[email protected]>
Commit-Queue: Björn Terelius <[email protected]>
Cr-Commit-Position: refs/heads/master@{#34284}
  • Loading branch information
Björn Terelius authored and WebRTC LUCI CQ committed Jun 14, 2021
1 parent 1c1f540 commit 48420fa
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 47 deletions.
7 changes: 2 additions & 5 deletions modules/rtp_rtcp/source/rtcp_transceiver_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -355,12 +355,9 @@ void RtcpTransceiverImpl::CreateCompoundPacket(PacketSender* sender) {
rtcp::ReceiverReport receiver_report;
receiver_report.SetSenderSsrc(sender_ssrc);
receiver_report.SetReportBlocks(CreateReportBlocks(now));
if (config_.rtcp_mode == RtcpMode::kCompound ||
!receiver_report.report_blocks().empty()) {
sender->AppendPacket(receiver_report);
}
sender->AppendPacket(receiver_report);

if (!config_.cname.empty() && !sender->IsEmpty()) {
if (!config_.cname.empty()) {
rtcp::Sdes sdes;
bool added = sdes.AddCName(config_.feedback_ssrc, config_.cname);
RTC_DCHECK(added) << "Failed to add cname " << config_.cname
Expand Down
42 changes: 0 additions & 42 deletions modules/rtp_rtcp/source/rtcp_transceiver_impl_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ namespace {

using ::testing::_;
using ::testing::ElementsAre;
using ::testing::NiceMock;
using ::testing::Return;
using ::testing::SizeIs;
using ::testing::StrictMock;
Expand Down Expand Up @@ -393,47 +392,6 @@ TEST(RtcpTransceiverImplTest, SendsMinimalCompoundPacket) {
EXPECT_EQ(rtcp_parser.sdes()->chunks()[0].cname, config.cname);
}

TEST(RtcpTransceiverImplTest, AvoidsEmptyPacketsInReducedMode) {
MockTransport transport;
EXPECT_CALL(transport, SendRtcp).Times(0);
NiceMock<MockReceiveStatisticsProvider> receive_statistics;
SimulatedClock clock(0);

RtcpTransceiverConfig config = DefaultTestConfig();
config.clock = &clock;
config.outgoing_transport = &transport;
config.rtcp_mode = webrtc::RtcpMode::kReducedSize;
config.schedule_periodic_compound_packets = false;
config.receive_statistics = &receive_statistics;
RtcpTransceiverImpl rtcp_transceiver(config);

rtcp_transceiver.SendCompoundPacket();
}

TEST(RtcpTransceiverImplTest, AvoidsEmptyReceiverReportsInReducedMode) {
RtcpPacketParser rtcp_parser;
RtcpParserTransport transport(&rtcp_parser);
NiceMock<MockReceiveStatisticsProvider> receive_statistics;
SimulatedClock clock(0);

RtcpTransceiverConfig config = DefaultTestConfig();
config.clock = &clock;
config.outgoing_transport = &transport;
config.rtcp_mode = webrtc::RtcpMode::kReducedSize;
config.schedule_periodic_compound_packets = false;
config.receive_statistics = &receive_statistics;
// Set it to produce something (RRTR) in the "periodic" rtcp packets.
config.non_sender_rtt_measurement = true;
RtcpTransceiverImpl rtcp_transceiver(config);

// Rather than waiting for the right time to produce the periodic packet,
// trigger it manually.
rtcp_transceiver.SendCompoundPacket();

EXPECT_EQ(rtcp_parser.receiver_report()->num_packets(), 0);
EXPECT_GT(rtcp_parser.xr()->num_packets(), 0);
}

TEST(RtcpTransceiverImplTest, SendsNoRembInitially) {
const uint32_t kSenderSsrc = 12345;
SimulatedClock clock(0);
Expand Down

0 comments on commit 48420fa

Please sign in to comment.