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 594 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
605 DCHECK(send_payload_router_ != NULL); | 605 DCHECK(send_payload_router_ != NULL); |
606 | 606 |
607 if (fec_enabled_ == fec && nack_enabled_ == nack) { | 607 if (fec_enabled_ == fec && nack_enabled_ == nack) { |
608 // No change needed, we're already in correct state. | 608 // No change needed, we're already in correct state. |
609 return 0; | 609 return 0; |
610 } | 610 } |
611 fec_enabled_ = fec; | 611 fec_enabled_ = fec; |
612 nack_enabled_ = nack; | 612 nack_enabled_ = nack; |
613 | 613 |
614 // Set Video Protection for VCM. | 614 // Set Video Protection for VCM. |
615 if (fec_enabled_ && nack_enabled_) { | 615 VCMVideoProtection protection_mode; |
616 vcm_->SetVideoProtection(webrtc::kProtectionNackFEC, true); | 616 if (fec_enabled_) { |
| 617 protection_mode = |
| 618 nack_enabled_ ? webrtc::kProtectionNackFEC : kProtectionFEC; |
617 } else { | 619 } else { |
618 vcm_->SetVideoProtection(webrtc::kProtectionFEC, fec_enabled_); | 620 protection_mode = nack_enabled_ ? kProtectionNack : kProtectionNone; |
619 vcm_->SetVideoProtection(webrtc::kProtectionNackSender, nack_enabled_); | |
620 vcm_->SetVideoProtection(webrtc::kProtectionNackFEC, false); | |
621 } | 621 } |
| 622 vcm_->SetVideoProtection(protection_mode, true); |
622 | 623 |
623 if (fec_enabled_ || nack_enabled_) { | 624 if (fec_enabled_ || nack_enabled_) { |
624 // The send codec must be registered to set correct MTU. | 625 // The send codec must be registered to set correct MTU. |
625 webrtc::VideoCodec codec; | 626 webrtc::VideoCodec codec; |
626 if (vcm_->SendCodec(&codec) == 0) { | 627 if (vcm_->SendCodec(&codec) == 0) { |
627 uint32_t current_bitrate_bps = 0; | 628 uint32_t current_bitrate_bps = 0; |
628 if (vcm_->Bitrate(¤t_bitrate_bps) != 0) { | 629 if (vcm_->Bitrate(¤t_bitrate_bps) != 0) { |
629 LOG_F(LS_WARNING) << | 630 LOG_F(LS_WARNING) << |
630 "Failed to get the current encoder target bitrate."; | 631 "Failed to get the current encoder target bitrate."; |
631 } | 632 } |
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
869 const uint32_t width, | 870 const uint32_t width, |
870 const uint32_t height) { | 871 const uint32_t height) { |
871 return vpm_->SetTargetResolution(width, height, frame_rate); | 872 return vpm_->SetTargetResolution(width, height, frame_rate); |
872 } | 873 } |
873 | 874 |
874 void QMVideoSettingsCallback::SetTargetFramerate(int frame_rate) { | 875 void QMVideoSettingsCallback::SetTargetFramerate(int frame_rate) { |
875 vpm_->SetTargetFramerate(frame_rate); | 876 vpm_->SetTargetFramerate(frame_rate); |
876 } | 877 } |
877 | 878 |
878 } // namespace webrtc | 879 } // namespace webrtc |
OLD | NEW |