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

Side by Side Diff: talk/app/webrtc/webrtcsession.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 unified diff | Download patch
« no previous file with comments | « no previous file | talk/app/webrtc/webrtcsession_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * libjingle 2 * libjingle
3 * Copyright 2012 Google Inc. 3 * Copyright 2012 Google Inc.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met: 6 * modification, are permitted provided that the following conditions are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright notice, 8 * 1. Redistributions of source code must retain the above copyright notice,
9 * this list of conditions and the following disclaimer. 9 * this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright notice, 10 * 2. Redistributions in binary form must reproduce the above copyright notice,
(...skipping 1228 matching lines...) Expand 10 before | Expand all | Expand 10 after
1239 ASSERT(signaling_thread()->IsCurrent()); 1239 ASSERT(signaling_thread()->IsCurrent());
1240 if (!voice_channel_) { 1240 if (!voice_channel_) {
1241 LOG(LS_ERROR) << "SetAudioPlayout: No audio channel exists."; 1241 LOG(LS_ERROR) << "SetAudioPlayout: No audio channel exists.";
1242 return; 1242 return;
1243 } 1243 }
1244 if (!voice_channel_->SetRemoteRenderer(ssrc, renderer)) { 1244 if (!voice_channel_->SetRemoteRenderer(ssrc, renderer)) {
1245 // SetRenderer() can fail if the ssrc does not match any playout channel. 1245 // SetRenderer() can fail if the ssrc does not match any playout channel.
1246 LOG(LS_ERROR) << "SetAudioPlayout: ssrc is incorrect: " << ssrc; 1246 LOG(LS_ERROR) << "SetAudioPlayout: ssrc is incorrect: " << ssrc;
1247 return; 1247 return;
1248 } 1248 }
1249 if (!voice_channel_->SetOutputScaling(ssrc, enable ? 1 : 0, enable ? 1 : 0)) { 1249 if (!voice_channel_->SetOutputVolume(ssrc, enable ? 1 : 0)) {
1250 // Allow that SetOutputScaling fail if |enable| is false but assert 1250 // Allow that SetOutputVolume fail if |enable| is false but assert
1251 // otherwise. This in the normal case when the underlying media channel has 1251 // otherwise. This in the normal case when the underlying media channel has
1252 // already been deleted. 1252 // already been deleted.
1253 ASSERT(enable == false); 1253 ASSERT(enable == false);
1254 } 1254 }
1255 } 1255 }
1256 1256
1257 void WebRtcSession::SetAudioSend(uint32_t ssrc, 1257 void WebRtcSession::SetAudioSend(uint32_t ssrc,
1258 bool enable, 1258 bool enable,
1259 const cricket::AudioOptions& options, 1259 const cricket::AudioOptions& options,
1260 cricket::AudioRenderer* renderer) { 1260 cricket::AudioRenderer* renderer) {
1261 ASSERT(signaling_thread()->IsCurrent()); 1261 ASSERT(signaling_thread()->IsCurrent());
1262 if (!voice_channel_) { 1262 if (!voice_channel_) {
1263 LOG(LS_ERROR) << "SetAudioSend: No audio channel exists."; 1263 LOG(LS_ERROR) << "SetAudioSend: No audio channel exists.";
1264 return; 1264 return;
1265 } 1265 }
1266 if (!voice_channel_->SetAudioSend(ssrc, enable, &options, renderer)) { 1266 if (!voice_channel_->SetAudioSend(ssrc, enable, &options, renderer)) {
1267 LOG(LS_ERROR) << "SetAudioSend: ssrc is incorrect: " << ssrc; 1267 LOG(LS_ERROR) << "SetAudioSend: ssrc is incorrect: " << ssrc;
1268 } 1268 }
1269 } 1269 }
1270 1270
1271 void WebRtcSession::SetAudioPlayoutVolume(uint32_t ssrc, double volume) { 1271 void WebRtcSession::SetAudioPlayoutVolume(uint32_t ssrc, double volume) {
1272 ASSERT(signaling_thread()->IsCurrent()); 1272 ASSERT(signaling_thread()->IsCurrent());
1273 ASSERT(volume >= 0 && volume <= 10); 1273 ASSERT(volume >= 0 && volume <= 10);
1274 if (!voice_channel_) { 1274 if (!voice_channel_) {
1275 LOG(LS_ERROR) << "SetAudioPlayoutVolume: No audio channel exists."; 1275 LOG(LS_ERROR) << "SetAudioPlayoutVolume: No audio channel exists.";
1276 return; 1276 return;
1277 } 1277 }
1278 1278
1279 if (!voice_channel_->SetOutputScaling(ssrc, volume, volume)) { 1279 if (!voice_channel_->SetOutputVolume(ssrc, volume)) {
1280 ASSERT(false); 1280 ASSERT(false);
1281 } 1281 }
1282 } 1282 }
1283 1283
1284 bool WebRtcSession::SetCaptureDevice(uint32_t ssrc, 1284 bool WebRtcSession::SetCaptureDevice(uint32_t ssrc,
1285 cricket::VideoCapturer* camera) { 1285 cricket::VideoCapturer* camera) {
1286 ASSERT(signaling_thread()->IsCurrent()); 1286 ASSERT(signaling_thread()->IsCurrent());
1287 1287
1288 if (!video_channel_) { 1288 if (!video_channel_) {
1289 // |video_channel_| doesnt't exist. Probably because the remote end doesnt't 1289 // |video_channel_| doesnt't exist. Probably because the remote end doesnt't
(...skipping 889 matching lines...) Expand 10 before | Expand all | Expand 10 after
2179 if (!srtp_cipher.empty()) { 2179 if (!srtp_cipher.empty()) {
2180 metrics_observer_->IncrementSparseEnumCounter( 2180 metrics_observer_->IncrementSparseEnumCounter(
2181 srtp_counter_type, rtc::GetSrtpCryptoSuiteFromName(srtp_cipher)); 2181 srtp_counter_type, rtc::GetSrtpCryptoSuiteFromName(srtp_cipher));
2182 } 2182 }
2183 if (ssl_cipher) { 2183 if (ssl_cipher) {
2184 metrics_observer_->IncrementSparseEnumCounter(ssl_counter_type, ssl_cipher); 2184 metrics_observer_->IncrementSparseEnumCounter(ssl_counter_type, ssl_cipher);
2185 } 2185 }
2186 } 2186 }
2187 2187
2188 } // namespace webrtc 2188 } // namespace webrtc
OLDNEW
« no previous file with comments | « no previous file | talk/app/webrtc/webrtcsession_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698