diff --git a/src/modules/audio_processing/main/source/audio_processing_impl.cc b/src/modules/audio_processing/main/source/audio_processing_impl.cc index 9b4808be8..b1464e12a 100644 --- a/src/modules/audio_processing/main/source/audio_processing_impl.cc +++ b/src/modules/audio_processing/main/source/audio_processing_impl.cc @@ -256,8 +256,7 @@ int AudioProcessingImpl::ProcessStream(AudioFrame* frame) { return kNullPointerError; } - if (frame->_frequencyInHz != - static_cast(sample_rate_hz_)) { + if (frame->_frequencyInHz != sample_rate_hz_) { return kBadSampleRateError; } @@ -382,8 +381,7 @@ int AudioProcessingImpl::AnalyzeReverseStream(AudioFrame* frame) { return kNullPointerError; } - if (frame->_frequencyInHz != - static_cast(sample_rate_hz_)) { + if (frame->_frequencyInHz != sample_rate_hz_) { return kBadSampleRateError; } diff --git a/src/modules/interface/module_common_types.h b/src/modules/interface/module_common_types.h index 1865b0f60..3df370a47 100644 --- a/src/modules/interface/module_common_types.h +++ b/src/modules/interface/module_common_types.h @@ -697,7 +697,7 @@ public: const WebRtc_UWord32 timeStamp, const WebRtc_Word16* payloadData, const WebRtc_UWord16 payloadDataLengthInSamples, - const WebRtc_UWord32 frequencyInHz, + const int frequencyInHz, const SpeechType speechType, const VADActivity vadActivity, const WebRtc_UWord8 audioChannel = 1, @@ -719,7 +719,7 @@ public: // Supporting Stereo, stereo samples are interleaved mutable WebRtc_Word16 _payloadData[kMaxAudioFrameSizeSamples]; WebRtc_UWord16 _payloadDataLengthInSamples; - WebRtc_UWord32 _frequencyInHz; + int _frequencyInHz; WebRtc_UWord8 _audioChannel; SpeechType _speechType; VADActivity _vadActivity; @@ -756,7 +756,7 @@ AudioFrame::UpdateFrame( const WebRtc_UWord32 timeStamp, const WebRtc_Word16* payloadData, const WebRtc_UWord16 payloadDataLengthInSamples, - const WebRtc_UWord32 frequencyInHz, + const int frequencyInHz, const SpeechType speechType, const VADActivity vadActivity, const WebRtc_UWord8 audioChannel, diff --git a/src/modules/rtp_rtcp/interface/rtp_rtcp_defines.h b/src/modules/rtp_rtcp/interface/rtp_rtcp_defines.h index e29a62d5a..28178fca8 100644 --- a/src/modules/rtp_rtcp/interface/rtp_rtcp_defines.h +++ b/src/modules/rtp_rtcp/interface/rtp_rtcp_defines.h @@ -159,7 +159,7 @@ public: virtual WebRtc_Word32 OnInitializeDecoder(const WebRtc_Word32 id, const WebRtc_Word8 payloadType, const WebRtc_Word8 payloadName[RTP_PAYLOAD_NAME_SIZE], - const WebRtc_UWord32 frequency, + const int frequency, const WebRtc_UWord8 channels, const WebRtc_UWord32 rate) = 0; diff --git a/src/video_engine/main/source/vie_channel.cc b/src/video_engine/main/source/vie_channel.cc index 5afcb17d8..9dbb99510 100644 --- a/src/video_engine/main/source/vie_channel.cc +++ b/src/video_engine/main/source/vie_channel.cc @@ -3142,7 +3142,7 @@ void ViEChannel::OnApplicationDataReceived(const WebRtc_Word32 id, WebRtc_Word32 ViEChannel::OnInitializeDecoder( const WebRtc_Word32 id, const WebRtc_Word8 payloadType, 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) { WEBRTC_TRACE(webrtc::kTraceInfo, webrtc::kTraceVideo, ViEId(_engineId, _channelId), diff --git a/src/video_engine/main/source/vie_channel.h b/src/video_engine/main/source/vie_channel.h index a4746b83b..5cce009ba 100644 --- a/src/video_engine/main/source/vie_channel.h +++ b/src/video_engine/main/source/vie_channel.h @@ -193,7 +193,7 @@ public: const WebRtc_Word32 id, const WebRtc_Word8 payloadType, const WebRtc_Word8 payloadName[RTP_PAYLOAD_NAME_SIZE], - const WebRtc_UWord32 frequency, + const int frequency, const WebRtc_UWord8 channels, const WebRtc_UWord32 rate); diff --git a/src/voice_engine/main/source/channel.cc b/src/voice_engine/main/source/channel.cc index 190c2201a..78d552e6a 100644 --- a/src/voice_engine/main/source/channel.cc +++ b/src/voice_engine/main/source/channel.cc @@ -630,7 +630,7 @@ Channel::OnInitializeDecoder( const WebRtc_Word32 id, const WebRtc_Word8 payloadType, const WebRtc_Word8 payloadName[RTP_PAYLOAD_NAME_SIZE], - const WebRtc_UWord32 frequency, + const int frequency, const WebRtc_UWord8 channels, const WebRtc_UWord32 rate) { @@ -5860,7 +5860,7 @@ Channel::Demultiplex(const AudioFrame& audioFrame, } WebRtc_UWord32 -Channel::PrepareEncodeAndSend(WebRtc_UWord32 mixingFrequency) +Channel::PrepareEncodeAndSend(int mixingFrequency) { WEBRTC_TRACE(kTraceStream, kTraceVoice, VoEId(_instanceId,_channelId), "Channel::PrepareEncodeAndSend()"); @@ -6216,7 +6216,7 @@ Channel::GetRtpRtcp(RtpRtcp* &rtpRtcpModule) const } WebRtc_Word32 -Channel::MixOrReplaceAudioWithFile(const WebRtc_UWord32 mixingFrequency) +Channel::MixOrReplaceAudioWithFile(const int mixingFrequency) { WebRtc_Word16 fileBuffer[320]; WebRtc_UWord32 fileSamples(0); @@ -6278,7 +6278,7 @@ Channel::MixOrReplaceAudioWithFile(const WebRtc_UWord32 mixingFrequency) WebRtc_Word32 Channel::MixAudioWithFile(AudioFrame& audioFrame, - const WebRtc_UWord32 mixingFrequency) + const int mixingFrequency) { assert(mixingFrequency <= 32000); diff --git a/src/voice_engine/main/source/channel.h b/src/voice_engine/main/source/channel.h index 95cfd6341..7285c2f70 100644 --- a/src/voice_engine/main/source/channel.h +++ b/src/voice_engine/main/source/channel.h @@ -389,7 +389,7 @@ public: const WebRtc_Word32 id, const WebRtc_Word8 payloadType, const WebRtc_Word8 payloadName[RTP_PAYLOAD_NAME_SIZE], - const WebRtc_UWord32 frequency, + const int frequency, const WebRtc_UWord8 channels, const WebRtc_UWord32 rate); @@ -533,15 +533,15 @@ public: #endif WebRtc_UWord32 Demultiplex(const AudioFrame& audioFrame, const WebRtc_UWord8 audioLevel_dBov); - WebRtc_UWord32 PrepareEncodeAndSend(WebRtc_UWord32 mixingFrequency); + WebRtc_UWord32 PrepareEncodeAndSend(int mixingFrequency); WebRtc_UWord32 EncodeAndSend(); private: int InsertInbandDtmfTone(); WebRtc_Word32 - MixOrReplaceAudioWithFile(const WebRtc_UWord32 mixingFrequency); + MixOrReplaceAudioWithFile(const int mixingFrequency); WebRtc_Word32 MixAudioWithFile(AudioFrame& audioFrame, - const WebRtc_UWord32 mixingFrequency); + const int mixingFrequency); WebRtc_Word32 GetPlayoutTimeStamp(WebRtc_UWord32& playoutTimestamp); void UpdateDeadOrAliveCounters(bool alive); WebRtc_Word32 SendPacketRaw(const void *data, int len, bool RTCP); @@ -576,9 +576,9 @@ private: FilePlayer* _inputFilePlayerPtr; FilePlayer* _outputFilePlayerPtr; FileRecorder* _outputFileRecorderPtr; - WebRtc_UWord32 _inputFilePlayerId; - WebRtc_UWord32 _outputFilePlayerId; - WebRtc_UWord32 _outputFileRecorderId; + int _inputFilePlayerId; + int _outputFilePlayerId; + int _outputFileRecorderId; bool _inputFilePlaying; bool _outputFilePlaying; bool _outputFileRecording; diff --git a/src/voice_engine/main/source/output_mixer.h b/src/voice_engine/main/source/output_mixer.h index 724cdf5b1..7fc1c4e32 100644 --- a/src/voice_engine/main/source/output_mixer.h +++ b/src/voice_engine/main/source/output_mixer.h @@ -142,12 +142,12 @@ private: // owns Resampler _apmResampler; // converts mixed audio to fit APM rate AudioLevel _audioLevel; // measures audio level for the combined signal DtmfInband _dtmfGenerator; - WebRtc_UWord32 _instanceId; + int _instanceId; VoEMediaProcess* _externalMediaCallbackPtr; bool _externalMedia; float _panLeft; float _panRight; - WebRtc_UWord32 _mixingFrequencyHz; + int _mixingFrequencyHz; FileRecorder* _outputFileRecorderPtr; bool _outputFileRecording; }; diff --git a/src/voice_engine/main/source/transmit_mixer.cc b/src/voice_engine/main/source/transmit_mixer.cc index 00c0d0188..570baa53b 100644 --- a/src/voice_engine/main/source/transmit_mixer.cc +++ b/src/voice_engine/main/source/transmit_mixer.cc @@ -314,7 +314,7 @@ TransmitMixer::PrepareDemux(const WebRtc_Word8* audioSamples, totalDelayMS, clockDrift, currentMicLevel); - const WebRtc_UWord32 mixingFrequency = _mixingFrequency; + const int mixingFrequency = _mixingFrequency; ScopedChannel sc(*_channelManagerPtr); void* iterator(NULL); @@ -326,7 +326,7 @@ TransmitMixer::PrepareDemux(const WebRtc_Word8* audioSamples, { CodecInst tmpCdc; channelPtr->GetSendCodec(tmpCdc); - if ((WebRtc_UWord32) tmpCdc.plfreq > _mixingFrequency) + if (tmpCdc.plfreq > _mixingFrequency) _mixingFrequency = tmpCdc.plfreq; } channelPtr = sc.GetNextChannel(iterator); @@ -1151,7 +1151,7 @@ TransmitMixer::GenerateAudioFrame(const WebRtc_Word16 audioSamples[], const WebRtc_UWord32 nSamples, const WebRtc_UWord8 nChannels, const WebRtc_UWord32 samplesPerSec, - const WebRtc_UWord32 mixingFrequency) + const int mixingFrequency) { WEBRTC_TRACE(kTraceStream, kTraceVoice, VoEId(_instanceId, -1), "TransmitMixer::GenerateAudioFrame(nSamples=%u," @@ -1214,12 +1214,11 @@ WebRtc_Word32 TransmitMixer::RecordAudioToFile( } WebRtc_Word32 TransmitMixer::MixOrReplaceAudioWithFile( - const WebRtc_UWord32 mixingFrequency) + const int mixingFrequency) { WebRtc_Word16 fileBuffer[320]; WebRtc_UWord32 fileSamples(0); - WebRtc_Word32 outSamples(0); { CriticalSectionScoped cs(_critSect); @@ -1387,7 +1386,6 @@ int TransmitMixer::TypingDetection() { return (-1); } - bool vad = (_audioFrame._vadActivity == AudioFrame::kVadActive); if (_audioFrame._vadActivity == AudioFrame::kVadActive) _timeActive++; @@ -1423,7 +1421,7 @@ int TransmitMixer::TypingDetection() } #endif -WebRtc_UWord32 TransmitMixer::GetMixingFrequency() +int TransmitMixer::GetMixingFrequency() { assert(_mixingFrequency!=0); return (_mixingFrequency); diff --git a/src/voice_engine/main/source/transmit_mixer.h b/src/voice_engine/main/source/transmit_mixer.h index 871521e9c..b832b8b9c 100644 --- a/src/voice_engine/main/source/transmit_mixer.h +++ b/src/voice_engine/main/source/transmit_mixer.h @@ -81,7 +81,7 @@ public: int DeRegisterExternalMediaProcessing(); - WebRtc_UWord32 GetMixingFrequency(); + int GetMixingFrequency(); // VoEVolumeControl int SetMute(const bool enable); @@ -160,11 +160,11 @@ private: const WebRtc_UWord32 nSamples, const WebRtc_UWord8 nChannels, const WebRtc_UWord32 samplesPerSec, - const WebRtc_UWord32 mixingFrequency); + const int mixingFrequency); WebRtc_Word32 RecordAudioToFile(const WebRtc_UWord32 mixingFrequency); WebRtc_Word32 MixOrReplaceAudioWithFile( - const WebRtc_UWord32 mixingFrequency); + const int mixingFrequency); WebRtc_Word32 APMProcessStream(const WebRtc_UWord16 totalDelayMS, const WebRtc_Word32 clockDrift, @@ -188,9 +188,9 @@ private: // owns FilePlayer* _filePlayerPtr; FileRecorder* _fileRecorderPtr; FileRecorder* _fileCallRecorderPtr; - WebRtc_UWord32 _filePlayerId; - WebRtc_UWord32 _fileRecorderId; - WebRtc_UWord32 _fileCallRecorderId; + int _filePlayerId; + int _fileRecorderId; + int _fileCallRecorderId; bool _filePlaying; bool _fileRecording; bool _fileCallRecording; @@ -208,14 +208,14 @@ private: // owns WebRtc_UWord32 _noiseWarning; private: - WebRtc_UWord32 _instanceId; + int _instanceId; bool _mixFileWithMicrophone; WebRtc_UWord32 _captureLevel; bool _externalMedia; VoEMediaProcess* _externalMediaCallbackPtr; bool _mute; WebRtc_Word32 _remainingMuteMicTimeMs; - WebRtc_UWord32 _mixingFrequency; + int _mixingFrequency; bool _includeAudioLevelIndication; WebRtc_UWord8 _audioLevel_dBov; }; diff --git a/src/voice_engine/main/source/voe_base_impl.cc b/src/voice_engine/main/source/voe_base_impl.cc index 478f0b7c7..a25a3e4ca 100644 --- a/src/voice_engine/main/source/voe_base_impl.cc +++ b/src/voice_engine/main/source/voe_base_impl.cc @@ -282,7 +282,8 @@ WebRtc_Word32 VoEBaseImpl::NeedMorePlayData( _outputMixerPtr->GetMixedAudio(samplesPerSec, nChannels, audioFrame); assert(nSamples == audioFrame._payloadDataLengthInSamples); - assert(samplesPerSec == audioFrame._frequencyInHz); + assert(samplesPerSec == + static_cast(audioFrame._frequencyInHz)); // Deliver audio (PCM) samples to the ADM memcpy( @@ -585,7 +586,6 @@ int VoEBaseImpl::Init() } bool available(false); - WebRtc_Word32 ret(0); // -------------------- // Reinitialize the ADM diff --git a/src/voice_engine/main/source/voe_call_report_impl.cc b/src/voice_engine/main/source/voe_call_report_impl.cc index 20c32e57d..9ae4f320a 100644 --- a/src/voice_engine/main/source/voe_call_report_impl.cc +++ b/src/voice_engine/main/source/voe_call_report_impl.cc @@ -85,8 +85,6 @@ int VoECallReportImpl::ResetCallReportStatistics(int channel) } assert(_audioProcessingModulePtr != NULL); - int res1(0); - int res2(0); bool levelMode = _audioProcessingModulePtr->level_estimator()->is_enabled(); bool echoMode =