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

Side by Side Diff: webrtc/api/webrtcsession.cc

Issue 1741933002: Prevent a voice channel from sending data before a renderer is set. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Adding unit test for the original problem this CL solves. Created 4 years, 9 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
OLDNEW
1 /* 1 /*
2 * Copyright 2012 The WebRTC project authors. All Rights Reserved. 2 * Copyright 2012 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 1196 matching lines...) Expand 10 before | Expand all | Expand 10 after
1207 // Allow that SetOutputVolume fail if |enable| is false but assert 1207 // Allow that SetOutputVolume fail if |enable| is false but assert
1208 // otherwise. This in the normal case when the underlying media channel has 1208 // otherwise. This in the normal case when the underlying media channel has
1209 // already been deleted. 1209 // already been deleted.
1210 ASSERT(enable == false); 1210 ASSERT(enable == false);
1211 } 1211 }
1212 } 1212 }
1213 1213
1214 void WebRtcSession::SetAudioSend(uint32_t ssrc, 1214 void WebRtcSession::SetAudioSend(uint32_t ssrc,
1215 bool enable, 1215 bool enable,
1216 const cricket::AudioOptions& options, 1216 const cricket::AudioOptions& options,
1217 cricket::AudioRenderer* renderer) { 1217 cricket::AudioSource* source) {
1218 ASSERT(signaling_thread()->IsCurrent()); 1218 ASSERT(signaling_thread()->IsCurrent());
1219 if (!voice_channel_) { 1219 if (!voice_channel_) {
1220 LOG(LS_ERROR) << "SetAudioSend: No audio channel exists."; 1220 LOG(LS_ERROR) << "SetAudioSend: No audio channel exists.";
1221 return; 1221 return;
1222 } 1222 }
1223 if (!voice_channel_->SetAudioSend(ssrc, enable, &options, renderer)) { 1223 if (!voice_channel_->SetAudioSend(ssrc, enable, &options, source)) {
1224 LOG(LS_ERROR) << "SetAudioSend: ssrc is incorrect: " << ssrc; 1224 LOG(LS_ERROR) << "SetAudioSend: ssrc is incorrect: " << ssrc;
1225 } 1225 }
1226 } 1226 }
1227 1227
1228 void WebRtcSession::SetAudioPlayoutVolume(uint32_t ssrc, double volume) { 1228 void WebRtcSession::SetAudioPlayoutVolume(uint32_t ssrc, double volume) {
1229 ASSERT(signaling_thread()->IsCurrent()); 1229 ASSERT(signaling_thread()->IsCurrent());
1230 ASSERT(volume >= 0 && volume <= 10); 1230 ASSERT(volume >= 0 && volume <= 10);
1231 if (!voice_channel_) { 1231 if (!voice_channel_) {
1232 LOG(LS_ERROR) << "SetAudioPlayoutVolume: No audio channel exists."; 1232 LOG(LS_ERROR) << "SetAudioPlayoutVolume: No audio channel exists.";
1233 return; 1233 return;
(...skipping 877 matching lines...) Expand 10 before | Expand all | Expand 10 after
2111 } 2111 }
2112 } 2112 }
2113 2113
2114 void WebRtcSession::OnSentPacket_w(cricket::TransportChannel* channel, 2114 void WebRtcSession::OnSentPacket_w(cricket::TransportChannel* channel,
2115 const rtc::SentPacket& sent_packet) { 2115 const rtc::SentPacket& sent_packet) {
2116 RTC_DCHECK(worker_thread()->IsCurrent()); 2116 RTC_DCHECK(worker_thread()->IsCurrent());
2117 media_controller_->call_w()->OnSentPacket(sent_packet); 2117 media_controller_->call_w()->OnSentPacket(sent_packet);
2118 } 2118 }
2119 2119
2120 } // namespace webrtc 2120 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698