Removing non decodable count from session info: This value isn't used, and therfore can be removed. This is a step towards the refactor of the session info to use maps.
R=stefan@webrtc.org Review URL: https://webrtc-codereview.appspot.com/2143004 git-svn-id: http://webrtc.googlecode.com/svn/trunk@4667 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
@@ -272,10 +272,6 @@ VCMFrameBuffer::ExtractFromStorage(const EncodedVideoData& frameFromStorage) {
|
||||
return VCM_OK;
|
||||
}
|
||||
|
||||
int VCMFrameBuffer::NotDecodablePackets() const {
|
||||
return _sessionInfo.packets_not_decodable();
|
||||
}
|
||||
|
||||
// Set counted status (as counted by JB or not)
|
||||
void VCMFrameBuffer::SetCountedFrame(bool frameCounted) {
|
||||
_frameCounted = frameCounted;
|
||||
|
@@ -79,10 +79,6 @@ class VCMFrameBuffer : public VCMEncodedFrame {
|
||||
|
||||
int32_t ExtractFromStorage(const EncodedVideoData& frameFromStorage);
|
||||
|
||||
// The number of packets discarded because the decoder can't make use of
|
||||
// them.
|
||||
int NotDecodablePackets() const;
|
||||
|
||||
// If _state is kStateDecodable, changes it to kStateIncomplete.
|
||||
// Used by the dual decoder. After the mode is changed to kNoErrors from
|
||||
// kWithErrors or kSelective errors, any states that have been marked
|
||||
|
@@ -147,7 +147,6 @@ VCMJitterBuffer::VCMJitterBuffer(Clock* clock,
|
||||
incomplete_frames_(),
|
||||
last_decoded_state_(),
|
||||
first_packet_since_reset_(true),
|
||||
num_not_decodable_packets_(0),
|
||||
receive_statistics_(),
|
||||
incoming_frame_rate_(0),
|
||||
incoming_frame_count_(0),
|
||||
@@ -215,7 +214,6 @@ void VCMJitterBuffer::CopyFrom(const VCMJitterBuffer& rhs) {
|
||||
rtt_ms_ = rhs.rtt_ms_;
|
||||
first_packet_since_reset_ = rhs.first_packet_since_reset_;
|
||||
last_decoded_state_ = rhs.last_decoded_state_;
|
||||
num_not_decodable_packets_ = rhs.num_not_decodable_packets_;
|
||||
decode_error_mode_ = rhs.decode_error_mode_;
|
||||
assert(max_nack_list_size_ == rhs.max_nack_list_size_);
|
||||
assert(max_packet_age_to_nack_ == rhs.max_packet_age_to_nack_);
|
||||
@@ -280,7 +278,6 @@ void VCMJitterBuffer::Start() {
|
||||
waiting_for_completion_.latest_packet_time = -1;
|
||||
first_packet_since_reset_ = true;
|
||||
rtt_ms_ = kDefaultRtt;
|
||||
num_not_decodable_packets_ = 0;
|
||||
last_decoded_state_.Reset();
|
||||
|
||||
WEBRTC_TRACE(webrtc::kTraceDebug, webrtc::kTraceVideoCoding,
|
||||
@@ -321,7 +318,6 @@ void VCMJitterBuffer::Flush() {
|
||||
decodable_frames_.Reset(&free_frames_);
|
||||
incomplete_frames_.Reset(&free_frames_);
|
||||
last_decoded_state_.Reset(); // TODO(mikhal): sync reset.
|
||||
num_not_decodable_packets_ = 0;
|
||||
frame_event_->Reset();
|
||||
packet_event_->Reset();
|
||||
num_consecutive_old_frames_ = 0;
|
||||
@@ -349,11 +345,6 @@ void VCMJitterBuffer::FrameStatistics(uint32_t* received_delta_frames,
|
||||
*received_key_frames = receive_statistics_[0] + receive_statistics_[2];
|
||||
}
|
||||
|
||||
int VCMJitterBuffer::num_not_decodable_packets() const {
|
||||
CriticalSectionScoped cs(crit_sect_);
|
||||
return num_not_decodable_packets_;
|
||||
}
|
||||
|
||||
int VCMJitterBuffer::num_discarded_packets() const {
|
||||
CriticalSectionScoped cs(crit_sect_);
|
||||
return num_discarded_packets_;
|
||||
@@ -562,8 +553,6 @@ VCMEncodedFrame* VCMJitterBuffer::ExtractAndSetDecode(uint32_t timestamp) {
|
||||
// decoder. Propagates the missing_frame bit.
|
||||
frame->PrepareForDecode(continuous);
|
||||
|
||||
num_not_decodable_packets_ += frame->NotDecodablePackets();
|
||||
|
||||
// We have a frame - update the last decoded state and nack list.
|
||||
last_decoded_state_.SetState(frame);
|
||||
DropPacketsFromNackList(last_decoded_state_.sequence_num());
|
||||
|
@@ -299,7 +299,6 @@ class VCMJitterBuffer {
|
||||
bool first_packet_since_reset_;
|
||||
|
||||
// Statistics.
|
||||
int num_not_decodable_packets_;
|
||||
// Frame counter for each type (key, delta, golden, key-delta).
|
||||
unsigned int receive_statistics_[4];
|
||||
// Latest calculated frame rates of incoming stream.
|
||||
|
@@ -937,8 +937,6 @@ TEST_F(TestBasicJitterBuffer, PacketLoss) {
|
||||
jitter_buffer_->ReleaseFrame(frame_out);
|
||||
}
|
||||
|
||||
EXPECT_EQ(10, jitter_buffer_->num_not_decodable_packets());
|
||||
|
||||
// Insert 3 old packets and verify that we have 3 discarded packets
|
||||
// Match value to actual latest timestamp decoded.
|
||||
timestamp_ -= 33 * 90;
|
||||
|
@@ -30,7 +30,6 @@ VCMSessionInfo::VCMSessionInfo()
|
||||
packets_(),
|
||||
empty_seq_num_low_(-1),
|
||||
empty_seq_num_high_(-1),
|
||||
packets_not_decodable_(0),
|
||||
first_packet_seq_num_(-1),
|
||||
last_packet_seq_num_(-1) {
|
||||
}
|
||||
@@ -101,7 +100,6 @@ void VCMSessionInfo::Reset() {
|
||||
packets_.clear();
|
||||
empty_seq_num_low_ = -1;
|
||||
empty_seq_num_high_ = -1;
|
||||
packets_not_decodable_ = 0;
|
||||
first_packet_seq_num_ = -1;
|
||||
last_packet_seq_num_ = -1;
|
||||
}
|
||||
@@ -247,7 +245,6 @@ int VCMSessionInfo::DeletePacketData(PacketIterator start,
|
||||
bytes_to_delete += (*it).sizeBytes;
|
||||
(*it).sizeBytes = 0;
|
||||
(*it).dataPtr = NULL;
|
||||
++packets_not_decodable_;
|
||||
}
|
||||
if (bytes_to_delete > 0)
|
||||
ShiftSubsequentPackets(end, -bytes_to_delete);
|
||||
@@ -266,8 +263,7 @@ int VCMSessionInfo::BuildVP8FragmentationHeader(
|
||||
kMaxVP8Partitions * sizeof(uint32_t));
|
||||
if (packets_.empty())
|
||||
return new_length;
|
||||
PacketIterator it = FindNextPartitionBeginning(packets_.begin(),
|
||||
&packets_not_decodable_);
|
||||
PacketIterator it = FindNextPartitionBeginning(packets_.begin());
|
||||
while (it != packets_.end()) {
|
||||
const int partition_id =
|
||||
(*it).codecSpecificHeader.codecHeader.VP8.partitionId;
|
||||
@@ -282,7 +278,7 @@ int VCMSessionInfo::BuildVP8FragmentationHeader(
|
||||
static_cast<uint32_t>(frame_buffer_length));
|
||||
new_length += fragmentation->fragmentationLength[partition_id];
|
||||
++partition_end;
|
||||
it = FindNextPartitionBeginning(partition_end, &packets_not_decodable_);
|
||||
it = FindNextPartitionBeginning(partition_end);
|
||||
if (partition_id + 1 > fragmentation->fragmentationVectorSize)
|
||||
fragmentation->fragmentationVectorSize = partition_id + 1;
|
||||
}
|
||||
@@ -304,14 +300,10 @@ int VCMSessionInfo::BuildVP8FragmentationHeader(
|
||||
}
|
||||
|
||||
VCMSessionInfo::PacketIterator VCMSessionInfo::FindNextPartitionBeginning(
|
||||
PacketIterator it, int* packets_skipped) const {
|
||||
PacketIterator it) const {
|
||||
while (it != packets_.end()) {
|
||||
if ((*it).codecSpecificHeader.codecHeader.VP8.beginningOfPartition) {
|
||||
return it;
|
||||
} else if (packets_skipped != NULL) {
|
||||
// This packet belongs to a partition with a previous loss and can't
|
||||
// be decoded.
|
||||
++(*packets_skipped);
|
||||
}
|
||||
++it;
|
||||
}
|
||||
@@ -479,8 +471,4 @@ void VCMSessionInfo::InformOfEmptyPacket(uint16_t seq_num) {
|
||||
empty_seq_num_low_ = seq_num;
|
||||
}
|
||||
|
||||
int VCMSessionInfo::packets_not_decodable() const {
|
||||
return packets_not_decodable_;
|
||||
}
|
||||
|
||||
} // namespace webrtc
|
||||
|
@@ -107,8 +107,7 @@ class VCMSessionInfo {
|
||||
// |it| is expected to point to the last packet of the previous partition,
|
||||
// or to the first packet of the frame. |packets_skipped| is incremented
|
||||
// for each packet found which doesn't have the beginning bit set.
|
||||
PacketIterator FindNextPartitionBeginning(PacketIterator it,
|
||||
int* packets_skipped) const;
|
||||
PacketIterator FindNextPartitionBeginning(PacketIterator it) const;
|
||||
|
||||
// Returns an iterator pointing to the last packet of the partition pointed to
|
||||
// by |it|.
|
||||
@@ -153,8 +152,6 @@ class VCMSessionInfo {
|
||||
PacketList packets_;
|
||||
int empty_seq_num_low_;
|
||||
int empty_seq_num_high_;
|
||||
// Number of packets discarded because the decoder can't use them.
|
||||
int packets_not_decodable_;
|
||||
|
||||
// The following two variables correspond to the first and last media packets
|
||||
// in a session defined by the first packet flag and the marker bit.
|
||||
|
@@ -219,7 +219,6 @@ TEST_F(TestSessionInfo, NormalOperation) {
|
||||
frame_data),
|
||||
packet_buffer_size());
|
||||
|
||||
EXPECT_EQ(0, session_.packets_not_decodable());
|
||||
EXPECT_EQ(10 * packet_buffer_size(), session_.SessionLength());
|
||||
for (int i = 0; i < 10; ++i) {
|
||||
SCOPED_TRACE("Calling VerifyPacket");
|
||||
@@ -237,7 +236,6 @@ TEST_F(TestSessionInfo, ErrorsEqualDecodableState) {
|
||||
kWithErrors,
|
||||
frame_data),
|
||||
packet_buffer_size());
|
||||
EXPECT_EQ(0, session_.packets_not_decodable());
|
||||
EXPECT_TRUE(session_.decodable());
|
||||
}
|
||||
|
||||
@@ -253,7 +251,6 @@ TEST_F(TestSessionInfo, SelectiveDecodableState) {
|
||||
kSelectiveErrors,
|
||||
frame_data),
|
||||
packet_buffer_size());
|
||||
EXPECT_EQ(0, session_.packets_not_decodable());
|
||||
EXPECT_FALSE(session_.decodable());
|
||||
|
||||
packet_.seqNum -= 1;
|
||||
@@ -264,7 +261,6 @@ TEST_F(TestSessionInfo, SelectiveDecodableState) {
|
||||
kSelectiveErrors,
|
||||
frame_data),
|
||||
packet_buffer_size());
|
||||
EXPECT_EQ(0, session_.packets_not_decodable());
|
||||
EXPECT_TRUE(session_.decodable());
|
||||
|
||||
packet_.isFirstPacket = false;
|
||||
@@ -277,7 +273,6 @@ TEST_F(TestSessionInfo, SelectiveDecodableState) {
|
||||
kSelectiveErrors,
|
||||
frame_data),
|
||||
packet_buffer_size());
|
||||
EXPECT_EQ(0, session_.packets_not_decodable());
|
||||
EXPECT_TRUE(session_.decodable());
|
||||
}
|
||||
|
||||
@@ -288,7 +283,6 @@ TEST_F(TestSessionInfo, SelectiveDecodableState) {
|
||||
kSelectiveErrors,
|
||||
frame_data),
|
||||
packet_buffer_size());
|
||||
EXPECT_EQ(0, session_.packets_not_decodable());
|
||||
EXPECT_TRUE(session_.decodable());
|
||||
}
|
||||
|
||||
@@ -614,7 +608,6 @@ TEST_F(TestVP8Partitions, TwoPartitionsOneLoss2) {
|
||||
EXPECT_TRUE(VerifyPartition(0, 2, 1));
|
||||
SCOPED_TRACE("Calling VerifyPartition");
|
||||
EXPECT_TRUE(VerifyPartition(1, 1, 3));
|
||||
EXPECT_EQ(1, session_.packets_not_decodable());
|
||||
}
|
||||
|
||||
TEST_F(TestVP8Partitions, TwoPartitionsNoLossWrap) {
|
||||
@@ -686,7 +679,6 @@ TEST_F(TestVP8Partitions, TwoPartitionsNoLossWrap) {
|
||||
EXPECT_TRUE(VerifyPartition(0, 2, 0));
|
||||
SCOPED_TRACE("Calling VerifyPartition");
|
||||
EXPECT_TRUE(VerifyPartition(1, 2, 2));
|
||||
EXPECT_EQ(0, session_.packets_not_decodable());
|
||||
}
|
||||
|
||||
TEST_F(TestVP8Partitions, TwoPartitionsLossWrap) {
|
||||
@@ -758,7 +750,6 @@ TEST_F(TestVP8Partitions, TwoPartitionsLossWrap) {
|
||||
EXPECT_TRUE(VerifyPartition(0, 2, 0));
|
||||
SCOPED_TRACE("Calling VerifyPartition");
|
||||
EXPECT_TRUE(VerifyPartition(1, 1, 2));
|
||||
EXPECT_EQ(1, session_.packets_not_decodable());
|
||||
}
|
||||
|
||||
|
||||
@@ -831,7 +822,6 @@ TEST_F(TestVP8Partitions, ThreePartitionsOneMissing) {
|
||||
EXPECT_TRUE(VerifyPartition(0, 2, 1));
|
||||
SCOPED_TRACE("Calling VerifyPartition");
|
||||
EXPECT_TRUE(VerifyPartition(2, 2, 5));
|
||||
EXPECT_EQ(0, session_.packets_not_decodable());
|
||||
}
|
||||
|
||||
TEST_F(TestVP8Partitions, ThreePartitionsLossInSecond) {
|
||||
@@ -932,7 +922,6 @@ TEST_F(TestVP8Partitions, ThreePartitionsLossInSecond) {
|
||||
EXPECT_TRUE(VerifyPartition(0, 2, 1));
|
||||
SCOPED_TRACE("Calling VerifyPartition");
|
||||
EXPECT_TRUE(VerifyPartition(2, 2, 6));
|
||||
EXPECT_EQ(2, session_.packets_not_decodable());
|
||||
}
|
||||
|
||||
TEST_F(TestVP8Partitions, AggregationOverTwoPackets) {
|
||||
@@ -986,7 +975,6 @@ TEST_F(TestVP8Partitions, AggregationOverTwoPackets) {
|
||||
frame_buffer_size(),
|
||||
&fragmentation_),
|
||||
3 * packet_buffer_size());
|
||||
EXPECT_EQ(0, session_.packets_not_decodable());
|
||||
SCOPED_TRACE("Calling VerifyPartition");
|
||||
EXPECT_TRUE(VerifyPartition(0, 2, 0));
|
||||
// This partition is aggregated in partition 0
|
||||
@@ -1010,7 +998,6 @@ TEST_F(TestNalUnits, OnlyReceivedEmptyPacket) {
|
||||
|
||||
EXPECT_EQ(0, session_.MakeDecodable());
|
||||
EXPECT_EQ(0, session_.SessionLength());
|
||||
EXPECT_EQ(0, session_.packets_not_decodable());
|
||||
}
|
||||
|
||||
TEST_F(TestNalUnits, OneIsolatedNaluLoss) {
|
||||
@@ -1038,7 +1025,6 @@ TEST_F(TestNalUnits, OneIsolatedNaluLoss) {
|
||||
|
||||
EXPECT_EQ(0, session_.MakeDecodable());
|
||||
EXPECT_EQ(2 * packet_buffer_size(), session_.SessionLength());
|
||||
EXPECT_EQ(0, session_.packets_not_decodable());
|
||||
SCOPED_TRACE("Calling VerifyNalu");
|
||||
EXPECT_TRUE(VerifyNalu(0, 1, 0));
|
||||
SCOPED_TRACE("Calling VerifyNalu");
|
||||
@@ -1070,7 +1056,6 @@ TEST_F(TestNalUnits, LossInMiddleOfNalu) {
|
||||
|
||||
EXPECT_EQ(packet_buffer_size(), session_.MakeDecodable());
|
||||
EXPECT_EQ(packet_buffer_size(), session_.SessionLength());
|
||||
EXPECT_EQ(1, session_.packets_not_decodable());
|
||||
SCOPED_TRACE("Calling VerifyNalu");
|
||||
EXPECT_TRUE(VerifyNalu(0, 1, 0));
|
||||
}
|
||||
@@ -1100,7 +1085,6 @@ TEST_F(TestNalUnits, StartAndEndOfLastNalUnitLost) {
|
||||
|
||||
EXPECT_EQ(packet_buffer_size(), session_.MakeDecodable());
|
||||
EXPECT_EQ(packet_buffer_size(), session_.SessionLength());
|
||||
EXPECT_EQ(1, session_.packets_not_decodable());
|
||||
SCOPED_TRACE("Calling VerifyNalu");
|
||||
EXPECT_TRUE(VerifyNalu(0, 1, 0));
|
||||
}
|
||||
@@ -1141,7 +1125,6 @@ TEST_F(TestNalUnits, ReorderWrapNoLoss) {
|
||||
packet_buffer_size());
|
||||
|
||||
EXPECT_EQ(0, session_.MakeDecodable());
|
||||
EXPECT_EQ(0, session_.packets_not_decodable());
|
||||
EXPECT_EQ(3 * packet_buffer_size(), session_.SessionLength());
|
||||
SCOPED_TRACE("Calling VerifyNalu");
|
||||
EXPECT_TRUE(VerifyNalu(0, 1, 0));
|
||||
@@ -1172,7 +1155,6 @@ TEST_F(TestNalUnits, WrapLosses) {
|
||||
|
||||
EXPECT_EQ(2 * packet_buffer_size(), session_.MakeDecodable());
|
||||
EXPECT_EQ(0, session_.SessionLength());
|
||||
EXPECT_EQ(2, session_.packets_not_decodable());
|
||||
}
|
||||
|
||||
TEST_F(TestNalUnits, ReorderWrapLosses) {
|
||||
@@ -1202,7 +1184,6 @@ TEST_F(TestNalUnits, ReorderWrapLosses) {
|
||||
|
||||
EXPECT_EQ(2 * packet_buffer_size(), session_.MakeDecodable());
|
||||
EXPECT_EQ(0, session_.SessionLength());
|
||||
EXPECT_EQ(2, session_.packets_not_decodable());
|
||||
}
|
||||
|
||||
} // namespace webrtc
|
||||
|
Reference in New Issue
Block a user