This CL fixes the warnings when building acm or acm test.

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

git-svn-id: http://webrtc.googlecode.com/svn/trunk@397 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
tina.legrand@webrtc.org 2011-08-18 06:20:30 +00:00
parent 18cec47eab
commit 2e09692006
12 changed files with 43 additions and 81 deletions

View File

@ -8,9 +8,6 @@
* be found in the AUTHORS file in the root of the source tree.
*/
// 'conversion' conversion from 'type1' to 'type2', possible loss of data
#pragma warning(disable: 4267)
#include <stdio.h>
#include "acm_codec_database.h"

View File

@ -8,8 +8,6 @@
* be found in the AUTHORS file in the root of the source tree.
*/
// 'conversion' conversion from 'type1' to 'type2', possible loss of data
#pragma warning(disable: 4267)
#include <stdlib.h> // malloc

View File

@ -8,8 +8,6 @@
* be found in the AUTHORS file in the root of the source tree.
*/
// 'conversion' conversion from 'type1' to 'type2', possible loss of data
#pragma warning(disable: 4267)
#include "acm_dtmf_detection.h"
#include "audio_coding_module.h"

View File

@ -206,7 +206,6 @@ APITest::SetUp()
{
// test if un-registration works;
CodecInst nextCodec;
int currentPayloadType = dummyCodec.pltype;
AudioCodingModule::Codec(n + 1, nextCodec);
nextCodec.pltype = dummyCodec.pltype;
if(!FixedPayloadTypeCodec(nextCodec.plname))
@ -780,7 +779,7 @@ APITest::CheckVADStatus(char side)
bool dtxEnabled;
bool vadEnabled;
ACMVADMode vadMode;
EventWrapper* myEvent = EventWrapper::Create();
if(side == 'A')
{
_acmA->VAD(dtxEnabled, vadEnabled, vadMode);
@ -1268,7 +1267,6 @@ void
APITest::TestReceiverVAD(char side)
{
AudioCodingModule* myACM;
EventWrapper* myEvent = EventWrapper::Create();
WebRtc_UWord64* myReceiveVADActivity;
if(side == 'A')
@ -1293,9 +1291,9 @@ APITest::TestReceiverVAD(char side)
fprintf(stdout, "----------------------------------\n");
fprintf(stdout, "Status........ %s\n", vadStatus? "ON":"OFF");
fprintf(stdout, "mode.......... %d\n", (int)mode);
fprintf(stdout, "VAD Active.... %llu\n", myReceiveVADActivity[0]);
fprintf(stdout, "VAD Passive... %llu\n", myReceiveVADActivity[1]);
fprintf(stdout, "VAD Unknown... %llu\n", myReceiveVADActivity[2]);
fprintf(stdout, "VAD Active.... %lu\n", myReceiveVADActivity[0]);
fprintf(stdout, "VAD Passive... %lu\n", myReceiveVADActivity[1]);
fprintf(stdout, "VAD Unknown... %lu\n", myReceiveVADActivity[2]);
}
if(vadStatus)
@ -1442,7 +1440,6 @@ void
APITest::CurrentCodec(char side)
{
CodecInst myCodec;
EventWrapper* myEvent = EventWrapper::Create();
if(side == 'A')
{
_acmA->SendCodec(myCodec);
@ -1478,7 +1475,6 @@ APITest::ChangeCodec(char side)
bool* dtx;
ACMVADMode* mode;
Channel* myChannel;
EventWrapper* myEvent = EventWrapper::Create();
// Reset and Wait
if(!_randomTest)
{

View File

@ -249,9 +249,9 @@ _saveBitStream(false),
_lastPayloadType(-1),
_isStereo(false),
_leftChannel(true),
_useFECTestWithPacketLoss(false),
_packetLoss(0),
_lastInTimestamp(0),
_packetLoss(0),
_useFECTestWithPacketLoss(false),
_chID(chID),
_beginTime(TickTime::MillisecondTimestamp()),
_totalBytes(0)

View File

@ -29,17 +29,17 @@ struct ACMTestFrameSizeStats
WebRtc_UWord32 numPackets;
WebRtc_UWord64 totalPayloadLenByte;
WebRtc_UWord64 totalEncodedSamples;
double rateBitPerSec;
double usageLenSec;
double rateBitPerSec;
double usageLenSec;
};
struct ACMTestPayloadStats
{
bool newPacket;
WebRtc_Word16 payloadType;
WebRtc_Word16 lastPayloadLenByte;
WebRtc_UWord32 lastTimestamp;
WebRtc_Word16 payloadType;
WebRtc_Word16 lastPayloadLenByte;
WebRtc_UWord32 lastTimestamp;
ACMTestFrameSizeStats frameSizeStats[MAX_NUM_FRAMESIZES];
};
@ -67,7 +67,7 @@ public:
void ResetStats();
WebRtc_Word16 Stats(
CodecInst& codecInst,
CodecInst& codecInst,
ACMTestPayloadStats& payloadStats);
void Stats(
@ -99,26 +99,26 @@ private:
WebRtcRTPHeader& rtpInfo,
WebRtc_UWord16 payloadSize);
AudioCodingModule* _receiverACM;
WebRtc_UWord16 _seqNo;
// 60 msec * 32 sample (max) / msec * 2 description (maybe) * 2 bytes / sample
WebRtc_UWord8 _payloadData[60 * 32 * 2 * 2];
AudioCodingModule* _receiverACM;
WebRtc_UWord16 _seqNo;
// 60msec * 32 sample(max)/msec * 2 description (maybe) * 2 bytes/sample
WebRtc_UWord8 _payloadData[60 * 32 * 2 * 2];
CriticalSectionWrapper* _channelCritSect;
FILE* _bitStreamFile;
bool _saveBitStream;
WebRtc_Word16 _lastPayloadType;
ACMTestPayloadStats _payloadStats[MAX_NUM_PAYLOADS];
bool _isStereo;
WebRtcRTPHeader _rtpInfo;
bool _leftChannel;
WebRtc_UWord32 _lastInTimestamp;
FILE* _bitStreamFile;
bool _saveBitStream;
WebRtc_Word16 _lastPayloadType;
ACMTestPayloadStats _payloadStats[MAX_NUM_PAYLOADS];
bool _isStereo;
WebRtcRTPHeader _rtpInfo;
bool _leftChannel;
WebRtc_UWord32 _lastInTimestamp;
// FEC Test variables
WebRtc_Word16 _packetLoss;
bool _useFECTestWithPacketLoss;
WebRtc_Word16 _chID;
WebRtc_UWord64 _beginTime;
WebRtc_UWord64 _totalBytes;
WebRtc_Word16 _packetLoss;
bool _useFECTestWithPacketLoss;
WebRtc_Word16 _chID;
WebRtc_UWord64 _beginTime;
WebRtc_UWord64 _totalBytes;
};

View File

@ -16,22 +16,9 @@
#include <cstdio>
#include <cstdlib>
// class PCMStream
// {
// protected:
// PCMStream(){}
// ~PCMStream(){}
// public:
// virtual WebRtc_Word32 Read10MsData(AudioFrame& audioFrame) = 0;
// virtual void Write10MsData(WebRtc_Word16 *playoutBuffer, WebRtc_UWord16 playoutLengthSmpls) = 0;
// virtual WebRtc_UWord16 PayloadLength10Ms() const = 0;
// virtual WebRtc_Word32 SamplingFrequency() const = 0;
// };
using namespace webrtc;
class PCMFile /*: public PCMStream*/
class PCMFile
{
public:
PCMFile();
@ -63,14 +50,14 @@ public:
bool readStereo = true);
private:
FILE* _pcmFile;
WebRtc_UWord16 _nSamples10Ms;
WebRtc_Word32 _frequency;
WebRtc_UWord16 _nSamples10Ms;
WebRtc_Word32 _frequency;
bool _endOfFile;
bool _autoRewind;
bool _rewinded;
WebRtc_UWord32 _timestamp;
bool _saveStereo;
WebRtc_UWord32 _timestamp;
bool _readStereo;
bool _saveStereo;
};
#endif

View File

@ -780,8 +780,6 @@ void TestAllCodecs::Run(TestPack* channel)
{
AudioFrame audioFrame;
WebRtc_UWord16 SamplesIn10MsecA = _inFileA.PayloadLength10Ms();
WebRtc_UWord32 timestampA = 1;
WebRtc_Word32 outFreqHzB = _outFileB.SamplingFrequency();
WebRtc_UWord16 recSize;
WebRtc_UWord32 timeStampDiff;

View File

@ -566,19 +566,13 @@ void TestFEC::Run()
WebRtc_UWord16 msecPassed = 0;
WebRtc_UWord32 secPassed = 0;
WebRtc_UWord16 SamplesIn10MsecA = _inFileA.PayloadLength10Ms();
WebRtc_UWord32 timestampA = 1;
WebRtc_Word32 outFreqHzB = _outFileB.SamplingFrequency();
while(!_inFileA.EndOfFile())
{
_inFileA.Read10MsData(audioFrame);
//audioFrame._timeStamp = timestampA;
//timestampA += SamplesIn10MsecA;
CHECK_ERROR(_acmA->Add10MsData(audioFrame));
CHECK_ERROR(_acmA->Process());
CHECK_ERROR(_acmB->PlayoutData10Ms(outFreqHzB, audioFrame));
_outFileB.Write10MsData(audioFrame._payloadData, audioFrame._payloadDataLengthInSamples);
msecPassed += 10;

View File

@ -56,10 +56,7 @@ TestPackStereo::SendData(
WebRtc_Word32 status;
WebRtc_UWord16 payloadDataSize = payloadSize;
WebRtc_UWord8 payloadDataMaster[60 * 32 * 2 * 2];
WebRtc_UWord8 payloadDataSlave[60 * 32 * 2 * 2];
bool twoBytePerSample = false;
bool oneBytePerSample = true;
bool frameBased = false;
WebRtc_UWord8 payloadDataSlave[60 * 32 * 2 * 2];
rtpInfo.header.markerBit = false;
rtpInfo.header.ssrc = 0;
@ -470,8 +467,6 @@ void TestStereo::Run(TestPackStereo* channel)
{
AudioFrame audioFrame;
WebRtc_UWord16 SamplesIn10MsecA = _inFileA.PayloadLength10Ms();
WebRtc_UWord32 timestampA = 1;
WebRtc_Word32 outFreqHzB = _outFileB.SamplingFrequency();
WebRtc_UWord16 recSize;
WebRtc_UWord32 timeStampDiff;

View File

@ -92,8 +92,6 @@ void TestVADDTX::Perform()
WebRtc_Word16 testCntr = 1;
VADDTXstruct setDTX, getDTX, expectedDTX;
bool dtxReplaced;
WebRtc_Word16 testResults = 0;
#ifdef WEBRTC_CODEC_ISAC
@ -144,7 +142,7 @@ void TestVADDTX::Perform()
printf("VAD/DTX test completed with %d subtests failed\n", testResults);
if (testResults > 0)
{
printf("Press return\n\n", testResults);
printf("Press return\n\n");
getchar();
}
}
@ -227,12 +225,13 @@ void TestVADDTX::SetVAD(bool statusDTX, bool statusVAD, WebRtc_Word16 vadMode)
printf("DTX: %s not the same as requested: %s\n",
dtxEnabled? "ON":"OFF", dtxEnabled? "OFF":"ON");
}
if((statusVAD == true) && (vadEnabled == false) ||
(statusVAD == false) && (vadEnabled == false) && (statusDTX == true))
if(((statusVAD == true) && (vadEnabled == false)) ||
((statusVAD == false) && (vadEnabled == false) &&
(statusDTX == true)))
{
printf("VAD: %s not the same as requested: %s\n",
vadEnabled? "ON":"OFF", vadEnabled? "OFF":"ON");
}
}
if(vadModeSet != vadMode)
{
printf("VAD mode: %d not the same as requested: %d\n",

View File

@ -158,13 +158,13 @@ PrintCodecs()
}
CircularBuffer::CircularBuffer(WebRtc_UWord32 len):
_buff(NULL),
_idx(0),
_buffIsFull(false),
_calcAvg(false),
_calcVar(false),
_sum(0),
_sumSqr(0),
_idx(0),
_buff(NULL)
_sumSqr(0)
{
_buff = new(double[len]);
if(_buff == NULL)