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

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: Modifying copyright header to satisfy presubmit bot. 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
« no previous file with comments | « webrtc/api/webrtcsession.h ('k') | webrtc/api/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 * 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 1162 matching lines...) Expand 10 before | Expand all | Expand 10 after
1173 // Allow that SetOutputVolume fail if |enable| is false but assert 1173 // Allow that SetOutputVolume fail if |enable| is false but assert
1174 // otherwise. This in the normal case when the underlying media channel has 1174 // otherwise. This in the normal case when the underlying media channel has
1175 // already been deleted. 1175 // already been deleted.
1176 ASSERT(enable == false); 1176 ASSERT(enable == false);
1177 } 1177 }
1178 } 1178 }
1179 1179
1180 void WebRtcSession::SetAudioSend(uint32_t ssrc, 1180 void WebRtcSession::SetAudioSend(uint32_t ssrc,
1181 bool enable, 1181 bool enable,
1182 const cricket::AudioOptions& options, 1182 const cricket::AudioOptions& options,
1183 cricket::AudioRenderer* renderer) { 1183 cricket::AudioSource* source) {
1184 ASSERT(signaling_thread()->IsCurrent()); 1184 ASSERT(signaling_thread()->IsCurrent());
1185 if (!voice_channel_) { 1185 if (!voice_channel_) {
1186 LOG(LS_ERROR) << "SetAudioSend: No audio channel exists."; 1186 LOG(LS_ERROR) << "SetAudioSend: No audio channel exists.";
1187 return; 1187 return;
1188 } 1188 }
1189 if (!voice_channel_->SetAudioSend(ssrc, enable, &options, renderer)) { 1189 if (!voice_channel_->SetAudioSend(ssrc, enable, &options, source)) {
1190 LOG(LS_ERROR) << "SetAudioSend: ssrc is incorrect: " << ssrc; 1190 LOG(LS_ERROR) << "SetAudioSend: ssrc is incorrect: " << ssrc;
1191 } 1191 }
1192 } 1192 }
1193 1193
1194 void WebRtcSession::SetAudioPlayoutVolume(uint32_t ssrc, double volume) { 1194 void WebRtcSession::SetAudioPlayoutVolume(uint32_t ssrc, double volume) {
1195 ASSERT(signaling_thread()->IsCurrent()); 1195 ASSERT(signaling_thread()->IsCurrent());
1196 ASSERT(volume >= 0 && volume <= 10); 1196 ASSERT(volume >= 0 && volume <= 10);
1197 if (!voice_channel_) { 1197 if (!voice_channel_) {
1198 LOG(LS_ERROR) << "SetAudioPlayoutVolume: No audio channel exists."; 1198 LOG(LS_ERROR) << "SetAudioPlayoutVolume: No audio channel exists.";
1199 return; 1199 return;
(...skipping 877 matching lines...) Expand 10 before | Expand all | Expand 10 after
2077 } 2077 }
2078 } 2078 }
2079 2079
2080 void WebRtcSession::OnSentPacket_w(cricket::TransportChannel* channel, 2080 void WebRtcSession::OnSentPacket_w(cricket::TransportChannel* channel,
2081 const rtc::SentPacket& sent_packet) { 2081 const rtc::SentPacket& sent_packet) {
2082 RTC_DCHECK(worker_thread()->IsCurrent()); 2082 RTC_DCHECK(worker_thread()->IsCurrent());
2083 media_controller_->call_w()->OnSentPacket(sent_packet); 2083 media_controller_->call_w()->OnSentPacket(sent_packet);
2084 } 2084 }
2085 2085
2086 } // namespace webrtc 2086 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/api/webrtcsession.h ('k') | webrtc/api/webrtcsession_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698