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

Side by Side Diff: webrtc/pc/channel.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/pc/channel.h ('k') | no next file » | 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 2004 The WebRTC project authors. All Rights Reserved. 2 * Copyright 2004 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 1316 matching lines...) Expand 10 before | Expand all | Expand 10 after
1327 bool VoiceChannel::Init() { 1327 bool VoiceChannel::Init() {
1328 if (!BaseChannel::Init()) { 1328 if (!BaseChannel::Init()) {
1329 return false; 1329 return false;
1330 } 1330 }
1331 return true; 1331 return true;
1332 } 1332 }
1333 1333
1334 bool VoiceChannel::SetAudioSend(uint32_t ssrc, 1334 bool VoiceChannel::SetAudioSend(uint32_t ssrc,
1335 bool enable, 1335 bool enable,
1336 const AudioOptions* options, 1336 const AudioOptions* options,
1337 AudioRenderer* renderer) { 1337 AudioSource* source) {
1338 return InvokeOnWorker(Bind(&VoiceMediaChannel::SetAudioSend, media_channel(), 1338 return InvokeOnWorker(Bind(&VoiceMediaChannel::SetAudioSend, media_channel(),
1339 ssrc, enable, options, renderer)); 1339 ssrc, enable, options, source));
1340 } 1340 }
1341 1341
1342 // TODO(juberti): Handle early media the right way. We should get an explicit 1342 // TODO(juberti): Handle early media the right way. We should get an explicit
1343 // ringing message telling us to start playing local ringback, which we cancel 1343 // ringing message telling us to start playing local ringback, which we cancel
1344 // if any early media actually arrives. For now, we do the opposite, which is 1344 // if any early media actually arrives. For now, we do the opposite, which is
1345 // to wait 1 second for early media, and start playing local ringback if none 1345 // to wait 1 second for early media, and start playing local ringback if none
1346 // arrives. 1346 // arrives.
1347 void VoiceChannel::SetEarlyMedia(bool enable) { 1347 void VoiceChannel::SetEarlyMedia(bool enable) {
1348 if (enable) { 1348 if (enable) {
1349 // Start the early media timeout 1349 // Start the early media timeout
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
1447 1447
1448 void VoiceChannel::ChangeState() { 1448 void VoiceChannel::ChangeState() {
1449 // Render incoming data if we're the active call, and we have the local 1449 // Render incoming data if we're the active call, and we have the local
1450 // content. We receive data on the default channel and multiplexed streams. 1450 // content. We receive data on the default channel and multiplexed streams.
1451 bool recv = IsReadyToReceive(); 1451 bool recv = IsReadyToReceive();
1452 media_channel()->SetPlayout(recv); 1452 media_channel()->SetPlayout(recv);
1453 1453
1454 // Send outgoing data if we're the active call, we have the remote content, 1454 // Send outgoing data if we're the active call, we have the remote content,
1455 // and we have had some form of connectivity. 1455 // and we have had some form of connectivity.
1456 bool send = IsReadyToSend(); 1456 bool send = IsReadyToSend();
1457 SendFlags send_flag = send ? SEND_MICROPHONE : SEND_NOTHING; 1457 media_channel()->SetSend(send);
1458 if (!media_channel()->SetSend(send_flag)) {
1459 LOG(LS_ERROR) << "Failed to SetSend " << send_flag << " on voice channel";
1460 }
1461 1458
1462 LOG(LS_INFO) << "Changing voice state, recv=" << recv << " send=" << send; 1459 LOG(LS_INFO) << "Changing voice state, recv=" << recv << " send=" << send;
1463 } 1460 }
1464 1461
1465 const ContentInfo* VoiceChannel::GetFirstContent( 1462 const ContentInfo* VoiceChannel::GetFirstContent(
1466 const SessionDescription* sdesc) { 1463 const SessionDescription* sdesc) {
1467 return GetFirstAudioContent(sdesc); 1464 return GetFirstAudioContent(sdesc);
1468 } 1465 }
1469 1466
1470 bool VoiceChannel::SetLocalContent_w(const MediaContentDescription* content, 1467 bool VoiceChannel::SetLocalContent_w(const MediaContentDescription* content,
(...skipping 665 matching lines...) Expand 10 before | Expand all | Expand 10 after
2136 return (data_channel_type_ == DCT_RTP) && BaseChannel::ShouldSetupDtlsSrtp(); 2133 return (data_channel_type_ == DCT_RTP) && BaseChannel::ShouldSetupDtlsSrtp();
2137 } 2134 }
2138 2135
2139 void DataChannel::OnStreamClosedRemotely(uint32_t sid) { 2136 void DataChannel::OnStreamClosedRemotely(uint32_t sid) {
2140 rtc::TypedMessageData<uint32_t>* message = 2137 rtc::TypedMessageData<uint32_t>* message =
2141 new rtc::TypedMessageData<uint32_t>(sid); 2138 new rtc::TypedMessageData<uint32_t>(sid);
2142 signaling_thread()->Post(this, MSG_STREAMCLOSEDREMOTELY, message); 2139 signaling_thread()->Post(this, MSG_STREAMCLOSEDREMOTELY, message);
2143 } 2140 }
2144 2141
2145 } // namespace cricket 2142 } // namespace cricket
OLDNEW
« no previous file with comments | « webrtc/pc/channel.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698