Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1409)

Unified Diff: talk/media/webrtc/webrtcvoiceengine.cc

Issue 1397773002: Change SetOutputScaling to set a single level, not left/right levels. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: rebase+rename Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « talk/media/webrtc/webrtcvoiceengine.h ('k') | talk/media/webrtc/webrtcvoiceengine_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: talk/media/webrtc/webrtcvoiceengine.cc
diff --git a/talk/media/webrtc/webrtcvoiceengine.cc b/talk/media/webrtc/webrtcvoiceengine.cc
index 54fac221d8fb7d6d829f606e8ab5f9897dc2469a..a370a7fce4b90734a49026c4f5d3ffa1116d0742 100644
--- a/talk/media/webrtc/webrtcvoiceengine.cc
+++ b/talk/media/webrtc/webrtcvoiceengine.cc
@@ -2514,9 +2514,7 @@ void WebRtcVoiceMediaChannel::SetTypingDetectionParameters(int time_window,
}
}
-bool WebRtcVoiceMediaChannel::SetOutputScaling(uint32_t ssrc,
- double left,
- double right) {
+bool WebRtcVoiceMediaChannel::SetOutputVolume(uint32_t ssrc, double volume) {
RTC_DCHECK(thread_checker_.CalledOnValidThread());
rtc::CritScope lock(&receive_channels_cs_);
// Collect the channels to scale the output volume.
@@ -2538,27 +2536,13 @@ bool WebRtcVoiceMediaChannel::SetOutputScaling(uint32_t ssrc,
channels.push_back(channel);
}
- // Scale the output volume for the collected channels. We first normalize to
- // scale the volume and then set the left and right pan.
- float scale = static_cast<float>(std::max(left, right));
- if (scale > 0.0001f) {
- left /= scale;
- right /= scale;
- }
for (int ch_id : channels) {
if (-1 == engine()->voe()->volume()->SetChannelOutputVolumeScaling(
- ch_id, scale)) {
- LOG_RTCERR2(SetChannelOutputVolumeScaling, ch_id, scale);
+ ch_id, volume)) {
+ LOG_RTCERR2(SetChannelOutputVolumeScaling, ch_id, volume);
return false;
}
- if (-1 == engine()->voe()->volume()->SetOutputVolumePan(
- ch_id, static_cast<float>(left), static_cast<float>(right))) {
- LOG_RTCERR3(SetOutputVolumePan, ch_id, left, right);
- // Do not return if fails. SetOutputVolumePan is not available for all
- // pltforms.
- }
- LOG(LS_INFO) << "SetOutputScaling to left=" << left * scale
- << " right=" << right * scale
+ LOG(LS_INFO) << "SetOutputVolume to " << volume
<< " for channel " << ch_id << " and ssrc " << ssrc;
}
return true;
« no previous file with comments | « talk/media/webrtc/webrtcvoiceengine.h ('k') | talk/media/webrtc/webrtcvoiceengine_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698