| Index: talk/media/webrtc/webrtcvoiceengine.cc
|
| diff --git a/talk/media/webrtc/webrtcvoiceengine.cc b/talk/media/webrtc/webrtcvoiceengine.cc
|
| index d0eb4aea24b881f609005d8a7eaa1196fd839288..e3a17c505a4934d4021e1ab2228e88e6a2f12bc9 100644
|
| --- a/talk/media/webrtc/webrtcvoiceengine.cc
|
| +++ b/talk/media/webrtc/webrtcvoiceengine.cc
|
| @@ -864,7 +864,7 @@ bool WebRtcVoiceEngine::ApplyOptions(const AudioOptions& options_in) {
|
| audioproc->SetExtraOptions(config);
|
| }
|
|
|
| - uint32 recording_sample_rate;
|
| + uint32_t recording_sample_rate;
|
| if (options.recording_sample_rate.Get(&recording_sample_rate)) {
|
| LOG(LS_INFO) << "Recording sample rate is " << recording_sample_rate;
|
| if (voe_wrapper_->hw()->SetRecordingSampleRate(recording_sample_rate)) {
|
| @@ -872,7 +872,7 @@ bool WebRtcVoiceEngine::ApplyOptions(const AudioOptions& options_in) {
|
| }
|
| }
|
|
|
| - uint32 playout_sample_rate;
|
| + uint32_t playout_sample_rate;
|
| if (options.playout_sample_rate.Get(&playout_sample_rate)) {
|
| LOG(LS_INFO) << "Playout sample rate is " << playout_sample_rate;
|
| if (voe_wrapper_->hw()->SetPlayoutSampleRate(playout_sample_rate)) {
|
| @@ -1298,7 +1298,7 @@ void WebRtcVoiceEngine::Print(webrtc::TraceLevel level, const char* trace,
|
| void WebRtcVoiceEngine::CallbackOnError(int channel_num, int err_code) {
|
| rtc::CritScope lock(&channels_cs_);
|
| WebRtcVoiceMediaChannel* channel = NULL;
|
| - uint32 ssrc = 0;
|
| + uint32_t ssrc = 0;
|
| LOG(LS_WARNING) << "VoiceEngine error " << err_code << " reported on channel "
|
| << channel_num << ".";
|
| if (FindChannelAndSsrc(channel_num, &channel, &ssrc)) {
|
| @@ -1310,8 +1310,9 @@ void WebRtcVoiceEngine::CallbackOnError(int channel_num, int err_code) {
|
| }
|
| }
|
|
|
| -bool WebRtcVoiceEngine::FindChannelAndSsrc(
|
| - int channel_num, WebRtcVoiceMediaChannel** channel, uint32* ssrc) const {
|
| +bool WebRtcVoiceEngine::FindChannelAndSsrc(int channel_num,
|
| + WebRtcVoiceMediaChannel** channel,
|
| + uint32_t* ssrc) const {
|
| RTC_DCHECK(channel != NULL && ssrc != NULL);
|
|
|
| *channel = NULL;
|
| @@ -1331,7 +1332,9 @@ bool WebRtcVoiceEngine::FindChannelAndSsrc(
|
| // This method will search through the WebRtcVoiceMediaChannels and
|
| // obtain the voice engine's channel number.
|
| bool WebRtcVoiceEngine::FindChannelNumFromSsrc(
|
| - uint32 ssrc, MediaProcessorDirection direction, int* channel_num) {
|
| + uint32_t ssrc,
|
| + MediaProcessorDirection direction,
|
| + int* channel_num) {
|
| RTC_DCHECK(channel_num != NULL);
|
| RTC_DCHECK(direction == MPD_RX || direction == MPD_TX);
|
|
|
| @@ -1421,14 +1424,13 @@ bool WebRtcVoiceEngine::StartAecDump(rtc::PlatformFile file) {
|
| return true;
|
| }
|
|
|
| -bool WebRtcVoiceEngine::RegisterProcessor(
|
| - uint32 ssrc,
|
| - VoiceProcessor* voice_processor,
|
| - MediaProcessorDirection direction) {
|
| +bool WebRtcVoiceEngine::RegisterProcessor(uint32_t ssrc,
|
| + VoiceProcessor* voice_processor,
|
| + MediaProcessorDirection direction) {
|
| bool register_with_webrtc = false;
|
| int channel_id = -1;
|
| bool success = false;
|
| - uint32* processor_ssrc = NULL;
|
| + uint32_t* processor_ssrc = NULL;
|
| bool found_channel = FindChannelNumFromSsrc(ssrc, direction, &channel_id);
|
| if (voice_processor == NULL || !found_channel) {
|
| LOG(LS_WARNING) << "Media Processing Registration Failed. ssrc: " << ssrc
|
| @@ -1484,13 +1486,13 @@ bool WebRtcVoiceEngine::RegisterProcessor(
|
|
|
| bool WebRtcVoiceEngine::UnregisterProcessorChannel(
|
| MediaProcessorDirection channel_direction,
|
| - uint32 ssrc,
|
| + uint32_t ssrc,
|
| VoiceProcessor* voice_processor,
|
| MediaProcessorDirection processor_direction) {
|
| bool success = true;
|
| FrameSignal* signal;
|
| webrtc::ProcessingTypes processing_type;
|
| - uint32* processor_ssrc = NULL;
|
| + uint32_t* processor_ssrc = NULL;
|
| if (channel_direction == MPD_RX) {
|
| signal = &SignalRxMediaFrame;
|
| processing_type = webrtc::kPlaybackAllChannelsMixed;
|
| @@ -1532,10 +1534,9 @@ bool WebRtcVoiceEngine::UnregisterProcessorChannel(
|
| return success;
|
| }
|
|
|
| -bool WebRtcVoiceEngine::UnregisterProcessor(
|
| - uint32 ssrc,
|
| - VoiceProcessor* voice_processor,
|
| - MediaProcessorDirection direction) {
|
| +bool WebRtcVoiceEngine::UnregisterProcessor(uint32_t ssrc,
|
| + VoiceProcessor* voice_processor,
|
| + MediaProcessorDirection direction) {
|
| bool success = true;
|
| if (voice_processor == NULL) {
|
| LOG(LS_WARNING) << "Media Processing Deregistration Failed. ssrc: "
|
| @@ -2375,7 +2376,8 @@ bool WebRtcVoiceMediaChannel::ChangeSend(int channel, SendFlags send) {
|
| return true;
|
| }
|
|
|
| -bool WebRtcVoiceMediaChannel::SetAudioSend(uint32 ssrc, bool mute,
|
| +bool WebRtcVoiceMediaChannel::SetAudioSend(uint32_t ssrc,
|
| + bool mute,
|
| const AudioOptions* options,
|
| AudioRenderer* renderer) {
|
| // TODO(solenberg): The state change should be fully rolled back if any one of
|
| @@ -2497,7 +2499,7 @@ bool WebRtcVoiceMediaChannel::AddSendStream(const StreamParams& sp) {
|
| return ChangeSend(channel, desired_send_);
|
| }
|
|
|
| -bool WebRtcVoiceMediaChannel::RemoveSendStream(uint32 ssrc) {
|
| +bool WebRtcVoiceMediaChannel::RemoveSendStream(uint32_t ssrc) {
|
| ChannelMap::iterator it = send_channels_.find(ssrc);
|
| if (it == send_channels_.end()) {
|
| LOG(LS_WARNING) << "Try to remove stream with ssrc " << ssrc
|
| @@ -2537,7 +2539,7 @@ bool WebRtcVoiceMediaChannel::AddRecvStream(const StreamParams& sp) {
|
|
|
| if (!VERIFY(sp.ssrcs.size() == 1))
|
| return false;
|
| - uint32 ssrc = sp.first_ssrc();
|
| + uint32_t ssrc = sp.first_ssrc();
|
|
|
| if (ssrc == 0) {
|
| LOG(LS_WARNING) << "AddRecvStream with 0 ssrc is not supported.";
|
| @@ -2661,7 +2663,7 @@ bool WebRtcVoiceMediaChannel::ConfigureRecvChannel(int channel) {
|
| return SetPlayout(channel, playout_);
|
| }
|
|
|
| -bool WebRtcVoiceMediaChannel::RemoveRecvStream(uint32 ssrc) {
|
| +bool WebRtcVoiceMediaChannel::RemoveRecvStream(uint32_t ssrc) {
|
| RTC_DCHECK(thread_checker_.CalledOnValidThread());
|
| rtc::CritScope lock(&receive_channels_cs_);
|
| ChannelMap::iterator it = receive_channels_.find(ssrc);
|
| @@ -2719,7 +2721,7 @@ bool WebRtcVoiceMediaChannel::RemoveRecvStream(uint32 ssrc) {
|
| return true;
|
| }
|
|
|
| -bool WebRtcVoiceMediaChannel::SetRemoteRenderer(uint32 ssrc,
|
| +bool WebRtcVoiceMediaChannel::SetRemoteRenderer(uint32_t ssrc,
|
| AudioRenderer* renderer) {
|
| ChannelMap::iterator it = receive_channels_.find(ssrc);
|
| if (it == receive_channels_.end()) {
|
| @@ -2741,7 +2743,7 @@ bool WebRtcVoiceMediaChannel::SetRemoteRenderer(uint32 ssrc,
|
| return true;
|
| }
|
|
|
| -bool WebRtcVoiceMediaChannel::SetLocalRenderer(uint32 ssrc,
|
| +bool WebRtcVoiceMediaChannel::SetLocalRenderer(uint32_t ssrc,
|
| AudioRenderer* renderer) {
|
| ChannelMap::iterator it = send_channels_.find(ssrc);
|
| if (it == send_channels_.end()) {
|
| @@ -2812,8 +2814,9 @@ void WebRtcVoiceMediaChannel::SetTypingDetectionParameters(int time_window,
|
| }
|
| }
|
|
|
| -bool WebRtcVoiceMediaChannel::SetOutputScaling(
|
| - uint32 ssrc, double left, double right) {
|
| +bool WebRtcVoiceMediaChannel::SetOutputScaling(uint32_t ssrc,
|
| + double left,
|
| + double right) {
|
| rtc::CritScope lock(&receive_channels_cs_);
|
| // Collect the channels to scale the output volume.
|
| std::vector<int> channels;
|
| @@ -2865,8 +2868,9 @@ bool WebRtcVoiceMediaChannel::SetRingbackTone(const char *buf, int len) {
|
| return true;
|
| }
|
|
|
| -bool WebRtcVoiceMediaChannel::PlayRingbackTone(uint32 ssrc,
|
| - bool play, bool loop) {
|
| +bool WebRtcVoiceMediaChannel::PlayRingbackTone(uint32_t ssrc,
|
| + bool play,
|
| + bool loop) {
|
| if (!ringback_tone_) {
|
| return false;
|
| }
|
| @@ -2911,8 +2915,10 @@ bool WebRtcVoiceMediaChannel::CanInsertDtmf() {
|
| return dtmf_allowed_;
|
| }
|
|
|
| -bool WebRtcVoiceMediaChannel::InsertDtmf(uint32 ssrc, int event,
|
| - int duration, int flags) {
|
| +bool WebRtcVoiceMediaChannel::InsertDtmf(uint32_t ssrc,
|
| + int event,
|
| + int duration,
|
| + int flags) {
|
| if (!dtmf_allowed_) {
|
| return false;
|
| }
|
| @@ -3052,7 +3058,7 @@ void WebRtcVoiceMediaChannel::OnRtcpReceived(
|
| }
|
| }
|
|
|
| -bool WebRtcVoiceMediaChannel::MuteStream(uint32 ssrc, bool muted) {
|
| +bool WebRtcVoiceMediaChannel::MuteStream(uint32_t ssrc, bool muted) {
|
| int channel = (ssrc == 0) ? voe_channel() : GetSendChannelNum(ssrc);
|
| if (channel == -1) {
|
| LOG(LS_WARNING) << "The specified ssrc " << ssrc << " is not in use.";
|
| @@ -3324,14 +3330,15 @@ bool WebRtcVoiceMediaChannel::GetStats(VoiceMediaInfo* info) {
|
| }
|
|
|
| void WebRtcVoiceMediaChannel::GetLastMediaError(
|
| - uint32* ssrc, VoiceMediaChannel::Error* error) {
|
| + uint32_t* ssrc,
|
| + VoiceMediaChannel::Error* error) {
|
| RTC_DCHECK(ssrc != NULL);
|
| RTC_DCHECK(error != NULL);
|
| FindSsrc(voe_channel(), ssrc);
|
| *error = WebRtcErrorToChannelError(GetLastEngineError());
|
| }
|
|
|
| -bool WebRtcVoiceMediaChannel::FindSsrc(int channel_num, uint32* ssrc) {
|
| +bool WebRtcVoiceMediaChannel::FindSsrc(int channel_num, uint32_t* ssrc) {
|
| rtc::CritScope lock(&receive_channels_cs_);
|
| RTC_DCHECK(ssrc != NULL);
|
| if (channel_num == -1 && send_ != SEND_NOTHING) {
|
| @@ -3346,7 +3353,7 @@ bool WebRtcVoiceMediaChannel::FindSsrc(int channel_num, uint32* ssrc) {
|
| for (const auto& ch : send_channels_) {
|
| if (ch.second->channel() == channel_num) {
|
| // This is a sending channel.
|
| - uint32 local_ssrc = 0;
|
| + uint32_t local_ssrc = 0;
|
| if (engine()->voe()->rtp()->GetLocalSSRC(
|
| channel_num, local_ssrc) != -1) {
|
| *ssrc = local_ssrc;
|
| @@ -3366,7 +3373,7 @@ bool WebRtcVoiceMediaChannel::FindSsrc(int channel_num, uint32* ssrc) {
|
| return false;
|
| }
|
|
|
| -void WebRtcVoiceMediaChannel::OnError(uint32 ssrc, int error) {
|
| +void WebRtcVoiceMediaChannel::OnError(uint32_t ssrc, int error) {
|
| if (error == VE_TYPING_NOISE_WARNING) {
|
| typing_noise_detected_ = true;
|
| } else if (error == VE_TYPING_NOISE_OFF_WARNING) {
|
| @@ -3382,14 +3389,14 @@ int WebRtcVoiceMediaChannel::GetOutputLevel(int channel) {
|
| return (ret == 0) ? static_cast<int>(ulevel) : -1;
|
| }
|
|
|
| -int WebRtcVoiceMediaChannel::GetReceiveChannelNum(uint32 ssrc) const {
|
| +int WebRtcVoiceMediaChannel::GetReceiveChannelNum(uint32_t ssrc) const {
|
| ChannelMap::const_iterator it = receive_channels_.find(ssrc);
|
| if (it != receive_channels_.end())
|
| return it->second->channel();
|
| return (ssrc == default_receive_ssrc_) ? voe_channel() : -1;
|
| }
|
|
|
| -int WebRtcVoiceMediaChannel::GetSendChannelNum(uint32 ssrc) const {
|
| +int WebRtcVoiceMediaChannel::GetSendChannelNum(uint32_t ssrc) const {
|
| ChannelMap::const_iterator it = send_channels_.find(ssrc);
|
| if (it != send_channels_.end())
|
| return it->second->channel();
|
| @@ -3483,10 +3490,11 @@ bool WebRtcVoiceMediaChannel::SetPlayout(int channel, bool playout) {
|
| return true;
|
| }
|
|
|
| -uint32 WebRtcVoiceMediaChannel::ParseSsrc(const void* data, size_t len,
|
| - bool rtcp) {
|
| +uint32_t WebRtcVoiceMediaChannel::ParseSsrc(const void* data,
|
| + size_t len,
|
| + bool rtcp) {
|
| size_t ssrc_pos = (!rtcp) ? 8 : 4;
|
| - uint32 ssrc = 0;
|
| + uint32_t ssrc = 0;
|
| if (len >= (ssrc_pos + sizeof(ssrc))) {
|
| ssrc = rtc::GetBE32(static_cast<const char*>(data) + ssrc_pos);
|
| }
|
| @@ -3553,7 +3561,7 @@ void WebRtcVoiceMediaChannel::RecreateAudioReceiveStreams() {
|
| }
|
| }
|
|
|
| -void WebRtcVoiceMediaChannel::AddAudioReceiveStream(uint32 ssrc) {
|
| +void WebRtcVoiceMediaChannel::AddAudioReceiveStream(uint32_t ssrc) {
|
| RTC_DCHECK(thread_checker_.CalledOnValidThread());
|
| WebRtcVoiceChannelRenderer* channel = receive_channels_[ssrc];
|
| RTC_DCHECK(channel != nullptr);
|
| @@ -3570,7 +3578,7 @@ void WebRtcVoiceMediaChannel::AddAudioReceiveStream(uint32 ssrc) {
|
| receive_streams_.insert(std::make_pair(ssrc, s));
|
| }
|
|
|
| -void WebRtcVoiceMediaChannel::RemoveAudioReceiveStream(uint32 ssrc) {
|
| +void WebRtcVoiceMediaChannel::RemoveAudioReceiveStream(uint32_t ssrc) {
|
| RTC_DCHECK(thread_checker_.CalledOnValidThread());
|
| auto stream_it = receive_streams_.find(ssrc);
|
| if (stream_it != receive_streams_.end()) {
|
|
|