Refactor NACK list creation to build the NACK list as packets arrive.
Also fixes a timer bug related to NACKing in the RTP module which could cause packets to only be NACKed twice if there's frequent packet losses. Note that I decided to remove any selective NACKing for now as I don't think the gain of doing it is big enough compared to the added complexity. The same reasoning for empty packets. None of them will be retransmitted by a smart sender since the sender would know that they aren't needed. BUG=1420 TEST=video_coding_unittests, vie_auto_test, video_coding_integrationtests, trybots Review URL: https://webrtc-codereview.appspot.com/1115006 git-svn-id: http://webrtc.googlecode.com/svn/trunk@3599 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
@ -24,7 +24,7 @@ VCMDecodingState::VCMDecodingState()
|
||||
temporal_id_(kNoTemporalIdx),
|
||||
tl0_pic_id_(kNoTl0PicIdx),
|
||||
full_sync_(true),
|
||||
init_(true) {}
|
||||
in_initial_state_(true) {}
|
||||
|
||||
VCMDecodingState::~VCMDecodingState() {}
|
||||
|
||||
@ -36,7 +36,7 @@ void VCMDecodingState::Reset() {
|
||||
temporal_id_ = kNoTemporalIdx;
|
||||
tl0_pic_id_ = kNoTl0PicIdx;
|
||||
full_sync_ = true;
|
||||
init_ = true;
|
||||
in_initial_state_ = true;
|
||||
}
|
||||
|
||||
uint32_t VCMDecodingState::time_stamp() const {
|
||||
@ -49,7 +49,7 @@ uint16_t VCMDecodingState::sequence_num() const {
|
||||
|
||||
bool VCMDecodingState::IsOldFrame(const VCMFrameBuffer* frame) const {
|
||||
assert(frame != NULL);
|
||||
if (init_)
|
||||
if (in_initial_state_)
|
||||
return false;
|
||||
return (LatestTimestamp(time_stamp_, frame->TimeStamp(), NULL)
|
||||
== time_stamp_);
|
||||
@ -57,7 +57,7 @@ bool VCMDecodingState::IsOldFrame(const VCMFrameBuffer* frame) const {
|
||||
|
||||
bool VCMDecodingState::IsOldPacket(const VCMPacket* packet) const {
|
||||
assert(packet != NULL);
|
||||
if (init_)
|
||||
if (in_initial_state_)
|
||||
return false;
|
||||
return (LatestTimestamp(time_stamp_, packet->timestamp, NULL)
|
||||
== time_stamp_);
|
||||
@ -71,7 +71,7 @@ void VCMDecodingState::SetState(const VCMFrameBuffer* frame) {
|
||||
picture_id_ = frame->PictureId();
|
||||
temporal_id_ = frame->TemporalId();
|
||||
tl0_pic_id_ = frame->Tl0PicId();
|
||||
init_ = false;
|
||||
in_initial_state_ = false;
|
||||
}
|
||||
|
||||
void VCMDecodingState::SetStateOneBack(const VCMFrameBuffer* frame) {
|
||||
@ -91,11 +91,11 @@ void VCMDecodingState::SetStateOneBack(const VCMFrameBuffer* frame) {
|
||||
else
|
||||
tl0_pic_id_ = frame->Tl0PicId() - 1;
|
||||
}
|
||||
init_ = false;
|
||||
in_initial_state_ = false;
|
||||
}
|
||||
|
||||
void VCMDecodingState::UpdateEmptyFrame(const VCMFrameBuffer* frame) {
|
||||
if (ContinuousFrame(frame) && frame->GetState() == kStateEmpty) {
|
||||
if (ContinuousFrame(frame)) {
|
||||
time_stamp_ = frame->TimeStamp();
|
||||
sequence_num_ = frame->GetHighSeqNum();
|
||||
}
|
||||
@ -114,8 +114,8 @@ void VCMDecodingState::SetSeqNum(uint16_t new_seq_num) {
|
||||
sequence_num_ = new_seq_num;
|
||||
}
|
||||
|
||||
bool VCMDecodingState::init() const {
|
||||
return init_;
|
||||
bool VCMDecodingState::in_initial_state() const {
|
||||
return in_initial_state_;
|
||||
}
|
||||
|
||||
bool VCMDecodingState::full_sync() const {
|
||||
@ -123,7 +123,7 @@ bool VCMDecodingState::full_sync() const {
|
||||
}
|
||||
|
||||
void VCMDecodingState::UpdateSyncState(const VCMFrameBuffer* frame) {
|
||||
if (init_)
|
||||
if (in_initial_state_)
|
||||
return;
|
||||
if (frame->TemporalId() == kNoTemporalIdx ||
|
||||
frame->Tl0PicId() == kNoTl0PicIdx) {
|
||||
@ -151,7 +151,7 @@ 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);
|
||||
if (init_)
|
||||
if (in_initial_state_)
|
||||
return true;
|
||||
|
||||
if (!ContinuousLayer(frame->TemporalId(), frame->Tl0PicId())) {
|
||||
|
||||
Reference in New Issue
Block a user