Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(208)

Unified Diff: webrtc/modules/video_coding/packet_buffer.cc

Issue 1988653002: PacketBuffer now can save how many times a packet has been nacked. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: webrtc/modules/video_coding/packet_buffer.cc
diff --git a/webrtc/modules/video_coding/packet_buffer.cc b/webrtc/modules/video_coding/packet_buffer.cc
index 09fb2499074fde1b12005d427b9cdba5dd81a18c..0ee5becdea9837fc2dee376830d37824c61fa432 100644
--- a/webrtc/modules/video_coding/packet_buffer.cc
+++ b/webrtc/modules/video_coding/packet_buffer.cc
@@ -37,7 +37,7 @@ PacketBuffer::PacketBuffer(size_t start_buffer_size,
RTC_DCHECK((max_buffer_size & (max_buffer_size - 1)) == 0);
}
-bool PacketBuffer::InsertPacket(const VCMPacket& packet) {
+bool PacketBuffer::InsertPacket(const VCMPacket& packet, int times_nacked) {
rtc::CritScope lock(&crit_);
uint16_t seq_num = packet.seqNum;
size_t index = seq_num % size_;
@@ -72,6 +72,7 @@ bool PacketBuffer::InsertPacket(const VCMPacket& packet) {
sequence_buffer_[index].continuous = false;
sequence_buffer_[index].frame_created = false;
sequence_buffer_[index].used = true;
+ sequence_buffer_[index].times_nacked = times_nacked;
data_buffer_[index] = packet;
FindFrames(seq_num);
@@ -138,17 +139,25 @@ void PacketBuffer::FindFrames(uint16_t seq_num) {
// frame and create an RtpFrameObject.
if (sequence_buffer_[index].frame_end) {
int start_index = index;
+ size_t combined_size = 0;
stefan-webrtc 2016/05/20 13:10:23 Should this be frame_size instead?
philipel 2016/05/23 09:19:22 Done.
+ int8_t max_nack_count = -1;
uint16_t start_seq_num = seq_num;
while (!sequence_buffer_[start_index].frame_begin) {
+ combined_size += data_buffer_[start_index].sizeBytes;
+ max_nack_count = std::max<int8_t>(
+ max_nack_count, sequence_buffer_[start_index].times_nacked);
sequence_buffer_[start_index].frame_created = true;
start_index = start_index > 0 ? start_index - 1 : size_ - 1;
stefan-webrtc 2016/05/20 13:10:23 start_index seems like a bad variable name as it d
philipel 2016/05/23 09:19:22 Hard to find a better name, I added a comment abou
start_seq_num--;
}
+ combined_size += data_buffer_[start_index].sizeBytes;
+ max_nack_count = std::max<int8_t>(
+ max_nack_count, sequence_buffer_[start_index].times_nacked);
sequence_buffer_[start_index].frame_created = true;
- std::unique_ptr<RtpFrameObject> frame(
- new RtpFrameObject(this, start_seq_num, seq_num));
+ std::unique_ptr<RtpFrameObject> frame(new RtpFrameObject(
+ this, start_seq_num, seq_num, combined_size, max_nack_count));
reference_finder_.ManageFrame(std::move(frame));
}

Powered by Google App Engine
This is Rietveld 408576698