Chromium Code Reviews| Index: webrtc/media/engine/webrtcvoiceengine.cc |
| diff --git a/webrtc/media/engine/webrtcvoiceengine.cc b/webrtc/media/engine/webrtcvoiceengine.cc |
| index 9fbfd494ebcef26e8ae589e4ec7a6b1d74dc6b98..d707902d7e29a5bf19826b37909f49ebe82ad881 100644 |
| --- a/webrtc/media/engine/webrtcvoiceengine.cc |
| +++ b/webrtc/media/engine/webrtcvoiceengine.cc |
| @@ -1263,6 +1263,11 @@ class WebRtcVoiceMediaChannel::WebRtcAudioReceiveStream { |
| stream_->SetSink(std::move(sink)); |
| } |
| + void SetOutputVolume(double volume) { |
| + RTC_DCHECK(worker_thread_checker_.CalledOnValidThread()); |
| + stream_->SetGain(volume); |
| + } |
| + |
| private: |
| void RecreateAudioReceiveStream( |
| bool use_transport_cc, |
| @@ -2204,19 +2209,14 @@ bool WebRtcVoiceMediaChannel::SetOutputVolume(uint32_t ssrc, double volume) { |
| } |
| ssrc = static_cast<uint32_t>(default_recv_ssrc_); |
| } |
| - int ch_id = GetReceiveChannelId(ssrc); |
| - if (ch_id < 0) { |
| - LOG(LS_WARNING) << "Cannot find channel for ssrc:" << ssrc; |
| - return false; |
| - } |
| - |
| - if (-1 == engine()->voe()->volume()->SetChannelOutputVolumeScaling(ch_id, |
| - volume)) { |
| - LOG_RTCERR2(SetChannelOutputVolumeScaling, ch_id, volume); |
| + const auto it = recv_streams_.find(ssrc); |
| + if (it == recv_streams_.end()) { |
| + LOG(LS_WARNING) << "SetOutputVolume: no recv stream" << ssrc; |
| return false; |
| } |
| - LOG(LS_INFO) << "SetOutputVolume to " << volume |
| - << " for channel " << ch_id << " and ssrc " << ssrc; |
| + it->second->SetOutputVolume(volume); |
| + LOG(LS_INFO) << "SetOutputVolume() to " << volume |
| + << " for recv channel with ssrc " << ssrc; |
|
kwiberg-webrtc
2016/06/16 09:26:53
"recv stream"?
the sun
2016/06/16 14:34:06
Done.
|
| return true; |
| } |