| Index: webrtc/media/engine/webrtcvoiceengine.cc
|
| diff --git a/webrtc/media/engine/webrtcvoiceengine.cc b/webrtc/media/engine/webrtcvoiceengine.cc
|
| index 996bc5accc482f459b86a61bd55125a02799d87a..ae4867883acd97c5c474efe85b60d8c6edae9dc7 100644
|
| --- a/webrtc/media/engine/webrtcvoiceengine.cc
|
| +++ b/webrtc/media/engine/webrtcvoiceengine.cc
|
| @@ -962,11 +962,12 @@ void WebRtcVoiceEngine::SetDefaultDevices() {
|
| #endif // !WEBRTC_IOS
|
| }
|
|
|
| +// TODO(solenberg): Remove, once AudioMonitor is gone.
|
| int WebRtcVoiceEngine::GetInputLevel() {
|
| RTC_DCHECK(worker_thread_checker_.CalledOnValidThread());
|
| - unsigned int ulevel;
|
| - return (voe_wrapper_->volume()->GetSpeechInputLevel(ulevel) != -1) ?
|
| - static_cast<int>(ulevel) : -1;
|
| + int8_t level = transmit_mixer()->AudioLevel();
|
| + RTC_DCHECK_LE(0, level);
|
| + return level;
|
| }
|
|
|
| const std::vector<AudioCodec>& WebRtcVoiceEngine::send_codecs() const {
|
| @@ -1577,6 +1578,12 @@ class WebRtcVoiceMediaChannel::WebRtcAudioReceiveStream {
|
| return stream_->GetStats();
|
| }
|
|
|
| + int GetOutputLevel() const {
|
| + RTC_DCHECK(worker_thread_checker_.CalledOnValidThread());
|
| + RTC_DCHECK(stream_);
|
| + return stream_->GetOutputLevel();
|
| + }
|
| +
|
| int channel() const {
|
| RTC_DCHECK(worker_thread_checker_.CalledOnValidThread());
|
| return config_.voe_channel_id;
|
| @@ -2341,12 +2348,13 @@ bool WebRtcVoiceMediaChannel::SetLocalSource(uint32_t ssrc,
|
| return true;
|
| }
|
|
|
| +// TODO(solenberg): Remove, once AudioMonitor is gone.
|
| bool WebRtcVoiceMediaChannel::GetActiveStreams(
|
| AudioInfo::StreamList* actives) {
|
| RTC_DCHECK(worker_thread_checker_.CalledOnValidThread());
|
| actives->clear();
|
| for (const auto& ch : recv_streams_) {
|
| - int level = GetOutputLevel(ch.second->channel());
|
| + int level = ch.second->GetOutputLevel();
|
| if (level > 0) {
|
| actives->push_back(std::make_pair(ch.first, level));
|
| }
|
| @@ -2354,11 +2362,12 @@ bool WebRtcVoiceMediaChannel::GetActiveStreams(
|
| return true;
|
| }
|
|
|
| +// TODO(solenberg): Remove, once AudioMonitor is gone.
|
| int WebRtcVoiceMediaChannel::GetOutputLevel() {
|
| RTC_DCHECK(worker_thread_checker_.CalledOnValidThread());
|
| int highest = 0;
|
| for (const auto& ch : recv_streams_) {
|
| - highest = std::max(GetOutputLevel(ch.second->channel()), highest);
|
| + highest = std::max(ch.second->GetOutputLevel(), highest);
|
| }
|
| return highest;
|
| }
|
| @@ -2657,12 +2666,6 @@ void WebRtcVoiceMediaChannel::SetRawAudioSink(
|
| it->second->SetRawAudioSink(std::move(sink));
|
| }
|
|
|
| -int WebRtcVoiceMediaChannel::GetOutputLevel(int channel) {
|
| - unsigned int ulevel = 0;
|
| - int ret = engine()->voe()->volume()->GetSpeechOutputLevel(channel, ulevel);
|
| - return (ret == 0) ? static_cast<int>(ulevel) : -1;
|
| -}
|
| -
|
| int WebRtcVoiceMediaChannel::GetReceiveChannelId(uint32_t ssrc) const {
|
| RTC_DCHECK(worker_thread_checker_.CalledOnValidThread());
|
| const auto it = recv_streams_.find(ssrc);
|
|
|