OLD | NEW |
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 1215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1226 return false; | 1226 return false; |
1227 return webrtc::GetTrackIdBySsrc(base_remote_description(), ssrc, track_id); | 1227 return webrtc::GetTrackIdBySsrc(base_remote_description(), ssrc, track_id); |
1228 } | 1228 } |
1229 | 1229 |
1230 std::string WebRtcSession::BadStateErrMsg(State state) { | 1230 std::string WebRtcSession::BadStateErrMsg(State state) { |
1231 std::ostringstream desc; | 1231 std::ostringstream desc; |
1232 desc << "Called in wrong state: " << GetStateString(state); | 1232 desc << "Called in wrong state: " << GetStateString(state); |
1233 return desc.str(); | 1233 return desc.str(); |
1234 } | 1234 } |
1235 | 1235 |
1236 void WebRtcSession::SetAudioPlayout(uint32_t ssrc, | 1236 void WebRtcSession::SetAudioPlayout(uint32_t ssrc, bool enable) { |
1237 bool enable, | |
1238 cricket::AudioRenderer* renderer) { | |
1239 ASSERT(signaling_thread()->IsCurrent()); | 1237 ASSERT(signaling_thread()->IsCurrent()); |
1240 if (!voice_channel_) { | 1238 if (!voice_channel_) { |
1241 LOG(LS_ERROR) << "SetAudioPlayout: No audio channel exists."; | 1239 LOG(LS_ERROR) << "SetAudioPlayout: No audio channel exists."; |
1242 return; | 1240 return; |
1243 } | 1241 } |
1244 if (!voice_channel_->SetRemoteRenderer(ssrc, renderer)) { | |
1245 // SetRenderer() can fail if the ssrc does not match any playout channel. | |
1246 LOG(LS_ERROR) << "SetAudioPlayout: ssrc is incorrect: " << ssrc; | |
1247 return; | |
1248 } | |
1249 if (!voice_channel_->SetOutputVolume(ssrc, enable ? 1 : 0)) { | 1242 if (!voice_channel_->SetOutputVolume(ssrc, enable ? 1 : 0)) { |
1250 // Allow that SetOutputVolume fail if |enable| is false but assert | 1243 // Allow that SetOutputVolume fail if |enable| is false but assert |
1251 // otherwise. This in the normal case when the underlying media channel has | 1244 // otherwise. This in the normal case when the underlying media channel has |
1252 // already been deleted. | 1245 // already been deleted. |
1253 ASSERT(enable == false); | 1246 ASSERT(enable == false); |
1254 } | 1247 } |
1255 } | 1248 } |
1256 | 1249 |
1257 void WebRtcSession::SetAudioSend(uint32_t ssrc, | 1250 void WebRtcSession::SetAudioSend(uint32_t ssrc, |
1258 bool enable, | 1251 bool enable, |
(...skipping 920 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2179 if (!srtp_cipher.empty()) { | 2172 if (!srtp_cipher.empty()) { |
2180 metrics_observer_->IncrementSparseEnumCounter( | 2173 metrics_observer_->IncrementSparseEnumCounter( |
2181 srtp_counter_type, rtc::GetSrtpCryptoSuiteFromName(srtp_cipher)); | 2174 srtp_counter_type, rtc::GetSrtpCryptoSuiteFromName(srtp_cipher)); |
2182 } | 2175 } |
2183 if (ssl_cipher) { | 2176 if (ssl_cipher) { |
2184 metrics_observer_->IncrementSparseEnumCounter(ssl_counter_type, ssl_cipher); | 2177 metrics_observer_->IncrementSparseEnumCounter(ssl_counter_type, ssl_cipher); |
2185 } | 2178 } |
2186 } | 2179 } |
2187 | 2180 |
2188 } // namespace webrtc | 2181 } // namespace webrtc |
OLD | NEW |