OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 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 396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
407 void ViEChannel::SetRTCPMode(const RtcpMode rtcp_mode) { | 407 void ViEChannel::SetRTCPMode(const RtcpMode rtcp_mode) { |
408 RTC_DCHECK(sender_); | 408 RTC_DCHECK(sender_); |
409 for (RtpRtcp* rtp_rtcp : rtp_rtcp_modules_) | 409 for (RtpRtcp* rtp_rtcp : rtp_rtcp_modules_) |
410 rtp_rtcp->SetRTCPStatus(rtcp_mode); | 410 rtp_rtcp->SetRTCPStatus(rtcp_mode); |
411 } | 411 } |
412 | 412 |
413 void ViEChannel::SetProtectionMode(bool enable_nack, | 413 void ViEChannel::SetProtectionMode(bool enable_nack, |
414 bool enable_fec, | 414 bool enable_fec, |
415 int payload_type_red, | 415 int payload_type_red, |
416 int payload_type_fec) { | 416 int payload_type_fec) { |
417 // Validate payload types. | 417 // Validate payload types. If either RED of FEC payload types are set then |
stefan-webrtc
2016/02/12 12:03:19
red or fec
pbos-webrtc
2016/02/12 12:34:48
Done.
| |
418 if (enable_fec) { | 418 // both should be. If FEC is enabled then they both have to be set. |
419 if (enable_fec || payload_type_red != -1 || payload_type_fec != -1) { | |
419 RTC_DCHECK_GE(payload_type_red, 0); | 420 RTC_DCHECK_GE(payload_type_red, 0); |
420 RTC_DCHECK_GE(payload_type_fec, 0); | 421 RTC_DCHECK_GE(payload_type_fec, 0); |
421 RTC_DCHECK_LE(payload_type_red, 127); | 422 RTC_DCHECK_LE(payload_type_red, 127); |
422 RTC_DCHECK_LE(payload_type_fec, 127); | 423 RTC_DCHECK_LE(payload_type_fec, 127); |
423 } else { | 424 } else { |
425 // Payload types unset. | |
424 RTC_DCHECK_EQ(payload_type_red, -1); | 426 RTC_DCHECK_EQ(payload_type_red, -1); |
425 RTC_DCHECK_EQ(payload_type_fec, -1); | 427 RTC_DCHECK_EQ(payload_type_fec, -1); |
426 // Set to valid uint8_ts to be castable later without signed overflows. | 428 // Set to valid uint8_ts to be castable later without signed overflows. |
427 payload_type_red = 0; | 429 payload_type_red = 0; |
428 payload_type_fec = 0; | 430 payload_type_fec = 0; |
429 } | 431 } |
430 | 432 |
431 VCMVideoProtection protection_method; | 433 VCMVideoProtection protection_method; |
432 if (enable_nack) { | 434 if (enable_nack) { |
433 protection_method = enable_fec ? kProtectionNackFEC : kProtectionNack; | 435 protection_method = enable_fec ? kProtectionNackFEC : kProtectionNack; |
(...skipping 612 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1046 rtc::CritScope lock(&crit_); | 1048 rtc::CritScope lock(&crit_); |
1047 receive_stats_callback_ = receive_statistics_proxy; | 1049 receive_stats_callback_ = receive_statistics_proxy; |
1048 } | 1050 } |
1049 | 1051 |
1050 void ViEChannel::SetIncomingVideoStream( | 1052 void ViEChannel::SetIncomingVideoStream( |
1051 IncomingVideoStream* incoming_video_stream) { | 1053 IncomingVideoStream* incoming_video_stream) { |
1052 rtc::CritScope lock(&crit_); | 1054 rtc::CritScope lock(&crit_); |
1053 incoming_video_stream_ = incoming_video_stream; | 1055 incoming_video_stream_ = incoming_video_stream; |
1054 } | 1056 } |
1055 } // namespace webrtc | 1057 } // namespace webrtc |
OLD | NEW |