Inject TickTimeInterface into VCM and tests

The purpose of this change is to introduce dependency injection
of the timer into the video coding module.

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

git-svn-id: http://webrtc.googlecode.com/svn/trunk@1220 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
henrik.lundin@webrtc.org
2011-12-16 14:40:05 +00:00
parent 5249cc8f77
commit a70f945086
45 changed files with 329 additions and 295 deletions

View File

@@ -19,10 +19,10 @@
#include "jitter_estimate_test.h"
#include "jitter_estimator.h"
#include "media_opt_util.h"
#include "modules/video_coding/main/source/tick_time_interface.h"
#include "packet.h"
#include "test_util.h"
#include "test_macros.h"
#include "tick_time.h"
using namespace webrtc;
@@ -92,10 +92,11 @@ int CheckOutFrame(VCMEncodedFrame* frameOut, unsigned int size, bool startCode)
int JitterBufferTest(CmdArgs& args)
{
// Don't run these tests with debug time
#if defined(TICK_TIME_DEBUG) || defined(EVENT_DEBUG)
// Don't run these tests with debug event.
#if defined(EVENT_DEBUG)
return -1;
#endif
TickTimeInterface clock;
// Start test
WebRtc_UWord16 seqNum = 1234;
@@ -114,7 +115,7 @@ int JitterBufferTest(CmdArgs& args)
packet.seqNum = seqNum;
packet.payloadType = 126;
seqNum++;
fb->InsertPacket(packet, VCMTickTime::MillisecondTimestamp(), false, 0);
fb->InsertPacket(packet, clock.MillisecondTimestamp(), false, 0);
TEST(frameList.Insert(fb) == 0);
}
VCMFrameListItem* item = NULL;
@@ -135,7 +136,7 @@ int JitterBufferTest(CmdArgs& args)
//printf("DONE timestamp ordered frame list\n");
VCMJitterBuffer jb;
VCMJitterBuffer jb(&clock);
seqNum = 1234;
timeStamp = 123*90;