Add API to get the number of packets discarded by the video jitter buffer due to being too late.

BUG=
TEST=

Review URL: http://webrtc-codereview.appspot.com/200001

git-svn-id: http://webrtc.googlecode.com/svn/trunk@723 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
stefan@webrtc.org
2011-10-11 07:53:43 +00:00
parent 06887aebae
commit 791eec7424
13 changed files with 506 additions and 205 deletions

View File

@@ -800,11 +800,6 @@ int JitterBufferTest(CmdArgs& args)
packet.insertStartCode = false;
//printf("DONE H.264 insert start code test 2 packets\n");
// Temporarily do this to make the rest of the test work:
timeStamp += 33*90;
seqNum += 4;
//
// TEST statistics
//
@@ -823,8 +818,35 @@ int JitterBufferTest(CmdArgs& args)
TEST(frameRate > 30);
TEST(bitRate > 10000000);
// Insert 3 old packets and verify that we have 3 discarded packets
packet.timestamp = timeStamp - 1000;
frameIn = jb.GetFrame(packet);
TEST(frameIn == NULL);
packet.timestamp = timeStamp - 500;
frameIn = jb.GetFrame(packet);
TEST(frameIn == NULL);
packet.timestamp = timeStamp - 100;
frameIn = jb.GetFrame(packet);
TEST(frameIn == NULL);
TEST(jb.DiscardedPackets() == 3);
jb.Flush();
// This statistic shouldn't be reset by a flush.
TEST(jb.DiscardedPackets() == 3);
//printf("DONE Statistics\n");
// Temporarily do this to make the rest of the test work:
timeStamp += 33*90;
seqNum += 4;
//
// TEST delta frame 100 packets with seqNum wrap
//
@@ -833,7 +855,6 @@ int JitterBufferTest(CmdArgs& args)
// ---------------------------------------
//
// test flush
jb.Flush();
// insert first packet