 Chromium Code Reviews
 Chromium Code Reviews 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
    
  
    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| OLD | NEW | 
|---|---|
| 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 1324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1335 bool VoiceChannel::Init() { | 1335 bool VoiceChannel::Init() { | 
| 1336 if (!BaseChannel::Init()) { | 1336 if (!BaseChannel::Init()) { | 
| 1337 return false; | 1337 return false; | 
| 1338 } | 1338 } | 
| 1339 return true; | 1339 return true; | 
| 1340 } | 1340 } | 
| 1341 | 1341 | 
| 1342 bool VoiceChannel::SetAudioSend(uint32_t ssrc, | 1342 bool VoiceChannel::SetAudioSend(uint32_t ssrc, | 
| 1343 bool enable, | 1343 bool enable, | 
| 1344 const AudioOptions* options, | 1344 const AudioOptions* options, | 
| 1345 AudioRenderer* renderer) { | 1345 AudioSource* source) { | 
| 1346 return InvokeOnWorker(Bind(&VoiceMediaChannel::SetAudioSend, media_channel(), | 1346 return InvokeOnWorker(Bind(&VoiceMediaChannel::SetAudioSend, media_channel(), | 
| 1347 ssrc, enable, options, renderer)); | 1347 ssrc, enable, options, source)); | 
| 1348 } | 1348 } | 
| 1349 | 1349 | 
| 1350 // TODO(juberti): Handle early media the right way. We should get an explicit | 1350 // TODO(juberti): Handle early media the right way. We should get an explicit | 
| 1351 // ringing message telling us to start playing local ringback, which we cancel | 1351 // ringing message telling us to start playing local ringback, which we cancel | 
| 1352 // if any early media actually arrives. For now, we do the opposite, which is | 1352 // if any early media actually arrives. For now, we do the opposite, which is | 
| 1353 // to wait 1 second for early media, and start playing local ringback if none | 1353 // to wait 1 second for early media, and start playing local ringback if none | 
| 1354 // arrives. | 1354 // arrives. | 
| 1355 void VoiceChannel::SetEarlyMedia(bool enable) { | 1355 void VoiceChannel::SetEarlyMedia(bool enable) { | 
| 1356 if (enable) { | 1356 if (enable) { | 
| 1357 // Start the early media timeout | 1357 // Start the early media timeout | 
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1455 | 1455 | 
| 1456 void VoiceChannel::ChangeState() { | 1456 void VoiceChannel::ChangeState() { | 
| 1457 // Render incoming data if we're the active call, and we have the local | 1457 // Render incoming data if we're the active call, and we have the local | 
| 1458 // content. We receive data on the default channel and multiplexed streams. | 1458 // content. We receive data on the default channel and multiplexed streams. | 
| 1459 bool recv = IsReadyToReceive(); | 1459 bool recv = IsReadyToReceive(); | 
| 1460 media_channel()->SetPlayout(recv); | 1460 media_channel()->SetPlayout(recv); | 
| 1461 | 1461 | 
| 1462 // Send outgoing data if we're the active call, we have the remote content, | 1462 // Send outgoing data if we're the active call, we have the remote content, | 
| 1463 // and we have had some form of connectivity. | 1463 // and we have had some form of connectivity. | 
| 1464 bool send = IsReadyToSend(); | 1464 bool send = IsReadyToSend(); | 
| 1465 SendFlags send_flag = send ? SEND_MICROPHONE : SEND_NOTHING; | 1465 if (!media_channel()->SetSend(send)) { | 
| 1466 if (!media_channel()->SetSend(send_flag)) { | 1466 LOG(LS_ERROR) << "Failed to SetSend " << send << " on voice channel"; | 
| 
the sun
2016/03/07 21:24:54
SetSend() always returns true now. This will never
 
Taylor Brandstetter
2016/03/08 00:00:31
Done.
 | |
| 1467 LOG(LS_ERROR) << "Failed to SetSend " << send_flag << " on voice channel"; | |
| 1468 } | 1467 } | 
| 1469 | 1468 | 
| 1470 LOG(LS_INFO) << "Changing voice state, recv=" << recv << " send=" << send; | 1469 LOG(LS_INFO) << "Changing voice state, recv=" << recv << " send=" << send; | 
| 1471 } | 1470 } | 
| 1472 | 1471 | 
| 1473 const ContentInfo* VoiceChannel::GetFirstContent( | 1472 const ContentInfo* VoiceChannel::GetFirstContent( | 
| 1474 const SessionDescription* sdesc) { | 1473 const SessionDescription* sdesc) { | 
| 1475 return GetFirstAudioContent(sdesc); | 1474 return GetFirstAudioContent(sdesc); | 
| 1476 } | 1475 } | 
| 1477 | 1476 | 
| (...skipping 770 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2248 return (data_channel_type_ == DCT_RTP) && BaseChannel::ShouldSetupDtlsSrtp(); | 2247 return (data_channel_type_ == DCT_RTP) && BaseChannel::ShouldSetupDtlsSrtp(); | 
| 2249 } | 2248 } | 
| 2250 | 2249 | 
| 2251 void DataChannel::OnStreamClosedRemotely(uint32_t sid) { | 2250 void DataChannel::OnStreamClosedRemotely(uint32_t sid) { | 
| 2252 rtc::TypedMessageData<uint32_t>* message = | 2251 rtc::TypedMessageData<uint32_t>* message = | 
| 2253 new rtc::TypedMessageData<uint32_t>(sid); | 2252 new rtc::TypedMessageData<uint32_t>(sid); | 
| 2254 signaling_thread()->Post(this, MSG_STREAMCLOSEDREMOTELY, message); | 2253 signaling_thread()->Post(this, MSG_STREAMCLOSEDREMOTELY, message); | 
| 2255 } | 2254 } | 
| 2256 | 2255 | 
| 2257 } // namespace cricket | 2256 } // namespace cricket | 
| OLD | NEW |