Buffer RTCP feedback messages in RtpVideoStreamReceiver

Currently, if LNTF and NACK messages are both created, they will
be sent out in separate RTCP messages. This is wasteful.
This CL is the first of in a series of CLs that will ensure that
these feedback messages can be buffered together, without introducing
more of a delay than the CPU time required to process both messages.

Bug: webrtc:10336
Change-Id: I950324112ee346695a12a17d025483ea5e99c732
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/139112
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Elad Alon <eladalon@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28136}
This commit is contained in:
Elad Alon
2019-05-31 13:25:50 +02:00
committed by Commit Bot
parent 4cd1c6a3db
commit ef09c5b734
9 changed files with 211 additions and 14 deletions

View File

@ -138,8 +138,11 @@ int NackModule::OnReceivedPacket(uint16_t seq_num,
// Are there any nacks that are waiting for this seq_num.
std::vector<uint16_t> nack_batch = GetNackBatch(kSeqNumOnly);
if (!nack_batch.empty())
nack_sender_->SendNack(nack_batch);
if (!nack_batch.empty()) {
// This batch of NACKs is triggered externally; the initiator can
// batch them with other feedback messages.
nack_sender_->SendNack(nack_batch, /*buffering_allowed=*/true);
}
return 0;
}
@ -178,8 +181,11 @@ void NackModule::Process() {
nack_batch = GetNackBatch(kTimeOnly);
}
if (!nack_batch.empty())
nack_sender_->SendNack(nack_batch);
if (!nack_batch.empty()) {
// This batch of NACKs is triggered externally; there is no external
// initiator who can batch them with other feedback messages.
nack_sender_->SendNack(nack_batch, /*buffering_allowed=*/false);
}
}
// Update the next_process_time_ms_ in intervals to achieve

View File

@ -28,6 +28,11 @@ class TestNackModule : public ::testing::Test,
keyframes_requested_(0) {}
void SendNack(const std::vector<uint16_t>& sequence_numbers) override {
RTC_NOTREACHED();
}
void SendNack(const std::vector<uint16_t>& sequence_numbers,
bool buffering_allowed) override {
sent_nacks_.insert(sent_nacks_.end(), sequence_numbers.begin(),
sequence_numbers.end());
}
@ -303,6 +308,11 @@ class TestNackModuleWithFieldTrial : public ::testing::Test,
keyframes_requested_(0) {}
void SendNack(const std::vector<uint16_t>& sequence_numbers) override {
RTC_NOTREACHED();
}
void SendNack(const std::vector<uint16_t>& sequence_numbers,
bool buffering_allowed) override {
sent_nacks_.insert(sent_nacks_.end(), sequence_numbers.begin(),
sequence_numbers.end());
}