Fixed GCC 4.6 errors (mostly 'unused variable' errors and incorrect usage of EXPECT_EQ with booleans.
Fixed remaining compilation errors in release, etc. Fixed errors from GCC 4.6 compilation. BUG= TEST= Review URL: https://webrtc-codereview.appspot.com/366008 git-svn-id: http://webrtc.googlecode.com/svn/trunk@1554 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
parent
42ae41e5a2
commit
d1a860b415
@ -52,7 +52,6 @@ int main(int argc, char* argv[])
|
|||||||
WebRtc_Word32 bottleneck;
|
WebRtc_Word32 bottleneck;
|
||||||
WebRtc_Word16 framesize = 30; /* ms */
|
WebRtc_Word16 framesize = 30; /* ms */
|
||||||
int cur_framesmpls, err;
|
int cur_framesmpls, err;
|
||||||
int testCE=0;
|
|
||||||
|
|
||||||
/* Runtime statistics */
|
/* Runtime statistics */
|
||||||
double starttime, runtime, length_file;
|
double starttime, runtime, length_file;
|
||||||
@ -73,7 +72,6 @@ int main(int argc, char* argv[])
|
|||||||
int setControlBWE = 0;
|
int setControlBWE = 0;
|
||||||
short FL, testNum;
|
short FL, testNum;
|
||||||
char version_number[20];
|
char version_number[20];
|
||||||
int readLoss;
|
|
||||||
FILE *plFile;
|
FILE *plFile;
|
||||||
WebRtc_Word32 sendBN;
|
WebRtc_Word32 sendBN;
|
||||||
|
|
||||||
@ -86,7 +84,6 @@ int main(int argc, char* argv[])
|
|||||||
|
|
||||||
/* If use GNS file */
|
/* If use GNS file */
|
||||||
FILE *fp_gns = NULL;
|
FILE *fp_gns = NULL;
|
||||||
int gns = 0;
|
|
||||||
char gns_file[100];
|
char gns_file[100];
|
||||||
short maxStreamLen30 = 0;
|
short maxStreamLen30 = 0;
|
||||||
short maxStreamLen60 = 0;
|
short maxStreamLen60 = 0;
|
||||||
@ -180,7 +177,6 @@ int main(int argc, char* argv[])
|
|||||||
/* Loop over all command line arguments */
|
/* Loop over all command line arguments */
|
||||||
CodingMode = 0;
|
CodingMode = 0;
|
||||||
testNum = 0;
|
testNum = 0;
|
||||||
testCE = 0;
|
|
||||||
useAssign = 0;
|
useAssign = 0;
|
||||||
//logFile = NULL;
|
//logFile = NULL;
|
||||||
char transCodingFileName[500];
|
char transCodingFileName[500];
|
||||||
@ -308,11 +304,9 @@ int main(int argc, char* argv[])
|
|||||||
{
|
{
|
||||||
printf( "\nNo Packet Loss Is Simulated \n" );
|
printf( "\nNo Packet Loss Is Simulated \n" );
|
||||||
}
|
}
|
||||||
readLoss = 0;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
readLoss = 1;
|
|
||||||
plFile = fopen( argv[i+1], "rb" );
|
plFile = fopen( argv[i+1], "rb" );
|
||||||
if( plFile == NULL )
|
if( plFile == NULL )
|
||||||
{
|
{
|
||||||
@ -341,7 +335,6 @@ int main(int argc, char* argv[])
|
|||||||
printf("Cannot read file %s.\n", gns_file);
|
printf("Cannot read file %s.\n", gns_file);
|
||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
gns = 1;
|
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -642,8 +635,6 @@ int main(int argc, char* argv[])
|
|||||||
cur_framesmpls = 0;
|
cur_framesmpls = 0;
|
||||||
while (1)
|
while (1)
|
||||||
{
|
{
|
||||||
int kkk;
|
|
||||||
|
|
||||||
/* Read 10 ms speech block */
|
/* Read 10 ms speech block */
|
||||||
endfile = readframe(shortdata, inp, samplesIn10Ms);
|
endfile = readframe(shortdata, inp, samplesIn10Ms);
|
||||||
|
|
||||||
@ -681,7 +672,7 @@ int main(int argc, char* argv[])
|
|||||||
cout << flush;
|
cout << flush;
|
||||||
}
|
}
|
||||||
|
|
||||||
kkk = WebRtcIsac_GetUplinkBw(ISAC_main_inst, &sendBN);
|
WebRtcIsac_GetUplinkBw(ISAC_main_inst, &sendBN);
|
||||||
|
|
||||||
if(stream_len>0)
|
if(stream_len>0)
|
||||||
{
|
{
|
||||||
@ -723,7 +714,6 @@ int main(int argc, char* argv[])
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
kkk = 0;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -58,7 +58,6 @@ int main(int argc, char* argv[])
|
|||||||
BottleNeckModel* packetData[MAX_NUM_CLIENTS];
|
BottleNeckModel* packetData[MAX_NUM_CLIENTS];
|
||||||
|
|
||||||
char versionNumber[100];
|
char versionNumber[100];
|
||||||
short bottleneckChange[MAX_NUM_CLIENTS];
|
|
||||||
short samplesIn10ms[MAX_NUM_CLIENTS];
|
short samplesIn10ms[MAX_NUM_CLIENTS];
|
||||||
int bottleneck[MAX_NUM_CLIENTS];
|
int bottleneck[MAX_NUM_CLIENTS];
|
||||||
|
|
||||||
@ -108,7 +107,6 @@ int main(int argc, char* argv[])
|
|||||||
(encoderSampRate[clientCntr] == kIsacWideband)
|
(encoderSampRate[clientCntr] == kIsacWideband)
|
||||||
? "wideband":"super-wideband");
|
? "wideband":"super-wideband");
|
||||||
|
|
||||||
bottleneckChange[clientCntr] = 2 * clientCntr - 1;
|
|
||||||
// Open output File Name
|
// Open output File Name
|
||||||
OPEN_FILE_WB(outFile[clientCntr], outFileName[clientCntr]);
|
OPEN_FILE_WB(outFile[clientCntr], outFileName[clientCntr]);
|
||||||
printf("Output File...................... %s\n", outFileName[clientCntr]);
|
printf("Output File...................... %s\n", outFileName[clientCntr]);
|
||||||
|
@ -291,7 +291,6 @@ void EncodeDecodeTest::Perform() {
|
|||||||
|
|
||||||
int numCodecs = 1;
|
int numCodecs = 1;
|
||||||
int codePars[3]; //freq, pacsize, rate
|
int codePars[3]; //freq, pacsize, rate
|
||||||
int playoutFreq[3]; //8, 16, 32k
|
|
||||||
int numPars[52]; //number of codec parameters sets (rate,freq,pacsize)to test,
|
int numPars[52]; //number of codec parameters sets (rate,freq,pacsize)to test,
|
||||||
//for a given codec
|
//for a given codec
|
||||||
|
|
||||||
@ -318,7 +317,6 @@ void EncodeDecodeTest::Perform() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
AudioCodingModule::Destroy(acmTmp);
|
AudioCodingModule::Destroy(acmTmp);
|
||||||
playoutFreq[1] = 16000;
|
|
||||||
} else if (_testMode == 0) {
|
} else if (_testMode == 0) {
|
||||||
AudioCodingModule *acmTmp = AudioCodingModule::Create(0);
|
AudioCodingModule *acmTmp = AudioCodingModule::Create(0);
|
||||||
numCodecs = acmTmp->NumberOfCodecs();
|
numCodecs = acmTmp->NumberOfCodecs();
|
||||||
@ -337,11 +335,9 @@ void EncodeDecodeTest::Perform() {
|
|||||||
numPars[i] = 0;
|
numPars[i] = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
playoutFreq[1] = 16000;
|
|
||||||
} else {
|
} else {
|
||||||
numCodecs = 1;
|
numCodecs = 1;
|
||||||
numPars[0] = 1;
|
numPars[0] = 1;
|
||||||
playoutFreq[1]=16000;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
_receiver.testMode = _testMode;
|
_receiver.testMode = _testMode;
|
||||||
|
@ -53,7 +53,6 @@ TestVADDTX::~TestVADDTX()
|
|||||||
|
|
||||||
void TestVADDTX::Perform()
|
void TestVADDTX::Perform()
|
||||||
{
|
{
|
||||||
|
|
||||||
if(_testMode == 0)
|
if(_testMode == 0)
|
||||||
{
|
{
|
||||||
printf("Running VAD/DTX Test");
|
printf("Running VAD/DTX Test");
|
||||||
@ -213,12 +212,15 @@ void TestVADDTX::runTestInternalDTX()
|
|||||||
|
|
||||||
void TestVADDTX::SetVAD(bool statusDTX, bool statusVAD, WebRtc_Word16 vadMode)
|
void TestVADDTX::SetVAD(bool statusDTX, bool statusVAD, WebRtc_Word16 vadMode)
|
||||||
{
|
{
|
||||||
WebRtc_Word32 status;
|
|
||||||
bool dtxEnabled, vadEnabled;
|
bool dtxEnabled, vadEnabled;
|
||||||
ACMVADMode vadModeSet;
|
ACMVADMode vadModeSet;
|
||||||
|
|
||||||
status = _acmA->SetVAD(statusDTX, statusVAD, (ACMVADMode) vadMode);
|
if (_acmA->SetVAD(statusDTX, statusVAD, (ACMVADMode) vadMode) < 0) {
|
||||||
status = _acmA->VAD(dtxEnabled, vadEnabled, vadModeSet);
|
assert(false);
|
||||||
|
}
|
||||||
|
if (_acmA->VAD(dtxEnabled, vadEnabled, vadModeSet) < 0) {
|
||||||
|
assert(false);
|
||||||
|
}
|
||||||
|
|
||||||
if(_testMode != 0)
|
if(_testMode != 0)
|
||||||
{
|
{
|
||||||
@ -256,11 +258,12 @@ void TestVADDTX::SetVAD(bool statusDTX, bool statusVAD, WebRtc_Word16 vadMode)
|
|||||||
VADDTXstruct TestVADDTX::GetVAD()
|
VADDTXstruct TestVADDTX::GetVAD()
|
||||||
{
|
{
|
||||||
VADDTXstruct retStruct;
|
VADDTXstruct retStruct;
|
||||||
WebRtc_Word32 status;
|
|
||||||
bool dtxEnabled, vadEnabled;
|
bool dtxEnabled, vadEnabled;
|
||||||
ACMVADMode vadModeSet;
|
ACMVADMode vadModeSet;
|
||||||
|
|
||||||
status = _acmA->VAD(dtxEnabled, vadEnabled, vadModeSet);
|
if (_acmA->VAD(dtxEnabled, vadEnabled, vadModeSet) < 0) {
|
||||||
|
assert(false);
|
||||||
|
}
|
||||||
|
|
||||||
retStruct.statusDTX = dtxEnabled;
|
retStruct.statusDTX = dtxEnabled;
|
||||||
retStruct.statusVAD = vadEnabled;
|
retStruct.statusVAD = vadEnabled;
|
||||||
|
@ -77,7 +77,6 @@ int func_test(int sel)
|
|||||||
TEST_LOG("- - - - - - - - - - - - - - - - - - - -\n");
|
TEST_LOG("- - - - - - - - - - - - - - - - - - - -\n");
|
||||||
TEST_LOG("\n: ");
|
TEST_LOG("\n: ");
|
||||||
|
|
||||||
int dummy(0);
|
|
||||||
int selection(0);
|
int selection(0);
|
||||||
enum TestType testType(TTInvalid);
|
enum TestType testType(TTInvalid);
|
||||||
|
|
||||||
@ -89,7 +88,9 @@ SHOW_MENU:
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
dummy = scanf("%d", &selection);
|
if (scanf("%d", &selection) < 0) {
|
||||||
|
perror("Failed to get selection.");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (selection)
|
switch (selection)
|
||||||
|
@ -664,58 +664,56 @@ WebRtc_Word32 FuncTestManager::Close()
|
|||||||
|
|
||||||
WebRtc_Word32 FuncTestManager::DoTest(const TestType testType)
|
WebRtc_Word32 FuncTestManager::DoTest(const TestType testType)
|
||||||
{
|
{
|
||||||
WebRtc_UWord32 ret(0);
|
|
||||||
|
|
||||||
switch (testType)
|
switch (testType)
|
||||||
{
|
{
|
||||||
case TTAll:
|
case TTAll:
|
||||||
ret = TestAudioLayerSelection();
|
TestAudioLayerSelection();
|
||||||
ret = TestDeviceEnumeration();
|
TestDeviceEnumeration();
|
||||||
ret = TestDeviceSelection();
|
TestDeviceSelection();
|
||||||
ret = TestAudioTransport();
|
TestAudioTransport();
|
||||||
ret = TestSpeakerVolume();
|
TestSpeakerVolume();
|
||||||
ret = TestMicrophoneVolume();
|
TestMicrophoneVolume();
|
||||||
ret = TestLoopback();
|
TestLoopback();
|
||||||
case TTAudioLayerSelection:
|
case TTAudioLayerSelection:
|
||||||
TestAudioLayerSelection();
|
TestAudioLayerSelection();
|
||||||
break;
|
break;
|
||||||
case TTDeviceEnumeration:
|
case TTDeviceEnumeration:
|
||||||
ret = TestDeviceEnumeration();
|
TestDeviceEnumeration();
|
||||||
break;
|
break;
|
||||||
case TTDeviceSelection:
|
case TTDeviceSelection:
|
||||||
ret = TestDeviceSelection();
|
TestDeviceSelection();
|
||||||
break;
|
break;
|
||||||
case TTAudioTransport:
|
case TTAudioTransport:
|
||||||
ret = TestAudioTransport();
|
TestAudioTransport();
|
||||||
break;
|
break;
|
||||||
case TTSpeakerVolume:
|
case TTSpeakerVolume:
|
||||||
ret = TestSpeakerVolume();
|
TestSpeakerVolume();
|
||||||
break;
|
break;
|
||||||
case TTMicrophoneVolume:
|
case TTMicrophoneVolume:
|
||||||
ret = TestMicrophoneVolume();
|
TestMicrophoneVolume();
|
||||||
break;
|
break;
|
||||||
case TTSpeakerMute:
|
case TTSpeakerMute:
|
||||||
ret = TestSpeakerMute();
|
TestSpeakerMute();
|
||||||
break;
|
break;
|
||||||
case TTMicrophoneMute:
|
case TTMicrophoneMute:
|
||||||
ret = TestMicrophoneMute();
|
TestMicrophoneMute();
|
||||||
break;
|
break;
|
||||||
case TTMicrophoneBoost:
|
case TTMicrophoneBoost:
|
||||||
ret = TestMicrophoneBoost();
|
TestMicrophoneBoost();
|
||||||
break;
|
break;
|
||||||
case TTMicrophoneAGC:
|
case TTMicrophoneAGC:
|
||||||
ret = TestMicrophoneAGC();
|
TestMicrophoneAGC();
|
||||||
break;
|
break;
|
||||||
case TTLoopback:
|
case TTLoopback:
|
||||||
ret = TestLoopback();
|
TestLoopback();
|
||||||
break;
|
break;
|
||||||
case TTDeviceRemoval:
|
case TTDeviceRemoval:
|
||||||
ret = TestDeviceRemoval();
|
TestDeviceRemoval();
|
||||||
break;
|
break;
|
||||||
case TTMobileAPI:
|
case TTMobileAPI:
|
||||||
ret = TestAdvancedMBAPI();
|
TestAdvancedMBAPI();
|
||||||
case TTTest:
|
case TTTest:
|
||||||
ret = TestExtra();
|
TestExtra();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
@ -88,11 +88,11 @@ void RtcpFormatRembTest::TearDown() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(RtcpFormatRembTest, TestBasicAPI) {
|
TEST_F(RtcpFormatRembTest, TestBasicAPI) {
|
||||||
EXPECT_EQ(false, rtcp_sender_->REMB());
|
EXPECT_FALSE(rtcp_sender_->REMB());
|
||||||
EXPECT_EQ(0, rtcp_sender_->SetREMBStatus(true));
|
EXPECT_EQ(0, rtcp_sender_->SetREMBStatus(true));
|
||||||
EXPECT_EQ(true, rtcp_sender_->REMB());
|
EXPECT_TRUE(rtcp_sender_->REMB());
|
||||||
EXPECT_EQ(0, rtcp_sender_->SetREMBStatus(false));
|
EXPECT_EQ(0, rtcp_sender_->SetREMBStatus(false));
|
||||||
EXPECT_EQ(false, rtcp_sender_->REMB());
|
EXPECT_FALSE(rtcp_sender_->REMB());
|
||||||
|
|
||||||
EXPECT_EQ(0, rtcp_sender_->SetREMBData(1234, 0, NULL));
|
EXPECT_EQ(0, rtcp_sender_->SetREMBData(1234, 0, NULL));
|
||||||
}
|
}
|
||||||
|
@ -58,9 +58,9 @@ TEST_F(RtpRtcpAPITest, Basic) {
|
|||||||
EXPECT_EQ(0, module->SetStartTimestamp(test_timestamp));
|
EXPECT_EQ(0, module->SetStartTimestamp(test_timestamp));
|
||||||
EXPECT_EQ(test_timestamp, module->StartTimestamp());
|
EXPECT_EQ(test_timestamp, module->StartTimestamp());
|
||||||
|
|
||||||
EXPECT_EQ(false, module->Sending());
|
EXPECT_FALSE(module->Sending());
|
||||||
EXPECT_EQ(0, module->SetSendingStatus(true));
|
EXPECT_EQ(0, module->SetSendingStatus(true));
|
||||||
EXPECT_EQ(true, module->Sending());
|
EXPECT_TRUE(module->Sending());
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(RtpRtcpAPITest, MTU) {
|
TEST_F(RtpRtcpAPITest, MTU) {
|
||||||
@ -108,11 +108,11 @@ TEST_F(RtpRtcpAPITest, RTCP) {
|
|||||||
EXPECT_STRCASEEQ(cName, "john.doe@test.test");
|
EXPECT_STRCASEEQ(cName, "john.doe@test.test");
|
||||||
EXPECT_EQ(-1, module->CNAME(NULL));
|
EXPECT_EQ(-1, module->CNAME(NULL));
|
||||||
|
|
||||||
EXPECT_EQ(false, module->TMMBR());
|
EXPECT_FALSE(module->TMMBR());
|
||||||
EXPECT_EQ(0, module->SetTMMBRStatus(true));
|
EXPECT_EQ(0, module->SetTMMBRStatus(true));
|
||||||
EXPECT_EQ(true, module->TMMBR());
|
EXPECT_TRUE(module->TMMBR());
|
||||||
EXPECT_EQ(0, module->SetTMMBRStatus(false));
|
EXPECT_EQ(0, module->SetTMMBRStatus(false));
|
||||||
EXPECT_EQ(false, module->TMMBR());
|
EXPECT_FALSE(module->TMMBR());
|
||||||
|
|
||||||
EXPECT_EQ(kNackOff, module->NACK());
|
EXPECT_EQ(kNackOff, module->NACK());
|
||||||
EXPECT_EQ(0, module->SetNACKStatus(kNackRtcp));
|
EXPECT_EQ(0, module->SetNACKStatus(kNackRtcp));
|
||||||
|
@ -65,7 +65,7 @@ class VerifyingAudioReceiver : public RtpData {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
EXPECT_EQ(false, true) << "This code path should never happen.";
|
ADD_FAILURE() << "This code path should never happen.";
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
@ -192,7 +192,7 @@ TEST_F(RtpRtcpAudioTest, Basic) {
|
|||||||
EXPECT_EQ(0, module1->SetSSRC(test_ssrc));
|
EXPECT_EQ(0, module1->SetSSRC(test_ssrc));
|
||||||
EXPECT_EQ(0, module1->SetStartTimestamp(test_timestamp));
|
EXPECT_EQ(0, module1->SetStartTimestamp(test_timestamp));
|
||||||
|
|
||||||
EXPECT_EQ(false, module1->TelephoneEvent());
|
EXPECT_FALSE(module1->TelephoneEvent());
|
||||||
|
|
||||||
// Test detection at the end of a DTMF tone.
|
// Test detection at the end of a DTMF tone.
|
||||||
EXPECT_EQ(0, module2->SetTelephoneEventStatus(true, true, true));
|
EXPECT_EQ(0, module2->SetTelephoneEventStatus(true, true, true));
|
||||||
|
@ -145,7 +145,7 @@ TEST_F(TestSessionInfo, TestSimpleAPIs) {
|
|||||||
FillPacket(0);
|
FillPacket(0);
|
||||||
ASSERT_EQ(kPacketBufferSize,
|
ASSERT_EQ(kPacketBufferSize,
|
||||||
session_.InsertPacket(packet_, frame_buffer_, false, 0));
|
session_.InsertPacket(packet_, frame_buffer_, false, 0));
|
||||||
EXPECT_EQ(false, session_.HaveLastPacket());
|
EXPECT_FALSE(session_.HaveLastPacket());
|
||||||
EXPECT_EQ(kVideoFrameKey, session_.FrameType());
|
EXPECT_EQ(kVideoFrameKey, session_.FrameType());
|
||||||
|
|
||||||
packet_.isFirstPacket = false;
|
packet_.isFirstPacket = false;
|
||||||
@ -153,7 +153,7 @@ TEST_F(TestSessionInfo, TestSimpleAPIs) {
|
|||||||
packet_.seqNum += 1;
|
packet_.seqNum += 1;
|
||||||
ASSERT_EQ(kPacketBufferSize,
|
ASSERT_EQ(kPacketBufferSize,
|
||||||
session_.InsertPacket(packet_, frame_buffer_, false, 0));
|
session_.InsertPacket(packet_, frame_buffer_, false, 0));
|
||||||
EXPECT_EQ(true, session_.HaveLastPacket());
|
EXPECT_TRUE(session_.HaveLastPacket());
|
||||||
EXPECT_EQ(packet_.seqNum, session_.HighSequenceNumber());
|
EXPECT_EQ(packet_.seqNum, session_.HighSequenceNumber());
|
||||||
EXPECT_EQ(0xFFFE, session_.LowSequenceNumber());
|
EXPECT_EQ(0xFFFE, session_.LowSequenceNumber());
|
||||||
|
|
||||||
@ -804,7 +804,7 @@ TEST_F(TestNackList, NoLosses) {
|
|||||||
EXPECT_EQ(10 * kPacketBufferSize, session_.SessionLength());
|
EXPECT_EQ(10 * kPacketBufferSize, session_.SessionLength());
|
||||||
BuildSeqNumList(low, packet_.seqNum);
|
BuildSeqNumList(low, packet_.seqNum);
|
||||||
EXPECT_EQ(0, session_.BuildHardNackList(seq_num_list_, seq_num_list_length_));
|
EXPECT_EQ(0, session_.BuildHardNackList(seq_num_list_, seq_num_list_length_));
|
||||||
EXPECT_EQ(false, session_.session_nack());
|
EXPECT_FALSE(session_.session_nack());
|
||||||
SCOPED_TRACE("Calling VerifyAll");
|
SCOPED_TRACE("Calling VerifyAll");
|
||||||
VerifyAll(-1);
|
VerifyAll(-1);
|
||||||
|
|
||||||
|
@ -275,7 +275,6 @@ GenericCodecTest::Perform(CmdArgs& args)
|
|||||||
const float nBitrates = sizeof(bitRate)/sizeof(*bitRate);
|
const float nBitrates = sizeof(bitRate)/sizeof(*bitRate);
|
||||||
float _bitRate = 0;
|
float _bitRate = 0;
|
||||||
int _frameCnt = 0;
|
int _frameCnt = 0;
|
||||||
WebRtc_Word64 startTime, currentTime, oneSecTime;
|
|
||||||
float totalBytesOneSec;//, totalBytesTenSec;
|
float totalBytesOneSec;//, totalBytesTenSec;
|
||||||
float totalBytes, actualBitrate;
|
float totalBytes, actualBitrate;
|
||||||
VCMFrameCount frameCount; // testing frame type counters
|
VCMFrameCount frameCount; // testing frame type counters
|
||||||
@ -309,7 +308,6 @@ GenericCodecTest::Perform(CmdArgs& args)
|
|||||||
_vcm->SetChannelParameters((WebRtc_UWord32)_bitRate, 0, 20);
|
_vcm->SetChannelParameters((WebRtc_UWord32)_bitRate, 0, 20);
|
||||||
_frameCnt = 0;
|
_frameCnt = 0;
|
||||||
totalBytes = 0;
|
totalBytes = 0;
|
||||||
startTime = _clock->MicrosecondTimestamp();
|
|
||||||
_encodeCompleteCallback->Initialize();
|
_encodeCompleteCallback->Initialize();
|
||||||
sendStats.SetTargetFrameRate(static_cast<WebRtc_UWord32>(_frameRate));
|
sendStats.SetTargetFrameRate(static_cast<WebRtc_UWord32>(_frameRate));
|
||||||
_vcm->RegisterSendStatisticsCallback(&sendStats);
|
_vcm->RegisterSendStatisticsCallback(&sendStats);
|
||||||
@ -333,7 +331,6 @@ GenericCodecTest::Perform(CmdArgs& args)
|
|||||||
//currentTime = VCMTickTime::MillisecondTimestamp();//clock()/(double)CLOCKS_PER_SEC;
|
//currentTime = VCMTickTime::MillisecondTimestamp();//clock()/(double)CLOCKS_PER_SEC;
|
||||||
if (_frameCnt == _frameRate)// @ 1sec
|
if (_frameCnt == _frameRate)// @ 1sec
|
||||||
{
|
{
|
||||||
oneSecTime = _clock->MicrosecondTimestamp();
|
|
||||||
totalBytesOneSec = _encodeCompleteCallback->EncodedBytes();//totalBytes;
|
totalBytesOneSec = _encodeCompleteCallback->EncodedBytes();//totalBytes;
|
||||||
}
|
}
|
||||||
TEST(_vcm->TimeUntilNextProcess() >= 0);
|
TEST(_vcm->TimeUntilNextProcess() >= 0);
|
||||||
@ -343,7 +340,6 @@ GenericCodecTest::Perform(CmdArgs& args)
|
|||||||
// estimating rates
|
// estimating rates
|
||||||
// complete sequence
|
// complete sequence
|
||||||
// bit rate assumes input frame rate is as specified
|
// bit rate assumes input frame rate is as specified
|
||||||
currentTime = _clock->MicrosecondTimestamp();
|
|
||||||
totalBytes = _encodeCompleteCallback->EncodedBytes();
|
totalBytes = _encodeCompleteCallback->EncodedBytes();
|
||||||
actualBitrate = (float)(8.0/1000)*(totalBytes / (_frameCnt / _frameRate));
|
actualBitrate = (float)(8.0/1000)*(totalBytes / (_frameCnt / _frameRate));
|
||||||
|
|
||||||
@ -367,7 +363,6 @@ GenericCodecTest::Perform(CmdArgs& args)
|
|||||||
/********************************/
|
/********************************/
|
||||||
/* Encoder Pipeline Delay Test */
|
/* Encoder Pipeline Delay Test */
|
||||||
/******************************/
|
/******************************/
|
||||||
WebRtc_Word32 retVal;
|
|
||||||
_vcm->InitializeSender();
|
_vcm->InitializeSender();
|
||||||
sourceFrame.Free();
|
sourceFrame.Free();
|
||||||
sourceFrame.VerifyAndAllocate(_lengthSourceFrame);
|
sourceFrame.VerifyAndAllocate(_lengthSourceFrame);
|
||||||
@ -376,11 +371,11 @@ GenericCodecTest::Perform(CmdArgs& args)
|
|||||||
// going over all available codecs
|
// going over all available codecs
|
||||||
for (int k = 0; k < NumberOfCodecs; k++)
|
for (int k = 0; k < NumberOfCodecs; k++)
|
||||||
{
|
{
|
||||||
retVal = _vcm->Codec(k, &_sendCodec);
|
_vcm->Codec(k, &_sendCodec);
|
||||||
retVal = _vcm->InitializeSender();
|
_vcm->InitializeSender();
|
||||||
_sendCodec.maxBitrate = 8000;
|
_sendCodec.maxBitrate = 8000;
|
||||||
retVal = _vcm->RegisterSendCodec(&_sendCodec, 4, 1440);
|
_vcm->RegisterSendCodec(&_sendCodec, 4, 1440);
|
||||||
retVal = _vcm->RegisterTransportCallback(_encodeCompleteCallback);
|
_vcm->RegisterTransportCallback(_encodeCompleteCallback);
|
||||||
|
|
||||||
_frameCnt = 0;
|
_frameCnt = 0;
|
||||||
encodeComplete = false;
|
encodeComplete = false;
|
||||||
@ -393,7 +388,7 @@ GenericCodecTest::Perform(CmdArgs& args)
|
|||||||
sourceFrame.SetWidth(_width);
|
sourceFrame.SetWidth(_width);
|
||||||
_timeStamp += (WebRtc_UWord32)(9e4 / static_cast<float>(_frameRate));
|
_timeStamp += (WebRtc_UWord32)(9e4 / static_cast<float>(_frameRate));
|
||||||
sourceFrame.SetTimeStamp(_timeStamp);
|
sourceFrame.SetTimeStamp(_timeStamp);
|
||||||
retVal = _vcm->AddVideoFrame(sourceFrame);
|
_vcm->AddVideoFrame(sourceFrame);
|
||||||
encodeComplete = _encodeCompleteCallback->EncodeComplete();
|
encodeComplete = _encodeCompleteCallback->EncodeComplete();
|
||||||
} // first frame encoded
|
} // first frame encoded
|
||||||
printf ("\n Codec type = %s \n", _sendCodec.plName);
|
printf ("\n Codec type = %s \n", _sendCodec.plName);
|
||||||
|
@ -470,40 +470,6 @@ VCMQMDecodeCompleCallback::SetOriginalFrameDimensions(WebRtc_Word32 width, WebRt
|
|||||||
WebRtc_Word32
|
WebRtc_Word32
|
||||||
VCMQMDecodeCompleCallback::buildInterpolator()
|
VCMQMDecodeCompleCallback::buildInterpolator()
|
||||||
{
|
{
|
||||||
// if (_interpolator != NULL)
|
|
||||||
// {
|
|
||||||
// deleteInterpolator(_interpolator);
|
|
||||||
// _interpolator = NULL;
|
|
||||||
// }
|
|
||||||
|
|
||||||
// create decimator
|
|
||||||
WebRtc_Word32 filterPar = 4; //Lanczos (assuming sampling ratio is 1, 1.5, 2, 4)
|
|
||||||
|
|
||||||
float HeightRatio = 0;
|
|
||||||
float WidthRatio = 0;
|
|
||||||
|
|
||||||
WidthRatio = (float)_origWidth/(float)_decWidth;
|
|
||||||
HeightRatio = (float)_origHeight/(float)_decHeight;
|
|
||||||
|
|
||||||
if ( (HeightRatio == 1.0 || HeightRatio == 1.5 || HeightRatio == 2 || HeightRatio == 4) &&
|
|
||||||
(WidthRatio == 1.0 || WidthRatio == 1.5 || WidthRatio == 2 || WidthRatio == 4))
|
|
||||||
{
|
|
||||||
filterPar = 4; //Lanczos
|
|
||||||
} else
|
|
||||||
{
|
|
||||||
filterPar = 0; //BiCubic
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// define interpolator here
|
|
||||||
|
|
||||||
// create interpolator here
|
|
||||||
|
|
||||||
// if (_interpolator == NULL)
|
|
||||||
// {
|
|
||||||
// return -1;
|
|
||||||
// }
|
|
||||||
|
|
||||||
WebRtc_UWord32 decFrameLength = _origWidth*_origHeight*3 >> 1;
|
WebRtc_UWord32 decFrameLength = _origWidth*_origHeight*3 >> 1;
|
||||||
if (_decBuffer != NULL)
|
if (_decBuffer != NULL)
|
||||||
{
|
{
|
||||||
|
@ -67,7 +67,6 @@ int ReceiverTimingTests(CmdArgs& args)
|
|||||||
WebRtc_UWord32 waitTime = 0;
|
WebRtc_UWord32 waitTime = 0;
|
||||||
WebRtc_UWord32 jitterDelayMs = 0;
|
WebRtc_UWord32 jitterDelayMs = 0;
|
||||||
WebRtc_UWord32 maxDecodeTimeMs = 0;
|
WebRtc_UWord32 maxDecodeTimeMs = 0;
|
||||||
WebRtc_UWord32 extraDelayMs = 0;
|
|
||||||
WebRtc_UWord32 timeStamp = 0;
|
WebRtc_UWord32 timeStamp = 0;
|
||||||
|
|
||||||
timing.Reset(static_cast<WebRtc_Word64>(clockInMs + 0.5));
|
timing.Reset(static_cast<WebRtc_Word64>(clockInMs + 0.5));
|
||||||
@ -170,7 +169,6 @@ int ReceiverTimingTests(CmdArgs& args)
|
|||||||
|
|
||||||
jitterDelayMs = 60;
|
jitterDelayMs = 60;
|
||||||
maxDecodeTimeMs = 10;
|
maxDecodeTimeMs = 10;
|
||||||
extraDelayMs = 0;
|
|
||||||
|
|
||||||
timeStamp = static_cast<WebRtc_UWord32>(-10000); // To produce a wrap
|
timeStamp = static_cast<WebRtc_UWord32>(-10000); // To produce a wrap
|
||||||
clockInMs = 10000.0f;
|
clockInMs = 10000.0f;
|
||||||
|
@ -204,9 +204,9 @@ TEST_F(VideoProcessingModuleTest, FrameStats)
|
|||||||
ASSERT_EQ(_frameLength, fread(_videoFrame.Buffer(), 1, _frameLength,
|
ASSERT_EQ(_frameLength, fread(_videoFrame.Buffer(), 1, _frameLength,
|
||||||
_sourceFile));
|
_sourceFile));
|
||||||
|
|
||||||
EXPECT_EQ(false, _vpm->ValidFrameStats(stats));
|
EXPECT_FALSE(_vpm->ValidFrameStats(stats));
|
||||||
EXPECT_EQ(0, _vpm->GetFrameStats(stats, _videoFrame));
|
EXPECT_EQ(0, _vpm->GetFrameStats(stats, _videoFrame));
|
||||||
EXPECT_EQ(true, _vpm->ValidFrameStats(stats));
|
EXPECT_TRUE(_vpm->ValidFrameStats(stats));
|
||||||
|
|
||||||
printf("\nFrameStats\n");
|
printf("\nFrameStats\n");
|
||||||
printf("mean: %u\nnumPixels: %u\nsubSamplWidth: "
|
printf("mean: %u\nnumPixels: %u\nsubSamplWidth: "
|
||||||
@ -218,7 +218,7 @@ TEST_F(VideoProcessingModuleTest, FrameStats)
|
|||||||
static_cast<unsigned int>(stats.sum));
|
static_cast<unsigned int>(stats.sum));
|
||||||
|
|
||||||
_vpm->ClearFrameStats(stats);
|
_vpm->ClearFrameStats(stats);
|
||||||
EXPECT_EQ(false, _vpm->ValidFrameStats(stats));
|
EXPECT_FALSE(_vpm->ValidFrameStats(stats));
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(VideoProcessingModuleTest, PreprocessorLogic)
|
TEST_F(VideoProcessingModuleTest, PreprocessorLogic)
|
||||||
|
@ -336,7 +336,12 @@ int TestSingleStream(VideoRender* renderModule) {
|
|||||||
|
|
||||||
printf("Start render\n");
|
printf("Start render\n");
|
||||||
error = renderModule->StartRender(streamId0);
|
error = renderModule->StartRender(streamId0);
|
||||||
assert(error == 0);
|
if (error != 0) {
|
||||||
|
// TODO(phoglund): This test will not work if compiled in release mode.
|
||||||
|
// This rather silly construct here is to avoid compilation errors when
|
||||||
|
// compiling in release. Release => no asserts => unused 'error' variable.
|
||||||
|
assert(false);
|
||||||
|
}
|
||||||
|
|
||||||
// Loop through an I420 file and render each frame
|
// Loop through an I420 file and render each frame
|
||||||
const WebRtc_UWord32 width = 352;
|
const WebRtc_UWord32 width = 352;
|
||||||
|
Loading…
Reference in New Issue
Block a user