Fixing warnings in the VCM tests. Also fixes a couple of bugs related

to those warnings.
Review URL: http://webrtc-codereview.appspot.com/98003

git-svn-id: http://webrtc.googlecode.com/svn/trunk@293 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
holmer@google.com 2011-08-03 07:49:56 +00:00
parent af874ebc90
commit e0f7d7b7e8
23 changed files with 196 additions and 158 deletions

View File

@ -14,6 +14,7 @@
#include "codec_database_test.h"
#include "vp8.h" // for external codecs test
#include "../source/event.h"
#include "test_macros.h"
#include "test_util.h"
#include "../../../../engine_configurations.h"
@ -34,13 +35,11 @@ int CodecDataBaseTest::RunTest(CmdArgs& args)
}
CodecDataBaseTest::CodecDataBaseTest(VideoCodingModule* vcm):
_vcm(vcm),
_width(0),
_height(0),
_timeStamp(0),
_lengthSourceFrame(0),
vcmMacrosTests(0),
vcmMacrosErrors(0),
_vcm(vcm)
_timeStamp(0)
{
//
}

View File

@ -12,7 +12,6 @@
#define WEBRTC_MODULES_VIDEO_CODING_TEST_CODEC_DATABASE_TEST_H_
#include "video_coding.h"
#include "test_macros.h"
#include "test_util.h"
#include <string.h>
@ -46,9 +45,7 @@ private:
WebRtc_UWord16 _height;
WebRtc_UWord32 _lengthSourceFrame;
WebRtc_UWord32 _timeStamp;
int vcmMacrosTests;
int vcmMacrosErrors;
float _frameRate;
float _frameRate;
}; // end of codecDBTest class definition
#endif // WEBRTC_MODULES_VIDEO_CODING_TEST_CODEC_DATABASE_TEST_H_

View File

@ -14,7 +14,6 @@
#include "trace.h"
#include "tick_time.h"
#include "../source/event.h"
#include "test_macros.h"
#include "rtp_player.h"
using namespace webrtc;

View File

@ -15,6 +15,7 @@
#include "../source/event.h"
#include "rtp_rtcp.h"
#include "module_common_types.h"
#include "test_macros.h"
#include "test_util.h"
using namespace webrtc;
@ -38,14 +39,12 @@ int GenericCodecTest::RunTest(CmdArgs& args)
}
GenericCodecTest::GenericCodecTest(VideoCodingModule* vcm):
_vcm(vcm),
_width(0),
_height(0),
_timeStamp(0),
_lengthSourceFrame(0),
_frameRate(0),
vcmMacrosTests(0),
vcmMacrosErrors(0),
_vcm(vcm)
_lengthSourceFrame(0),
_timeStamp(0)
{
}
@ -255,7 +254,7 @@ GenericCodecTest::Perform(CmdArgs& args)
//NOTE: time requirements are not part of the release tests
*/
double FullReq = 0.1;
double OneSecReq = 0.15;
//double OneSecReq = 0.15;
printf("\n RATE CONTROL TEST\n");
// initializing....
_vcm->InitializeSender();
@ -336,13 +335,12 @@ GenericCodecTest::Perform(CmdArgs& args)
currentTime = VCMTickTime::MicrosecondTimestamp();
totalBytes = _encodeCompleteCallback->EncodedBytes();
actualBitrate = (float)(8.0/1000)*(totalBytes / (_frameCnt / _frameRate));
WebRtc_Word64 timeDiff = (currentTime - startTime)/1000;
//actualBitrate = (float)(8.0*totalBytes)/timeDiff;
printf("Complete Seq.: target bitrate: %.0f kbps, actual bitrate: %.1f kbps\n", _bitRate, actualBitrate);
TEST((fabs(actualBitrate - _bitRate) < FullReq * _bitRate) ||
(strncmp(_sendCodec.plName, "I420", 4) == 0));
// 1 Sec.
// 1 Sec.
actualBitrate = (float)(8.0/1000)*(totalBytesOneSec);
//actualBitrate = (float)(8.0*totalBytesOneSec)/(oneSecTime - startTime);
//printf("First 1Sec: target bitrate: %.0f kbps, actual bitrate: %.1f kbps\n", _bitRate, actualBitrate);

View File

@ -12,7 +12,6 @@
#define WEBRTC_MODULES_VIDEO_CODING_TEST_GENERIC_CODEC_TEST_H_
#include "video_coding.h"
#include "test_macros.h"
#include "test_util.h"
#include <string.h>
@ -46,22 +45,20 @@ private:
webrtc::VideoCodingModule* _vcm;
webrtc::VideoCodec _sendCodec;
webrtc::VideoCodec _receiveCodec;
std::string _inname;
std::string _outname;
std::string _encodedName;
WebRtc_Word32 _sumEncBytes;
FILE* _sourceFile;
FILE* _decodedFile;
FILE* _encodedFile;
WebRtc_UWord16 _width;
WebRtc_UWord16 _height;
float _frameRate;
WebRtc_UWord32 _lengthSourceFrame;
WebRtc_UWord32 _timeStamp;
int vcmMacrosTests;
int vcmMacrosErrors;
VCMDecodeCompleteCallback* _decodeCallback;
VCMEncodeCompleteCallback* _encodeCompleteCallback;
std::string _inname;
std::string _outname;
std::string _encodedName;
WebRtc_Word32 _sumEncBytes;
FILE* _sourceFile;
FILE* _decodedFile;
FILE* _encodedFile;
WebRtc_UWord16 _width;
WebRtc_UWord16 _height;
float _frameRate;
WebRtc_UWord32 _lengthSourceFrame;
WebRtc_UWord32 _timeStamp;
VCMDecodeCompleteCallback* _decodeCallback;
VCMEncodeCompleteCallback* _encodeCompleteCallback;
}; // end of GenericCodecTest class definition

View File

@ -17,20 +17,20 @@
#include "../source/event.h"
#include "frame_buffer.h"
#include "jitter_estimate_test.h"
#include "test_macros.h"
#include "test_util.h"
#include "test_macros.h"
#include <stdio.h>
#include <math.h>
using namespace webrtc;
void CheckOutFrame(VCMEncodedFrame* frameOut, int size, bool startCode)
void CheckOutFrame(VCMEncodedFrame* frameOut, unsigned int size, bool startCode)
{
TEST(frameOut != 0);
const WebRtc_UWord8* outData = frameOut->Buffer();
int i = 0;
unsigned int i = 0;
if(startCode)
{
@ -43,7 +43,6 @@ void CheckOutFrame(VCMEncodedFrame* frameOut, int size, bool startCode)
// check the frame data
int count = 3;
int layer = 0;
// check the frame length
TEST(frameOut->Length() == size);
@ -64,10 +63,6 @@ void CheckOutFrame(VCMEncodedFrame* frameOut, int size, bool startCode)
}
else
{
if (outData[i] != count)
{
int a=0;
}
TEST(outData[i] == count);
count++;
if(count == 10)
@ -114,7 +109,8 @@ int JitterBufferTest(CmdArgs& args)
item = frameList.First();
fb = static_cast<VCMFrameBuffer*>(item->GetItem());
TEST(i > 0 || fb->TimeStamp() == 0xfffffff0); // Frame 0 has no prev
TEST(prevTimestamp - fb->TimeStamp() == -1 || i == 0);
TEST(prevTimestamp - fb->TimeStamp() == static_cast<WebRtc_UWord32>(-1)
|| i == 0);
prevTimestamp = fb->TimeStamp();
frameList.Erase(item);
delete fb;
@ -127,11 +123,9 @@ int JitterBufferTest(CmdArgs& args)
seqNum = 1234;
timeStamp = 123*90;
VCMFrameBufferEnum retVal(kNoError);
FrameType incomingFrameType(kVideoFrameKey);
VCMEncodedFrame* frameOut=NULL;
WebRtc_Word64 renderTimeMs = 0;
WebRtc_UWord8 payloadType = 0;
packet.timestamp = timeStamp;
packet.seqNum = seqNum;
@ -140,7 +134,7 @@ int JitterBufferTest(CmdArgs& args)
data[1] = 0;
data[2] = 0x80;
int count = 3;
for(int i = 3; i < sizeof(data) - 3; ++i )
for (unsigned int i = 3; i < sizeof(data) - 3; ++i)
{
data[i] = count;
count++;
@ -2244,6 +2238,18 @@ int JitterBufferTest(CmdArgs& args)
jb.Stop();
printf("DONE !!!\n");
printf("\nVCM Jitter Buffer Test: \n\n%i tests completed\n",
vcmMacrosTests);
if (vcmMacrosErrors > 0)
{
printf("%i FAILED\n\n", vcmMacrosErrors);
}
else
{
printf("ALL PASSED\n\n");
}
EventWrapper* waitEvent = EventWrapper::Create();
waitEvent->Wait(5000);

View File

@ -14,6 +14,7 @@
#include "receiver_tests.h" // receive side callbacks
#include "video_coding.h"
#include "rtp_rtcp.h"
#include "test_macros.h"
#include "test_util.h" // send side callback
#include "media_opt_test.h"
#include "../source/event.h"
@ -21,8 +22,6 @@
#include <string.h>
#include <stdio.h>
#include <vector>
//#include <Windows.h>
#include <time.h>
using namespace webrtc;
@ -74,15 +73,13 @@ _frameRate(30.0f),
_nackEnabled(false),
_fecEnabled(false),
_rttMS(0),
_renderDelayMs(0),
_bitRate(300.0f),
_lossRate(0.0f),
_renderDelayMs(0),
_frameCnt(0),
_sumEncBytes(0),
_numFramesDropped(0),
_numberOfCores(4),
vcmMacrosTests(0),
vcmMacrosErrors(0)
_numberOfCores(4)
{
_rtp = RtpRtcp::CreateRtpRtcp(1, false);
}
@ -160,7 +157,6 @@ MediaOptTest::Setup(int testType, CmdArgs& args)
//
_renderDelayMs = 0;
WebRtc_UWord32 minPlayoutDelayMs = 0;
/* test settings end*/
_lengthSourceFrame = 3*_width*_height/2;
@ -171,10 +167,7 @@ MediaOptTest::Setup(int testType, CmdArgs& args)
void
MediaOptTest::GeneralSetup()
{
WebRtc_UWord8 deltaFECRate = 0;
WebRtc_UWord8 keyFECRate = 0;
WebRtc_UWord32 minPlayoutDelayMs = 0;
WebRtc_UWord32 minPlayoutDelayMs = 0;
if ((_sourceFile = fopen(_inname.c_str(), "rb")) == NULL)
{
@ -240,7 +233,6 @@ MediaOptTest::GeneralSetup()
exit(1);
}
WebRtc_UWord8 i= 0;
if (_vcm->Codec(_sendCodecType, &sendCodec) != 0)
{
printf("Unknown codec\n");
@ -384,7 +376,6 @@ MediaOptTest::RTTest()
// constant settings (valid for entire run time)
_rttMS = 20;
_renderDelayMs = 0;
WebRtc_UWord32 minPlayoutDelayMs = 0;
_outname = "../RTMOTest_out.yuv"; // same out name for all
_actualSourcename = "../RTMOTestSource.yuv"; // actual source after frame dropping

View File

@ -13,7 +13,6 @@
#define WEBRTC_MODULES_VIDEO_CODING_TEST_MEDIA_OPT_TEST_H_
#include "video_coding.h"
#include "test_macros.h"
#include "test_util.h"
#include "video_source.h"
@ -104,8 +103,6 @@ private:
string _codecName;
webrtc::VideoCodecType _sendCodecType;
WebRtc_Word32 _numberOfCores;
int vcmMacrosTests;
int vcmMacrosErrors;
//for release test#2
FILE* _fpinp;

View File

@ -19,6 +19,7 @@
#include "rtp_rtcp.h"
#include "thread_wrapper.h"
#include "../source/event.h"
#include "test_macros.h"
#include "test_util.h" // send side callback
#include "media_opt_test.h"
@ -100,7 +101,6 @@ int MTRxTxTest(CmdArgs& args)
WebRtc_UWord16 width = args.width;
WebRtc_UWord16 height = args.height;
WebRtc_UWord32 lengthSourceFrame = 3*width*height/2;
float frameRate = args.frameRate;
float bitRate = args.bitRate;
@ -114,8 +114,6 @@ int MTRxTxTest(CmdArgs& args)
float lossRate = 0.0*255; // no packet loss
WebRtc_UWord32 renderDelayMs = 0;
WebRtc_UWord32 minPlayoutDelayMs = 0;
WebRtc_UWord8 deltaFECRate = 0;
WebRtc_UWord8 keyFECRate = 0;
/* TEST SET-UP */
@ -242,7 +240,7 @@ int MTRxTxTest(CmdArgs& args)
ThreadWrapper* intSenderThread = ThreadWrapper::CreateThread(IntSenderThread,
&mtSendState, kNormalPriority, "IntThread");
if (MainSenderThread != NULL)
if (mainSenderThread != NULL)
{
unsigned int tid;
mainSenderThread->Start(tid);
@ -253,7 +251,7 @@ int MTRxTxTest(CmdArgs& args)
return -1;
}
if (IntSenderThread != NULL)
if (intSenderThread != NULL)
{
unsigned int tid;
intSenderThread->Start(tid);
@ -320,6 +318,16 @@ int MTRxTxTest(CmdArgs& args)
;
}
printf("\nVCM MT RX/TX Test: \n\n%i tests completed\n", vcmMacrosTests);
if (vcmMacrosErrors > 0)
{
printf("%i FAILED\n\n", vcmMacrosErrors);
}
else
{
printf("ALL PASSED\n\n");
}
delete &waitEvent;
delete mainSenderThread;
delete intSenderThread;

View File

@ -13,6 +13,7 @@
#include "tick_time.h"
#include "common_types.h"
#include "trace.h"
#include "test_macros.h"
#include "test_util.h"
#include <assert.h>
#include <iostream>
@ -44,14 +45,14 @@ int NormalTest::RunTest(CmdArgs& args)
// Callback Implementation
//////////////
VCMNTEncodeCompleteCallback::VCMNTEncodeCompleteCallback(FILE* encodedFile, NormalTest& test):
_seqNo(0),
_layerPacketId(1),
_encodedFile(encodedFile),
_encodedBytes(0),
_skipCnt(0),
_VCMReceiver(NULL),
_test(test)
VCMNTEncodeCompleteCallback::VCMNTEncodeCompleteCallback(FILE* encodedFile,
NormalTest& test):
_encodedFile(encodedFile),
_encodedBytes(0),
_skipCnt(0),
_VCMReceiver(NULL),
_seqNo(0),
_test(test)
{
//
}
@ -98,6 +99,9 @@ VCMNTEncodeCompleteCallback::SendData(
case kVideoCodecI420:
rtpInfo.type.Video.codec = kRTPVideoI420;
break;
default:
assert(false);
return -1;
}
rtpInfo.header.payloadType = payloadType;
rtpInfo.header.sequenceNumber = _seqNo++;
@ -173,6 +177,8 @@ VCMNTDecodeCompleCallback::DecodedBytes()
NormalTest::NormalTest(VideoCodingModule* vcm)
:
_vcm(vcm),
_sumEncBytes(0),
_timeStamp(0),
_totalEncodeTime(0),
_totalDecodeTime(0),
_decodeCompleteTime(0),
@ -180,11 +186,8 @@ _encodeCompleteTime(0),
_totalEncodePipeTime(0),
_totalDecodePipeTime(0),
_frameCnt(0),
_timeStamp(0),
_encFrameCnt(0),
_decFrameCnt(0),
_sumEncBytes(0)
_decFrameCnt(0)
{
//
}
@ -268,7 +271,9 @@ NormalTest::Perform(CmdArgs& args)
while (feof(_sourceFile)== 0)
{
#if !(defined(TICK_TIME_DEBUG) || defined(EVENT_DEBUG))
WebRtc_Word64 processStartTime = VCMTickTime::MillisecondTimestamp();
#endif
fread(tmpBuffer, 1, _lengthSourceFrame, _sourceFile);
_frameCnt++;
sourceFrame.CopyFrame(_lengthSourceFrame, tmpBuffer);
@ -299,7 +304,7 @@ NormalTest::Perform(CmdArgs& args)
}
WebRtc_UWord32 framePeriod = static_cast<WebRtc_UWord32>(1000.0f/static_cast<float>(_sendCodec.maxFramerate) + 0.5f);
#if defined(TICK_TIME_DEBUG) || defined(EVENT_DEBUG)
for (int i=0; i < framePeriod; i++)
for (unsigned int i=0; i < framePeriod; i++)
{
VCMTickTime::IncrementDebugClock();
}
@ -364,6 +369,16 @@ NormalTest::Print()
printf("PSNR: %f \n", psnr);
( _log) << "PSNR: " << psnr << std::endl;
(_log) << std::endl;
printf("\nVCM Normal Test: \n\n%i tests completed\n", vcmMacrosTests);
if (vcmMacrosErrors > 0)
{
printf("%i FAILED\n\n", vcmMacrosErrors);
}
else
{
printf("ALL PASSED\n\n");
}
}
void
NormalTest::Teardown()

View File

@ -12,7 +12,6 @@
#define WEBRTC_MODULES_VIDEO_CODING_TEST_NORMAL_TEST_H_
#include "video_coding.h"
#include "test_macros.h"
#include "test_util.h"
#include <map>
@ -54,19 +53,15 @@ private:
webrtc::FrameType _frameType;
WebRtc_UWord8* _payloadData; // max payload size??
WebRtc_UWord16 _seqNo;
WebRtc_UWord8 _layerPacketId;
NormalTest& _test;
// int _vcmMacrosTests;
// int _vcmMacrosErrors;
}; // end of VCMEncodeCompleteCallback
class VCMNTDecodeCompleCallback: public webrtc::VCMReceiveCallback
{
public:
VCMNTDecodeCompleCallback(std::string outname): // or should it get a name?
_outname(outname),
_decodedFile(NULL),
_outname(outname),
_decodedBytes(0),
_currentWidth(0),
_currentHeight(0) {}

View File

@ -10,6 +10,7 @@
#include "quality_modes_test.h"
#include "../source/event.h"
#include "test_macros.h"
#include "vplib.h"
#include <iostream>
@ -124,6 +125,16 @@ QualityModesTest::Print()
printf("SSIM: %f \n", ssim);
}
(_log) << std::endl;
printf("\nVCM Qualit Modes Test: \n\n%i tests completed\n", vcmMacrosTests);
if (vcmMacrosErrors > 0)
{
printf("%i FAILED\n\n", vcmMacrosErrors);
}
else
{
printf("ALL PASSED\n\n");
}
}
void
QualityModesTest::Teardown()

View File

@ -22,14 +22,14 @@ class QualityModesTest : public NormalTest
public:
QualityModesTest(webrtc::VideoCodingModule* vcm);
virtual ~QualityModesTest();
WebRtc_Word32 Perform();
WebRtc_Word32 Perform();
private:
void Setup();
void Print();
void Teardown();
void SsimComp();
void Setup();
void Print();
void Teardown();
void SsimComp();
webrtc::VideoProcessingModule* _vpm;
@ -61,10 +61,10 @@ private:
FILE* _decodedFile;
WebRtc_UWord32 _decodedBytes;
// QualityModesTest& _test;
WebRtc_Word32 _origWidth;
WebRtc_Word32 _origHeight;
WebRtc_Word32 _decWidth;
WebRtc_Word32 _decHeight;
WebRtc_UWord32 _origWidth;
WebRtc_UWord32 _origHeight;
WebRtc_UWord32 _decWidth;
WebRtc_UWord32 _decHeight;
// VideoInterpolator* _interpolator;
WebRtc_UWord8* _decBuffer;
WebRtc_UWord32 _frameCnt; // debug

View File

@ -57,8 +57,8 @@ class SharedState
{
public:
SharedState(webrtc::VideoCodingModule& vcm, RTPPlayer& rtpPlayer) :
_rtpPlayer(rtpPlayer),
_vcm(vcm) {}
_vcm(vcm),
_rtpPlayer(rtpPlayer) {}
webrtc::VideoCodingModule& _vcm;
RTPPlayer& _rtpPlayer;
};
@ -67,10 +67,10 @@ class SharedRTPState
{
public:
SharedRTPState(webrtc::VideoCodingModule& vcm, webrtc::RtpRtcp& rtp) :
_rtp(rtp),
_vcm(vcm) {}
_vcm(vcm),
_rtp(rtp) {}
webrtc::VideoCodingModule& _vcm;
webrtc::RtpRtcp& _rtp;
webrtc::RtpRtcp& _rtp;
};
int RtpPlay(CmdArgs& args);

View File

@ -65,9 +65,9 @@ int ReceiverTimingTests(CmdArgs& args)
VCMTiming timing;
float clockInMs = 0.0;
WebRtc_UWord32 waitTime = 0;
WebRtc_Word32 jitterDelayMs = 0;
WebRtc_Word32 maxDecodeTimeMs = 0;
WebRtc_Word32 extraDelayMs = 0;
WebRtc_UWord32 jitterDelayMs = 0;
WebRtc_UWord32 maxDecodeTimeMs = 0;
WebRtc_UWord32 extraDelayMs = 0;
WebRtc_UWord32 timeStamp = 0;
timing.Reset(static_cast<WebRtc_Word64>(clockInMs + 0.5));
@ -222,6 +222,17 @@ int ReceiverTimingTests(CmdArgs& args)
MaskWord64ToUWord32(renderTimeMs));
}
WEBRTC_TRACE(webrtc::kTraceDebug, webrtc::kTraceVideoCoding, -1, "End Stochastic test 1");
printf("\nVCM Timing Test: \n\n%i tests completed\n", vcmMacrosTests);
if (vcmMacrosErrors > 0)
{
printf("%i FAILED\n\n", vcmMacrosErrors);
}
else
{
printf("ALL PASSED\n\n");
}
Trace::ReturnTrace();
return 0;
}

View File

@ -40,7 +40,6 @@ LostPackets::LostPackets()
:
_critSect(*CriticalSectionWrapper::CreateCriticalSection()),
_lossCount(0),
ListWrapper(),
_debugFile(NULL)
{
_debugFile = fopen("PacketLossDebug.txt", "w");

View File

@ -50,8 +50,8 @@ public:
void Unlock() {_critSect.Leave();};
private:
webrtc::CriticalSectionWrapper& _critSect;
WebRtc_UWord32 _lossCount;
FILE* _debugFile;
WebRtc_UWord32 _lossCount;
FILE* _debugFile;
};
struct PayloadCodecTuple

View File

@ -14,8 +14,8 @@
#include <cstdio>
#include <cstdlib>
static int vcmMacrosTests = 0;
static int vcmMacrosErrors = 0;
extern int vcmMacrosTests;
extern int vcmMacrosErrors;
#define PRINT_ERR_MSG(msg) \
do { \
@ -42,4 +42,4 @@ static int vcmMacrosErrors = 0;
} \
} while(0)
#endif
#endif

View File

@ -9,6 +9,7 @@
*/
#include "test_util.h"
#include "test_macros.h"
#include "rtp_dump.h"
#include <cmath>
@ -21,15 +22,14 @@ using namespace webrtc;
// passes the encoded frame directly to the encoder
// Packetization callback implmentation
VCMEncodeCompleteCallback::VCMEncodeCompleteCallback(FILE* encodedFile):
_seqNo(0),
_encodedFile(encodedFile),
_encodedBytes(0),
_VCMReceiver(NULL),
_encodeComplete(false),
_width(0),
_height(0),
_codecType(kRTPVideoNoVideo),
_layerPacketId(1)
_encodedFile(encodedFile),
_encodedBytes(0),
_VCMReceiver(NULL),
_seqNo(0),
_encodeComplete(false),
_width(0),
_height(0),
_codecType(kRTPVideoNoVideo)
{
//
}
@ -38,7 +38,8 @@ VCMEncodeCompleteCallback::~VCMEncodeCompleteCallback()
}
void
VCMEncodeCompleteCallback::RegisterTransportCallback(VCMPacketizationCallback* transport)
VCMEncodeCompleteCallback::RegisterTransportCallback(
VCMPacketizationCallback* transport)
{
}
@ -68,6 +69,11 @@ VCMEncodeCompleteCallback::SendData(
rtpInfo.type.Video.height = (WebRtc_UWord16)_height;
rtpInfo.type.Video.width = (WebRtc_UWord16)_width;
break;
case webrtc::kRTPVideoVP8:
break;
default:
assert(false);
return -1;
}
rtpInfo.header.payloadType = payloadType;
@ -121,9 +127,9 @@ VCMEncodeCompleteCallback::ResetByteCount()
_encodedBytes = 0;
}
/**********************************/
/* VCMRTPEncodeCompleteCallback /
/********************************/
/***********************************/
/* VCMRTPEncodeCompleteCallback */
/***********************************/
// Encode Complete callback implementation
// passes the encoded frame via the RTP module to the decoder
// Packetization callback implmentation
@ -220,32 +226,32 @@ VCMDecodeCompleteCallback::PSNRLastFrame(const VideoFrame& sourceFrame, double
return 0;
}
WebRtc_Word32
VCMDecodeCompleteCallback::DecodedBytes()
{
return _decodedBytes;
}
WebRtc_Word32
VCMDecodeCompleteCallback::DecodedBytes()
{
return _decodedBytes;
}
RTPSendCompleteCallback::RTPSendCompleteCallback(RtpRtcp* rtp, const char* filename):
_rtp(rtp),
_sendCount(0),
_lossPct(0),
_rtpDump(NULL)
{
if (filename != NULL)
{
_rtpDump = RtpDump::CreateRtpDump();
_rtpDump->Start(filename);
}
}
RTPSendCompleteCallback::~RTPSendCompleteCallback()
{
if (_rtpDump != NULL)
{
_rtpDump->Stop();
RtpDump::DestroyRtpDump(_rtpDump);
}
}
RTPSendCompleteCallback::RTPSendCompleteCallback(RtpRtcp* rtp, const char* filename):
_sendCount(0),
_rtp(rtp),
_lossPct(0),
_rtpDump(NULL)
{
if (filename != NULL)
{
_rtpDump = RtpDump::CreateRtpDump();
_rtpDump->Start(filename);
}
}
RTPSendCompleteCallback::~RTPSendCompleteCallback()
{
if (_rtpDump != NULL)
{
_rtpDump->Stop();
RtpDump::DestroyRtpDump(_rtpDump);
}
}
int
RTPSendCompleteCallback::SendPacket(int channel, const void *data, int len)
{

View File

@ -16,7 +16,6 @@
#include "trace.h"
#include "module_common_types.h"
#include "tick_time.h"
#include "test_macros.h"
#include "test_util.h"
#include <string.h>
@ -109,7 +108,6 @@ private:
WebRtc_Word32 _width;
WebRtc_Word32 _height;
webrtc::RTPVideoCodecTypes _codecType;
WebRtc_UWord8 _layerPacketId;
}; // end of VCMEncodeCompleteCallback
@ -118,7 +116,11 @@ class VCMRTPEncodeCompleteCallback: public webrtc::VCMPacketizationCallback
{
public:
VCMRTPEncodeCompleteCallback(webrtc::RtpRtcp* rtp) :
_seqNo(0), _encodedBytes(0), _RTPModule(rtp), _encodeComplete(false) {}
_encodedBytes(0),
_seqNo(0),
_encodeComplete(false),
_RTPModule(rtp) {}
virtual ~VCMRTPEncodeCompleteCallback() {}
// process encoded data received from the encoder, pass stream to the RTP module
WebRtc_Word32 SendData(const webrtc::FrameType frameType,
@ -201,11 +203,15 @@ class SendSharedState
public:
SendSharedState(webrtc::VideoCodingModule& vcm, webrtc::RtpRtcp& rtp,
CmdArgs args) :
_rtp(rtp), _vcm(vcm), _args(args), _sourceFile(NULL), _frameCnt(0),
_timestamp(0) {}
_vcm(vcm),
_rtp(rtp),
_args(args),
_sourceFile(NULL),
_frameCnt(0),
_timestamp(0) {}
webrtc::VideoCodingModule& _vcm;
webrtc::RtpRtcp& _rtp;
webrtc::RtpRtcp& _rtp;
CmdArgs _args;
FILE* _sourceFile;
WebRtc_Word32 _frameCnt;

View File

@ -37,6 +37,9 @@ using namespace webrtc;
WebRtc_Word64 VCMTickTime::_timeNowDebug = 0; // current time in ms
#endif
int vcmMacrosTests = 0;
int vcmMacrosErrors = 0;
int ParseArguments(int argc, char **argv, CmdArgs& args)
{
int i = 1;

View File

@ -53,7 +53,7 @@ bool RtpReaderThread(void* obj)
bool DecodeThread(void* obj)
{
SharedState* state = static_cast<SharedState*>(obj);
WebRtc_Word32 ret = state->_vcm.Decode(10000);
state->_vcm.Decode(10000);
while (state->_vcm.DecodeDualFrame(0) == 1);
return true;
}

View File

@ -27,10 +27,10 @@ VideoSource::VideoSource(std::string fileName, VideoSize size,
float frameRate, webrtc::VideoType type /*= webrtc::kI420*/)
:
_fileName(fileName),
_type(type),
_frameRate(frameRate),
_width(0),
_height(0)
_height(0),
_type(type),
_frameRate(frameRate)
{
assert(size != kUndefined && size != kNumberOfVideoSizes);
assert(type != webrtc::kUnknown);