Revert 4104 "Refactor jitter buffer to use separate lists for de..."

Reason - leading suspect of video frame corruption tracked in http://b/9216252
Note that if this turns out to not be the cause, be sure to re-revert both this change and r4145.

> Refactor jitter buffer to use separate lists for decodable and incomplete frames.
> 
> This changes the design of the jitter buffer to keeping track of decodable frames from the point when packets are inserted in the buffer, instead of searching for decodable frames when they are needed.
> 
> To accomplish this the frame_list_, which previously contained all frames (incomplete or complete, continuous or not), is split into a list of decodable_frames_ (complete, continuous) and a list of incomplete_frames_ (either incomplete or non-continuous). These frame lists are updated every time a packet is inserted.
> 
> This is another step in the direction of doing most of the work in the jitter buffer only once, when packets are inserted, instead of doing it every time we look for a frame or try to get a nack list.
> 
> BUG=1798
> TEST=vie_auto_test, trybots
> R=mikhal@webrtc.org
> 
> Review URL: https://webrtc-codereview.appspot.com/1522005

TBR=stefan@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/1586007

git-svn-id: http://webrtc.googlecode.com/svn/trunk@4146 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
tnakamura@webrtc.org
2013-05-31 16:09:48 +00:00
parent 4d9c07ad6d
commit 694cdc6e84
7 changed files with 381 additions and 433 deletions

View File

@ -82,21 +82,11 @@ void VCMDecodingState::CopyFrom(const VCMDecodingState& state) {
in_initial_state_ = state.in_initial_state_;
}
bool VCMDecodingState::UpdateEmptyFrame(const VCMFrameBuffer* frame) {
bool empty_packet = frame->GetHighSeqNum() == frame->GetLowSeqNum();
if (in_initial_state_ && empty_packet) {
// Drop empty packets as long as we are in the initial state.
return true;
}
if ((empty_packet && ContinuousSeqNum(frame->GetHighSeqNum())) ||
ContinuousFrame(frame)) {
// Continuous empty packets or continuous frames can be dropped if we
// advance the sequence number.
sequence_num_ = frame->GetHighSeqNum();
void VCMDecodingState::UpdateEmptyFrame(const VCMFrameBuffer* frame) {
if (ContinuousFrame(frame)) {
time_stamp_ = frame->TimeStamp();
return true;
sequence_num_ = frame->GetHighSeqNum();
}
return false;
}
void VCMDecodingState::UpdateOldPacket(const VCMPacket* packet) {
@ -149,14 +139,11 @@ bool VCMDecodingState::ContinuousFrame(const VCMFrameBuffer* frame) const {
// Return true when in initial state.
// Note that when a method is not applicable it will return false.
assert(frame != NULL);
// A key frame is always considered continuous as it doesn't refer to any
// frames and therefore won't introduce any errors even if prior frames are
// missing.
if (frame->FrameType() == kVideoFrameKey)
return true;
// When in the initial state we always require a key frame to start decoding.
if (in_initial_state_)
if (in_initial_state_) {
// Always start with a key frame.
if (frame->FrameType() == kVideoFrameKey) return true;
return false;
}
if (!ContinuousLayer(frame->TemporalId(), frame->Tl0PicId())) {
// Base layers are not continuous or temporal layers are inactive.