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

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: combined_size to frame_size 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..f4cf0f80ba9753e3420a2643db248fa0834591d6 100644
--- a/webrtc/modules/video_coding/packet_buffer.cc
+++ b/webrtc/modules/video_coding/packet_buffer.cc
@@ -137,18 +137,28 @@ void PacketBuffer::FindFrames(uint16_t seq_num) {
// If all packets of the frame is continuous, find the first packet of the
// frame and create an RtpFrameObject.
if (sequence_buffer_[index].frame_end) {
- int start_index = index;
+ size_t frame_size = 0;
+ int8_t max_nack_count = -1;
uint16_t start_seq_num = seq_num;
+ // Find the start index by searching backward until the packet with
+ // the |frame_begin| flag is set.
+ int start_index = index;
while (!sequence_buffer_[start_index].frame_begin) {
stefan-webrtc 2016/05/23 13:01:25 Can this be a do ... while instead so that you don
philipel 2016/05/23 13:34:18 Cleaned it up a bit, can't really use do-while in
+ frame_size += data_buffer_[start_index].sizeBytes;
+ max_nack_count = std::max<int8_t>(
stefan-webrtc 2016/05/23 13:01:25 int
philipel 2016/05/23 13:34:18 Done.
+ max_nack_count, data_buffer_[start_index].timesNacked);
sequence_buffer_[start_index].frame_created = true;
start_index = start_index > 0 ? start_index - 1 : size_ - 1;
start_seq_num--;
}
+ frame_size += data_buffer_[start_index].sizeBytes;
+ max_nack_count = std::max<int8_t>(
stefan-webrtc 2016/05/23 13:01:25 int
+ max_nack_count, data_buffer_[start_index].timesNacked);
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, frame_size, max_nack_count));
reference_finder_.ManageFrame(std::move(frame));
}

Powered by Google App Engine
This is Rietveld 408576698