Revert "Inject TickTimeInterface into VCM and tests"
This CL reverts r1220. Review URL: http://webrtc-codereview.appspot.com/336002 git-svn-id: http://webrtc.googlecode.com/svn/trunk@1235 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
@@ -11,11 +11,11 @@
|
||||
#include "generic_codec_test.h"
|
||||
#include <cmath>
|
||||
#include <stdio.h>
|
||||
#include "tick_time.h"
|
||||
#include "../source/event.h"
|
||||
#include "rtp_rtcp.h"
|
||||
#include "module_common_types.h"
|
||||
#include "test_macros.h"
|
||||
#include "modules/video_coding/main/source/mock/fake_tick_time_interface.h"
|
||||
|
||||
using namespace webrtc;
|
||||
|
||||
@@ -23,13 +23,12 @@ enum { kMaxWaitEncTimeMs = 100 };
|
||||
|
||||
int GenericCodecTest::RunTest(CmdArgs& args)
|
||||
{
|
||||
#if !defined(EVENT_DEBUG)
|
||||
printf("\n\nEnable debug events to run this test!\n\n");
|
||||
#if !defined(TICK_TIME_DEBUG) || !defined(EVENT_DEBUG)
|
||||
printf("\n\nEnable debug time to run this test!\n\n");
|
||||
return -1;
|
||||
#endif
|
||||
FakeTickTime clock(0);
|
||||
VideoCodingModule* vcm = VideoCodingModule::Create(1, &clock);
|
||||
GenericCodecTest* get = new GenericCodecTest(vcm, &clock);
|
||||
VideoCodingModule* vcm = VideoCodingModule::Create(1);
|
||||
GenericCodecTest* get = new GenericCodecTest(vcm);
|
||||
Trace::CreateTrace();
|
||||
Trace::SetTraceFile(
|
||||
(test::OutputPath() + "genericCodecTestTrace.txt").c_str());
|
||||
@@ -41,8 +40,7 @@ int GenericCodecTest::RunTest(CmdArgs& args)
|
||||
return 0;
|
||||
}
|
||||
|
||||
GenericCodecTest::GenericCodecTest(VideoCodingModule* vcm, FakeTickTime* clock):
|
||||
_clock(clock),
|
||||
GenericCodecTest::GenericCodecTest(VideoCodingModule* vcm):
|
||||
_vcm(vcm),
|
||||
_width(0),
|
||||
_height(0),
|
||||
@@ -309,7 +307,7 @@ GenericCodecTest::Perform(CmdArgs& args)
|
||||
_vcm->SetChannelParameters((WebRtc_UWord32)_bitRate, 0, 20);
|
||||
_frameCnt = 0;
|
||||
totalBytes = 0;
|
||||
startTime = _clock->MicrosecondTimestamp();
|
||||
startTime = VCMTickTime::MicrosecondTimestamp();
|
||||
_encodeCompleteCallback->Initialize();
|
||||
sendStats.SetTargetFrameRate(static_cast<WebRtc_UWord32>(_frameRate));
|
||||
_vcm->RegisterSendStatisticsCallback(&sendStats);
|
||||
@@ -333,7 +331,7 @@ GenericCodecTest::Perform(CmdArgs& args)
|
||||
//currentTime = VCMTickTime::MillisecondTimestamp();//clock()/(double)CLOCKS_PER_SEC;
|
||||
if (_frameCnt == _frameRate)// @ 1sec
|
||||
{
|
||||
oneSecTime = _clock->MicrosecondTimestamp();
|
||||
oneSecTime = VCMTickTime::MicrosecondTimestamp();
|
||||
totalBytesOneSec = _encodeCompleteCallback->EncodedBytes();//totalBytes;
|
||||
}
|
||||
TEST(_vcm->TimeUntilNextProcess() >= 0);
|
||||
@@ -343,7 +341,7 @@ GenericCodecTest::Perform(CmdArgs& args)
|
||||
// estimating rates
|
||||
// complete sequence
|
||||
// bit rate assumes input frame rate is as specified
|
||||
currentTime = _clock->MicrosecondTimestamp();
|
||||
currentTime = VCMTickTime::MicrosecondTimestamp();
|
||||
totalBytes = _encodeCompleteCallback->EncodedBytes();
|
||||
actualBitrate = (float)(8.0/1000)*(totalBytes / (_frameCnt / _frameRate));
|
||||
|
||||
@@ -516,8 +514,8 @@ GenericCodecTest::Print()
|
||||
float
|
||||
GenericCodecTest::WaitForEncodedFrame() const
|
||||
{
|
||||
WebRtc_Word64 startTime = _clock->MillisecondTimestamp();
|
||||
while (_clock->MillisecondTimestamp() - startTime < kMaxWaitEncTimeMs*10)
|
||||
WebRtc_Word64 startTime = TickTime::MillisecondTimestamp();
|
||||
while (TickTime::MillisecondTimestamp() - startTime < kMaxWaitEncTimeMs*10)
|
||||
{
|
||||
if (_encodeCompleteCallback->EncodeComplete())
|
||||
{
|
||||
@@ -530,7 +528,11 @@ GenericCodecTest::WaitForEncodedFrame() const
|
||||
void
|
||||
GenericCodecTest::IncrementDebugClock(float frameRate)
|
||||
{
|
||||
_clock->IncrementDebugClock(1000/frameRate);
|
||||
for (int t= 0; t < 1000/frameRate; t++)
|
||||
{
|
||||
VCMTickTime::IncrementDebugClock();
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
int
|
||||
|
||||
Reference in New Issue
Block a user