OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2015 The WebRTC project authors. All Rights Reserved. | 2 * Copyright 2015 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 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
236 if (can_send_track()) { | 236 if (can_send_track()) { |
237 ClearAudioSend(); | 237 ClearAudioSend(); |
238 if (stats_) { | 238 if (stats_) { |
239 stats_->RemoveLocalAudioTrack(track_.get(), ssrc_); | 239 stats_->RemoveLocalAudioTrack(track_.get(), ssrc_); |
240 } | 240 } |
241 } | 241 } |
242 stopped_ = true; | 242 stopped_ = true; |
243 } | 243 } |
244 | 244 |
245 void AudioRtpSender::SetAudioSend() { | 245 void AudioRtpSender::SetAudioSend() { |
246 RTC_DCHECK(!stopped_ && can_send_track()); | 246 RTC_DCHECK(!stopped_); |
| 247 RTC_DCHECK(can_send_track()); |
247 if (!channel_) { | 248 if (!channel_) { |
248 LOG(LS_ERROR) << "SetAudioSend: No audio channel exists."; | 249 LOG(LS_ERROR) << "SetAudioSend: No audio channel exists."; |
249 return; | 250 return; |
250 } | 251 } |
251 cricket::AudioOptions options; | 252 cricket::AudioOptions options; |
252 #if !defined(WEBRTC_CHROMIUM_BUILD) && !defined(WEBRTC_WEBKIT_BUILD) | 253 #if !defined(WEBRTC_CHROMIUM_BUILD) && !defined(WEBRTC_WEBKIT_BUILD) |
253 // TODO(tommi): Remove this hack when we move CreateAudioSource out of | 254 // TODO(tommi): Remove this hack when we move CreateAudioSource out of |
254 // PeerConnection. This is a bit of a strange way to apply local audio | 255 // PeerConnection. This is a bit of a strange way to apply local audio |
255 // options since it is also applied to all streams/channels, local or remote. | 256 // options since it is also applied to all streams/channels, local or remote. |
256 if (track_->enabled() && track_->GetSource() && | 257 if (track_->enabled() && track_->GetSource() && |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
423 if (track_) { | 424 if (track_) { |
424 track_->UnregisterObserver(this); | 425 track_->UnregisterObserver(this); |
425 } | 426 } |
426 if (can_send_track()) { | 427 if (can_send_track()) { |
427 ClearVideoSend(); | 428 ClearVideoSend(); |
428 } | 429 } |
429 stopped_ = true; | 430 stopped_ = true; |
430 } | 431 } |
431 | 432 |
432 void VideoRtpSender::SetVideoSend() { | 433 void VideoRtpSender::SetVideoSend() { |
433 RTC_DCHECK(!stopped_ && can_send_track()); | 434 RTC_DCHECK(!stopped_); |
| 435 RTC_DCHECK(can_send_track()); |
434 if (!channel_) { | 436 if (!channel_) { |
435 LOG(LS_ERROR) << "SetVideoSend: No video channel exists."; | 437 LOG(LS_ERROR) << "SetVideoSend: No video channel exists."; |
436 return; | 438 return; |
437 } | 439 } |
438 cricket::VideoOptions options; | 440 cricket::VideoOptions options; |
439 VideoTrackSourceInterface* source = track_->GetSource(); | 441 VideoTrackSourceInterface* source = track_->GetSource(); |
440 if (source) { | 442 if (source) { |
441 options.is_screencast = rtc::Optional<bool>(source->is_screencast()); | 443 options.is_screencast = rtc::Optional<bool>(source->is_screencast()); |
442 options.video_noise_reduction = source->needs_denoising(); | 444 options.video_noise_reduction = source->needs_denoising(); |
443 } | 445 } |
(...skipping 19 matching lines...) Expand all Loading... |
463 LOG(LS_WARNING) << "SetVideoSend: No video channel exists."; | 465 LOG(LS_WARNING) << "SetVideoSend: No video channel exists."; |
464 return; | 466 return; |
465 } | 467 } |
466 // Allow SetVideoSend to fail since |enable| is false and |source| is null. | 468 // Allow SetVideoSend to fail since |enable| is false and |source| is null. |
467 // This the normal case when the underlying media channel has already been | 469 // This the normal case when the underlying media channel has already been |
468 // deleted. | 470 // deleted. |
469 channel_->SetVideoSend(ssrc_, false, nullptr, nullptr); | 471 channel_->SetVideoSend(ssrc_, false, nullptr, nullptr); |
470 } | 472 } |
471 | 473 |
472 } // namespace webrtc | 474 } // namespace webrtc |
OLD | NEW |