Calculate min and max receive timestamps for packets in a video frame

Bug: webrtc:10106
Change-Id: I1d3469abb1e7bb7c91a5912d7b781505526abaca
Reviewed-on: https://webrtc-review.googlesource.com/c/113507
Reviewed-by: Sebastian Jansson <srte@webrtc.org>
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25935}
This commit is contained in:
Ilya Nikolaevskiy
2018-12-07 16:26:56 +01:00
committed by Commit Bot
parent 48a79465ec
commit 4348ce240a
6 changed files with 23 additions and 14 deletions

View File

@ -285,6 +285,8 @@ std::vector<std::unique_ptr<RtpFrameObject>> PacketBuffer::FindFrames(
size_t frame_size = 0;
int max_nack_count = -1;
uint16_t start_seq_num = seq_num;
int64_t min_recv_time = data_buffer_[index].receive_time_ms;
int64_t max_recv_time = data_buffer_[index].receive_time_ms;
// Find the start index by searching backward until the packet with
// the |frame_begin| flag is set.
@ -306,6 +308,11 @@ std::vector<std::unique_ptr<RtpFrameObject>> PacketBuffer::FindFrames(
std::max(max_nack_count, data_buffer_[start_index].timesNacked);
sequence_buffer_[start_index].frame_created = true;
min_recv_time =
std::min(min_recv_time, data_buffer_[start_index].receive_time_ms);
max_recv_time =
std::max(max_recv_time, data_buffer_[start_index].receive_time_ms);
if (!is_h264 && sequence_buffer_[start_index].frame_begin)
break;
@ -393,7 +400,7 @@ std::vector<std::unique_ptr<RtpFrameObject>> PacketBuffer::FindFrames(
found_frames.emplace_back(
new RtpFrameObject(this, start_seq_num, seq_num, frame_size,
max_nack_count, clock_->TimeInMilliseconds()));
max_nack_count, min_recv_time, max_recv_time));
}
++seq_num;
}