This CL changes all the freq relevant variables to be int type. So it will take away the VoE "comparison between signed and unsigned integer expressions" warnings.

BR,
/SX
Review URL: http://webrtc-codereview.appspot.com/89014

git-svn-id: http://webrtc.googlecode.com/svn/trunk@320 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
xians@google.com 2011-08-08 08:18:44 +00:00
parent 81520b7955
commit 0b0665acc1
12 changed files with 36 additions and 42 deletions

View File

@ -256,8 +256,7 @@ int AudioProcessingImpl::ProcessStream(AudioFrame* frame) {
return kNullPointerError; return kNullPointerError;
} }
if (frame->_frequencyInHz != if (frame->_frequencyInHz != sample_rate_hz_) {
static_cast<WebRtc_UWord32>(sample_rate_hz_)) {
return kBadSampleRateError; return kBadSampleRateError;
} }
@ -382,8 +381,7 @@ int AudioProcessingImpl::AnalyzeReverseStream(AudioFrame* frame) {
return kNullPointerError; return kNullPointerError;
} }
if (frame->_frequencyInHz != if (frame->_frequencyInHz != sample_rate_hz_) {
static_cast<WebRtc_UWord32>(sample_rate_hz_)) {
return kBadSampleRateError; return kBadSampleRateError;
} }

View File

@ -697,7 +697,7 @@ public:
const WebRtc_UWord32 timeStamp, const WebRtc_UWord32 timeStamp,
const WebRtc_Word16* payloadData, const WebRtc_Word16* payloadData,
const WebRtc_UWord16 payloadDataLengthInSamples, const WebRtc_UWord16 payloadDataLengthInSamples,
const WebRtc_UWord32 frequencyInHz, const int frequencyInHz,
const SpeechType speechType, const SpeechType speechType,
const VADActivity vadActivity, const VADActivity vadActivity,
const WebRtc_UWord8 audioChannel = 1, const WebRtc_UWord8 audioChannel = 1,
@ -719,7 +719,7 @@ public:
// Supporting Stereo, stereo samples are interleaved // Supporting Stereo, stereo samples are interleaved
mutable WebRtc_Word16 _payloadData[kMaxAudioFrameSizeSamples]; mutable WebRtc_Word16 _payloadData[kMaxAudioFrameSizeSamples];
WebRtc_UWord16 _payloadDataLengthInSamples; WebRtc_UWord16 _payloadDataLengthInSamples;
WebRtc_UWord32 _frequencyInHz; int _frequencyInHz;
WebRtc_UWord8 _audioChannel; WebRtc_UWord8 _audioChannel;
SpeechType _speechType; SpeechType _speechType;
VADActivity _vadActivity; VADActivity _vadActivity;
@ -756,7 +756,7 @@ AudioFrame::UpdateFrame(
const WebRtc_UWord32 timeStamp, const WebRtc_UWord32 timeStamp,
const WebRtc_Word16* payloadData, const WebRtc_Word16* payloadData,
const WebRtc_UWord16 payloadDataLengthInSamples, const WebRtc_UWord16 payloadDataLengthInSamples,
const WebRtc_UWord32 frequencyInHz, const int frequencyInHz,
const SpeechType speechType, const SpeechType speechType,
const VADActivity vadActivity, const VADActivity vadActivity,
const WebRtc_UWord8 audioChannel, const WebRtc_UWord8 audioChannel,

View File

@ -159,7 +159,7 @@ public:
virtual WebRtc_Word32 OnInitializeDecoder(const WebRtc_Word32 id, virtual WebRtc_Word32 OnInitializeDecoder(const WebRtc_Word32 id,
const WebRtc_Word8 payloadType, const WebRtc_Word8 payloadType,
const WebRtc_Word8 payloadName[RTP_PAYLOAD_NAME_SIZE], const WebRtc_Word8 payloadName[RTP_PAYLOAD_NAME_SIZE],
const WebRtc_UWord32 frequency, const int frequency,
const WebRtc_UWord8 channels, const WebRtc_UWord8 channels,
const WebRtc_UWord32 rate) = 0; const WebRtc_UWord32 rate) = 0;

View File

@ -3142,7 +3142,7 @@ void ViEChannel::OnApplicationDataReceived(const WebRtc_Word32 id,
WebRtc_Word32 ViEChannel::OnInitializeDecoder( WebRtc_Word32 ViEChannel::OnInitializeDecoder(
const WebRtc_Word32 id, const WebRtc_Word8 payloadType, const WebRtc_Word32 id, const WebRtc_Word8 payloadType,
const WebRtc_Word8 payloadName[RTP_PAYLOAD_NAME_SIZE], const WebRtc_Word8 payloadName[RTP_PAYLOAD_NAME_SIZE],
const WebRtc_UWord32 frequency, const WebRtc_UWord8 channels, const int frequency, const WebRtc_UWord8 channels,
const WebRtc_UWord32 rate) const WebRtc_UWord32 rate)
{ {
WEBRTC_TRACE(webrtc::kTraceInfo, webrtc::kTraceVideo, ViEId(_engineId, _channelId), WEBRTC_TRACE(webrtc::kTraceInfo, webrtc::kTraceVideo, ViEId(_engineId, _channelId),

View File

@ -193,7 +193,7 @@ public:
const WebRtc_Word32 id, const WebRtc_Word32 id,
const WebRtc_Word8 payloadType, const WebRtc_Word8 payloadType,
const WebRtc_Word8 payloadName[RTP_PAYLOAD_NAME_SIZE], const WebRtc_Word8 payloadName[RTP_PAYLOAD_NAME_SIZE],
const WebRtc_UWord32 frequency, const int frequency,
const WebRtc_UWord8 channels, const WebRtc_UWord8 channels,
const WebRtc_UWord32 rate); const WebRtc_UWord32 rate);

View File

@ -630,7 +630,7 @@ Channel::OnInitializeDecoder(
const WebRtc_Word32 id, const WebRtc_Word32 id,
const WebRtc_Word8 payloadType, const WebRtc_Word8 payloadType,
const WebRtc_Word8 payloadName[RTP_PAYLOAD_NAME_SIZE], const WebRtc_Word8 payloadName[RTP_PAYLOAD_NAME_SIZE],
const WebRtc_UWord32 frequency, const int frequency,
const WebRtc_UWord8 channels, const WebRtc_UWord8 channels,
const WebRtc_UWord32 rate) const WebRtc_UWord32 rate)
{ {
@ -5860,7 +5860,7 @@ Channel::Demultiplex(const AudioFrame& audioFrame,
} }
WebRtc_UWord32 WebRtc_UWord32
Channel::PrepareEncodeAndSend(WebRtc_UWord32 mixingFrequency) Channel::PrepareEncodeAndSend(int mixingFrequency)
{ {
WEBRTC_TRACE(kTraceStream, kTraceVoice, VoEId(_instanceId,_channelId), WEBRTC_TRACE(kTraceStream, kTraceVoice, VoEId(_instanceId,_channelId),
"Channel::PrepareEncodeAndSend()"); "Channel::PrepareEncodeAndSend()");
@ -6216,7 +6216,7 @@ Channel::GetRtpRtcp(RtpRtcp* &rtpRtcpModule) const
} }
WebRtc_Word32 WebRtc_Word32
Channel::MixOrReplaceAudioWithFile(const WebRtc_UWord32 mixingFrequency) Channel::MixOrReplaceAudioWithFile(const int mixingFrequency)
{ {
WebRtc_Word16 fileBuffer[320]; WebRtc_Word16 fileBuffer[320];
WebRtc_UWord32 fileSamples(0); WebRtc_UWord32 fileSamples(0);
@ -6278,7 +6278,7 @@ Channel::MixOrReplaceAudioWithFile(const WebRtc_UWord32 mixingFrequency)
WebRtc_Word32 WebRtc_Word32
Channel::MixAudioWithFile(AudioFrame& audioFrame, Channel::MixAudioWithFile(AudioFrame& audioFrame,
const WebRtc_UWord32 mixingFrequency) const int mixingFrequency)
{ {
assert(mixingFrequency <= 32000); assert(mixingFrequency <= 32000);

View File

@ -389,7 +389,7 @@ public:
const WebRtc_Word32 id, const WebRtc_Word32 id,
const WebRtc_Word8 payloadType, const WebRtc_Word8 payloadType,
const WebRtc_Word8 payloadName[RTP_PAYLOAD_NAME_SIZE], const WebRtc_Word8 payloadName[RTP_PAYLOAD_NAME_SIZE],
const WebRtc_UWord32 frequency, const int frequency,
const WebRtc_UWord8 channels, const WebRtc_UWord8 channels,
const WebRtc_UWord32 rate); const WebRtc_UWord32 rate);
@ -533,15 +533,15 @@ public:
#endif #endif
WebRtc_UWord32 Demultiplex(const AudioFrame& audioFrame, WebRtc_UWord32 Demultiplex(const AudioFrame& audioFrame,
const WebRtc_UWord8 audioLevel_dBov); const WebRtc_UWord8 audioLevel_dBov);
WebRtc_UWord32 PrepareEncodeAndSend(WebRtc_UWord32 mixingFrequency); WebRtc_UWord32 PrepareEncodeAndSend(int mixingFrequency);
WebRtc_UWord32 EncodeAndSend(); WebRtc_UWord32 EncodeAndSend();
private: private:
int InsertInbandDtmfTone(); int InsertInbandDtmfTone();
WebRtc_Word32 WebRtc_Word32
MixOrReplaceAudioWithFile(const WebRtc_UWord32 mixingFrequency); MixOrReplaceAudioWithFile(const int mixingFrequency);
WebRtc_Word32 MixAudioWithFile(AudioFrame& audioFrame, WebRtc_Word32 MixAudioWithFile(AudioFrame& audioFrame,
const WebRtc_UWord32 mixingFrequency); const int mixingFrequency);
WebRtc_Word32 GetPlayoutTimeStamp(WebRtc_UWord32& playoutTimestamp); WebRtc_Word32 GetPlayoutTimeStamp(WebRtc_UWord32& playoutTimestamp);
void UpdateDeadOrAliveCounters(bool alive); void UpdateDeadOrAliveCounters(bool alive);
WebRtc_Word32 SendPacketRaw(const void *data, int len, bool RTCP); WebRtc_Word32 SendPacketRaw(const void *data, int len, bool RTCP);
@ -576,9 +576,9 @@ private:
FilePlayer* _inputFilePlayerPtr; FilePlayer* _inputFilePlayerPtr;
FilePlayer* _outputFilePlayerPtr; FilePlayer* _outputFilePlayerPtr;
FileRecorder* _outputFileRecorderPtr; FileRecorder* _outputFileRecorderPtr;
WebRtc_UWord32 _inputFilePlayerId; int _inputFilePlayerId;
WebRtc_UWord32 _outputFilePlayerId; int _outputFilePlayerId;
WebRtc_UWord32 _outputFileRecorderId; int _outputFileRecorderId;
bool _inputFilePlaying; bool _inputFilePlaying;
bool _outputFilePlaying; bool _outputFilePlaying;
bool _outputFileRecording; bool _outputFileRecording;

View File

@ -142,12 +142,12 @@ private: // owns
Resampler _apmResampler; // converts mixed audio to fit APM rate Resampler _apmResampler; // converts mixed audio to fit APM rate
AudioLevel _audioLevel; // measures audio level for the combined signal AudioLevel _audioLevel; // measures audio level for the combined signal
DtmfInband _dtmfGenerator; DtmfInband _dtmfGenerator;
WebRtc_UWord32 _instanceId; int _instanceId;
VoEMediaProcess* _externalMediaCallbackPtr; VoEMediaProcess* _externalMediaCallbackPtr;
bool _externalMedia; bool _externalMedia;
float _panLeft; float _panLeft;
float _panRight; float _panRight;
WebRtc_UWord32 _mixingFrequencyHz; int _mixingFrequencyHz;
FileRecorder* _outputFileRecorderPtr; FileRecorder* _outputFileRecorderPtr;
bool _outputFileRecording; bool _outputFileRecording;
}; };

View File

@ -314,7 +314,7 @@ TransmitMixer::PrepareDemux(const WebRtc_Word8* audioSamples,
totalDelayMS, clockDrift, currentMicLevel); totalDelayMS, clockDrift, currentMicLevel);
const WebRtc_UWord32 mixingFrequency = _mixingFrequency; const int mixingFrequency = _mixingFrequency;
ScopedChannel sc(*_channelManagerPtr); ScopedChannel sc(*_channelManagerPtr);
void* iterator(NULL); void* iterator(NULL);
@ -326,7 +326,7 @@ TransmitMixer::PrepareDemux(const WebRtc_Word8* audioSamples,
{ {
CodecInst tmpCdc; CodecInst tmpCdc;
channelPtr->GetSendCodec(tmpCdc); channelPtr->GetSendCodec(tmpCdc);
if ((WebRtc_UWord32) tmpCdc.plfreq > _mixingFrequency) if (tmpCdc.plfreq > _mixingFrequency)
_mixingFrequency = tmpCdc.plfreq; _mixingFrequency = tmpCdc.plfreq;
} }
channelPtr = sc.GetNextChannel(iterator); channelPtr = sc.GetNextChannel(iterator);
@ -1151,7 +1151,7 @@ TransmitMixer::GenerateAudioFrame(const WebRtc_Word16 audioSamples[],
const WebRtc_UWord32 nSamples, const WebRtc_UWord32 nSamples,
const WebRtc_UWord8 nChannels, const WebRtc_UWord8 nChannels,
const WebRtc_UWord32 samplesPerSec, const WebRtc_UWord32 samplesPerSec,
const WebRtc_UWord32 mixingFrequency) const int mixingFrequency)
{ {
WEBRTC_TRACE(kTraceStream, kTraceVoice, VoEId(_instanceId, -1), WEBRTC_TRACE(kTraceStream, kTraceVoice, VoEId(_instanceId, -1),
"TransmitMixer::GenerateAudioFrame(nSamples=%u," "TransmitMixer::GenerateAudioFrame(nSamples=%u,"
@ -1214,12 +1214,11 @@ WebRtc_Word32 TransmitMixer::RecordAudioToFile(
} }
WebRtc_Word32 TransmitMixer::MixOrReplaceAudioWithFile( WebRtc_Word32 TransmitMixer::MixOrReplaceAudioWithFile(
const WebRtc_UWord32 mixingFrequency) const int mixingFrequency)
{ {
WebRtc_Word16 fileBuffer[320]; WebRtc_Word16 fileBuffer[320];
WebRtc_UWord32 fileSamples(0); WebRtc_UWord32 fileSamples(0);
WebRtc_Word32 outSamples(0);
{ {
CriticalSectionScoped cs(_critSect); CriticalSectionScoped cs(_critSect);
@ -1387,7 +1386,6 @@ int TransmitMixer::TypingDetection()
{ {
return (-1); return (-1);
} }
bool vad = (_audioFrame._vadActivity == AudioFrame::kVadActive);
if (_audioFrame._vadActivity == AudioFrame::kVadActive) if (_audioFrame._vadActivity == AudioFrame::kVadActive)
_timeActive++; _timeActive++;
@ -1423,7 +1421,7 @@ int TransmitMixer::TypingDetection()
} }
#endif #endif
WebRtc_UWord32 TransmitMixer::GetMixingFrequency() int TransmitMixer::GetMixingFrequency()
{ {
assert(_mixingFrequency!=0); assert(_mixingFrequency!=0);
return (_mixingFrequency); return (_mixingFrequency);

View File

@ -81,7 +81,7 @@ public:
int DeRegisterExternalMediaProcessing(); int DeRegisterExternalMediaProcessing();
WebRtc_UWord32 GetMixingFrequency(); int GetMixingFrequency();
// VoEVolumeControl // VoEVolumeControl
int SetMute(const bool enable); int SetMute(const bool enable);
@ -160,11 +160,11 @@ private:
const WebRtc_UWord32 nSamples, const WebRtc_UWord32 nSamples,
const WebRtc_UWord8 nChannels, const WebRtc_UWord8 nChannels,
const WebRtc_UWord32 samplesPerSec, const WebRtc_UWord32 samplesPerSec,
const WebRtc_UWord32 mixingFrequency); const int mixingFrequency);
WebRtc_Word32 RecordAudioToFile(const WebRtc_UWord32 mixingFrequency); WebRtc_Word32 RecordAudioToFile(const WebRtc_UWord32 mixingFrequency);
WebRtc_Word32 MixOrReplaceAudioWithFile( WebRtc_Word32 MixOrReplaceAudioWithFile(
const WebRtc_UWord32 mixingFrequency); const int mixingFrequency);
WebRtc_Word32 APMProcessStream(const WebRtc_UWord16 totalDelayMS, WebRtc_Word32 APMProcessStream(const WebRtc_UWord16 totalDelayMS,
const WebRtc_Word32 clockDrift, const WebRtc_Word32 clockDrift,
@ -188,9 +188,9 @@ private: // owns
FilePlayer* _filePlayerPtr; FilePlayer* _filePlayerPtr;
FileRecorder* _fileRecorderPtr; FileRecorder* _fileRecorderPtr;
FileRecorder* _fileCallRecorderPtr; FileRecorder* _fileCallRecorderPtr;
WebRtc_UWord32 _filePlayerId; int _filePlayerId;
WebRtc_UWord32 _fileRecorderId; int _fileRecorderId;
WebRtc_UWord32 _fileCallRecorderId; int _fileCallRecorderId;
bool _filePlaying; bool _filePlaying;
bool _fileRecording; bool _fileRecording;
bool _fileCallRecording; bool _fileCallRecording;
@ -208,14 +208,14 @@ private: // owns
WebRtc_UWord32 _noiseWarning; WebRtc_UWord32 _noiseWarning;
private: private:
WebRtc_UWord32 _instanceId; int _instanceId;
bool _mixFileWithMicrophone; bool _mixFileWithMicrophone;
WebRtc_UWord32 _captureLevel; WebRtc_UWord32 _captureLevel;
bool _externalMedia; bool _externalMedia;
VoEMediaProcess* _externalMediaCallbackPtr; VoEMediaProcess* _externalMediaCallbackPtr;
bool _mute; bool _mute;
WebRtc_Word32 _remainingMuteMicTimeMs; WebRtc_Word32 _remainingMuteMicTimeMs;
WebRtc_UWord32 _mixingFrequency; int _mixingFrequency;
bool _includeAudioLevelIndication; bool _includeAudioLevelIndication;
WebRtc_UWord8 _audioLevel_dBov; WebRtc_UWord8 _audioLevel_dBov;
}; };

View File

@ -282,7 +282,8 @@ WebRtc_Word32 VoEBaseImpl::NeedMorePlayData(
_outputMixerPtr->GetMixedAudio(samplesPerSec, nChannels, audioFrame); _outputMixerPtr->GetMixedAudio(samplesPerSec, nChannels, audioFrame);
assert(nSamples == audioFrame._payloadDataLengthInSamples); assert(nSamples == audioFrame._payloadDataLengthInSamples);
assert(samplesPerSec == audioFrame._frequencyInHz); assert(samplesPerSec ==
static_cast<WebRtc_UWord32>(audioFrame._frequencyInHz));
// Deliver audio (PCM) samples to the ADM // Deliver audio (PCM) samples to the ADM
memcpy( memcpy(
@ -585,7 +586,6 @@ int VoEBaseImpl::Init()
} }
bool available(false); bool available(false);
WebRtc_Word32 ret(0);
// -------------------- // --------------------
// Reinitialize the ADM // Reinitialize the ADM

View File

@ -85,8 +85,6 @@ int VoECallReportImpl::ResetCallReportStatistics(int channel)
} }
assert(_audioProcessingModulePtr != NULL); assert(_audioProcessingModulePtr != NULL);
int res1(0);
int res2(0);
bool levelMode = bool levelMode =
_audioProcessingModulePtr->level_estimator()->is_enabled(); _audioProcessingModulePtr->level_estimator()->is_enabled();
bool echoMode = bool echoMode =