aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormikhal@webrtc.org <mikhal@webrtc.org@4adac7df-926f-26a2-2b94-8c16560cd09d>2013-09-03 19:09:49 +0000
committermikhal@webrtc.org <mikhal@webrtc.org@4adac7df-926f-26a2-2b94-8c16560cd09d>2013-09-03 19:09:49 +0000
commit2b810bf77b63ceecdd2b4941cd3fbca252edf294 (patch)
tree08bfc34f8f6e40a8c92353bc459a7af3971702cb
parentccf8b5667049a9e3165a80635071bd3bcd0a38ae (diff)
downloadwebrtc-2b810bf77b63ceecdd2b4941cd3fbca252edf294.tar.gz
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
-rw-r--r--webrtc/modules/video_coding/main/source/frame_buffer.cc4
-rw-r--r--webrtc/modules/video_coding/main/source/frame_buffer.h4
-rw-r--r--webrtc/modules/video_coding/main/source/jitter_buffer.cc11
-rw-r--r--webrtc/modules/video_coding/main/source/jitter_buffer.h1
-rw-r--r--webrtc/modules/video_coding/main/source/jitter_buffer_unittest.cc2
-rw-r--r--webrtc/modules/video_coding/main/source/session_info.cc18
-rw-r--r--webrtc/modules/video_coding/main/source/session_info.h5
-rw-r--r--webrtc/modules/video_coding/main/source/session_info_unittest.cc19
8 files changed, 4 insertions, 60 deletions
diff --git a/webrtc/modules/video_coding/main/source/frame_buffer.cc b/webrtc/modules/video_coding/main/source/frame_buffer.cc
index 42d627997a..b4a32e49f4 100644
--- a/webrtc/modules/video_coding/main/source/frame_buffer.cc
+++ b/webrtc/modules/video_coding/main/source/frame_buffer.cc
@@ -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;
diff --git a/webrtc/modules/video_coding/main/source/frame_buffer.h b/webrtc/modules/video_coding/main/source/frame_buffer.h
index 2df38300ac..d8c9d2725a 100644
--- a/webrtc/modules/video_coding/main/source/frame_buffer.h
+++ b/webrtc/modules/video_coding/main/source/frame_buffer.h
@@ -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
diff --git a/webrtc/modules/video_coding/main/source/jitter_buffer.cc b/webrtc/modules/video_coding/main/source/jitter_buffer.cc
index 327b8f2348..8bf7d78314 100644
--- a/webrtc/modules/video_coding/main/source/jitter_buffer.cc
+++ b/webrtc/modules/video_coding/main/source/jitter_buffer.cc
@@ -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());
diff --git a/webrtc/modules/video_coding/main/source/jitter_buffer.h b/webrtc/modules/video_coding/main/source/jitter_buffer.h
index 805c9b9275..c7646c1425 100644
--- a/webrtc/modules/video_coding/main/source/jitter_buffer.h
+++ b/webrtc/modules/video_coding/main/source/jitter_buffer.h
@@ -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.
diff --git a/webrtc/modules/video_coding/main/source/jitter_buffer_unittest.cc b/webrtc/modules/video_coding/main/source/jitter_buffer_unittest.cc
index db53b80289..b982ace22b 100644
--- a/webrtc/modules/video_coding/main/source/jitter_buffer_unittest.cc
+++ b/webrtc/modules/video_coding/main/source/jitter_buffer_unittest.cc
@@ -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;
diff --git a/webrtc/modules/video_coding/main/source/session_info.cc b/webrtc/modules/video_coding/main/source/session_info.cc
index 6d90b96c4b..814d27957b 100644
--- a/webrtc/modules/video_coding/main/source/session_info.cc
+++ b/webrtc/modules/video_coding/main/source/session_info.cc
@@ -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
diff --git a/webrtc/modules/video_coding/main/source/session_info.h b/webrtc/modules/video_coding/main/source/session_info.h
index c7950d3e8e..039f09763a 100644
--- a/webrtc/modules/video_coding/main/source/session_info.h
+++ b/webrtc/modules/video_coding/main/source/session_info.h
@@ -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.
diff --git a/webrtc/modules/video_coding/main/source/session_info_unittest.cc b/webrtc/modules/video_coding/main/source/session_info_unittest.cc
index 1317d783e8..2fab94de36 100644
--- a/webrtc/modules/video_coding/main/source/session_info_unittest.cc
+++ b/webrtc/modules/video_coding/main/source/session_info_unittest.cc
@@ -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